mbox series

[v4,0/2] add new PHY affinity in the flow item and Tx queue API

Message ID 20230203133339.30271-1-jiaweiw@nvidia.com (mailing list archive)
Headers
Series add new PHY affinity in the flow item and Tx queue API |

Message

Jiawei Wang Feb. 3, 2023, 1:33 p.m. UTC
  When multiple physical ports are connected to a single DPDK port,
(example: kernel bonding, DPDK bonding, failsafe, etc.),
we want to know which physical port is used for Rx and Tx.

This patch maps a DPDK Tx queue with a physical port,
by adding tx_phy_affinity setting in Tx queue.
The affinity number is the physical port ID where packets will be
sent.
Value 0 means no affinity and traffic could be routed to any
connected physical ports, this is the default current behavior.

The number of physical ports is reported with rte_eth_dev_info_get().

This patch allows to map a Rx queue with a physical port by using
a flow rule. The new item is called RTE_FLOW_ITEM_TYPE_PHY_AFFINITY.

While uses the phy affinity as a matching item in the flow rule, and
sets the same phy_affinity value on the Tx queue, then the packet
can be sent from the same physical port as the receiving one.
The physical affinity numbering starts from 1, then trying to
match on phy_affinity 0 will result in an error.

RFC: http://patches.dpdk.org/project/dpdk/cover/20221221102934.13822-1-jiaweiw@nvidia.com/

v4:
* Rebase the latest code
* Update new field description
* Update release release note
* Reword the commit log to make clear

v3:
* Update exception rule
* Update the commit log
* Add the description for PHY affinity and numbering definition
* Add the number of physical ports into device info
* Change the patch order 

v2: Update based on the comments

Jiawei Wang (2):
  ethdev: introduce the PHY affinity field in Tx queue API
  ethdev: add PHY affinity match item

 app/test-pmd/cmdline.c                      | 100 ++++++++++++++++++++
 app/test-pmd/cmdline_flow.c                 |  28 ++++++
 app/test-pmd/config.c                       |   1 +
 devtools/libabigail.abignore                |   5 +
 doc/guides/prog_guide/rte_flow.rst          |   8 ++
 doc/guides/rel_notes/release_23_03.rst      |   5 +
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  17 ++++
 lib/ethdev/rte_ethdev.h                     |  10 ++
 lib/ethdev/rte_flow.c                       |   1 +
 lib/ethdev/rte_flow.h                       |  35 +++++++
 10 files changed, 210 insertions(+)