All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] mlxsw: spectrum: Fix ECN marking in tunnel decapsulation
@ 2021-03-29  8:29 Ido Schimmel
  2021-03-29  8:29 ` [PATCH net 1/2] " Ido Schimmel
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Ido Schimmel @ 2021-03-29  8:29 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, jiri, petrm, liuhangbin, toke, mlxsw, Ido Schimmel

From: Ido Schimmel <idosch@nvidia.com>

Patch #1 fixes a discrepancy between the software and hardware data
paths with regards to ECN marking after decapsulation. See the changelog
for a detailed description.

Patch #2 extends the ECN decap test to cover all possible combinations
of inner and outer ECN markings. The test passes over both data paths.

Ido Schimmel (2):
  mlxsw: spectrum: Fix ECN marking in tunnel decapsulation
  selftests: forwarding: vxlan_bridge_1d: Add more ECN decap test cases

 drivers/net/ethernet/mellanox/mlxsw/spectrum.h    | 15 +++++++++++++++
 .../net/ethernet/mellanox/mlxsw/spectrum_ipip.c   |  7 +++----
 .../net/ethernet/mellanox/mlxsw/spectrum_nve.c    |  7 +++----
 .../selftests/net/forwarding/vxlan_bridge_1d.sh   | 13 ++++++++++++-
 4 files changed, 33 insertions(+), 9 deletions(-)

-- 
2.30.2


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

* [PATCH net 1/2] mlxsw: spectrum: Fix ECN marking in tunnel decapsulation
  2021-03-29  8:29 [PATCH net 0/2] mlxsw: spectrum: Fix ECN marking in tunnel decapsulation Ido Schimmel
@ 2021-03-29  8:29 ` Ido Schimmel
  2021-03-29  9:03   ` Toke Høiland-Jørgensen
  2021-03-29  8:29 ` [PATCH net 2/2] selftests: forwarding: vxlan_bridge_1d: Add more ECN decap test cases Ido Schimmel
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Ido Schimmel @ 2021-03-29  8:29 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, jiri, petrm, liuhangbin, toke, mlxsw, Ido Schimmel

From: Ido Schimmel <idosch@nvidia.com>

Cited commit changed the behavior of the software data path with regards
to the ECN marking of decapsulated packets. However, the commit did not
change other callers of __INET_ECN_decapsulate(), namely mlxsw. The
driver is using the function in order to ensure that the hardware and
software data paths act the same with regards to the ECN marking of
decapsulated packets.

The discrepancy was uncovered by commit 5aa3c334a449 ("selftests:
forwarding: vxlan_bridge_1d: Fix vxlan ecn decapsulate value") that
aligned the selftest to the new behavior. Without this patch the
selftest passes when used with veth pairs, but fails when used with
mlxsw netdevs.

Fix this by instructing the device to propagate the ECT(1) mark from the
outer header to the inner header when the inner header is ECT(0), for
both NVE and IP-in-IP tunnels.

A helper is added in order not to duplicate the code between both tunnel
types.

Fixes: b723748750ec ("tunnel: Propagate ECT(1) when decapsulating as recommended by RFC6040")
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum.h    | 15 +++++++++++++++
 .../net/ethernet/mellanox/mlxsw/spectrum_ipip.c   |  7 +++----
 .../net/ethernet/mellanox/mlxsw/spectrum_nve.c    |  7 +++----
 3 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
index d9d9e1f488f9..ba28ac7e79bc 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
@@ -21,6 +21,7 @@
 #include <net/red.h>
 #include <net/vxlan.h>
 #include <net/flow_offload.h>
+#include <net/inet_ecn.h>
 
 #include "port.h"
 #include "core.h"
@@ -347,6 +348,20 @@ struct mlxsw_sp_port_type_speed_ops {
 	u32 (*ptys_proto_cap_masked_get)(u32 eth_proto_cap);
 };
 
+static inline u8 mlxsw_sp_tunnel_ecn_decap(u8 outer_ecn, u8 inner_ecn,
+					   bool *trap_en)
+{
+	bool set_ce = false;
+
+	*trap_en = !!__INET_ECN_decapsulate(outer_ecn, inner_ecn, &set_ce);
+	if (set_ce)
+		return INET_ECN_CE;
+	else if (outer_ecn == INET_ECN_ECT_1 && inner_ecn == INET_ECN_ECT_0)
+		return INET_ECN_ECT_1;
+	else
+		return inner_ecn;
+}
+
 static inline struct net_device *
 mlxsw_sp_bridge_vxlan_dev_find(struct net_device *br_dev)
 {
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c
index 6ccca39bae84..64a8f838eb53 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c
@@ -335,12 +335,11 @@ static int mlxsw_sp_ipip_ecn_decap_init_one(struct mlxsw_sp *mlxsw_sp,
 					    u8 inner_ecn, u8 outer_ecn)
 {
 	char tidem_pl[MLXSW_REG_TIDEM_LEN];
-	bool trap_en, set_ce = false;
 	u8 new_inner_ecn;
+	bool trap_en;
 
-	trap_en = __INET_ECN_decapsulate(outer_ecn, inner_ecn, &set_ce);
-	new_inner_ecn = set_ce ? INET_ECN_CE : inner_ecn;
-
+	new_inner_ecn = mlxsw_sp_tunnel_ecn_decap(outer_ecn, inner_ecn,
+						  &trap_en);
 	mlxsw_reg_tidem_pack(tidem_pl, outer_ecn, inner_ecn, new_inner_ecn,
 			     trap_en, trap_en ? MLXSW_TRAP_ID_DECAP_ECN0 : 0);
 	return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(tidem), tidem_pl);
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c
index e5ec595593f4..9eba8fa684ae 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c
@@ -909,12 +909,11 @@ static int __mlxsw_sp_nve_ecn_decap_init(struct mlxsw_sp *mlxsw_sp,
 					 u8 inner_ecn, u8 outer_ecn)
 {
 	char tndem_pl[MLXSW_REG_TNDEM_LEN];
-	bool trap_en, set_ce = false;
 	u8 new_inner_ecn;
+	bool trap_en;
 
-	trap_en = !!__INET_ECN_decapsulate(outer_ecn, inner_ecn, &set_ce);
-	new_inner_ecn = set_ce ? INET_ECN_CE : inner_ecn;
-
+	new_inner_ecn = mlxsw_sp_tunnel_ecn_decap(outer_ecn, inner_ecn,
+						  &trap_en);
 	mlxsw_reg_tndem_pack(tndem_pl, outer_ecn, inner_ecn, new_inner_ecn,
 			     trap_en, trap_en ? MLXSW_TRAP_ID_DECAP_ECN0 : 0);
 	return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(tndem), tndem_pl);
-- 
2.30.2


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

* [PATCH net 2/2] selftests: forwarding: vxlan_bridge_1d: Add more ECN decap test cases
  2021-03-29  8:29 [PATCH net 0/2] mlxsw: spectrum: Fix ECN marking in tunnel decapsulation Ido Schimmel
  2021-03-29  8:29 ` [PATCH net 1/2] " Ido Schimmel
@ 2021-03-29  8:29 ` Ido Schimmel
  2021-03-29  9:03   ` Toke Høiland-Jørgensen
  2021-03-29  8:29 ` [PATCH net mlxsw v2 0/2] mlxsw: spectrum: Fix ECN marking in tunnel decapsulation Ido Schimmel
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Ido Schimmel @ 2021-03-29  8:29 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, jiri, petrm, liuhangbin, toke, mlxsw, Ido Schimmel

From: Ido Schimmel <idosch@nvidia.com>

Test that all possible combinations of inner and outer ECN bits result
in the correct inner ECN marking according to RFC 6040 4.2.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
---
 .../selftests/net/forwarding/vxlan_bridge_1d.sh     | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh b/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh
index 0ccb1dda099a..eb307ca37bfa 100755
--- a/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh
+++ b/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh
@@ -657,10 +657,21 @@ test_ecn_decap()
 {
 	# In accordance with INET_ECN_decapsulate()
 	__test_ecn_decap 00 00 0x00
+	__test_ecn_decap 00 01 0x00
+	__test_ecn_decap 00 02 0x00
+	# 00 03 is tested in test_ecn_decap_error()
+	__test_ecn_decap 01 00 0x01
 	__test_ecn_decap 01 01 0x01
-	__test_ecn_decap 02 01 0x01
+	__test_ecn_decap 01 02 0x01
 	__test_ecn_decap 01 03 0x03
+	__test_ecn_decap 02 00 0x02
+	__test_ecn_decap 02 01 0x01
+	__test_ecn_decap 02 02 0x02
 	__test_ecn_decap 02 03 0x03
+	__test_ecn_decap 03 00 0x03
+	__test_ecn_decap 03 01 0x03
+	__test_ecn_decap 03 02 0x03
+	__test_ecn_decap 03 03 0x03
 	test_ecn_decap_error
 }
 
-- 
2.30.2


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

* [PATCH net mlxsw v2 0/2] mlxsw: spectrum: Fix ECN marking in tunnel decapsulation
  2021-03-29  8:29 [PATCH net 0/2] mlxsw: spectrum: Fix ECN marking in tunnel decapsulation Ido Schimmel
  2021-03-29  8:29 ` [PATCH net 1/2] " Ido Schimmel
  2021-03-29  8:29 ` [PATCH net 2/2] selftests: forwarding: vxlan_bridge_1d: Add more ECN decap test cases Ido Schimmel
@ 2021-03-29  8:29 ` Ido Schimmel
  2021-03-29  8:38   ` Ido Schimmel
  2021-03-29  8:29 ` [PATCH net mlxsw v2 1/2] " Ido Schimmel
  2021-03-29  8:29 ` [PATCH net mlxsw v2 2/2] selftests: forwarding: vxlan_bridge_1d: Add more ECN decap test cases Ido Schimmel
  4 siblings, 1 reply; 9+ messages in thread
From: Ido Schimmel @ 2021-03-29  8:29 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, jiri, petrm, liuhangbin, toke, mlxsw, Ido Schimmel

From: Ido Schimmel <idosch@nvidia.com>

Patch #1 fixes a discrepancy between the software and hardware data
paths with regards to ECN marking after decapsulation. See the changelog
for a detailed description.

Patch #2 extends the ECN decap test to cover all possible combinations
of inner and outer ECN markings. The test passes over both data paths.

v2:
* Only set ECT(1) if inner is ECT(0)
* Introduce a new helper to determine inner ECN. Share it between NVE
  and IP-in-IP tunnels
* Extend the selftest

Ido Schimmel (2):
  mlxsw: spectrum: Fix ECN marking in tunnel decapsulation
  selftests: forwarding: vxlan_bridge_1d: Add more ECN decap test cases

 drivers/net/ethernet/mellanox/mlxsw/spectrum.h    | 15 +++++++++++++++
 .../net/ethernet/mellanox/mlxsw/spectrum_ipip.c   |  7 +++----
 .../net/ethernet/mellanox/mlxsw/spectrum_nve.c    |  7 +++----
 .../selftests/net/forwarding/vxlan_bridge_1d.sh   | 13 ++++++++++++-
 4 files changed, 33 insertions(+), 9 deletions(-)

-- 
2.30.2


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

* [PATCH net mlxsw v2 1/2] mlxsw: spectrum: Fix ECN marking in tunnel decapsulation
  2021-03-29  8:29 [PATCH net 0/2] mlxsw: spectrum: Fix ECN marking in tunnel decapsulation Ido Schimmel
                   ` (2 preceding siblings ...)
  2021-03-29  8:29 ` [PATCH net mlxsw v2 0/2] mlxsw: spectrum: Fix ECN marking in tunnel decapsulation Ido Schimmel
@ 2021-03-29  8:29 ` Ido Schimmel
  2021-03-29  8:29 ` [PATCH net mlxsw v2 2/2] selftests: forwarding: vxlan_bridge_1d: Add more ECN decap test cases Ido Schimmel
  4 siblings, 0 replies; 9+ messages in thread
From: Ido Schimmel @ 2021-03-29  8:29 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, jiri, petrm, liuhangbin, toke, mlxsw, Ido Schimmel

From: Ido Schimmel <idosch@nvidia.com>

Cited commit changed the behavior of the software data path with regards
to the ECN marking of decapsulated packets. However, the commit did not
change other callers of __INET_ECN_decapsulate(), namely mlxsw. The
driver is using the function in order to ensure that the hardware and
software data paths act the same with regards to the ECN marking of
decapsulated packets.

The discrepancy was uncovered by commit 5aa3c334a449 ("selftests:
forwarding: vxlan_bridge_1d: Fix vxlan ecn decapsulate value") that
aligned the selftest to the new behavior. Without this patch the
selftest passes when used with veth pairs, but fails when used with
mlxsw netdevs.

Fix this by instructing the device to propagate the ECT(1) mark from the
outer header to the inner header when the inner header is ECT(0), for
both NVE and IP-in-IP tunnels.

A helper is added in order not to duplicate the code between both tunnel
types.

Fixes: b723748750ec ("tunnel: Propagate ECT(1) when decapsulating as recommended by RFC6040")
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum.h    | 15 +++++++++++++++
 .../net/ethernet/mellanox/mlxsw/spectrum_ipip.c   |  7 +++----
 .../net/ethernet/mellanox/mlxsw/spectrum_nve.c    |  7 +++----
 3 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
index 8554cf7356cb..09eeadac2352 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
@@ -22,6 +22,7 @@
 #include <net/red.h>
 #include <net/vxlan.h>
 #include <net/flow_offload.h>
+#include <net/inet_ecn.h>
 
 #include "port.h"
 #include "core.h"
@@ -367,6 +368,20 @@ struct mlxsw_sp_port_type_speed_ops {
 	u32 (*ptys_proto_cap_masked_get)(u32 eth_proto_cap);
 };
 
+static inline u8 mlxsw_sp_tunnel_ecn_decap(u8 outer_ecn, u8 inner_ecn,
+					   bool *trap_en)
+{
+	bool set_ce = false;
+
+	*trap_en = !!__INET_ECN_decapsulate(outer_ecn, inner_ecn, &set_ce);
+	if (set_ce)
+		return INET_ECN_CE;
+	else if (outer_ecn == INET_ECN_ECT_1 && inner_ecn == INET_ECN_ECT_0)
+		return INET_ECN_ECT_1;
+	else
+		return inner_ecn;
+}
+
 static inline struct net_device *
 mlxsw_sp_bridge_vxlan_dev_find(struct net_device *br_dev)
 {
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c
index b8b08a6a1d10..5facabd86882 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c
@@ -337,12 +337,11 @@ static int mlxsw_sp_ipip_ecn_decap_init_one(struct mlxsw_sp *mlxsw_sp,
 					    u8 inner_ecn, u8 outer_ecn)
 {
 	char tidem_pl[MLXSW_REG_TIDEM_LEN];
-	bool trap_en, set_ce = false;
 	u8 new_inner_ecn;
+	bool trap_en;
 
-	trap_en = __INET_ECN_decapsulate(outer_ecn, inner_ecn, &set_ce);
-	new_inner_ecn = set_ce ? INET_ECN_CE : inner_ecn;
-
+	new_inner_ecn = mlxsw_sp_tunnel_ecn_decap(outer_ecn, inner_ecn,
+						  &trap_en);
 	mlxsw_reg_tidem_pack(tidem_pl, outer_ecn, inner_ecn, new_inner_ecn,
 			     trap_en, trap_en ? MLXSW_TRAP_ID_DECAP_ECN0 : 0);
 	return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(tidem), tidem_pl);
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c
index e5ec595593f4..9eba8fa684ae 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c
@@ -909,12 +909,11 @@ static int __mlxsw_sp_nve_ecn_decap_init(struct mlxsw_sp *mlxsw_sp,
 					 u8 inner_ecn, u8 outer_ecn)
 {
 	char tndem_pl[MLXSW_REG_TNDEM_LEN];
-	bool trap_en, set_ce = false;
 	u8 new_inner_ecn;
+	bool trap_en;
 
-	trap_en = !!__INET_ECN_decapsulate(outer_ecn, inner_ecn, &set_ce);
-	new_inner_ecn = set_ce ? INET_ECN_CE : inner_ecn;
-
+	new_inner_ecn = mlxsw_sp_tunnel_ecn_decap(outer_ecn, inner_ecn,
+						  &trap_en);
 	mlxsw_reg_tndem_pack(tndem_pl, outer_ecn, inner_ecn, new_inner_ecn,
 			     trap_en, trap_en ? MLXSW_TRAP_ID_DECAP_ECN0 : 0);
 	return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(tndem), tndem_pl);
-- 
2.30.2


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

* [PATCH net mlxsw v2 2/2] selftests: forwarding: vxlan_bridge_1d: Add more ECN decap test cases
  2021-03-29  8:29 [PATCH net 0/2] mlxsw: spectrum: Fix ECN marking in tunnel decapsulation Ido Schimmel
                   ` (3 preceding siblings ...)
  2021-03-29  8:29 ` [PATCH net mlxsw v2 1/2] " Ido Schimmel
@ 2021-03-29  8:29 ` Ido Schimmel
  4 siblings, 0 replies; 9+ messages in thread
From: Ido Schimmel @ 2021-03-29  8:29 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, jiri, petrm, liuhangbin, toke, mlxsw, Ido Schimmel

From: Ido Schimmel <idosch@nvidia.com>

Test that all possible combinations of inner and outer ECN bits result
in the correct inner ECN marking according to RFC 6040 4.2.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
 .../selftests/net/forwarding/vxlan_bridge_1d.sh     | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh b/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh
index 0ccb1dda099a..eb307ca37bfa 100755
--- a/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh
+++ b/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh
@@ -657,10 +657,21 @@ test_ecn_decap()
 {
 	# In accordance with INET_ECN_decapsulate()
 	__test_ecn_decap 00 00 0x00
+	__test_ecn_decap 00 01 0x00
+	__test_ecn_decap 00 02 0x00
+	# 00 03 is tested in test_ecn_decap_error()
+	__test_ecn_decap 01 00 0x01
 	__test_ecn_decap 01 01 0x01
-	__test_ecn_decap 02 01 0x01
+	__test_ecn_decap 01 02 0x01
 	__test_ecn_decap 01 03 0x03
+	__test_ecn_decap 02 00 0x02
+	__test_ecn_decap 02 01 0x01
+	__test_ecn_decap 02 02 0x02
 	__test_ecn_decap 02 03 0x03
+	__test_ecn_decap 03 00 0x03
+	__test_ecn_decap 03 01 0x03
+	__test_ecn_decap 03 02 0x03
+	__test_ecn_decap 03 03 0x03
 	test_ecn_decap_error
 }
 
-- 
2.30.2


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

* Re: [PATCH net mlxsw v2 0/2] mlxsw: spectrum: Fix ECN marking in tunnel decapsulation
  2021-03-29  8:29 ` [PATCH net mlxsw v2 0/2] mlxsw: spectrum: Fix ECN marking in tunnel decapsulation Ido Schimmel
@ 2021-03-29  8:38   ` Ido Schimmel
  0 siblings, 0 replies; 9+ messages in thread
From: Ido Schimmel @ 2021-03-29  8:38 UTC (permalink / raw)
  To: Ido Schimmel; +Cc: netdev, davem, kuba, jiri, petrm, liuhangbin, toke, mlxsw

On Mon, Mar 29, 2021 at 11:29:25AM +0300, Ido Schimmel wrote:
> From: Ido Schimmel <idosch@nvidia.com>
> 
> Patch #1 fixes a discrepancy between the software and hardware data
> paths with regards to ECN marking after decapsulation. See the changelog
> for a detailed description.
> 
> Patch #2 extends the ECN decap test to cover all possible combinations
> of inner and outer ECN markings. The test passes over both data paths.
> 
> v2:
> * Only set ECT(1) if inner is ECT(0)
> * Introduce a new helper to determine inner ECN. Share it between NVE
>   and IP-in-IP tunnels
> * Extend the selftest

Sorry about the "PATCH net mlxsw v2" patches. They are the internal
version of the patches and I sent them out by mistake.

Let me know if you want me to re-submit.

> 
> Ido Schimmel (2):
>   mlxsw: spectrum: Fix ECN marking in tunnel decapsulation
>   selftests: forwarding: vxlan_bridge_1d: Add more ECN decap test cases
> 
>  drivers/net/ethernet/mellanox/mlxsw/spectrum.h    | 15 +++++++++++++++
>  .../net/ethernet/mellanox/mlxsw/spectrum_ipip.c   |  7 +++----
>  .../net/ethernet/mellanox/mlxsw/spectrum_nve.c    |  7 +++----
>  .../selftests/net/forwarding/vxlan_bridge_1d.sh   | 13 ++++++++++++-
>  4 files changed, 33 insertions(+), 9 deletions(-)
> 
> -- 
> 2.30.2
> 

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

* Re: [PATCH net 1/2] mlxsw: spectrum: Fix ECN marking in tunnel decapsulation
  2021-03-29  8:29 ` [PATCH net 1/2] " Ido Schimmel
@ 2021-03-29  9:03   ` Toke Høiland-Jørgensen
  0 siblings, 0 replies; 9+ messages in thread
From: Toke Høiland-Jørgensen @ 2021-03-29  9:03 UTC (permalink / raw)
  To: Ido Schimmel, netdev
  Cc: davem, kuba, jiri, petrm, liuhangbin, mlxsw, Ido Schimmel

Ido Schimmel <idosch@idosch.org> writes:

> From: Ido Schimmel <idosch@nvidia.com>
>
> Cited commit changed the behavior of the software data path with regards
> to the ECN marking of decapsulated packets. However, the commit did not
> change other callers of __INET_ECN_decapsulate(), namely mlxsw. The
> driver is using the function in order to ensure that the hardware and
> software data paths act the same with regards to the ECN marking of
> decapsulated packets.
>
> The discrepancy was uncovered by commit 5aa3c334a449 ("selftests:
> forwarding: vxlan_bridge_1d: Fix vxlan ecn decapsulate value") that
> aligned the selftest to the new behavior. Without this patch the
> selftest passes when used with veth pairs, but fails when used with
> mlxsw netdevs.
>
> Fix this by instructing the device to propagate the ECT(1) mark from the
> outer header to the inner header when the inner header is ECT(0), for
> both NVE and IP-in-IP tunnels.
>
> A helper is added in order not to duplicate the code between both tunnel
> types.
>
> Fixes: b723748750ec ("tunnel: Propagate ECT(1) when decapsulating as recommended by RFC6040")
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> Reviewed-by: Petr Machata <petrm@nvidia.com>

Huh, I had no idea there was a caller in the driver - thanks for fixing
that!

Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>


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

* Re: [PATCH net 2/2] selftests: forwarding: vxlan_bridge_1d: Add more ECN decap test cases
  2021-03-29  8:29 ` [PATCH net 2/2] selftests: forwarding: vxlan_bridge_1d: Add more ECN decap test cases Ido Schimmel
@ 2021-03-29  9:03   ` Toke Høiland-Jørgensen
  0 siblings, 0 replies; 9+ messages in thread
From: Toke Høiland-Jørgensen @ 2021-03-29  9:03 UTC (permalink / raw)
  To: Ido Schimmel, netdev
  Cc: davem, kuba, jiri, petrm, liuhangbin, mlxsw, Ido Schimmel

Ido Schimmel <idosch@idosch.org> writes:

> From: Ido Schimmel <idosch@nvidia.com>
>
> Test that all possible combinations of inner and outer ECN bits result
> in the correct inner ECN marking according to RFC 6040 4.2.
>
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> Reviewed-by: Petr Machata <petrm@nvidia.com>

Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>


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

end of thread, other threads:[~2021-03-29  9:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-29  8:29 [PATCH net 0/2] mlxsw: spectrum: Fix ECN marking in tunnel decapsulation Ido Schimmel
2021-03-29  8:29 ` [PATCH net 1/2] " Ido Schimmel
2021-03-29  9:03   ` Toke Høiland-Jørgensen
2021-03-29  8:29 ` [PATCH net 2/2] selftests: forwarding: vxlan_bridge_1d: Add more ECN decap test cases Ido Schimmel
2021-03-29  9:03   ` Toke Høiland-Jørgensen
2021-03-29  8:29 ` [PATCH net mlxsw v2 0/2] mlxsw: spectrum: Fix ECN marking in tunnel decapsulation Ido Schimmel
2021-03-29  8:38   ` Ido Schimmel
2021-03-29  8:29 ` [PATCH net mlxsw v2 1/2] " Ido Schimmel
2021-03-29  8:29 ` [PATCH net mlxsw v2 2/2] selftests: forwarding: vxlan_bridge_1d: Add more ECN decap test cases Ido Schimmel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.