summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorStephen Hemminger <[email protected]>2024-10-04 09:21:53 -0700
committerThomas Monjalon <[email protected]>2024-11-11 16:20:08 +0100
commit07e4dc04d99a99699d71a0a39dd2a7034049e663 (patch)
treea69f0e20be563dc43774869302463451184b423b /examples
parenta937954e3d1ccfcc88aad472b0e6ee67f3eb560c (diff)
examples/ntb: check info query return
The ethdev_info is only valid if rte_eth_dev_info_get returns success. Fixes: 5194299d6ef5 ("examples/ntb: support more functions") Cc: [email protected] Signed-off-by: Stephen Hemminger <[email protected]> Acked-by: Morten Brørup <[email protected]>
Diffstat (limited to 'examples')
-rw-r--r--examples/ntb/ntb_fwd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/ntb/ntb_fwd.c b/examples/ntb/ntb_fwd.c
index 56c7672392..37d60208e3 100644
--- a/examples/ntb/ntb_fwd.c
+++ b/examples/ntb/ntb_fwd.c
@@ -1285,7 +1285,10 @@ main(int argc, char **argv)
eth_port_id = rte_eth_find_next(0);
if (eth_port_id < RTE_MAX_ETHPORTS) {
- rte_eth_dev_info_get(eth_port_id, &ethdev_info);
+ ret = rte_eth_dev_info_get(eth_port_id, &ethdev_info);
+ if (ret)
+ rte_exit(EXIT_FAILURE, "Can't get info for port %u\n", eth_port_id);
+
eth_pconf.rx_adv_conf.rss_conf.rss_hf &=
ethdev_info.flow_type_rss_offloads;
ret = rte_eth_dev_configure(eth_port_id, num_queues,