Message ID | 1424979778-20444-1-git-send-email-maxim.uvarov@linaro.org |
---|---|
State | Accepted |
Commit | b276e4a5b0d68ec44ee039625baa29cdba989eb4 |
Headers | show |
On Thu, Feb 26, 2015 at 1:42 PM, Maxim Uvarov <maxim.uvarov@linaro.org> wrote: > 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> > Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> > --- > platform/linux-generic/odp_packet_socket.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/platform/linux-generic/odp_packet_socket.c > b/platform/linux-generic/odp_packet_socket.c > index 41e57c1..55c212e 100644 > --- a/platform/linux-generic/odp_packet_socket.c > +++ b/platform/linux-generic/odp_packet_socket.c > @@ -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; > } > > -- > 1.8.5.1.163.gd7aced9 > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp >
diff --git a/platform/linux-generic/odp_packet_socket.c b/platform/linux-generic/odp_packet_socket.c index 41e57c1..55c212e 100644 --- a/platform/linux-generic/odp_packet_socket.c +++ b/platform/linux-generic/odp_packet_socket.c @@ -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(-)