summaryrefslogtreecommitdiff
path: root/examples/vmdq
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/vmdq
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/vmdq')
-rw-r--r--examples/vmdq/main.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 7281ffd..91f9a99 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -169,7 +169,13 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
* The max pool number from dev_info will be used to validate the pool
* number specified in cmd line
*/
- 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;
+ }
+
max_nb_pools = (uint32_t)dev_info.max_vmdq_pools;
/*
* We allow to process part of VMDQ pools specified by num_pools in
@@ -214,7 +220,13 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
rxRings = (uint16_t)dev_info.max_rx_queues;
txRings = (uint16_t)dev_info.max_tx_queues;
- 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;