Blame SOURCES/0014-netdrv-net-mlx5e-Rx-checksum-handling-refactoring.patch

d8f823
From e31d980ab9849683588324b04f8596e901b3721e Mon Sep 17 00:00:00 2001
d8f823
From: Alaa Hleihel <ahleihel@redhat.com>
d8f823
Date: Sun, 10 May 2020 14:51:34 -0400
d8f823
Subject: [PATCH 014/312] [netdrv] net/mlx5e: Rx, checksum handling refactoring
d8f823
d8f823
Message-id: <20200510145245.10054-12-ahleihel@redhat.com>
d8f823
Patchwork-id: 306554
d8f823
Patchwork-instance: patchwork
d8f823
O-Subject: [RHEL8.3 BZ 1789378 v2 11/82] net/mlx5e: Rx, checksum handling refactoring
d8f823
Bugzilla: 1789378
d8f823
RH-Acked-by: Kamal Heib <kheib@redhat.com>
d8f823
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
d8f823
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
d8f823
RH-Acked-by: Jonathan Toppins <jtoppins@redhat.com>
d8f823
d8f823
Bugzilla: http://bugzilla.redhat.com/1789378
d8f823
Upstream: v5.4-rc1
d8f823
d8f823
commit 8c7698d5caa7852bebae0cf7402b7d3a1f30423b
d8f823
Author: Saeed Mahameed <saeedm@mellanox.com>
d8f823
Date:   Fri May 3 15:12:46 2019 -0700
d8f823
d8f823
    net/mlx5e: Rx, checksum handling refactoring
d8f823
d8f823
    Move vlan checksum fixup flow into mlx5e_skb_padding_csum(), which is
d8f823
    supposed to fixup SKB checksum if needed. And rename
d8f823
    mlx5e_skb_padding_csum() to mlx5e_skb_csum_fixup().
d8f823
d8f823
    Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
d8f823
d8f823
Signed-off-by: Alaa Hleihel <ahleihel@redhat.com>
d8f823
Signed-off-by: Frantisek Hrbata <fhrbata@redhat.com>
d8f823
---
d8f823
 drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 26 +++++++++++++------------
d8f823
 1 file changed, 14 insertions(+), 12 deletions(-)
d8f823
d8f823
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
d8f823
index 6518d1101de0..a22b3a3db253 100644
d8f823
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
d8f823
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
d8f823
@@ -860,13 +860,24 @@ tail_padding_csum(struct sk_buff *skb, int offset,
d8f823
 }
d8f823
 
d8f823
 static void
d8f823
-mlx5e_skb_padding_csum(struct sk_buff *skb, int network_depth, __be16 proto,
d8f823
-		       struct mlx5e_rq_stats *stats)
d8f823
+mlx5e_skb_csum_fixup(struct sk_buff *skb, int network_depth, __be16 proto,
d8f823
+		     struct mlx5e_rq_stats *stats)
d8f823
 {
d8f823
 	struct ipv6hdr *ip6;
d8f823
 	struct iphdr   *ip4;
d8f823
 	int pkt_len;
d8f823
 
d8f823
+	/* Fixup vlan headers, if any */
d8f823
+	if (network_depth > ETH_HLEN)
d8f823
+		/* CQE csum is calculated from the IP header and does
d8f823
+		 * not cover VLAN headers (if present). This will add
d8f823
+		 * the checksum manually.
d8f823
+		 */
d8f823
+		skb->csum = csum_partial(skb->data + ETH_HLEN,
d8f823
+					 network_depth - ETH_HLEN,
d8f823
+					 skb->csum);
d8f823
+
d8f823
+	/* Fixup tail padding, if any */
d8f823
 	switch (proto) {
d8f823
 	case htons(ETH_P_IP):
d8f823
 		ip4 = (struct iphdr *)(skb->data + network_depth);
d8f823
@@ -932,16 +943,7 @@ static inline void mlx5e_handle_csum(struct net_device *netdev,
d8f823
 			return; /* CQE csum covers all received bytes */
d8f823
 
d8f823
 		/* csum might need some fixups ...*/
d8f823
-		if (network_depth > ETH_HLEN)
d8f823
-			/* CQE csum is calculated from the IP header and does
d8f823
-			 * not cover VLAN headers (if present). This will add
d8f823
-			 * the checksum manually.
d8f823
-			 */
d8f823
-			skb->csum = csum_partial(skb->data + ETH_HLEN,
d8f823
-						 network_depth - ETH_HLEN,
d8f823
-						 skb->csum);
d8f823
-
d8f823
-		mlx5e_skb_padding_csum(skb, network_depth, proto, stats);
d8f823
+		mlx5e_skb_csum_fixup(skb, network_depth, proto, stats);
d8f823
 		return;
d8f823
 	}
d8f823
 
d8f823
-- 
d8f823
2.13.6
d8f823