[dpdk-dev] [PATCH v4 14/15] net/bnxt: set thread safe flow ops flag
Ajit Khaparde
ajit.khaparde at broadcom.com
Mon Oct 26 04:56:15 CET 2020
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 at broadcom.com>
---
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 bf2ef19adb..b38fc0b330 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 471c670317..367ccb3248 100644
--- a/doc/guides/rel_notes/release_20_11.rst
+++ b/doc/guides/rel_notes/release_20_11.rst
@@ -149,6 +149,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 a0e01d059d..71ad05dfe9 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3824,6 +3824,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.21.1 (Apple Git-122.3)
More information about the dev
mailing list