net/bnxt: set thread safe flow ops flag
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Mon, 26 Oct 2020 03:56:15 +0000 (20:56 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 3 Nov 2020 22:35:03 +0000 (23:35 +0100)
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 <ajit.khaparde@broadcom.com>
doc/guides/nics/bnxt.rst
doc/guides/rel_notes/release_20_11.rst
drivers/net/bnxt/bnxt_ethdev.c

index e247bde..ab093c3 100644 (file)
@@ -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.
index d6fb438..60a3cc2 100644 (file)
@@ -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.**
 
index b150227..b4c1dae 100644 (file)
@@ -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