From: Ajit Khaparde Date: Mon, 26 Oct 2020 03:56:15 +0000 (-0700) Subject: net/bnxt: set thread safe flow ops flag X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e24a5d3f5887aa75506d65df4c38e321952042c4;p=dpdk.git 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 --- 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