examples/ipsec-secgw: check status of getting ethdev info
authorIvan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Thu, 12 Sep 2019 16:42:58 +0000 (17:42 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 7 Oct 2019 12:45:35 +0000 (14:45 +0200)
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/ipsec-secgw according to its new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
examples/ipsec-secgw/ipsec-secgw.c
examples/ipsec-secgw/ipsec.c
examples/ipsec-secgw/sa.c

index 345c8e5..5ed4131 100644 (file)
@@ -1914,7 +1914,11 @@ port_init(uint16_t portid, uint64_t req_rx_offloads, uint64_t req_tx_offloads)
        struct rte_ether_addr ethaddr;
        struct rte_eth_conf local_port_conf = port_conf;
 
-       rte_eth_dev_info_get(portid, &dev_info);
+       ret = rte_eth_dev_info_get(portid, &dev_info);
+       if (ret != 0)
+               rte_exit(EXIT_FAILURE,
+                       "Error during getting device (port %u) info: %s\n",
+                       portid, strerror(-ret));
 
        /* limit allowed HW offloafs, as user requested */
        dev_info.rx_offload_capa &= dev_rx_offload;
index 1145ca1..51fb22e 100644 (file)
@@ -255,7 +255,14 @@ create_inline_session(struct socket_ctx *skt_ctx, struct ipsec_sa *sa)
                        unsigned int i;
                        unsigned int j;
 
-                       rte_eth_dev_info_get(sa->portid, &dev_info);
+                       ret = rte_eth_dev_info_get(sa->portid, &dev_info);
+                       if (ret != 0) {
+                               RTE_LOG(ERR, IPSEC,
+                                       "Error during getting device (port %u) info: %s\n",
+                                       sa->portid, strerror(-ret));
+                               return ret;
+                       }
+
                        sa->action[2].type = RTE_FLOW_ACTION_TYPE_END;
                        /* Try RSS. */
                        sa->action[1].type = RTE_FLOW_ACTION_TYPE_RSS;
index c3cf3bd..14ee947 100644 (file)
@@ -756,8 +756,16 @@ static int
 check_eth_dev_caps(uint16_t portid, uint32_t inbound)
 {
        struct rte_eth_dev_info dev_info;
+       int retval;
 
-       rte_eth_dev_info_get(portid, &dev_info);
+       retval = rte_eth_dev_info_get(portid, &dev_info);
+       if (retval != 0) {
+               RTE_LOG(ERR, IPSEC,
+                       "Error during getting device (port %u) info: %s\n",
+                       portid, strerror(-retval));
+
+               return retval;
+       }
 
        if (inbound) {
                if ((dev_info.rx_offload_capa &