@@ -157,7 +157,8 @@ int setup_pkt_sock(pkt_sock_t *const pkt_sock, const char *netdev,
snprintf(ethreq.ifr_name, IFNAMSIZ, "%s", netdev);
err = ioctl(sockfd, SIOCGIFINDEX, ðreq);
if (err != 0) {
- ODP_ERR("ioctl(SIOCGIFINDEX): %s\n", strerror(errno));
+ ODP_ERR("ioctl(SIOCGIFINDEX): %s: \"%s\".\n", strerror(errno),
+ ethreq.ifr_name);
goto error;
}
if_idx = ethreq.ifr_ifindex;
@@ -732,7 +733,9 @@ static int mmap_store_hw_addr(pkt_sock_mmap_t *const pkt_sock,
ret = ioctl(pkt_sock->sockfd, SIOCGIFHWADDR, ðreq);
if (ret != 0) {
__odp_errno = errno;
- ODP_ERR("ioctl(SIOCGIFHWADDR): %s\n", strerror(errno));
+ ODP_ERR("ioctl(SIOCGIFHWADDR): %s: \"%s\".\n",
+ strerror(errno),
+ ethreq.ifr_name);
return -1;
}
Pkio tests also test for incorrect number. In log there are messages about errors on ioctl. Make prints for that errors more clean. Like: odp_packet_socket.c:161:setup_pkt_sock():ioctl(SIOCGIFINDEX): No such device: "nothere". odp_packet_socket.c:738:mmap_store_hw_addr():ioctl(SIOCGIFHWADDR): No such device: "nothere" Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> --- platform/linux-generic/odp_packet_socket.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)