[SRU G][PATCH 0/1] Fix geneve overlay network on vlan interface broken with offload enabled

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU G][PATCH 0/1] Fix geneve overlay network on vlan interface broken with offload enabled

Stefan Bader-2
[SRU Justification]

Impact: In upstream v5.2 geneve tunnel stateless offload support was added
to the mlx5 driver. This had some issue with VLANs where the VLAN ID was set
by the driver even when offload support was enabled.

Fix: Upstream (v5.11-rc3) commit 378d3783412e38dc3a2b9d524f551c0008ea314a
"net/mlx5e: Fix SWP offsets when vlan inserted by driver" was backported
(dropping some code because it did not yet exist in 5.8) and verified to
address the problem.

Testcase: Enable geneve tunnel offload support on a mlx5(e) card over VLAN.

Regression potential: The modified code path is sending packets tagged for
VLAN(s), so outgoing traffic into VLAN(s) would most likely be impacted.

Moshe Shemesh (1):
  net/mlx5e: Fix SWP offsets when vlan inserted by driver

 drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h        | 9 +++++++++
 .../net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h  | 4 +++-
 drivers/net/ethernet/mellanox/mlx5/core/en_tx.c          | 2 +-
 3 files changed, 13 insertions(+), 2 deletions(-)

--
2.25.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU G][PATCH 1/1] net/mlx5e: Fix SWP offsets when vlan inserted by driver

Stefan Bader-2
From: Moshe Shemesh <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1914447

In case WQE includes inline header the vlan is inserted by driver even
if vlan offload is set. On geneve over vlan interface where software
parser is used the SWP offsets should be updated according to the added
vlan.

Fixes: e3cfc7e6b7bd ("net/mlx5e: TX, Add geneve tunnel stateless offload support")
Signed-off-by: Moshe Shemesh <[hidden email]>
Reviewed-by: Tariq Toukan <[hidden email]>
Signed-off-by: Saeed Mahameed <[hidden email]>

(backported from commit b544011f0e58ce43c40105468d6dc67f980a0c7a)
[smb: adjust for missing mlx5e_accel_tx_eseg(), mlx5e_txwqe_build_eseg()
      mlx5e_tx_tunnel_accel() called directly from mlx5e_sq_xmit()]
Signed-off-by: Stefan Bader <[hidden email]>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h        | 9 +++++++++
 .../net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h  | 4 +++-
 drivers/net/ethernet/mellanox/mlx5/core/en_tx.c          | 2 +-
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h b/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
index f0aa23d0665b..29e9aec2bc04 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
@@ -299,6 +299,15 @@ struct mlx5e_swp_spec {
  u8 tun_l4_proto;
 };
 
+static inline void mlx5e_eseg_swp_offsets_add_vlan(struct mlx5_wqe_eth_seg *eseg)
+{
+ /* SWP offsets are in 2-bytes words */
+ eseg->swp_outer_l3_offset += VLAN_HLEN / 2;
+ eseg->swp_outer_l4_offset += VLAN_HLEN / 2;
+ eseg->swp_inner_l3_offset += VLAN_HLEN / 2;
+ eseg->swp_inner_l4_offset += VLAN_HLEN / 2;
+}
+
 static inline void
 mlx5e_set_eseg_swp(struct sk_buff *skb, struct mlx5_wqe_eth_seg *eseg,
    struct mlx5e_swp_spec *swp_spec)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h
index 110476bdeffb..8f039c4a6194 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h
@@ -51,7 +51,7 @@ static inline bool mlx5_geneve_tx_allowed(struct mlx5_core_dev *mdev)
 }
 
 static inline void
-mlx5e_tx_tunnel_accel(struct sk_buff *skb, struct mlx5_wqe_eth_seg *eseg)
+mlx5e_tx_tunnel_accel(struct sk_buff *skb, struct mlx5_wqe_eth_seg *eseg, u16 ihs)
 {
  struct mlx5e_swp_spec swp_spec = {};
  unsigned int offset = 0;
@@ -85,6 +85,8 @@ mlx5e_tx_tunnel_accel(struct sk_buff *skb, struct mlx5_wqe_eth_seg *eseg)
  }
 
  mlx5e_set_eseg_swp(skb, eseg, &swp_spec);
+ if (skb_vlan_tag_present(skb) && ihs)
+ mlx5e_eseg_swp_offsets_add_vlan(eseg);
 }
 
 #else
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
index da596de3abba..77bd986a8c27 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
@@ -341,7 +341,7 @@ void mlx5e_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb,
 
 #if IS_ENABLED(CONFIG_GENEVE)
  if (skb->encapsulation)
- mlx5e_tx_tunnel_accel(skb, eseg);
+ mlx5e_tx_tunnel_accel(skb, eseg, ihs);
 #endif
  mlx5e_txwqe_build_eseg_csum(sq, skb, eseg);
 
--
2.25.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [SRU G][PATCH 1/1] net/mlx5e: Fix SWP offsets when vlan inserted by driver

Kleber Souza
On 08.02.21 14:42, Stefan Bader wrote:

> From: Moshe Shemesh <[hidden email]>
>
> BugLink: https://bugs.launchpad.net/bugs/1914447
>
> In case WQE includes inline header the vlan is inserted by driver even
> if vlan offload is set. On geneve over vlan interface where software
> parser is used the SWP offsets should be updated according to the added
> vlan.
>
> Fixes: e3cfc7e6b7bd ("net/mlx5e: TX, Add geneve tunnel stateless offload support")
> Signed-off-by: Moshe Shemesh <[hidden email]>
> Reviewed-by: Tariq Toukan <[hidden email]>
> Signed-off-by: Saeed Mahameed <[hidden email]>
>
> (backported from commit b544011f0e58ce43c40105468d6dc67f980a0c7a)
> [smb: adjust for missing mlx5e_accel_tx_eseg(), mlx5e_txwqe_build_eseg()
>        mlx5e_tx_tunnel_accel() called directly from mlx5e_sq_xmit()]
> Signed-off-by: Stefan Bader <[hidden email]>

The backport looks good, good test results.

Acked-by: Kleber Sacilotto de Souza <[hidden email]>

> ---
>   drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h        | 9 +++++++++
>   .../net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h  | 4 +++-
>   drivers/net/ethernet/mellanox/mlx5/core/en_tx.c          | 2 +-
>   3 files changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h b/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
> index f0aa23d0665b..29e9aec2bc04 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
> @@ -299,6 +299,15 @@ struct mlx5e_swp_spec {
>   u8 tun_l4_proto;
>   };
>  
> +static inline void mlx5e_eseg_swp_offsets_add_vlan(struct mlx5_wqe_eth_seg *eseg)
> +{
> + /* SWP offsets are in 2-bytes words */
> + eseg->swp_outer_l3_offset += VLAN_HLEN / 2;
> + eseg->swp_outer_l4_offset += VLAN_HLEN / 2;
> + eseg->swp_inner_l3_offset += VLAN_HLEN / 2;
> + eseg->swp_inner_l4_offset += VLAN_HLEN / 2;
> +}
> +
>   static inline void
>   mlx5e_set_eseg_swp(struct sk_buff *skb, struct mlx5_wqe_eth_seg *eseg,
>     struct mlx5e_swp_spec *swp_spec)
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h
> index 110476bdeffb..8f039c4a6194 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h
> @@ -51,7 +51,7 @@ static inline bool mlx5_geneve_tx_allowed(struct mlx5_core_dev *mdev)
>   }
>  
>   static inline void
> -mlx5e_tx_tunnel_accel(struct sk_buff *skb, struct mlx5_wqe_eth_seg *eseg)
> +mlx5e_tx_tunnel_accel(struct sk_buff *skb, struct mlx5_wqe_eth_seg *eseg, u16 ihs)
>   {
>   struct mlx5e_swp_spec swp_spec = {};
>   unsigned int offset = 0;
> @@ -85,6 +85,8 @@ mlx5e_tx_tunnel_accel(struct sk_buff *skb, struct mlx5_wqe_eth_seg *eseg)
>   }
>  
>   mlx5e_set_eseg_swp(skb, eseg, &swp_spec);
> + if (skb_vlan_tag_present(skb) && ihs)
> + mlx5e_eseg_swp_offsets_add_vlan(eseg);
>   }
>  
>   #else
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
> index da596de3abba..77bd986a8c27 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
> @@ -341,7 +341,7 @@ void mlx5e_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb,
>  
>   #if IS_ENABLED(CONFIG_GENEVE)
>   if (skb->encapsulation)
> - mlx5e_tx_tunnel_accel(skb, eseg);
> + mlx5e_tx_tunnel_accel(skb, eseg, ihs);
>   #endif
>   mlx5e_txwqe_build_eseg_csum(sq, skb, eseg);
>  
>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [SRU G][PATCH 1/1] net/mlx5e: Fix SWP offsets when vlan inserted by driver

Guilherme Piccoli
In reply to this post by Stefan Bader-2
On 08/02/2021 10:42, Stefan Bader wrote:

> From: Moshe Shemesh <[hidden email]>
>
> BugLink: https://bugs.launchpad.net/bugs/1914447
>
> In case WQE includes inline header the vlan is inserted by driver even
> if vlan offload is set. On geneve over vlan interface where software
> parser is used the SWP offsets should be updated according to the added
> vlan.
>
> Fixes: e3cfc7e6b7bd ("net/mlx5e: TX, Add geneve tunnel stateless offload support")
> Signed-off-by: Moshe Shemesh <[hidden email]>
> Reviewed-by: Tariq Toukan <[hidden email]>
> Signed-off-by: Saeed Mahameed <[hidden email]>
>
> (backported from commit b544011f0e58ce43c40105468d6dc67f980a0c7a)
> [smb: adjust for missing mlx5e_accel_tx_eseg(), mlx5e_txwqe_build_eseg()
>       mlx5e_tx_tunnel_accel() called directly from mlx5e_sq_xmit()]
> Signed-off-by: Stefan Bader <[hidden email]>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h        | 9 +++++++++
>  .../net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h  | 4 +++-
>  drivers/net/ethernet/mellanox/mlx5/core/en_tx.c          | 2 +-
>  3 files changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h b/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
> index f0aa23d0665b..29e9aec2bc04 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
> @@ -299,6 +299,15 @@ struct mlx5e_swp_spec {
>   u8 tun_l4_proto;
>  };
>  
> +static inline void mlx5e_eseg_swp_offsets_add_vlan(struct mlx5_wqe_eth_seg *eseg)
> +{
> + /* SWP offsets are in 2-bytes words */
> + eseg->swp_outer_l3_offset += VLAN_HLEN / 2;
> + eseg->swp_outer_l4_offset += VLAN_HLEN / 2;
> + eseg->swp_inner_l3_offset += VLAN_HLEN / 2;
> + eseg->swp_inner_l4_offset += VLAN_HLEN / 2;
> +}
> +
>  static inline void
>  mlx5e_set_eseg_swp(struct sk_buff *skb, struct mlx5_wqe_eth_seg *eseg,
>     struct mlx5e_swp_spec *swp_spec)
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h
> index 110476bdeffb..8f039c4a6194 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h
> @@ -51,7 +51,7 @@ static inline bool mlx5_geneve_tx_allowed(struct mlx5_core_dev *mdev)
>  }
>  
>  static inline void
> -mlx5e_tx_tunnel_accel(struct sk_buff *skb, struct mlx5_wqe_eth_seg *eseg)
> +mlx5e_tx_tunnel_accel(struct sk_buff *skb, struct mlx5_wqe_eth_seg *eseg, u16 ihs)
>  {
>   struct mlx5e_swp_spec swp_spec = {};
>   unsigned int offset = 0;
> @@ -85,6 +85,8 @@ mlx5e_tx_tunnel_accel(struct sk_buff *skb, struct mlx5_wqe_eth_seg *eseg)
>   }
>  
>   mlx5e_set_eseg_swp(skb, eseg, &swp_spec);
> + if (skb_vlan_tag_present(skb) && ihs)
> + mlx5e_eseg_swp_offsets_add_vlan(eseg);
>  }
>  
>  #else
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
> index da596de3abba..77bd986a8c27 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
> @@ -341,7 +341,7 @@ void mlx5e_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb,
>  
>  #if IS_ENABLED(CONFIG_GENEVE)
>   if (skb->encapsulation)
> - mlx5e_tx_tunnel_accel(skb, eseg);
> + mlx5e_tx_tunnel_accel(skb, eseg, ihs);
>  #endif
>   mlx5e_txwqe_build_eseg_csum(sq, skb, eseg);
>  
>

Thanks Stefan, the backport seems correct!

Acked-by: Guilherme G. Piccoli <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

APPLIED: [SRU G][PATCH 0/1] Fix geneve overlay network on vlan interface broken with offload enabled

Kelsey Skunberg
In reply to this post by Stefan Bader-2
Applied to G/master-next. thank you!

-Kelsey

On 2021-02-08 14:40:44 , Stefan Bader wrote:

> [SRU Justification]
>
> Impact: In upstream v5.2 geneve tunnel stateless offload support was added
> to the mlx5 driver. This had some issue with VLANs where the VLAN ID was set
> by the driver even when offload support was enabled.
>
> Fix: Upstream (v5.11-rc3) commit 378d3783412e38dc3a2b9d524f551c0008ea314a
> "net/mlx5e: Fix SWP offsets when vlan inserted by driver" was backported
> (dropping some code because it did not yet exist in 5.8) and verified to
> address the problem.
>
> Testcase: Enable geneve tunnel offload support on a mlx5(e) card over VLAN.
>
> Regression potential: The modified code path is sending packets tagged for
> VLAN(s), so outgoing traffic into VLAN(s) would most likely be impacted.
>
> Moshe Shemesh (1):
>   net/mlx5e: Fix SWP offsets when vlan inserted by driver
>
>  drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h        | 9 +++++++++
>  .../net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h  | 4 +++-
>  drivers/net/ethernet/mellanox/mlx5/core/en_tx.c          | 2 +-
>  3 files changed, 13 insertions(+), 2 deletions(-)
>
> --
> 2.25.1
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team