examples/ipsec-secgw: fix default flow rule creation
authorNithin Dabilpuram <ndabilpuram@marvell.com>
Fri, 17 Dec 2021 12:44:51 +0000 (18:14 +0530)
committerAkhil Goyal <gakhil@marvell.com>
Fri, 21 Jan 2022 09:17:35 +0000 (10:17 +0100)
Fix default flow rule to create after ethdev start to align
with rte_flow spec.

Fixes: 513f192b5fd4 ("examples/ipsec-secgw: add default flow for inline Rx")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
examples/ipsec-secgw/ipsec-secgw.c

index 96916cd..21abc0d 100644 (file)
@@ -3379,13 +3379,14 @@ main(int32_t argc, char **argv)
                if ((enabled_port_mask & (1 << portid)) == 0)
                        continue;
 
-               /* Create flow before starting the device */
-               create_default_ipsec_flow(portid, req_rx_offloads[portid]);
-
                ret = rte_eth_dev_start(portid);
                if (ret < 0)
                        rte_exit(EXIT_FAILURE, "rte_eth_dev_start: "
                                        "err=%d, port=%d\n", ret, portid);
+
+               /* Create flow after starting the device */
+               create_default_ipsec_flow(portid, req_rx_offloads[portid]);
+
                /*
                 * If enabled, put device in promiscuous mode.
                 * This allows IO forwarding mode to forward packets