From 33a5d155d0dab0058ff020a2b88f07b3b28ac4b4 Mon Sep 17 00:00:00 2001 From: Nithin Dabilpuram Date: Fri, 17 Dec 2021 18:14:51 +0530 Subject: [PATCH] examples/ipsec-secgw: fix default flow rule creation [ upstream commit b0c6a0f1ee962b1540aab44df94e0fd65a9def9b ] 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") Signed-off-by: Nithin Dabilpuram Acked-by: Akhil Goyal --- examples/ipsec-secgw/ipsec-secgw.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index 573f6303d4..8d244318e0 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -2931,13 +2931,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