DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix mirror flow split with L3 encapsulation
@ 2021-07-23 12:43 Jiawei Wang
  2021-07-23 12:57 ` Thomas Monjalon
  2021-07-26  6:22 ` [dpdk-dev] [PATCH v2] " Jiawei Wang
  0 siblings, 2 replies; 7+ messages in thread
From: Jiawei Wang @ 2021-07-23 12:43 UTC (permalink / raw)
  To: viacheslavo, matan, orika, thomas, Shahaf Shuler; +Cc: dev, rasland, stable

Due to hardware limitations, the decap action can't follow the
sample action in the same flow, to keep the original action order
of sample and decap actions the flow was internally split by PMD,
and decap action was moved into suffix subflow in the new table.

There is a specific combination of raw decap and raw encap actions
to specify "L3 encapsulation" packet transformation - raw decap action
to remove L2 header and raw encap to add the tunnel header.
This specific L3 encapsulation is encoded as a single packet reformat
hardware transaction and is supported by hardware after sample
action (no hardware limitations for packet reformat).

The patch checks whether the decap action is the part of "L3 encapsulation"
and does not move the decap action into suffix subflow for the case.

Fixes: cafd87f62a06 ("net/mlx5: fix VLAN push/pop and decap actions with mirror")
Cc: stable@dpdk.org

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index a3fdce685e..3200a306e9 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -5259,6 +5259,7 @@ flow_check_match_action(const struct rte_flow_action actions[],
 			int *modify_after_mirror)
 {
 	const struct rte_flow_action_sample *sample;
+	const struct rte_flow_action_raw_decap *decap;
 	int actions_n = 0;
 	uint32_t ratio = 0;
 	int sub_type = 0;
@@ -5311,12 +5312,29 @@ flow_check_match_action(const struct rte_flow_action actions[],
 		case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP:
 		case RTE_FLOW_ACTION_TYPE_VXLAN_DECAP:
 		case RTE_FLOW_ACTION_TYPE_NVGRE_DECAP:
-		case RTE_FLOW_ACTION_TYPE_RAW_DECAP:
 		case RTE_FLOW_ACTION_TYPE_MODIFY_FIELD:
 		case RTE_FLOW_ACTION_TYPE_METER:
 			if (fdb_mirror)
 				*modify_after_mirror = 1;
 			break;
+		case RTE_FLOW_ACTION_TYPE_RAW_DECAP:
+			decap = actions->conf;
+			while ((++actions)->type == RTE_FLOW_ACTION_TYPE_VOID)
+				;
+			actions_n++;
+			if (actions->type == RTE_FLOW_ACTION_TYPE_RAW_ENCAP) {
+				const struct rte_flow_action_raw_encap *encap =
+								actions->conf;
+				if (decap->size <=
+					MLX5_ENCAPSULATION_DECISION_SIZE &&
+				    encap->size >
+					MLX5_ENCAPSULATION_DECISION_SIZE)
+					/* L3 encap. */
+					break;
+			}
+			if (fdb_mirror)
+				*modify_after_mirror = 1;
+			break;
 		default:
 			break;
 		}
-- 
2.18.1


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

* Re: [dpdk-dev] [PATCH] net/mlx5: fix mirror flow split with L3 encapsulation
  2021-07-23 12:43 [dpdk-dev] [PATCH] net/mlx5: fix mirror flow split with L3 encapsulation Jiawei Wang
@ 2021-07-23 12:57 ` Thomas Monjalon
  2021-07-23 14:01   ` Jiawei(Jonny) Wang
  2021-07-26  6:22 ` [dpdk-dev] [PATCH v2] " Jiawei Wang
  1 sibling, 1 reply; 7+ messages in thread
From: Thomas Monjalon @ 2021-07-23 12:57 UTC (permalink / raw)
  To: viacheslavo, Jiawei Wang
  Cc: matan, orika, Shahaf Shuler, dev, rasland, stable

23/07/2021 14:43, Jiawei Wang:
> Due to hardware limitations, the decap action can't follow the

Which decap action? Pleas be more specific.

> sample action in the same flow, to keep the original action order
> of sample and decap actions the flow was internally split by PMD,
> and decap action was moved into suffix subflow in the new table.

"the" new table? which one?

Was there an issue? Above seems to say all is fine.

> There is a specific combination of raw decap and raw encap actions
> to specify "L3 encapsulation" packet transformation - raw decap action
> to remove L2 header and raw encap to add the tunnel header.

Is this combination the problem? It was not working before this patch?
Please describe what happened.

> This specific L3 encapsulation is encoded as a single packet reformat
> hardware transaction and is supported by hardware after sample
> action (no hardware limitations for packet reformat).
> 
> The patch checks whether the decap action is the part of "L3 encapsulation"

I think you mean "is part of".

> and does not move the decap action into suffix subflow for the case.
> 
> Fixes: cafd87f62a06 ("net/mlx5: fix VLAN push/pop and decap actions with mirror")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>




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

* Re: [dpdk-dev] [PATCH] net/mlx5: fix mirror flow split with L3 encapsulation
  2021-07-23 12:57 ` Thomas Monjalon
@ 2021-07-23 14:01   ` Jiawei(Jonny) Wang
  2021-07-23 14:09     ` Thomas Monjalon
  0 siblings, 1 reply; 7+ messages in thread
From: Jiawei(Jonny) Wang @ 2021-07-23 14:01 UTC (permalink / raw)
  To: NBU-Contact-Thomas Monjalon, Slava Ovsiienko
  Cc: Matan Azrad, Ori Kam, Shahaf Shuler, dev, Raslan Darawsheh, stable

Hello, 

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Friday, July 23, 2021 8:57 PM
> To: Slava Ovsiienko <viacheslavo@nvidia.com>; Jiawei(Jonny) Wang
> <jiaweiw@nvidia.com>
> Cc: Matan Azrad <matan@nvidia.com>; Ori Kam <orika@nvidia.com>;
> Shahaf Shuler <shahafs@nvidia.com>; dev@dpdk.org; Raslan Darawsheh
> <rasland@nvidia.com>; stable@dpdk.org
> Subject: Re: [PATCH] net/mlx5: fix mirror flow split with L3 encapsulation
> 
> 23/07/2021 14:43, Jiawei Wang:
> > Due to hardware limitations, the decap action can't follow the
> 
> Which decap action? Pleas be more specific.

All of decap,  vxlan_decap, nvgre_decap and raw_decap.
Will update details.

> 
> > sample action in the same flow, to keep the original action order of
> > sample and decap actions the flow was internally split by PMD, and
> > decap action was moved into suffix subflow in the new table.
> 
> "the" new table? which one?

" sample and decap actions the flow was internally split by PMD, " means
that PMD split internally into two flows:prefix subflow with sample action in original table;
suffix subflow with decap action in the new table;

> 
> Was there an issue? Above seems to say all is fine.
> 

The issue is mentioned below that 'L3 encapsulation' case (raw_decap+raw_encap), 
the previous code not consier the combination decap/encap case.
And under this case flow don't need split.

> > There is a specific combination of raw decap and raw encap actions to
> > specify "L3 encapsulation" packet transformation - raw decap action to
> > remove L2 header and raw encap to add the tunnel header.
> 
> Is this combination the problem? It was not working before this patch?
> Please describe what happened.
> 

L3 encap is working without sample action or sample is working without L3 encap;

> > This specific L3 encapsulation is encoded as a single packet reformat
> > hardware transaction and is supported by hardware after sample action
> > (no hardware limitations for packet reformat).
> >
> > The patch checks whether the decap action is the part of "L3
> encapsulation"
> 
> I think you mean "is part of".

Thanks, will fix in new version.

> 
> > and does not move the decap action into suffix subflow for the case.
> >
> > Fixes: cafd87f62a06 ("net/mlx5: fix VLAN push/pop and decap actions
> > with mirror")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
> > Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> 
> 

Thanks.


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

* Re: [dpdk-dev] [PATCH] net/mlx5: fix mirror flow split with L3 encapsulation
  2021-07-23 14:01   ` Jiawei(Jonny) Wang
@ 2021-07-23 14:09     ` Thomas Monjalon
  2021-07-26  6:26       ` Jiawei(Jonny) Wang
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Monjalon @ 2021-07-23 14:09 UTC (permalink / raw)
  To: Slava Ovsiienko, Jiawei(Jonny) Wang
  Cc: Matan Azrad, Ori Kam, Shahaf Shuler, dev, Raslan Darawsheh, stable

23/07/2021 16:01, Jiawei(Jonny) Wang:
> Hello, 
> 
> From: Thomas Monjalon <thomas@monjalon.net>
> > 23/07/2021 14:43, Jiawei Wang:
> > > Due to hardware limitations, the decap action can't follow the
> > 
> > Which decap action? Pleas be more specific.
> 
> All of decap,  vxlan_decap, nvgre_decap and raw_decap.
> Will update details.
> 
> > 
> > > sample action in the same flow, to keep the original action order of
> > > sample and decap actions the flow was internally split by PMD, and
> > > decap action was moved into suffix subflow in the new table.
> > 
> > "the" new table? which one?
> 
> " sample and decap actions the flow was internally split by PMD, " means
> that PMD split internally into two flows:prefix subflow with sample action in original table;
> suffix subflow with decap action in the new table;
> 
> > 
> > Was there an issue? Above seems to say all is fine.
> > 
> 
> The issue is mentioned below that 'L3 encapsulation' case (raw_decap+raw_encap), 
> the previous code not consier the combination decap/encap case.
> And under this case flow don't need split.
> 
> > > There is a specific combination of raw decap and raw encap actions to
> > > specify "L3 encapsulation" packet transformation - raw decap action to
> > > remove L2 header and raw encap to add the tunnel header.
> > 
> > Is this combination the problem? It was not working before this patch?
> > Please describe what happened.
> > 
> 
> L3 encap is working without sample action or sample is working without L3 encap;

OK please be more explicit in the next version.

> > > This specific L3 encapsulation is encoded as a single packet reformat
> > > hardware transaction and is supported by hardware after sample action
> > > (no hardware limitations for packet reformat).
> > >
> > > The patch checks whether the decap action is the part of "L3
> > encapsulation"
> > 
> > I think you mean "is part of".
> 
> Thanks, will fix in new version.
> 
> > 
> > > and does not move the decap action into suffix subflow for the case.
> > >
> > > Fixes: cafd87f62a06 ("net/mlx5: fix VLAN push/pop and decap actions
> > > with mirror")
> > > Cc: stable@dpdk.org
> > >
> > > Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
> > > Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>




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

* [dpdk-dev] [PATCH v2] net/mlx5: fix mirror flow split with L3 encapsulation
  2021-07-23 12:43 [dpdk-dev] [PATCH] net/mlx5: fix mirror flow split with L3 encapsulation Jiawei Wang
  2021-07-23 12:57 ` Thomas Monjalon
@ 2021-07-26  6:22 ` Jiawei Wang
  2021-07-28 13:07   ` Raslan Darawsheh
  1 sibling, 1 reply; 7+ messages in thread
From: Jiawei Wang @ 2021-07-26  6:22 UTC (permalink / raw)
  To: viacheslavo, matan, orika, thomas, Shahaf Shuler; +Cc: dev, rasland, stable

Due to hardware limitations, the decap action (such as
VXLAN/NVGRE/RAW decap) can't follow the sample action in the
same flow, to keep the original action order of sample and decap
actions the flow was internally split into two subflows by PMD,
the sample action was moved into prefix subflow in the original table,
and decap action was moved into suffix subflow in the new table.

There is a specific combination of raw decap and raw encap actions
to specify "L3 encapsulation" packet transformation - raw decap action
to remove L2 header and raw encap to add the tunnel header.
This specific L3 encapsulation is encoded as a single packet reformat
hardware transaction and is supported by hardware after sample
action (no hardware limitations for packet reformat).

The "L3 encapsulation" with mirror actions in the same flow was not handled
correctly in the previous commit.
The patch checks whether the decap action is part of "L3 encapsulation"
and does not move the decap action into suffix subflow for the case.

Fixes: cafd87f62a06 ("net/mlx5: fix VLAN push/pop and decap actions with mirror")
Cc: stable@dpdk.org

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
v2: update commit log
---
 drivers/net/mlx5/mlx5_flow.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index a3fdce685e..3200a306e9 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -5259,6 +5259,7 @@ flow_check_match_action(const struct rte_flow_action actions[],
 			int *modify_after_mirror)
 {
 	const struct rte_flow_action_sample *sample;
+	const struct rte_flow_action_raw_decap *decap;
 	int actions_n = 0;
 	uint32_t ratio = 0;
 	int sub_type = 0;
@@ -5311,12 +5312,29 @@ flow_check_match_action(const struct rte_flow_action actions[],
 		case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP:
 		case RTE_FLOW_ACTION_TYPE_VXLAN_DECAP:
 		case RTE_FLOW_ACTION_TYPE_NVGRE_DECAP:
-		case RTE_FLOW_ACTION_TYPE_RAW_DECAP:
 		case RTE_FLOW_ACTION_TYPE_MODIFY_FIELD:
 		case RTE_FLOW_ACTION_TYPE_METER:
 			if (fdb_mirror)
 				*modify_after_mirror = 1;
 			break;
+		case RTE_FLOW_ACTION_TYPE_RAW_DECAP:
+			decap = actions->conf;
+			while ((++actions)->type == RTE_FLOW_ACTION_TYPE_VOID)
+				;
+			actions_n++;
+			if (actions->type == RTE_FLOW_ACTION_TYPE_RAW_ENCAP) {
+				const struct rte_flow_action_raw_encap *encap =
+								actions->conf;
+				if (decap->size <=
+					MLX5_ENCAPSULATION_DECISION_SIZE &&
+				    encap->size >
+					MLX5_ENCAPSULATION_DECISION_SIZE)
+					/* L3 encap. */
+					break;
+			}
+			if (fdb_mirror)
+				*modify_after_mirror = 1;
+			break;
 		default:
 			break;
 		}
-- 
2.18.1


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

* Re: [dpdk-dev] [PATCH] net/mlx5: fix mirror flow split with L3 encapsulation
  2021-07-23 14:09     ` Thomas Monjalon
@ 2021-07-26  6:26       ` Jiawei(Jonny) Wang
  0 siblings, 0 replies; 7+ messages in thread
From: Jiawei(Jonny) Wang @ 2021-07-26  6:26 UTC (permalink / raw)
  To: NBU-Contact-Thomas Monjalon, Slava Ovsiienko
  Cc: Matan Azrad, Ori Kam, Shahaf Shuler, dev, Raslan Darawsheh, stable



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Friday, July 23, 2021 10:10 PM
> To: Slava Ovsiienko <viacheslavo@nvidia.com>; Jiawei(Jonny) Wang
> <jiaweiw@nvidia.com>
> Cc: Matan Azrad <matan@nvidia.com>; Ori Kam <orika@nvidia.com>;
> Shahaf Shuler <shahafs@nvidia.com>; dev@dpdk.org; Raslan Darawsheh
> <rasland@nvidia.com>; stable@dpdk.org
> Subject: Re: [PATCH] net/mlx5: fix mirror flow split with L3 encapsulation
> 
> 23/07/2021 16:01, Jiawei(Jonny) Wang:
> > Hello,
> >
> > From: Thomas Monjalon <thomas@monjalon.net>
> > > 23/07/2021 14:43, Jiawei Wang:
> > > > Due to hardware limitations, the decap action can't follow the
> > >
> > > Which decap action? Pleas be more specific.
> >
> > All of decap,  vxlan_decap, nvgre_decap and raw_decap.
> > Will update details.
> >
> > >
> > > > sample action in the same flow, to keep the original action order
> > > > of sample and decap actions the flow was internally split by PMD,
> > > > and decap action was moved into suffix subflow in the new table.
> > >
> > > "the" new table? which one?
> >
> > " sample and decap actions the flow was internally split by PMD, "
> > means that PMD split internally into two flows:prefix subflow with
> > sample action in original table; suffix subflow with decap action in
> > the new table;
> >
> > >
> > > Was there an issue? Above seems to say all is fine.
> > >
> >
> > The issue is mentioned below that 'L3 encapsulation' case
> > (raw_decap+raw_encap), the previous code not consier the combination
> decap/encap case.
> > And under this case flow don't need split.
> >
> > > > There is a specific combination of raw decap and raw encap actions
> > > > to specify "L3 encapsulation" packet transformation - raw decap
> > > > action to remove L2 header and raw encap to add the tunnel header.
> > >
> > > Is this combination the problem? It was not working before this patch?
> > > Please describe what happened.
> > >
> >
> > L3 encap is working without sample action or sample is working without
> > L3 encap;
> 
> OK please be more explicit in the next version.
> 

The v2 patch is ready, https://patchwork.dpdk.org/project/dpdk/patch/20210726062233.30657-1-jiaweiw@nvidia.com/
Please help to review, and Thanks your comments.

> > > > This specific L3 encapsulation is encoded as a single packet
> > > > reformat hardware transaction and is supported by hardware after
> > > > sample action (no hardware limitations for packet reformat).
> > > >
> > > > The patch checks whether the decap action is the part of "L3
> > > encapsulation"
> > >
> > > I think you mean "is part of".
> >
> > Thanks, will fix in new version.
> >
> > >
> > > > and does not move the decap action into suffix subflow for the case.
> > > >
> > > > Fixes: cafd87f62a06 ("net/mlx5: fix VLAN push/pop and decap
> > > > actions with mirror")
> > > > Cc: stable@dpdk.org
> > > >
> > > > Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
> > > > Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> 
> 


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

* Re: [dpdk-dev] [PATCH v2] net/mlx5: fix mirror flow split with L3 encapsulation
  2021-07-26  6:22 ` [dpdk-dev] [PATCH v2] " Jiawei Wang
@ 2021-07-28 13:07   ` Raslan Darawsheh
  0 siblings, 0 replies; 7+ messages in thread
From: Raslan Darawsheh @ 2021-07-28 13:07 UTC (permalink / raw)
  To: Jiawei(Jonny) Wang, Slava Ovsiienko, Matan Azrad, Ori Kam,
	NBU-Contact-Thomas Monjalon, Shahaf Shuler
  Cc: dev, stable

Hi,

> -----Original Message-----
> From: Jiawei(Jonny) Wang <jiaweiw@nvidia.com>
> Sent: Monday, July 26, 2021 9:23 AM
> To: Slava Ovsiienko <viacheslavo@nvidia.com>; Matan Azrad
> <matan@nvidia.com>; Ori Kam <orika@nvidia.com>; NBU-Contact-Thomas
> Monjalon <thomas@monjalon.net>; Shahaf Shuler <shahafs@nvidia.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>;
> stable@dpdk.org
> Subject: [PATCH v2] net/mlx5: fix mirror flow split with L3 encapsulation
> 
> Due to hardware limitations, the decap action (such as
> VXLAN/NVGRE/RAW decap) can't follow the sample action in the
> same flow, to keep the original action order of sample and decap
> actions the flow was internally split into two subflows by PMD,
> the sample action was moved into prefix subflow in the original table,
> and decap action was moved into suffix subflow in the new table.
> 
> There is a specific combination of raw decap and raw encap actions
> to specify "L3 encapsulation" packet transformation - raw decap action
> to remove L2 header and raw encap to add the tunnel header.
> This specific L3 encapsulation is encoded as a single packet reformat
> hardware transaction and is supported by hardware after sample
> action (no hardware limitations for packet reformat).
> 
> The "L3 encapsulation" with mirror actions in the same flow was not handled
> correctly in the previous commit.
> The patch checks whether the decap action is part of "L3 encapsulation"
> and does not move the decap action into suffix subflow for the case.
> 
> Fixes: cafd87f62a06 ("net/mlx5: fix VLAN push/pop and decap actions with
> mirror")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> ---
> v2: update commit log
> ---

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

end of thread, other threads:[~2021-07-28 13:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-23 12:43 [dpdk-dev] [PATCH] net/mlx5: fix mirror flow split with L3 encapsulation Jiawei Wang
2021-07-23 12:57 ` Thomas Monjalon
2021-07-23 14:01   ` Jiawei(Jonny) Wang
2021-07-23 14:09     ` Thomas Monjalon
2021-07-26  6:26       ` Jiawei(Jonny) Wang
2021-07-26  6:22 ` [dpdk-dev] [PATCH v2] " Jiawei Wang
2021-07-28 13:07   ` Raslan Darawsheh

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).