[1/3] ethdev: add send to kernel action

Message ID 20220912125908.922188-1-michaelsav@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Andrew Rybchenko
Headers
Series [1/3] ethdev: add send to kernel action |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Michael Savisko Sept. 12, 2022, 12:59 p.m. UTC
  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(+)
  

Comments

Thomas Monjalon Sept. 12, 2022, 1:14 p.m. UTC | #1
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,
  

Patch

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,
 };
 
 /**