All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH net v1] ice: Fix tunnel checksum offload with fragmented traffic
@ 2022-07-18 11:34 Jedrzej Jagielski
  2022-07-21 16:59 ` G, GurucharanX
  0 siblings, 1 reply; 2+ messages in thread
From: Jedrzej Jagielski @ 2022-07-18 11:34 UTC (permalink / raw)
  To: intel-wired-lan; +Cc: Przemyslaw Patynowski, Jedrzej Jagielski

From: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>

Fix checksum offload on VXLAN tunnels.
In case, when mpls protocol is not used, set l4 header to transport
header of skb. This fixes case, when user tries to offload checksums
of VXLAN tunneled traffic.

Steps for reproduction (requires link partner with tunnels):
ip l s enp130s0f0 up
ip a f enp130s0f0
ip a a 10.10.110.2/24 dev enp130s0f0
ip l s enp130s0f0 mtu 1600
ip link add vxlan12_sut type vxlan id 12 group 238.168.100.100 dev enp130s0f0 dstport 4789
ip l s vxlan12_sut up
ip a a 20.10.110.2/24 dev vxlan12_sut
iperf3 -c 20.10.110.1 #should connect

Offload params: td_offset, cd_tunnel_params were
corrupted, due to l4 header pointing wrong address. NIC would then drop
those packets internally, due to incorrect TX descriptor data,
which increased GLV_TEPC register.

Fixes: 69e66c04c672 ("ice: Add mpls+tso support")
Signed-off-by: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_txrx.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c
index 3f8b7274ed2f..836dce840712 100644
--- a/drivers/net/ethernet/intel/ice/ice_txrx.c
+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c
@@ -1751,11 +1751,13 @@ int ice_tx_csum(struct ice_tx_buf *first, struct ice_tx_offload_params *off)
 
 	protocol = vlan_get_protocol(skb);
 
-	if (eth_p_mpls(protocol))
+	if (eth_p_mpls(protocol)) {
 		ip.hdr = skb_inner_network_header(skb);
-	else
+		l4.hdr = skb_checksum_start(skb);
+	} else {
 		ip.hdr = skb_network_header(skb);
-	l4.hdr = skb_checksum_start(skb);
+		l4.hdr = skb_transport_header(skb);
+	}
 
 	/* compute outer L2 header size */
 	l2_len = ip.hdr - skb->data;
-- 
2.27.0

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

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

* Re: [Intel-wired-lan] [PATCH net v1] ice: Fix tunnel checksum offload with fragmented traffic
  2022-07-18 11:34 [Intel-wired-lan] [PATCH net v1] ice: Fix tunnel checksum offload with fragmented traffic Jedrzej Jagielski
@ 2022-07-21 16:59 ` G, GurucharanX
  0 siblings, 0 replies; 2+ messages in thread
From: G, GurucharanX @ 2022-07-21 16:59 UTC (permalink / raw)
  To: Jagielski, Jedrzej, intel-wired-lan
  Cc: Patynowski, PrzemyslawX, Jagielski,  Jedrzej



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Jedrzej Jagielski
> Sent: Monday, July 18, 2022 5:04 PM
> To: intel-wired-lan@lists.osuosl.org
> Cc: Patynowski, PrzemyslawX <przemyslawx.patynowski@intel.com>;
> Jagielski, Jedrzej <jedrzej.jagielski@intel.com>
> Subject: [Intel-wired-lan] [PATCH net v1] ice: Fix tunnel checksum offload
> with fragmented traffic
> 
> From: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
> 
> Fix checksum offload on VXLAN tunnels.
> In case, when mpls protocol is not used, set l4 header to transport header of
> skb. This fixes case, when user tries to offload checksums of VXLAN tunneled
> traffic.
> 
> Steps for reproduction (requires link partner with tunnels):
> ip l s enp130s0f0 up
> ip a f enp130s0f0
> ip a a 10.10.110.2/24 dev enp130s0f0
> ip l s enp130s0f0 mtu 1600
> ip link add vxlan12_sut type vxlan id 12 group 238.168.100.100 dev
> enp130s0f0 dstport 4789 ip l s vxlan12_sut up ip a a 20.10.110.2/24 dev
> vxlan12_sut
> iperf3 -c 20.10.110.1 #should connect
> 
> Offload params: td_offset, cd_tunnel_params were corrupted, due to l4
> header pointing wrong address. NIC would then drop those packets
> internally, due to incorrect TX descriptor data, which increased GLV_TEPC
> register.
> 
> Fixes: 69e66c04c672 ("ice: Add mpls+tso support")
> Signed-off-by: Przemyslaw Patynowski
> <przemyslawx.patynowski@intel.com>
> Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
> Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_txrx.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 

Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

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

end of thread, other threads:[~2022-07-21 16:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-18 11:34 [Intel-wired-lan] [PATCH net v1] ice: Fix tunnel checksum offload with fragmented traffic Jedrzej Jagielski
2022-07-21 16:59 ` G, GurucharanX

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.