DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/3] ethdev: add send to kernel action
@ 2022-09-12 12:59 Michael Savisko
  2022-09-12 12:59 ` [PATCH 2/3] app/testpmd: add new action kernel Michael Savisko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michael Savisko @ 2022-09-12 12:59 UTC (permalink / raw)
  To: dev
  Cc: michaelsav, asafp, orika, Thomas Monjalon, Ferruh Yigit,
	Andrew Rybchenko

In some cases application may receive a packet that should have been
received by the kernel. In this case application uses KNI or other means
to transfer the packet to the kernel.
This commit introduces rte flow action that the application may use
to route the packet to the kernel while still in the HW.

Signed-off-by: Michael Savisko <michaelsav@nvidia.com>
---
 lib/ethdev/rte_flow.c | 1 +
 lib/ethdev/rte_flow.h | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index 501be9d602..627c671ce4 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -259,6 +259,7 @@ static const struct rte_flow_desc_data rte_flow_desc_action[] = {
 	MK_FLOW_ACTION(CONNTRACK, sizeof(struct rte_flow_action_conntrack)),
 	MK_FLOW_ACTION(PORT_REPRESENTOR, sizeof(struct rte_flow_action_ethdev)),
 	MK_FLOW_ACTION(REPRESENTED_PORT, sizeof(struct rte_flow_action_ethdev)),
+	MK_FLOW_ACTION(SEND_TO_KERNEL, 0),
 };
 
 int
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index a79f1e7ef0..f11d1659e8 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -2879,6 +2879,11 @@ enum rte_flow_action_type {
 	 * @see struct rte_flow_action_ethdev
 	 */
 	RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT,
+
+	/*
+	 * Send traffic to kernel.
+	 */
+	RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL,
 };
 
 /**
-- 
2.27.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/3] app/testpmd: add new action kernel
  2022-09-12 12:59 [PATCH 1/3] ethdev: add send to kernel action Michael Savisko
@ 2022-09-12 12:59 ` Michael Savisko
  2022-09-12 12:59 ` [PATCH 3/3] doc: update testpmd application guide Michael Savisko
  2022-09-12 13:14 ` [PATCH 1/3] ethdev: add send to kernel action Thomas Monjalon
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Savisko @ 2022-09-12 12:59 UTC (permalink / raw)
  To: dev; +Cc: michaelsav, asafp, orika, Aman Singh, Yuying Zhang

Add new test-pmd rte_flow action 'send_to_kernel'. The application
may use this action to route the packet to the kernel while still
in the HW.

The example of test-pmd command:

flow create 0 ingress priority 0 group 1 pattern eth type spec 0x0800
type mask 0xffff / end actions send_to_kernel / end

Signed-off-by: Michael Savisko <michaelsav@nvidia.com>
---
 app/test-pmd/cmdline_flow.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 7f50028eb7..042f6b34a6 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -612,6 +612,7 @@ enum index {
 	ACTION_PORT_REPRESENTOR_PORT_ID,
 	ACTION_REPRESENTED_PORT,
 	ACTION_REPRESENTED_PORT_ETHDEV_PORT_ID,
+	ACTION_SEND_TO_KERNEL,
 };
 
 /** Maximum size for pattern in struct rte_flow_item_raw. */
@@ -1872,6 +1873,7 @@ static const enum index next_action[] = {
 	ACTION_CONNTRACK_UPDATE,
 	ACTION_PORT_REPRESENTOR,
 	ACTION_REPRESENTED_PORT,
+	ACTION_SEND_TO_KERNEL,
 	ZERO,
 };
 
@@ -6341,6 +6343,13 @@ static const struct token token_list[] = {
 		.help = "submit a list of associated actions for red",
 		.next = NEXT(next_action),
 	},
+	[ACTION_SEND_TO_KERNEL] = {
+		.name = "send_to_kernel",
+		.help = "send packets to kernel",
+		.priv = PRIV_ACTION(SEND_TO_KERNEL, 0),
+		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
+		.call = parse_vc,
+	},
 
 	/* Top-level command. */
 	[ADD] = {
-- 
2.27.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 3/3] doc: update testpmd application guide
  2022-09-12 12:59 [PATCH 1/3] ethdev: add send to kernel action Michael Savisko
  2022-09-12 12:59 ` [PATCH 2/3] app/testpmd: add new action kernel Michael Savisko
@ 2022-09-12 12:59 ` Michael Savisko
  2022-09-12 13:14 ` [PATCH 1/3] ethdev: add send to kernel action Thomas Monjalon
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Savisko @ 2022-09-12 12:59 UTC (permalink / raw)
  To: dev; +Cc: michaelsav, asafp, orika, Aman Singh, Yuying Zhang

Add description of new rte_flow action 'send_to_kernel'.

Signed-off-by: Michael Savisko <michaelsav@nvidia.com>
---
 doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 330e34427d..c259c8239a 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -4189,6 +4189,8 @@ This section lists supported actions and their attributes, if any.
 
   - ``ethdev_port_id {unsigned}``: ethdev port ID
 
+- ``send_to_kernel``: send packets to kernel.
+
 Destroying flow rules
 ~~~~~~~~~~~~~~~~~~~~~
 
-- 
2.27.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] ethdev: add send to kernel action
  2022-09-12 12:59 [PATCH 1/3] ethdev: add send to kernel action Michael Savisko
  2022-09-12 12:59 ` [PATCH 2/3] app/testpmd: add new action kernel Michael Savisko
  2022-09-12 12:59 ` [PATCH 3/3] doc: update testpmd application guide Michael Savisko
@ 2022-09-12 13:14 ` Thomas Monjalon
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2022-09-12 13:14 UTC (permalink / raw)
  To: Michael Savisko; +Cc: dev, asafp, orika, Ferruh Yigit, Andrew Rybchenko

Hi,

Please don't split ethdev, testpmd and doc in different patches.
They are all very related and may come together in a single patch.

12/09/2022 14:59, Michael Savisko:
> In some cases application may receive a packet that should have been
> received by the kernel. In this case application uses KNI or other means
> to transfer the packet to the kernel.

You should mention bifurcated driver capability:
in isolated mode, with mlx5, we can receive directly in the kernel.
Are we able to do the same with Linux TC rules?

> This commit introduces rte flow action that the application may use
> to route the packet to the kernel while still in the HW.

Should we understand it is the opposite of isolated mode?

[...]
> +	/*
> +	 * Send traffic to kernel.
> +	 */

You should make explicit that the traffic is directed to the kernel,
without going to userspace at all.
A reference to the isolated mode would be worthwhile as well.

> +	RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL,




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-09-12 13:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-12 12:59 [PATCH 1/3] ethdev: add send to kernel action Michael Savisko
2022-09-12 12:59 ` [PATCH 2/3] app/testpmd: add new action kernel Michael Savisko
2022-09-12 12:59 ` [PATCH 3/3] doc: update testpmd application guide Michael Savisko
2022-09-12 13:14 ` [PATCH 1/3] ethdev: add send to kernel action Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).