On 1/30/23 20:00, Jiawei Wang wrote:
For the multiple hardware ports connect to a single DPDK port (mhpsdp),

Sorry, what is mhpsdp?

currently, there is no information to indicate the packet belongs to
which hardware port.

This patch introduces a new phy affinity item in rte flow API, and

"This patch introduces ..." -> "Introduce ..."
rte -> RTE

the phy affinity value reflects the physical port of the received packets.

While uses the phy affinity as a matching item in the flow, and sets the
same phy_affinity value on the tx queue, then the packet can be sent from

tx -> Tx

the same hardware port with received.

This patch also adds the testpmd command line to match the new item:
        flow create 0 ingress group 0 pattern phy_affinity affinity is 1 /
        end actions queue index 0 / end

The above command means that creates a flow on a single DPDK port and
matches the packet from the first physical port (assume the phy affinity 1

Why is it numbered from 1, not 0? Anyway it should be defined
in the documentation below.

stands for the first port) and redirects these packets into RxQ 0.

Signed-off-by: Jiawei Wang <jiaw...@nvidia.com>

[snip]

diff --git a/doc/guides/rel_notes/release_23_03.rst 
b/doc/guides/rel_notes/release_23_03.rst
index c15f6fbb9f..a1abd67771 100644
--- a/doc/guides/rel_notes/release_23_03.rst
+++ b/doc/guides/rel_notes/release_23_03.rst
@@ -69,6 +69,11 @@ New Features
      ``rte_event_dev_config::nb_single_link_event_port_queues`` parameter
      required for eth_rx, eth_tx, crypto and timer eventdev adapters.
+* **Added rte_flow support for matching PHY Affinity fields.**

Why "Affinity", not "affinity"?

+
+  For the multiple hardware ports connect to a single DPDK port (mhpsdp),
+  Added ``phy_affinity`` item in rte_flow to support physical affinity of
+  the packets.

Please, add one more empty line to have two before the next
section.

Removed Items
  -------------

[snip]

diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index b60987db4b..56c04ea37c 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h

@@ -2103,6 +2110,27 @@ static const struct rte_flow_item_meter_color 
rte_flow_item_meter_color_mask = {
  };
  #endif
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ITEM_TYPE_PHY_AFFINITY
+ *
+ * For the multiple hardware ports connect to a single DPDK port (mhpsdp),
+ * use this item to match the physical affinity of the packets.
+ */
+struct rte_flow_item_phy_affinity {
+       uint8_t affinity; /**< physical affinity value. */

Sorry, I'd like to know how application should find out which
values may be used here? How many physical ports are behind
this one DPDK ethdev?

Also, please, define which value should be used for the first
port 0 or 1. I'd vote for 0.

Reply via email to