Patch set 100637 v3

[v3] ethdev: add API to query proxy port to manage transfer flows

Submitter
Ivan Malov
Applied on
dpdk-next-net (bd026ee0e890eee3d63307c380ffefbf484055bd)
Date submitted
Oct. 6, 2021, 12:33 p.m.

Test Results Apply Error

Checking patch app/test-pmd/config.c...
Checking patch app/test-pmd/testpmd.c...
error: while searching for:
 */
unsigned int num_procs = 1;

static int
eth_dev_configure_mp(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
		      const struct rte_eth_conf *dev_conf)

error: patch failed: app/test-pmd/testpmd.c:533
error: while searching for:
	int ret;
	int i;

	port->dev_conf.txmode = tx_mode;
	port->dev_conf.rxmode = rx_mode;


error: patch failed: app/test-pmd/testpmd.c:1489
Checking patch app/test-pmd/testpmd.h...
Checking patch app/test-pmd/util.c...
Checking patch doc/guides/rel_notes/release_21_11.rst...
error: while searching for:
  Added macros ETH_RSS_IPV4_CHKSUM and ETH_RSS_L4_CHKSUM, now IPv4 and
  TCP/UDP/SCTP header checksum field can be used as input set for RSS.

* **Updated Broadcom bnxt PMD.**

  * Added flow offload support for Thor.

error: patch failed: doc/guides/rel_notes/release_21_11.rst:67
Checking patch lib/ethdev/rte_flow.c...
Hunk #1 succeeded at 1266 (offset -4 lines).
Checking patch lib/ethdev/rte_flow.h...
error: while searching for:
	 *
	 * In order to match traffic originating from specific source(s), the
	 * application should use pattern items ETHDEV and ESWITCH_PORT.
	 */
	uint32_t transfer:1;
	uint32_t reserved:29; /**< Reserved, must be zero. */

error: patch failed: lib/ethdev/rte_flow.h:122
Hunk #2 succeeded at 4286 (offset -144 lines).
Checking patch lib/ethdev/rte_flow_driver.h...
Checking patch lib/ethdev/version.map...
error: while searching for:
	rte_mtr_meter_policy_delete;
	rte_mtr_meter_policy_update;
	rte_mtr_meter_policy_validate;
};

INTERNAL {

error: patch failed: lib/ethdev/version.map:247
Applied patch app/test-pmd/config.c cleanly.
Applying patch app/test-pmd/testpmd.c with 2 rejects...
Rejected hunk #1.
Rejected hunk #2.
Applied patch app/test-pmd/testpmd.h cleanly.
Applied patch app/test-pmd/util.c cleanly.
Applying patch doc/guides/rel_notes/release_21_11.rst with 1 reject...
Rejected hunk #1.
Applied patch lib/ethdev/rte_flow.c cleanly.
Applying patch lib/ethdev/rte_flow.h with 1 reject...
Rejected hunk #1.
Hunk #2 applied cleanly.
Applied patch lib/ethdev/rte_flow_driver.h cleanly.
Applying patch lib/ethdev/version.map with 1 reject...
Rejected hunk #1.
diff a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c	(rejected hunks)
@@ -533,6 +533,25 @@ int proc_id;
  */
 unsigned int num_procs = 1;
 
+static void
+flow_pick_transfer_proxy_mp(uint16_t port_id)
+{
+	struct rte_port *port = &ports[port_id];
+	int ret;
+
+	port->flow_transfer_proxy = port_id;
+
+	if (!is_proc_primary())
+		return;
+
+	ret = rte_flow_pick_transfer_proxy(port_id, &port->flow_transfer_proxy,
+					   NULL);
+	if (ret != 0) {
+		fprintf(stderr, "Error picking flow transfer proxy for port %u: %s - ignore\n",
+			port_id, rte_strerror(-ret));
+	}
+}
+
 static int
 eth_dev_configure_mp(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		      const struct rte_eth_conf *dev_conf)
@@ -1489,6 +1508,8 @@ init_config_port_offloads(portid_t pid, uint32_t socket_id)
 	int ret;
 	int i;
 
+	flow_pick_transfer_proxy_mp(pid);
+
 	port->dev_conf.txmode = tx_mode;
 	port->dev_conf.rxmode = rx_mode;
 
diff a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst	(rejected hunks)
@@ -67,6 +67,9 @@ New Features
   Added macros ETH_RSS_IPV4_CHKSUM and ETH_RSS_L4_CHKSUM, now IPv4 and
   TCP/UDP/SCTP header checksum field can be used as input set for RSS.
 
+* **Added an API to get a proxy port to manage "transfer" flows**
+  A new API, ``rte_flow_pick_transfer_proxy()``, was added.
+
 * **Updated Broadcom bnxt PMD.**
 
   * Added flow offload support for Thor.
diff a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h	(rejected hunks)
@@ -122,6 +122,9 @@ struct rte_flow_attr {
 	 *
 	 * In order to match traffic originating from specific source(s), the
 	 * application should use pattern items ETHDEV and ESWITCH_PORT.
+	 *
+	 * Managing "transfer" flows requires that the user communicate them
+	 * through a suitable port. @see rte_flow_pick_transfer_proxy().
 	 */
 	uint32_t transfer:1;
 	uint32_t reserved:29; /**< Reserved, must be zero. */
diff a/lib/ethdev/version.map b/lib/ethdev/version.map	(rejected hunks)
@@ -247,6 +247,9 @@ EXPERIMENTAL {
 	rte_mtr_meter_policy_delete;
 	rte_mtr_meter_policy_update;
 	rte_mtr_meter_policy_validate;
+
+	# added in 21.11
+	rte_flow_pick_transfer_proxy;
 };
 
 INTERNAL {