summaryrefslogtreecommitdiff
path: root/examples/skeleton
diff options
context:
space:
mode:
authorIvan Ilchenko <ivan.ilchenko@oktetlabs.ru>2019-09-12 17:42:29 +0100
committerFerruh Yigit <ferruh.yigit@intel.com>2019-10-07 14:45:35 +0200
commit089e5ed727a15da2729cfee9b63533dd120bd04c (patch)
tree184616d0d9eaf309b5a60ceb7d01f567f6b47599 /examples/skeleton
parent37fb306c1665efd52cdf2fc1fc99441b8e98aa9e (diff)
downloaddpdk-089e5ed727a15da2729cfee9b63533dd120bd04c.zip
dpdk-089e5ed727a15da2729cfee9b63533dd120bd04c.tar.gz
dpdk-089e5ed727a15da2729cfee9b63533dd120bd04c.tar.xz
examples: check status of getting ethdev info
rte_eth_dev_info_get() return value was changed from void to int, so this patch modify rte_eth_dev_info_get() usage across examples according to its new return type. Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Diffstat (limited to 'examples/skeleton')
-rw-r--r--examples/skeleton/basicfwd.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index a8a8e98..171ebde 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -44,7 +44,13 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
if (!rte_eth_dev_is_valid_port(port))
return -1;
- rte_eth_dev_info_get(port, &dev_info);
+ retval = rte_eth_dev_info_get(port, &dev_info);
+ if (retval != 0) {
+ printf("Error during getting device (port %u) info: %s\n",
+ port, strerror(-retval));
+ return retval;
+ }
+
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
port_conf.txmode.offloads |=
DEV_TX_OFFLOAD_MBUF_FAST_FREE;