ethdev: add send to kernel action
RFC 1/1 ethdev: add send to kernel action
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.
--- lib/librte_ethdev/rte_flow.h | 5 +++++ 1 file changed, 5 insertions(+)
lib/librte_ethdev/rte_flow.h +5 -0
@@ -2853,6 +2853,11 @@ enum rte_flow_action_type {* See file rte_mtr.h for MTR profile object configuration. */ RTE_FLOW_ACTION_TYPE_METER_MARK , + +/* +* Send traffic to kernel. +*/ + RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL, };/**
Signature · 1 line
2.27.0
Quoted 33 lines
-----Original Message-----
From: Michael Savisko <[email protected]>
Sent: Thursday, 11 August 2022 14:36In 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 <[email protected]>--- lib/librte_ethdev/rte_flow.h | 5 +++++ 1 file changed, 5 insertions(+)lib/librte_ethdev/rte_flow.h +5
-1@@ -2853,6 +2853,11 @@ enum rte_flow_action_type {* See file rte_mtr.h for MTR profile object configuration. */ RTE_FLOW_ACTION_TYPE_METER_MARK , + +/* +* Send traffic to kernel. +*/ + RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL, };/** --
Quoted 1 line
2.27.0
Best,
Ori
Quoted 10 lines · Michael Savisko
CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
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 <[email protected]>
I assume this only works for bifurcated drivers, right?
16/08/2022 11:50, Ferruh Yigit:
Quoted 10 lines · Michael Savisko
Quoted 9 lines
CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
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.
Quoted 3 lines
Quoted 1 line
Signed-off-by Michael Savisko <[email protected]>I assume this only works for bifurcated drivers, right?
This question has not been replied after a month.
Please let's be more reactive.
I replied to it the same day but unfortunately only to the author (see attached). My apologies.
Here's the answer:
"Depends on HW. If it can forward packets to different places then it can also be supported. But in most cases yes - for bifurcated drivers."
Regards,
Michael
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Monday, 12 September 2022 16:33
To: Michael Savisko <[email protected]>; Ori Kam <[email protected]>
Cc: [email protected]; [email protected]; Ferruh Yigit <[email protected]>; Slava Ovsiienko <[email protected]>
Subject: Re: [RFC] ethdev: add send to kernel action
16/08/2022 11:50, Ferruh Yigit:
Quoted 10 lines · Michael Savisko
Quoted 9 lines
CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
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.
Quoted 3 lines
Quoted 1 line
Signed-off-by Michael Savisko <[email protected]>I assume this only works for bifurcated drivers, right?
This question has not been replied after a month.
Please let's be more reactive.
Depends on HW. If it can forward packets to different places then it can also be supported. But in most cases yes - for bifurcated drivers.
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Tuesday, August 16, 2022 12:51 PM
To: Michael Savisko <[email protected]>; Ori Kam <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [RFC] ethdev: add send to kernel action
Quoted 10 lines · Michael Savisko
CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
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 <[email protected]>
I assume this only works for bifurcated drivers, right?
Quoted 16 lines · Michael Savisko
Quoted 16 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Monday, 12 September 2022 16:33
To: Michael Savisko <[email protected]>; Ori Kam <[email protected]>
Cc: [email protected]; [email protected]; Ferruh Yigit <[email protected]>; Slava Ovsiienko <[email protected]>
Subject: Re: [RFC] ethdev: add send to kernel action16/08/2022 11:50, Ferruh Yigit:
Quoted 8 lines · Michael Savisko
Quoted 7 lines
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.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Michael Savisko <[email protected]>I assume this only works for bifurcated drivers, right?
This question has not been replied after a month.
Please let's be more reactive.Depends on HW. If it can forward packets to different places then it can also be supported. But in most cases yes - for bifurcated drivers.
The action sounds like "do some magic". As far as I know we have no concept of kernel and cooperation with the kernel in DPDK yet.
Is it a transfer or non-transfer action?
I guess non-transfer, since otherwise the next question is which kernel...
In the case of non-transfer DPDK has a concept of Rx queues which are used to deliver traffic to and we have QUEUE and RSS flow actions to do it.
The patch adds some magic direction "kernel". Don't we want to control destination queue? RSS?
May be we need dedicated control steps to setup kernel Rx queues and than use QUEUE/RSS to direct traffic there?
Quoted 23 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Monday, 12 September 2022 17:41Quoted 17 lines · Michael Savisko
Quoted 17 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Monday, 12 September 2022 16:3316/08/2022 11:50, Ferruh Yigit:
Quoted 11 lines · Michael Savisko
Quoted 8 lines
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 <[email protected]>I assume this only works for bifurcated drivers, right?
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
This question has not been replied after a month.
Please let's be more reactive.Depends on HW. If it can forward packets to different places then it can also
be supported. But in most cases yes - for bifurcated drivers.
The action sounds like "do some magic". As far as I know we have no concept of kernel and cooperation with the kernel in DPDK yet.
There's nothing "magical". Kernel is not a part of DPDK, but DPDK can use KNI to transfer messages between application and kernel.
With bifurcated driver we can have a rule to route the packet matching a pattern (example: IPv4 packets) to the DPDK application and the rest of the traffic will be received by the kernel. But if we want to receive most of the traffic in DPDK except specific pattern (example: ICMP packets) that should be processed by the kernel, then it's easier to re-route these packets with a single rule. The new action I'm suggesting allows application to route packets directly to the kernel without software involvement, it is a HW offload.
We see it used when working with bifurcated driver, because the kernel driver and the DPDK driver are sharing the same HW.
Quoted 2 lines
Is it a transfer or non-transfer action?
I guess non-transfer, since otherwise the next question is which kernel...
This is an ingress action only.
Quoted 2 lines
In the case of non-transfer DPDK has a concept of Rx queues which are used to deliver traffic to and we have QUEUE and RSS flow actions to do it.
The idea of this offload action is to route traffic away from the DPDK application.
Quoted 4 lines
The patch adds some magic direction "kernel". Don't we want to control destination queue? RSS?
May be we need dedicated control steps to setup kernel Rx queues and than use QUEUE/RSS to direct traffic there?
We have no control of how the kernel is configured.
I will provide a new version of the patch with better documentation. Please feel free to suggest any wording.
Thank you,
Michael
13/09/2022 14:09, Michael Savisko:
Quoted 31 lines
From: Andrew Rybchenko <[email protected]>
Quoted 15 lines · Michael Savisko
Quoted 14 lines
From: Thomas Monjalon <[email protected]>
Quoted 13 lines
16/08/2022 11:50, Ferruh Yigit:
Quoted 11 lines · Michael Savisko
Quoted 8 lines
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 <[email protected]>I assume this only works for bifurcated drivers, right?
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
This question has not been replied after a month.
Please let's be more reactive.Depends on HW. If it can forward packets to different places then it can also
be supported. But in most cases yes - for bifurcated drivers.
The action sounds like "do some magic". As far as I know we have no concept of kernel and cooperation with the kernel in DPDK yet.
There's nothing "magical". Kernel is not a part of DPDK, but DPDK can use KNI to transfer messages between application and kernel.
With bifurcated driver we can have a rule to route the packet matching a pattern (example: IPv4 packets) to the DPDK application and the rest of the traffic will be received by the kernel. But if we want to receive most of the traffic in DPDK except specific pattern (example: ICMP packets) that should be processed by the kernel, then it's easier to re-route these packets with a single rule. The new action I'm suggesting allows application to route packets directly to the kernel without software involvement, it is a HW offload.
We see it used when working with bifurcated driver, because the kernel driver and the DPDK driver are sharing the same HW.
Quoted 4 lines
Quoted 2 lines
Is it a transfer or non-transfer action?
I guess non-transfer, since otherwise the next question is which kernel...This is an ingress action only.
Should we add this note in the doxygen comment?
This is the wording in the v2 sent today:
+ /*
+ * Send packets to the kernel, without going to userspace at all. + * The packets will be received by the kernel driver sharing + * the same device as the DPDK port. + * + * No associated configuration structure. + */
+ RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL,
Quoted 11 lines
Quoted 2 lines
In the case of non-transfer DPDK has a concept of Rx queues which are used to deliver traffic to and we have QUEUE and RSS flow actions to do it.
The idea of this offload action is to route traffic away from the DPDK application.
Quoted 4 lines
The patch adds some magic direction "kernel". Don't we want to control destination queue? RSS?
May be we need dedicated control steps to setup kernel Rx queues and than use QUEUE/RSS to direct traffic there?We have no control of how the kernel is configured.
PATCH v2 1/1 ethdev: add send to kernel action
In reply to Michael SaviskoIn 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.
With bifurcated driver we can have a rule to route packets matching a pattern (example: IPv4 packets) to the DPDK application and the rest of the traffic will be received by the kernel.
But if we want to receive most of the traffic in DPDK except specific pattern (example: ICMP packets) that should be processed by the kernel, then it's easier to re-route these packets with a single rule.
This commit introduces new rte_flow action which allows application to re-route packets directly to the kernel without software involvement.
Add new testpmd rte_flow action 'send_to_kernel'. The application may use this action to route the packet to the kernel while still in the HW.
Example with testpmd command:
flow create 0 ingress priority 0 group 1 pattern eth type spec 0x0800 type mask 0xffff / end actions send_to_kernel / end
--- app/test-pmd/cmdline_flow.c | 9 +++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 ++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 9 +++++++++ 4 files changed, 21 insertions(+)
app/test-pmd/cmdline_flow.c +9 -0
@@ -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] = {
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2 -0
@@ -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 ~~~~~~~~~~~~~~~~~~~~~
lib/ethdev/rte_flow.c +1 -0
@@ -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
lib/ethdev/rte_flow.h +9 -0
@@ -2879,6 +2879,15 @@ enum rte_flow_action_type {* @see struct rte_flow_action_ethdev */ RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT , + +/* +* Send packets to the kernel, without going to userspace at all. +* The packets will be received by the kernel driver sharing +* the same device as the DPDK port. +* +* No associated configuration structure. +*/ + RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL, };/**
Signature · 1 line
2.27.0
PATCH v3 1/1 ethdev: add send to kernel action
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.
With bifurcated driver we can have a rule to route packets matching a pattern (example: IPv4 packets) to the DPDK application and the rest of the traffic will be received by the kernel.
But if we want to receive most of the traffic in DPDK except specific pattern (example: ICMP packets) that should be processed by the kernel, then it's easier to re-route these packets with a single rule.
This commit introduces new rte_flow action which allows application to re-route packets directly to the kernel without software involvement.
Add new testpmd rte_flow action 'send_to_kernel'. The application may use this action to route the packet to the kernel while still in the HW.
Example with testpmd command:
flow create 0 ingress priority 0 group 1 pattern eth type spec 0x0800 type mask 0xffff / end actions send_to_kernel / end
--- app/test-pmd/cmdline_flow.c | 9 +++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 ++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 10 ++++++++++ 4 files changed, 22 insertions(+)
app/test-pmd/cmdline_flow.c +9 -0
@@ -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] = {
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2 -0
@@ -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 ~~~~~~~~~~~~~~~~~~~~~
lib/ethdev/rte_flow.c +1 -0
@@ -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
lib/ethdev/rte_flow.h +10 -0
@@ -2879,6 +2879,16 @@ enum rte_flow_action_type {* @see struct rte_flow_action_ethdev */ RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT , + +/** +* Send packets to the kernel, without going to userspace at all. +* The packets will be received by the kernel driver sharing +* the same device as the DPDK port. +* This is an ingress action only. +* +* No associated configuration structure. +*/ + RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL, };/**
Signature · 1 line
2.27.0
Hi Michael
Quoted 122 lines
-----Original Message-----
From: Michael Savisko <[email protected]>
Sent: Monday, 19 September 2022 18:50In 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.
With bifurcated driver we can have a rule to route packets matching a pattern (example: IPv4 packets) to the DPDK application and the rest of the traffic will be received by the kernel.
But if we want to receive most of the traffic in DPDK except specific pattern (example: ICMP packets) that should be processed by the kernel, then it's easier to re-route these packets with a single rule.This commit introduces new
rte_flowaction which allows application to re-route packets directly to the kernel without software involvement.Add new testpmd
rte_flowaction 'send_to_kernel'. The application may use this action to route the packet to the kernel while still in the HW.Example with testpmd command:
flow create 0 ingress priority 0 group 1 pattern eth type spec
0x0800type mask0xffff/ end actionssend_to_kernel/ endSigned-off-by Michael Savisko <[email protected]>--- app/test-pmd/cmdline_flow.c | 9 +++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 ++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 10 ++++++++++ 4 files changed, 22 insertions(+)app/test-pmd/cmdline_flow.c +9
-0@@ -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] = {doc/guides/testpmd_app_ug/testpmd_funcs.rst +0
-0@@ -4189,6 +4189,8 @@ This section lists supported actions and theirattributes, if any.
- ``ethdev_port_id {unsigned}``: ethdev port ID
+- ``send_to_kernel``: send packets to kernel.
doc/guides/testpmd_app_ug/testpmd_funcs.rst +1
-0+ Destroying flow rules ~~~~~~~~~~~~~~~~~~~~~lib/ethdev/rte_flow.c +0
-0@@ -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)),lib/ethdev/rte_flow.c +1
-0+ MK_FLOW_ACTION(SEND_TO_KERNEL, 0), };int lib/ethdev/rte_flow.h +10
-1@@ -2879,6 +2879,16 @@ enum rte_flow_action_type {* @see struct rte_flow_action_ethdev */ RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT , + +/** +* Send packets to the kernel, without going to userspace at all. +* The packets will be received by the kernel driver sharing +* the same device as the DPDK port. +* This is an ingress action only. +* +* No associated configuration structure. +*/ + RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL, };/** --
Quoted 1 line
2.27.0
Best,
Ori
Quoted 95 lines · 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.
With bifurcated driver we can have a rule to route packets matching a pattern (example: IPv4 packets) to the DPDK application and the rest of the traffic will be received by the kernel.
But if we want to receive most of the traffic in DPDK except specific pattern (example: ICMP packets) that should be processed by the kernel, then it's easier to re-route these packets with a single rule.This commit introduces new
rte_flowaction which allows application to re-route packets directly to the kernel without software involvement.Add new testpmd
rte_flowaction 'send_to_kernel'. The application may use this action to route the packet to the kernel while still in the HW.Example with testpmd command:
flow create 0 ingress priority 0 group 1 pattern eth type spec
0x0800type mask0xffff/ end actionssend_to_kernel/ endSigned-off-by Michael Savisko <[email protected]>--- app/test-pmd/cmdline_flow.c | 9 +++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 ++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 10 ++++++++++ 4 files changed, 22 insertions(+)app/test-pmd/cmdline_flow.c +9
-0@@ -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] = {doc/guides/testpmd_app_ug/testpmd_funcs.rst +2
-0@@ -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 ~~~~~~~~~~~~~~~~~~~~~lib/ethdev/rte_flow.c +1
-0@@ -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 lib/ethdev/rte_flow.h +0
-0
lib/ethdev/rte_flow.h enum rte_flow_action_type { · line 2885
Quoted 7 lines
lib/ethdev/rte_flow.h +4
-0@@ -2879,6 +2879,16 @@ enum rte_flow_action_type {* @see struct rte_flow_action_ethdev */ RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT, + +/** +* Send packets to the kernel, without going to userspace at all. +* The packets will be received by the kernel driver sharing
May be it is better to mentioned bifurcated driver model and add a reference to the documentation.
lib/ethdev/rte_flow.h enum rte_flow_action_type { · line 2886
Quoted 1 line
lib/ethdev/rte_flow.h +1
-0+* the same device as the DPDK port.
Which DPDK port? There is no control structure associated with the action.
I guess it is the port used to create the flow rule. If so, it should be documented that it is non-transfer action and highlighted that the port used to create the action.
Quoted 8 lines
lib/ethdev/rte_flow.h +5
-0+* This is an ingress action only. +* +* No associated configuration structure. +*/ + RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL, };/**
Quoted 101 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Monday, 26 September 2022 16:07doc/guides/testpmd_app_ug/testpmd_funcs.rst This section lists supported actions and their
Quoted 71 lines · 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.
With bifurcated driver we can have a rule to route packets matching a pattern (example: IPv4 packets) to the DPDK application and the rest of the traffic will be received by the kernel.
But if we want to receive most of the traffic in DPDK except specific pattern (example: ICMP packets) that should be processed by the kernel, then it's easier to re-route these packets with a single rule.This commit introduces new
rte_flowaction which allows application to re-route packets directly to the kernel without software involvement.Add new testpmd
rte_flowaction 'send_to_kernel'. The application may use this action to route the packet to the kernel while still in the HW.Example with testpmd command:
flow create 0 ingress priority 0 group 1 pattern eth type spec
0x0800type mask0xffff/ end actionssend_to_kernel/ endSigned-off-by Michael Savisko <[email protected]>--- app/test-pmd/cmdline_flow.c | 9 +++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 ++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 10 ++++++++++ 4 files changed, 22 insertions(+)app/test-pmd/cmdline_flow.c +9
-1@@ -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] = {doc/guides/testpmd_app_ug/testpmd_funcs.rst +0
-0@@ -4189,6 +4189,8 @@ This section lists supported actions and theirattributes, if any.
lib/ethdev/rte_flow.c static const struct rte_flow_desc_data
Quoted 13 lines
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2
-0- ``ethdev_port_id {unsigned}``: ethdev port ID +- ``send_to_kernel``: send packets to kernel. + Destroying flow rules ~~~~~~~~~~~~~~~~~~~~~lib/ethdev/rte_flow.c index renamed from lib/ethdev/rte_flow.c +0
-0
501be9d602..627c671ce4100644lib/ethdev/rte_flow.c +0
-0@@ -259,6 +259,7 @@ static const struct rte_flow_desc_datarte_flow_desc_action[] = {
lib/ethdev/rte_flow.c static const struct rte_flow_desc_data · line 259
Quoted 1 line
lib/ethdev/rte_flow.c +0
-0MK_FLOW_ACTION(CONNTRACK, sizeof(struct
rte_flow_action_conntrack)),lib/ethdev/rte_flow.c static const struct rte_flow_desc_data · line 260
Quoted 1 line
lib/ethdev/rte_flow.c +0
-0MK_FLOW_ACTION(PORT_REPRESENTOR, sizeof(struct
rte_flow_action_ethdev)),Quoted 5 lines
lib/ethdev/rte_flow.c +1
-0MK_FLOW_ACTION (REPRESENTED_PORT ,sizeof (struct rte_flow_action_ethdev )), + MK_FLOW_ACTION(SEND_TO_KERNEL, 0), };
Quoted 16 lines
lib/ethdev/rte_flow.h enum rte_flow_action_type { · line 2885
Quoted 13 lines
int
lib/ethdev/rte_flow.h index renamed from lib/ethdev/rte_flow.h +0
-0
a79f1e7ef0..bf076087b3100644lib/ethdev/rte_flow.h +4
-0@@ -2879,6 +2879,16 @@ enum rte_flow_action_type {* @see struct rte_flow_action_ethdev */ RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT, + +/** +* Send packets to the kernel, without going to userspace at all. +* The packets will be received by the kernel driver sharing May be it is better to mentioned bifurcated driver model and add a reference to the documentation.
Yes, I will add mentioning bifurcated driver model.
Quoted 8 lines
lib/ethdev/rte_flow.h enum rte_flow_action_type { · line 2886
Quoted 2 lines
lib/ethdev/rte_flow.h +1
-0+* the same device as the DPDK port. Which DPDK port? There is no control structure associated with the action.
I guess it is the port used to create the flow rule.
If so, it should be documented that it is non-transfer action and highlighted that the port used to create the action.
Yes, its is the port used to create the flow rule. I will add this to the comment. I will emphasize that it's non-transfer action as well.
I will provide a new version of the patch with better documentation.
Thank you,
Michael Savisko
Quoted 9 lines
Quoted 9 lines
lib/ethdev/rte_flow.h +5
-0+* This is an ingress action only. +* +* No associated configuration structure. +*/ + RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL, };/**
PATCH v4 1/1 ethdev: add send to kernel action
In reply to Michael SaviskoIn 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.
With bifurcated driver we can have a rule to route packets matching a pattern (example: IPv4 packets) to the DPDK application and the rest of the traffic will be received by the kernel.
But if we want to receive most of the traffic in DPDK except specific pattern (example: ICMP packets) that should be processed by the kernel, then it's easier to re-route these packets with a single rule.
This commit introduces new rte_flow action which allows application to re-route packets directly to the kernel without software involvement.
Add new testpmd rte_flow action 'send_to_kernel'. The application may use this action to route the packet to the kernel while still in the HW.
Example with testpmd command:
flow create 0 ingress priority 0 group 1 pattern eth type spec 0x0800 type mask 0xffff / end actions send_to_kernel / end
---
v4:
- improve description comment above RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL
v3:
http://patches.dpdk.org/project/dpdk/patch/[email protected]/
v2:
http://patches.dpdk.org/project/dpdk/patch/[email protected]/
--- app/test-pmd/cmdline_flow.c | 9 +++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 ++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 12 ++++++++++++ 4 files changed, 24 insertions(+)
app/test-pmd/cmdline_flow.c +9 -0
@@ -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] = {
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2 -0
@@ -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 ~~~~~~~~~~~~~~~~~~~~~
lib/ethdev/rte_flow.c +1 -0
@@ -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
lib/ethdev/rte_flow.h +12 -0
@@ -2879,6 +2879,18 @@ enum rte_flow_action_type {* @see struct rte_flow_action_ethdev */ RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT , + +/** +* Send packets to the kernel, without going to userspace at all. +* The packets will be received by the kernel driver sharing +* the same device as the DPDK port on which this action is +* configured. This action is mostly suits bifurcated driver +* model. +* This is an ingress non-transfer action only. +* +* No associated configuration structure. +*/ + RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL, };/**
Signature · 1 line
2.27.0
Quoted 107 lines · 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.
With bifurcated driver we can have a rule to route packets matching a pattern (example: IPv4 packets) to the DPDK application and the rest of the traffic will be received by the kernel.
But if we want to receive most of the traffic in DPDK except specific pattern (example: ICMP packets) that should be processed by the kernel, then it's easier to re-route these packets with a single rule.This commit introduces new
rte_flowaction which allows application to re-route packets directly to the kernel without software involvement.Add new testpmd
rte_flowaction 'send_to_kernel'. The application may use this action to route the packet to the kernel while still in the HW.Example with testpmd command:
flow create 0 ingress priority 0 group 1 pattern eth type spec
0x0800type mask0xffff/ end actionssend_to_kernel/ endSigned-off-by Michael Savisko <[email protected]>Acked-by Ori Kam <[email protected]>---
v4:
- improve description comment aboveRTE_FLOW_ACTION_TYPE_SEND_TO_KERNELv3:
http://patches.dpdk.org/project/dpdk/patch/[email protected]/v2:
http://patches.dpdk.org/project/dpdk/patch/[email protected]/--- app/test-pmd/cmdline_flow.c | 9 +++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 ++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 12 ++++++++++++ 4 files changed, 24 insertions(+)app/test-pmd/cmdline_flow.c +9
-0@@ -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] = {doc/guides/testpmd_app_ug/testpmd_funcs.rst +2
-0@@ -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 ~~~~~~~~~~~~~~~~~~~~~lib/ethdev/rte_flow.c +1
-0@@ -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 lib/ethdev/rte_flow.h +0
-0@@ -2879,6 +2879,18 @@ enum rte_flow_action_type {* @see struct rte_flow_action_ethdev
lib/ethdev/rte_flow.h enum rte_flow_action_type { · line 2889
Quoted 10 lines
lib/ethdev/rte_flow.h +8
-0*/ RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT , + +/** +* Send packets to the kernel, without going to userspace at all. +* The packets will be received by the kernel driver sharing +* the same device as the DPDK port on which this action is +* configured. This action is mostly suits bifurcated driver +* model. +* This is an ingress non-transfer action only.
May be we should not limit the definition to ingress only? It could be useful on egress as a way to reroute packet back to kernel.
Quoted 7 lines
lib/ethdev/rte_flow.h +4
-0+* +* No associated configuration structure. +*/ + RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL, };/**
Hi Andrew
Quoted 126 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Monday, 3 October 2022 10:54Quoted 20 lines · 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.
With bifurcated driver we can have a rule to route packets matching a pattern (example: IPv4 packets) to the DPDK application and the rest of the traffic will be received by the kernel.
But if we want to receive most of the traffic in DPDK except specific pattern (example: ICMP packets) that should be processed by the kernel, then it's easier to re-route these packets with a single rule.This commit introduces new
rte_flowaction which allows application to re-route packets directly to the kernel without software involvement.Add new testpmd
rte_flowaction 'send_to_kernel'. The application may use this action to route the packet to the kernel while still in the HW.Example with testpmd command:
Quoted 8 lines
flow create 0 ingress priority 0 group 1 pattern eth type spec
0x0800type mask0xffff/ end actionssend_to_kernel/ endSigned-off-by Michael Savisko <[email protected]>Acked-by Ori Kam <[email protected]>---
v4:
- improve description comment above
RTE_FLOW_ACTION_TYPE_SEND_TO_KERNELQuoted 3 lines
v3:
http://patches.dpdk.org/project/dpdk/patch/20220919155013.61473-1-Quoted 3 lines
v2:
http://patches.dpdk.org/project/dpdk/patch/20220914093219.11728-1-Review
Quoted 43 lines
--- app/test-pmd/cmdline_flow.c | 9 +++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 ++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 12 ++++++++++++ 4 files changed, 24 insertions(+)app/test-pmd/cmdline_flow.c +9
-0@@ -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] = {(quoted diff) +0
-0
b/doc/guides/testpmd_app_ug/testpmd_funcs.rstdoc/guides/testpmd_app_ug/testpmd_funcs.rst This section lists supported actions and their
Quoted 4 lines
index
330e34427d..c259c8239a100644doc/guides/testpmd_app_ug/testpmd_funcs.rst +0
-0@@ -4189,6 +4189,8 @@ This section lists supported actions and theirattributes, if any.
lib/ethdev/rte_flow.c static const struct rte_flow_desc_data
Quoted 13 lines
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2
-0- ``ethdev_port_id {unsigned}``: ethdev port ID +- ``send_to_kernel``: send packets to kernel. + Destroying flow rules ~~~~~~~~~~~~~~~~~~~~~lib/ethdev/rte_flow.c +0
-0@@ -259,6 +259,7 @@ static const struct rte_flow_desc_datarte_flow_desc_action[] = {
lib/ethdev/rte_flow.c static const struct rte_flow_desc_data · line 259
Quoted 1 line
lib/ethdev/rte_flow.c +0
-0MK_FLOW_ACTION(CONNTRACK, sizeof(struct
rte_flow_action_conntrack)),lib/ethdev/rte_flow.c static const struct rte_flow_desc_data · line 260
Quoted 1 line
lib/ethdev/rte_flow.c +0
-0MK_FLOW_ACTION(PORT_REPRESENTOR, sizeof(struct
rte_flow_action_ethdev)),lib/ethdev/rte_flow.c static const struct rte_flow_desc_data · line 261
Quoted 1 line
lib/ethdev/rte_flow.c +0
-0MK_FLOW_ACTION(REPRESENTED_PORT, sizeof(struct
rte_flow_action_ethdev)),Quoted 16 lines
lib/ethdev/rte_flow.c +1
-0+ MK_FLOW_ACTION(SEND_TO_KERNEL, 0), };int lib/ethdev/rte_flow.h +4
-0@@ -2879,6 +2879,18 @@ enum rte_flow_action_type {* @see struct rte_flow_action_ethdev */ RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT, + +/** +* Send packets to the kernel, without going to userspace at all. +* The packets will be received by the kernel driver sharing
Quoted 9 lines
lib/ethdev/rte_flow.h enum rte_flow_action_type { · line 2889
Quoted 4 lines
lib/ethdev/rte_flow.h +4
-0+* the same device as the DPDK port on which this action is +* configured. This action is mostly suits bifurcated driver +* model. +* This is an ingress non-transfer action only. May be we should not limit the definition to ingress only? It could be useful on egress as a way to reroute packet back to kernel.
Interesting, but there are no Kernel queues on egress that can receive packets (by definition of egress) do you mean that this will also do loopback from the egress back to the ingress of the same port and then send to kernel?
if so, I think we need a new action "loop_back"
Quoted 8 lines
Quoted 8 lines
lib/ethdev/rte_flow.h +4
-0+* +* No associated configuration structure. +*/ + RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL, };/**
Quoted 138 lines · Ori Kam
Hi Andrew
Quoted 126 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Monday, 3 October 2022 10:54Quoted 20 lines · 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.
With bifurcated driver we can have a rule to route packets matching a pattern (example: IPv4 packets) to the DPDK application and the rest of the traffic will be received by the kernel.
But if we want to receive most of the traffic in DPDK except specific pattern (example: ICMP packets) that should be processed by the kernel, then it's easier to re-route these packets with a single rule.This commit introduces new
rte_flowaction which allows application to re-route packets directly to the kernel without software involvement.Add new testpmd
rte_flowaction 'send_to_kernel'. The application may use this action to route the packet to the kernel while still in the HW.Example with testpmd command:
Quoted 8 lines
flow create 0 ingress priority 0 group 1 pattern eth type spec
0x0800type mask0xffff/ end actionssend_to_kernel/ endSigned-off-by Michael Savisko <[email protected]>Acked-by Ori Kam <[email protected]>---
v4:
- improve description comment above
RTE_FLOW_ACTION_TYPE_SEND_TO_KERNELQuoted 3 lines
v3:
http://patches.dpdk.org/project/dpdk/patch/20220919155013.61473-1-Quoted 3 lines
v2:
http://patches.dpdk.org/project/dpdk/patch/20220914093219.11728-1-Review
Quoted 43 lines
--- app/test-pmd/cmdline_flow.c | 9 +++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 ++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 12 ++++++++++++ 4 files changed, 24 insertions(+)app/test-pmd/cmdline_flow.c +9
-0@@ -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] = {(quoted diff) +0
-0
b/doc/guides/testpmd_app_ug/testpmd_funcs.rstdoc/guides/testpmd_app_ug/testpmd_funcs.rst This section lists supported actions and their
Quoted 4 lines
index
330e34427d..c259c8239a100644doc/guides/testpmd_app_ug/testpmd_funcs.rst +0
-0@@ -4189,6 +4189,8 @@ This section lists supported actions and theirattributes, if any.
lib/ethdev/rte_flow.c static const struct rte_flow_desc_data
Quoted 13 lines
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2
-0- ``ethdev_port_id {unsigned}``: ethdev port ID +- ``send_to_kernel``: send packets to kernel. + Destroying flow rules ~~~~~~~~~~~~~~~~~~~~~lib/ethdev/rte_flow.c +0
-0@@ -259,6 +259,7 @@ static const struct rte_flow_desc_datarte_flow_desc_action[] = {
lib/ethdev/rte_flow.c static const struct rte_flow_desc_data · line 259
Quoted 1 line
lib/ethdev/rte_flow.c +0
-0MK_FLOW_ACTION(CONNTRACK, sizeof(struct
rte_flow_action_conntrack)),lib/ethdev/rte_flow.c static const struct rte_flow_desc_data · line 260
Quoted 1 line
lib/ethdev/rte_flow.c +0
-0MK_FLOW_ACTION(PORT_REPRESENTOR, sizeof(struct
rte_flow_action_ethdev)),lib/ethdev/rte_flow.c static const struct rte_flow_desc_data · line 261
Quoted 1 line
lib/ethdev/rte_flow.c +0
-0MK_FLOW_ACTION(REPRESENTED_PORT, sizeof(struct
rte_flow_action_ethdev)),Quoted 16 lines
lib/ethdev/rte_flow.c +1
-0+ MK_FLOW_ACTION(SEND_TO_KERNEL, 0), };int lib/ethdev/rte_flow.h +4
-0@@ -2879,6 +2879,18 @@ enum rte_flow_action_type {* @see struct rte_flow_action_ethdev */ RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT, + +/** +* Send packets to the kernel, without going to userspace at all. +* The packets will be received by the kernel driver sharing Quoted 9 lines
lib/ethdev/rte_flow.h enum rte_flow_action_type { · line 2889
Quoted 4 lines
lib/ethdev/rte_flow.h +4
-0+* the same device as the DPDK port on which this action is +* configured. This action is mostly suits bifurcated driver +* model. +* This is an ingress non-transfer action only. May be we should not limit the definition to ingress only? It could be useful on egress as a way to reroute packet back to kernel.
Quoted 4 lines
Interesting, but there are no Kernel queues on egress that can receive packets (by definition of egress) do you mean that this will also do loopback from the egress back to the ingress of the same port and then send to kernel?
if so, I think we need a new action "loop_back"
Yes, I meant intercept packet on egress and send to kernel. But we still need loopback+send_to_kernel. Loopback itself cannot send to kernel. Moreover it should be two rules:
loopback on egress plus send-to-kernel on ingress. Does it really worse it? I'm not sure. Yes, it sounds a bit better from arch point of view, but I'm still unsure. I'd allow send-to-kernel on egress. Up to you.
Quoted 10 lines
Quoted 9 lines
Quoted 9 lines
lib/ethdev/rte_flow.h +4
-0+* +* No associated configuration structure. +*/ + RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL, };/**
Hi Andrew,
Quoted 152 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Monday, 3 October 2022 12:44Quoted 15 lines · Ori Kam
Hi Andrew
Quoted 13 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Monday, 3 October 2022 10:54Quoted 9 lines · 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.
With bifurcated driver we can have a rule to route packets matching a pattern (example: IPv4 packets) to the DPDK application and the rest of the traffic will be received by the kernel.
But if we want to receive most of the traffic in DPDK except specific pattern (example: ICMP packets) that should be processed by thekernel,
Quoted 29 lines
Quoted 29 lines
Quoted 11 lines
then it's easier to re-route these packets with a single rule.
This commit introduces new
rte_flowaction which allows application to re-route packets directly to the kernel without software involvement.Add new testpmd
rte_flowaction 'send_to_kernel'. The application may use this action to route the packet to the kernel while still in the HW.Example with testpmd command:
Quoted 8 lines
flow create 0 ingress priority 0 group 1 pattern eth type spec
0x0800type mask0xffff/ end actionssend_to_kernel/ endSigned-off-by Michael Savisko <[email protected]>Acked-by Ori Kam <[email protected]>---
v4:
- improve description comment above
RTE_FLOW_ACTION_TYPE_SEND_TO_KERNELQuoted 3 lines
v3:
http://patches.dpdk.org/project/dpdk/patch/20220919155013.61473-1-Quoted 3 lines
v2:
http://patches.dpdk.org/project/dpdk/patch/20220914093219.11728-1-Quoted 1 line
Quoted 8 lines
Quoted 8 lines
app/test-
Quoted 8 lines
--- app/test-pmd/cmdline_flow.c | 9 +++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 ++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 12 ++++++++++++ 4 files changed, 24 insertions(+)app/test- renamed from app/test-pmd/cmdline_flow.c +0
-0
pmd/cmdline_flow.cQuoted 86 lines
Quoted 76 lines
Review
Quoted 34 lines
index
7f50028eb7..042f6b34a6100644app/test-pmd/cmdline_flow.c +9
-0@@ -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] = {(quoted diff) +0
-0
b/doc/guides/testpmd_app_ug/testpmd_funcs.rstdoc/guides/testpmd_app_ug/testpmd_funcs.rst This section lists supported actions and their
Quoted 4 lines
index
330e34427d..c259c8239a100644doc/guides/testpmd_app_ug/testpmd_funcs.rst +0
-0@@ -4189,6 +4189,8 @@ This section lists supported actions and theirattributes, if any.
lib/ethdev/rte_flow.c static const struct rte_flow_desc_data
Quoted 13 lines
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2
-0- ``ethdev_port_id {unsigned}``: ethdev port ID +- ``send_to_kernel``: send packets to kernel. + Destroying flow rules ~~~~~~~~~~~~~~~~~~~~~lib/ethdev/rte_flow.c +0
-0@@ -259,6 +259,7 @@ static const struct rte_flow_desc_datarte_flow_desc_action[] = {
lib/ethdev/rte_flow.c static const struct rte_flow_desc_data · line 259
Quoted 1 line
lib/ethdev/rte_flow.c +0
-0MK_FLOW_ACTION(CONNTRACK, sizeof(struct
rte_flow_action_conntrack)),lib/ethdev/rte_flow.c static const struct rte_flow_desc_data · line 260
Quoted 1 line
lib/ethdev/rte_flow.c +0
-0MK_FLOW_ACTION(PORT_REPRESENTOR, sizeof(struct
rte_flow_action_ethdev)),lib/ethdev/rte_flow.c static const struct rte_flow_desc_data · line 261
Quoted 1 line
lib/ethdev/rte_flow.c +0
-0MK_FLOW_ACTION(REPRESENTED_PORT, sizeof(struct
rte_flow_action_ethdev)),Quoted 16 lines
lib/ethdev/rte_flow.c +1
-0+ MK_FLOW_ACTION(SEND_TO_KERNEL, 0), };int lib/ethdev/rte_flow.h +4
-0@@ -2879,6 +2879,18 @@ enum rte_flow_action_type {* @see struct rte_flow_action_ethdev */ RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT, + +/** +* Send packets to the kernel, without going to userspace at all. +* The packets will be received by the kernel driver sharing Quoted 9 lines
lib/ethdev/rte_flow.h enum rte_flow_action_type { · line 2889
Quoted 4 lines
lib/ethdev/rte_flow.h +4
-0+* the same device as the DPDK port on which this action is +* configured. This action is mostly suits bifurcated driver +* model. +* This is an ingress non-transfer action only. May be we should not limit the definition to ingress only? It could be useful on egress as a way to reroute packet back to kernel.
Quoted 1 line
Interesting, but there are no Kernel queues on egress that can receive
packets (by definition of egress)
Quoted 1 line
do you mean that this will also do loopback from the egress back to the
ingress of the same port and then
Quoted 2 lines
send to kernel?
if so, I think we need a new action "loop_back"
Quoted 8 lines
Yes, I meant intercept packet on egress and send to kernel. But we still need loopback+send_to_kernel. Loopback itself cannot send to kernel. Moreover it should be two rules:
loopback on egress plus send-to-kernel on ingress. Does it really worse it? I'm not sure. Yes, it sounds a bit better from arch point of view, but I'm still unsure. I'd allow send-to-kernel on egress. Up to you.
It looks more correct with loop_back on the egress and send-to-kernel on egress I suggest to keep the current design,
and if we see that we can merge those to commands, we will change it
Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
Quoted 9 lines
lib/ethdev/rte_flow.h +4
-0+* +* No associated configuration structure. +*/ + RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL, };/**
Andrew Rybchenko
Acked-byQuoted 163 lines · Ori Kam
Hi Andrew,
Quoted 152 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Monday, 3 October 2022 12:44Quoted 15 lines · Ori Kam
Hi Andrew
Quoted 13 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Monday, 3 October 2022 10:54Quoted 9 lines · 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.
With bifurcated driver we can have a rule to route packets matching a pattern (example: IPv4 packets) to the DPDK application and the rest of the traffic will be received by the kernel.
But if we want to receive most of the traffic in DPDK except specific pattern (example: ICMP packets) that should be processed by thekernel,
Quoted 29 lines
Quoted 29 lines
Quoted 11 lines
then it's easier to re-route these packets with a single rule.
This commit introduces new
rte_flowaction which allows application to re-route packets directly to the kernel without software involvement.Add new testpmd
rte_flowaction 'send_to_kernel'. The application may use this action to route the packet to the kernel while still in the HW.Example with testpmd command:
Quoted 8 lines
flow create 0 ingress priority 0 group 1 pattern eth type spec
0x0800type mask0xffff/ end actionssend_to_kernel/ endSigned-off-by Michael Savisko <[email protected]>Acked-by Ori Kam <[email protected]>---
v4:
- improve description comment above
RTE_FLOW_ACTION_TYPE_SEND_TO_KERNELQuoted 3 lines
v3:
http://patches.dpdk.org/project/dpdk/patch/20220919155013.61473-1-Quoted 3 lines
v2:
http://patches.dpdk.org/project/dpdk/patch/20220914093219.11728-1-Quoted 1 line
Quoted 8 lines
Quoted 8 lines
app/test-
Quoted 8 lines
--- app/test-pmd/cmdline_flow.c | 9 +++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 ++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 12 ++++++++++++ 4 files changed, 24 insertions(+)app/test- renamed from app/test-pmd/cmdline_flow.c +0
-0
pmd/cmdline_flow.cQuoted 86 lines
Quoted 76 lines
Review
Quoted 34 lines
index
7f50028eb7..042f6b34a6100644app/test-pmd/cmdline_flow.c +9
-0@@ -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] = {(quoted diff) +0
-0
b/doc/guides/testpmd_app_ug/testpmd_funcs.rstdoc/guides/testpmd_app_ug/testpmd_funcs.rst This section lists supported actions and their
Quoted 4 lines
index
330e34427d..c259c8239a100644doc/guides/testpmd_app_ug/testpmd_funcs.rst +0
-0@@ -4189,6 +4189,8 @@ This section lists supported actions and theirattributes, if any.
lib/ethdev/rte_flow.c static const struct rte_flow_desc_data
Quoted 13 lines
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2
-0- ``ethdev_port_id {unsigned}``: ethdev port ID +- ``send_to_kernel``: send packets to kernel. + Destroying flow rules ~~~~~~~~~~~~~~~~~~~~~lib/ethdev/rte_flow.c +0
-0@@ -259,6 +259,7 @@ static const struct rte_flow_desc_datarte_flow_desc_action[] = {
lib/ethdev/rte_flow.c static const struct rte_flow_desc_data · line 259
Quoted 1 line
lib/ethdev/rte_flow.c +0
-0MK_FLOW_ACTION(CONNTRACK, sizeof(struct
rte_flow_action_conntrack)),lib/ethdev/rte_flow.c static const struct rte_flow_desc_data · line 260
Quoted 1 line
lib/ethdev/rte_flow.c +0
-0MK_FLOW_ACTION(PORT_REPRESENTOR, sizeof(struct
rte_flow_action_ethdev)),lib/ethdev/rte_flow.c static const struct rte_flow_desc_data · line 261
Quoted 1 line
lib/ethdev/rte_flow.c +0
-0MK_FLOW_ACTION(REPRESENTED_PORT, sizeof(struct
rte_flow_action_ethdev)),Quoted 16 lines
lib/ethdev/rte_flow.c +1
-0+ MK_FLOW_ACTION(SEND_TO_KERNEL, 0), };int lib/ethdev/rte_flow.h +4
-0@@ -2879,6 +2879,18 @@ enum rte_flow_action_type {* @see struct rte_flow_action_ethdev */ RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT, + +/** +* Send packets to the kernel, without going to userspace at all. +* The packets will be received by the kernel driver sharing Quoted 9 lines
lib/ethdev/rte_flow.h enum rte_flow_action_type { · line 2889
Quoted 4 lines
lib/ethdev/rte_flow.h +4
-0+* the same device as the DPDK port on which this action is +* configured. This action is mostly suits bifurcated driver +* model. +* This is an ingress non-transfer action only. May be we should not limit the definition to ingress only? It could be useful on egress as a way to reroute packet back to kernel.
Quoted 1 line
Interesting, but there are no Kernel queues on egress that can receive
packets (by definition of egress)
Quoted 1 line
do you mean that this will also do loopback from the egress back to the
ingress of the same port and then
Quoted 2 lines
send to kernel?
if so, I think we need a new action "loop_back"Quoted 8 lines
Yes, I meant intercept packet on egress and send to kernel. But we still need loopback+send_to_kernel. Loopback itself cannot send to kernel. Moreover it should be two rules:
loopback on egress plus send-to-kernel on ingress. Does it really worse it? I'm not sure. Yes, it sounds a bit better from arch point of view, but I'm still unsure. I'd allow send-to-kernel on egress. Up to you.
Quoted 3 lines
It looks more correct with
loop_backon the egress and send-to-kernel on egress I suggest to keep the current design,
and if we see that we can merge those to commands, we will change it
OK. And the last question: do we need to announce it in release notes?
Quoted 12 lines
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
Quoted 10 lines
lib/ethdev/rte_flow.h +4
-0+* +* No associated configuration structure. +*/ + RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL, };/**
Hi Andrew,
Quoted 174 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Monday, 3 October 2022 13:47Quoted 15 lines · Ori Kam
Hi Andrew,
Quoted 13 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Monday, 3 October 2022 12:44Quoted 8 lines · Ori Kam
Hi Andrew
Quoted 6 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Monday, 3 October 2022 10:54Quoted 2 lines · 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
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
to transfer the packet to the kernel.
With bifurcated driver we can have a rule to route packets matching a pattern (example: IPv4 packets) to the DPDK application and the
rest
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
of the traffic will be received by the kernel.
But if we want to receive most of the traffic in DPDK except specific pattern (example: ICMP packets) that should be processed by thekernel,
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
then it's easier to re-route these packets with a single rule.
This commit introduces new
rte_flowaction which allows applicationto
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
re-route packets directly to the kernel without software involvement.
Add new testpmd
rte_flowaction 'send_to_kernel'. The application may use this action to route the packet to the kernel while still in the HW.Example with testpmd command:
flow create 0 ingress priority 0 group 1 pattern eth type spec
0x0800type mask0xffff/ end actionssend_to_kernel/ endSigned-off-by Michael Savisko <[email protected]>Acked-by Ori Kam <[email protected]>---
v4:
- improve description comment aboveQuoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
RTE_FLOW_ACTION_TYPE_SEND_TO_KERNELQuoted 3 lines
v3:
http://patches.dpdk.org/project/dpdk/patch/20220919155013.61473-1-
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
v2:
http://patches.dpdk.org/project/dpdk/patch/20220914093219.11728-1-
Quoted 74 lines
Quoted 74 lines
Quoted 10 lines
Quoted 10 lines
app/test-
Quoted 9 lines
--- app/test-pmd/cmdline_flow.c | 9 +++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 ++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 12 ++++++++++++ 4 files changed, 24 insertions(+)app/test- renamed from app/test-pmd/cmdline_flow.c +0
-0
pmd/cmdline_flow.cQuoted 63 lines
Quoted 63 lines
Review
Quoted 34 lines
index
7f50028eb7..042f6b34a6100644app/test-pmd/cmdline_flow.c +9
-0@@ -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] = {(quoted diff) +0
-0
b/doc/guides/testpmd_app_ug/testpmd_funcs.rstdoc/guides/testpmd_app_ug/testpmd_funcs.rst This section lists supported actions and their
Quoted 4 lines
index
330e34427d..c259c8239a100644doc/guides/testpmd_app_ug/testpmd_funcs.rst +0
-0@@ -4189,6 +4189,8 @@ This section lists supported actions and theirattributes, if any.
lib/ethdev/rte_flow.c static const struct rte_flow_desc_data
Quoted 13 lines
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2
-0- ``ethdev_port_id {unsigned}``: ethdev port ID +- ``send_to_kernel``: send packets to kernel. + Destroying flow rules ~~~~~~~~~~~~~~~~~~~~~lib/ethdev/rte_flow.c +0
-0@@ -259,6 +259,7 @@ static const struct rte_flow_desc_datarte_flow_desc_action[] = {
lib/ethdev/rte_flow.c static const struct rte_flow_desc_data · line 259
Quoted 1 line
lib/ethdev/rte_flow.c +0
-0MK_FLOW_ACTION(CONNTRACK, sizeof(struct
rte_flow_action_conntrack)),lib/ethdev/rte_flow.c static const struct rte_flow_desc_data · line 260
Quoted 1 line
lib/ethdev/rte_flow.c +0
-0MK_FLOW_ACTION(PORT_REPRESENTOR, sizeof(struct
rte_flow_action_ethdev)),lib/ethdev/rte_flow.c static const struct rte_flow_desc_data · line 261
Quoted 1 line
lib/ethdev/rte_flow.c +0
-0MK_FLOW_ACTION(REPRESENTED_PORT, sizeof(struct
rte_flow_action_ethdev)),Quoted 3 lines
lib/ethdev/rte_flow.c +1
-0+ MK_FLOW_ACTION(SEND_TO_KERNEL, 0), };Quoted 12 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
lib/ethdev/rte_flow.c +0
-0int lib/ethdev/rte_flow.h +0
-1--- a/lib/ethdev/rte_flow.hQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
lib/ethdev/rte_flow.h enum rte_flow_action_type { · line 2884
Quoted 8 lines
+++
b/lib/ethdev/rte_flow.hlib/ethdev/rte_flow.h +3
-0@@ -2879,6 +2879,18 @@ enum rte_flow_action_type {* @see struct rte_flow_action_ethdev */ RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT, + +/** +* Send packets to the kernel, without going to userspace at all.
Quoted 27 lines
Quoted 26 lines
Quoted 11 lines
Quoted 10 lines
lib/ethdev/rte_flow.h enum rte_flow_action_type { · line 2889
Quoted 5 lines
lib/ethdev/rte_flow.h +5
-0+* The packets will be received by the kernel driver sharing +* the same device as the DPDK port on which this action is +* configured. This action is mostly suits bifurcated driver +* model. +* This is an ingress non-transfer action only. May be we should not limit the definition to ingress only? It could be useful on egress as a way to reroute packet back to kernel.
Quoted 1 line
Interesting, but there are no Kernel queues on egress that can receive
packets (by definition of egress)
Quoted 1 line
do you mean that this will also do loopback from the egress back to the
ingress of the same port and then
Quoted 2 lines
send to kernel?
if so, I think we need a new action "loop_back"Yes, I meant intercept packet on egress and send to kernel. But we still need loopback+send_to_kernel. Loopback itself cannot send to kernel. Moreover it should be two rules:
loopback on egress plus send-to-kernel on ingress. Does it really worse it? I'm not sure. Yes, it sounds a bit better from arch point of view, but I'm still unsure. I'd allow send-to-kernel on egress. Up to you.
Quoted 8 lines
Quoted 1 line
It looks more correct with
loop_backon the egress and send-to-kernel onegress
Quoted 2 lines
I suggest to keep the current design,
and if we see that we can merge those to commands, we will change itOK. And the last question: do we need to announce it in release notes?
+1
Quoted 14 lines
Acked-by Andrew Rybchenko <[email protected]>Quoted 12 lines
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
Quoted 10 lines
lib/ethdev/rte_flow.h +4
-0+* +* No associated configuration structure. +*/ + RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL, };/**
Quoted 178 lines · Ori Kam
Hi Andrew,
Quoted 176 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Monday, 3 October 2022 13:47Quoted 15 lines · Ori Kam
Hi Andrew,
Quoted 13 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Monday, 3 October 2022 12:44Quoted 8 lines · Ori Kam
Hi Andrew
Quoted 6 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Monday, 3 October 2022 10:54Quoted 2 lines · 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
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
to transfer the packet to the kernel.
With bifurcated driver we can have a rule to route packets matching a pattern (example: IPv4 packets) to the DPDK application and the
rest
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
of the traffic will be received by the kernel.
But if we want to receive most of the traffic in DPDK except specific pattern (example: ICMP packets) that should be processed by thekernel,
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
then it's easier to re-route these packets with a single rule.
This commit introduces new
rte_flowaction which allows applicationto
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
re-route packets directly to the kernel without software involvement.
Add new testpmd
rte_flowaction 'send_to_kernel'. The application may use this action to route the packet to the kernel while still in the HW.Example with testpmd command:
flow create 0 ingress priority 0 group 1 pattern eth type spec
0x0800type mask0xffff/ end actionssend_to_kernel/ endSigned-off-by Michael Savisko <[email protected]>Acked-by Ori Kam <[email protected]>---
v4:
- improve description comment aboveQuoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
RTE_FLOW_ACTION_TYPE_SEND_TO_KERNELQuoted 3 lines
v3:
http://patches.dpdk.org/project/dpdk/patch/20220919155013.61473-1-
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
v2:
http://patches.dpdk.org/project/dpdk/patch/20220914093219.11728-1-
Quoted 74 lines
Quoted 74 lines
Quoted 10 lines
Quoted 10 lines
app/test-
Quoted 9 lines
--- app/test-pmd/cmdline_flow.c | 9 +++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 ++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 12 ++++++++++++ 4 files changed, 24 insertions(+)app/test- renamed from app/test-pmd/cmdline_flow.c +0
-0
pmd/cmdline_flow.cQuoted 63 lines
Quoted 63 lines
Review
Quoted 34 lines
index
7f50028eb7..042f6b34a6100644app/test-pmd/cmdline_flow.c +9
-0@@ -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] = {(quoted diff) +0
-0
b/doc/guides/testpmd_app_ug/testpmd_funcs.rstdoc/guides/testpmd_app_ug/testpmd_funcs.rst This section lists supported actions and their
Quoted 4 lines
index
330e34427d..c259c8239a100644doc/guides/testpmd_app_ug/testpmd_funcs.rst +0
-0@@ -4189,6 +4189,8 @@ This section lists supported actions and theirattributes, if any.
lib/ethdev/rte_flow.c static const struct rte_flow_desc_data
Quoted 13 lines
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2
-0- ``ethdev_port_id {unsigned}``: ethdev port ID +- ``send_to_kernel``: send packets to kernel. + Destroying flow rules ~~~~~~~~~~~~~~~~~~~~~lib/ethdev/rte_flow.c +0
-0@@ -259,6 +259,7 @@ static const struct rte_flow_desc_datarte_flow_desc_action[] = {
lib/ethdev/rte_flow.c static const struct rte_flow_desc_data · line 259
Quoted 1 line
lib/ethdev/rte_flow.c +0
-0MK_FLOW_ACTION(CONNTRACK, sizeof(struct
rte_flow_action_conntrack)),lib/ethdev/rte_flow.c static const struct rte_flow_desc_data · line 260
Quoted 1 line
lib/ethdev/rte_flow.c +0
-0MK_FLOW_ACTION(PORT_REPRESENTOR, sizeof(struct
rte_flow_action_ethdev)),lib/ethdev/rte_flow.c static const struct rte_flow_desc_data · line 261
Quoted 1 line
lib/ethdev/rte_flow.c +0
-0MK_FLOW_ACTION(REPRESENTED_PORT, sizeof(struct
rte_flow_action_ethdev)),Quoted 3 lines
lib/ethdev/rte_flow.c +1
-0+ MK_FLOW_ACTION(SEND_TO_KERNEL, 0), };Quoted 12 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
lib/ethdev/rte_flow.c +0
-0int lib/ethdev/rte_flow.h +0
-1--- a/lib/ethdev/rte_flow.hQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
lib/ethdev/rte_flow.h enum rte_flow_action_type { · line 2884
Quoted 8 lines
+++
b/lib/ethdev/rte_flow.hlib/ethdev/rte_flow.h +3
-0@@ -2879,6 +2879,18 @@ enum rte_flow_action_type {* @see struct rte_flow_action_ethdev */ RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT, + +/** +* Send packets to the kernel, without going to userspace at all.
Quoted 27 lines
Quoted 18 lines
Quoted 11 lines
Quoted 10 lines
lib/ethdev/rte_flow.h enum rte_flow_action_type { · line 2889
Quoted 5 lines
lib/ethdev/rte_flow.h +5
-0+* The packets will be received by the kernel driver sharing +* the same device as the DPDK port on which this action is +* configured. This action is mostly suits bifurcated driver +* model. +* This is an ingress non-transfer action only. May be we should not limit the definition to ingress only? It could be useful on egress as a way to reroute packet back to kernel.
Quoted 1 line
Interesting, but there are no Kernel queues on egress that can receive
packets (by definition of egress)
Quoted 1 line
do you mean that this will also do loopback from the egress back to the
ingress of the same port and then
Quoted 2 lines
send to kernel?
if so, I think we need a new action "loop_back"Quoted 8 lines
Yes, I meant intercept packet on egress and send to kernel. But we still need loopback+send_to_kernel. Loopback itself cannot send to kernel. Moreover it should be two rules:
loopback on egress plus send-to-kernel on ingress. Does it really worse it? I'm not sure. Yes, it sounds a bit better from arch point of view, but I'm still unsure. I'd allow send-to-kernel on egress. Up to you.Quoted 1 line
It looks more correct with
loop_backon the egress and send-to-kernel onegress
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
I suggest to keep the current design,
and if we see that we can merge those to commands, we will change itOK. And the last question: do we need to announce it in release notes?
+1
Michael,
please, send v5 with release notes update. Don't forget to rebase in on current next-net/main, please.
Thanks,
Andrew.
Quoted 16 lines
Quoted 15 lines
Acked-by Andrew Rybchenko <[email protected]>Quoted 12 lines
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
Quoted 10 lines
lib/ethdev/rte_flow.h +4
-0+* +* No associated configuration structure. +*/ + RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL, };/**
PATCH v5 1/1 ethdev: add send to kernel action
In reply to Michael SaviskoIn 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.
With bifurcated driver we can have a rule to route packets matching a pattern (example: IPv4 packets) to the DPDK application and the rest of the traffic will be received by the kernel.
But if we want to receive most of the traffic in DPDK except specific pattern (example: ICMP packets) that should be processed by the kernel, then it's easier to re-route these packets with a single rule.
This commit introduces new rte_flow action which allows application to re-route packets directly to the kernel without software involvement.
Add new testpmd rte_flow action 'send_to_kernel'. The application may use this action to route the packet to the kernel while still in the HW.
Example with testpmd command:
flow create 0 ingress priority 0 group 1 pattern eth type spec 0x0800 type mask 0xffff / end actions send_to_kernel / end
---
v5:
- added description of the feature to release notes
v4:
- improve description comment above RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL
http://patches.dpdk.org/project/dpdk/patch/[email protected]/
v3:
http://patches.dpdk.org/project/dpdk/patch/[email protected]/
v2:
http://patches.dpdk.org/project/dpdk/patch/[email protected]/
--- app/test-pmd/cmdline_flow.c | 9 +++++++++ doc/guides/rel_notes/release_22_11.rst | 5 +++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 +++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 12 ++++++++++++ 5 files changed, 30 insertions(+)
app/test-pmd/cmdline_flow.c +9 -0
@@ -622,6 +622,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. */
@@ -1888,6 +1889,7 @@ static const enum index next_action[] = {ACTION_CONNTRACK_UPDATE ,ACTION_PORT_REPRESENTOR ,ACTION_REPRESENTED_PORT , +ACTION_SEND_TO_KERNEL , ZERO, };
@@ -6098,6 +6100,13 @@ static const struct token token_list[] = { width)), .call = parse_vc_conf, }, + [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. */ [SET] = { .name = "set",
doc/guides/rel_notes/release_22_11.rst +5 -0
@@ -114,6 +114,11 @@ New Features * Added ``rte_event_eth_tx_adapter_queue_stop`` to stop the Tx Adapter from enqueueing any packets to the Tx queue. +* **Added new rte_flow action SEND_TO_KERNEL.** + + Added new rte_flow action which allows application to re-route packets + directly to the kernel without software involvement. + Removed Items -------------
doc/guides/testpmd_app_ug/testpmd_funcs.rst +3 -0
@@ -3691,6 +3691,9 @@ This section lists supported pattern items and their attributes, if any. - ``color {value}``: Meter color value(green/yellow/red). +- ``send_to_kernel``: send packets to kernel. + + Actions list ^^^^^^^^^^^^
lib/ethdev/rte_flow.c +1 -0
@@ -257,6 +257,7 @@ static const struct rte_flow_desc_data rte_flow_desc_action[] = {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 (METER_MARK ,sizeof (struct rte_flow_action_meter_mark )), + MK_FLOW_ACTION(SEND_TO_KERNEL, 0), };int
lib/ethdev/rte_flow.h +12 -0
@@ -2797,6 +2797,18 @@ enum rte_flow_action_type {* See file rte_mtr.h for MTR profile object configuration. */ RTE_FLOW_ACTION_TYPE_METER_MARK , + +/** +* Send packets to the kernel, without going to userspace at all. +* The packets will be received by the kernel driver sharing +* the same device as the DPDK port on which this action is +* configured. This action is mostly suits bifurcated driver +* model. +* This is an ingress non-transfer action only. +* +* No associated configuration structure. +*/ + RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL, };/**
Signature · 1 line
2.27.0
Quoted 18 lines · 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.
With bifurcated driver we can have a rule to route packets matching a pattern (example: IPv4 packets) to the DPDK application and the rest of the traffic will be received by the kernel.
But if we want to receive most of the traffic in DPDK except specific pattern (example: ICMP packets) that should be processed by the kernel, then it's easier to re-route these packets with a single rule.This commit introduces new
rte_flowaction which allows application to re-route packets directly to the kernel without software involvement.Add new testpmd
rte_flowaction 'send_to_kernel'. The application may use this action to route the packet to the kernel while still in the HW.
Quoted 7 lines
Example with testpmd command:
flow create 0 ingress priority 0 group 1 pattern eth type spec
0x0800type mask0xffff/ end actionssend_to_kernel/ endSigned-off-by Michael Savisko <[email protected]>Acked-by Ori Kam <[email protected]>
Applied to dpdk-next-net/main, thanks.
Hi Michael,
Quoted 121 lines
-----Original Message-----
From: Michael Savisko <[email protected]>
Sent: Wednesday, 14 September 2022 12:32In 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.
With bifurcated driver we can have a rule to route packets matching a pattern (example: IPv4 packets) to the DPDK application and the rest of the traffic will be received by the kernel.
But if we want to receive most of the traffic in DPDK except specific pattern (example: ICMP packets) that should be processed by the kernel, then it's easier to re-route these packets with a single rule.This commit introduces new
rte_flowaction which allows application to re-route packets directly to the kernel without software involvement.Add new testpmd
rte_flowaction 'send_to_kernel'. The application may use this action to route the packet to the kernel while still in the HW.Example with testpmd command:
flow create 0 ingress priority 0 group 1 pattern eth type spec
0x0800type mask0xffff/ end actionssend_to_kernel/ endSigned-off-by Michael Savisko <[email protected]>--- app/test-pmd/cmdline_flow.c | 9 +++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 ++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 9 +++++++++ 4 files changed, 21 insertions(+)app/test-pmd/cmdline_flow.c +9
-0@@ -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] = {doc/guides/testpmd_app_ug/testpmd_funcs.rst +0
-0@@ -4189,6 +4189,8 @@ This section lists supported actions and theirattributes, if any.
- ``ethdev_port_id {unsigned}``: ethdev port ID
+- ``send_to_kernel``: send packets to kernel.
doc/guides/testpmd_app_ug/testpmd_funcs.rst +1
-0+ Destroying flow rules ~~~~~~~~~~~~~~~~~~~~~lib/ethdev/rte_flow.c +0
-0@@ -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)),lib/ethdev/rte_flow.c +1
-0+ MK_FLOW_ACTION(SEND_TO_KERNEL, 0), };int lib/ethdev/rte_flow.h +9
-1@@ -2879,6 +2879,15 @@ enum rte_flow_action_type {* @see struct rte_flow_action_ethdev */ RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT , + +/* +* Send packets to the kernel, without going to userspace at all. +* The packets will be received by the kernel driver sharing +* the same device as the DPDK port. +* +* No associated configuration structure. +*/ + RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL, };/** --
Quoted 1 line
2.27.0
Best,
Ori