From 540df3befe14ee6faae297aefb9b39f9dfc67e1d Mon Sep 17 00:00:00 2001 From: Lukas Sismis Date: Fri, 2 Jun 2023 15:59:52 +0200 Subject: [PATCH] dpdk: separate i40e prestop actions from DPKD 19.11 In DPDK 19.11 Suricata does not setup RSS on i40e driver with rte_flow. As a result, it should not be deinitializing RSS configuration with rte_flow as well. --- src/source-dpdk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/source-dpdk.c b/src/source-dpdk.c index 14dd9f8071..18bfe7bb69 100644 --- a/src/source-dpdk.c +++ b/src/source-dpdk.c @@ -202,16 +202,16 @@ static void DevicePostStartPMDSpecificActions(DPDKThreadVars *ptv, const char *d static void DevicePreStopPMDSpecificActions(DPDKThreadVars *ptv, const char *driver_name) { - int retval; - if (strcmp(driver_name, "net_i40e") == 0) { +#if RTE_VERSION > RTE_VERSION_NUM(20, 0, 0, 0) // Flush the RSS rules that have been inserted in the post start section struct rte_flow_error flush_error = { 0 }; - retval = rte_flow_flush(ptv->port_id, &flush_error); + int32_t retval = rte_flow_flush(ptv->port_id, &flush_error); if (retval != 0) { SCLogError("Unable to flush rte_flow rules: %s Flush error msg: %s", rte_strerror(-retval), flush_error.message); } +#endif /* RTE_VERSION > RTE_VERSION_NUM(20, 0, 0, 0) */ } }