From e24a5d3f5887aa75506d65df4c38e321952042c4 Mon Sep 17 00:00:00 2001 From: Ajit Khaparde Date: Sun, 25 Oct 2020 20:56:15 -0700 Subject: [PATCH] net/bnxt: set thread safe flow ops flag PMD supports thread-safe flow operations. Set the RTE_ETH_DEV_FLOW_OPS_THREAD_SAFE dev_flag to indicate this info to the application. rte_flow API functions can avoid using its own mutex for safe multi-thread flow handling. Signed-off-by: Ajit Khaparde --- doc/guides/nics/bnxt.rst | 2 ++ doc/guides/rel_notes/release_20_11.rst | 1 + drivers/net/bnxt/bnxt_ethdev.c | 6 ++++++ 3 files changed, 9 insertions(+) diff --git a/doc/guides/nics/bnxt.rst b/doc/guides/nics/bnxt.rst index e247bdeeb2..ab093c3f4d 100644 --- a/doc/guides/nics/bnxt.rst +++ b/doc/guides/nics/bnxt.rst @@ -721,6 +721,8 @@ Notes of deferring Flow2 for offloading. Flow2 that arrive after Flow1 is offloaded will be directly programmed and not cached. +- PMD supports thread-safe rte_flow operations. + Note: A VNIC represents a virtual interface in the hardware. It is a resource in the RX path of the chip and is used to setup various target actions such as RSS, MAC filtering etc. for the physical function in use. diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst index d6fb4386df..60a3cc2fb4 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -158,6 +158,7 @@ New Features * Added TRUFLOW support for Stingray devices. * Added support for representors on MAIA cores of SR. * Added support for VXLAN decap offload using rte_flow. + * Added support to indicate native rte_flow API thread safety. * **Updated Cisco enic driver.** diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index b150227ddf..b4c1dae1e4 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -3827,6 +3827,12 @@ bnxt_filter_ctrl_op(struct rte_eth_dev *dev, case RTE_ETH_FILTER_GENERIC: if (filter_op != RTE_ETH_FILTER_GET) return -EINVAL; + + /* PMD supports thread-safe flow operations. rte_flow API + * functions can avoid mutex for multi-thread safety. + */ + dev->data->dev_flags |= RTE_ETH_DEV_FLOW_OPS_THREAD_SAFE; + if (BNXT_TRUFLOW_EN(bp)) *(const void **)arg = &bnxt_ulp_rte_flow_ops; else -- 2.20.1