All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Feras Daoud <ferasda@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: [net 07/10] net/mlx5e: IPoIB, Fix RX checksum statistics update
Date: Mon, 11 Mar 2019 11:39:26 -0700	[thread overview]
Message-ID: <20190311183929.12796-8-saeedm@mellanox.com> (raw)
In-Reply-To: <20190311183929.12796-1-saeedm@mellanox.com>

From: Feras Daoud <ferasda@mellanox.com>

Update the RX checksum only if the feature is enabled.

Fixes: 9d6bd752c63c ("net/mlx5e: IPoIB, RX handler")
Signed-off-by: Feras Daoud <ferasda@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
index be396e5e4e39..3dde5c7e0739 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
@@ -1295,8 +1295,14 @@ static inline void mlx5i_complete_rx_cqe(struct mlx5e_rq *rq,
 
 	skb->protocol = *((__be16 *)(skb->data));
 
-	skb->ip_summed = CHECKSUM_COMPLETE;
-	skb->csum = csum_unfold((__force __sum16)cqe->check_sum);
+	if (netdev->features & NETIF_F_RXCSUM) {
+		skb->ip_summed = CHECKSUM_COMPLETE;
+		skb->csum = csum_unfold((__force __sum16)cqe->check_sum);
+		stats->csum_complete++;
+	} else {
+		skb->ip_summed = CHECKSUM_NONE;
+		stats->csum_none++;
+	}
 
 	if (unlikely(mlx5e_rx_hw_stamp(tstamp)))
 		skb_hwtstamps(skb)->hwtstamp =
@@ -1315,7 +1321,6 @@ static inline void mlx5i_complete_rx_cqe(struct mlx5e_rq *rq,
 
 	skb->dev = netdev;
 
-	stats->csum_complete++;
 	stats->packets++;
 	stats->bytes += cqe_bcnt;
 }
-- 
2.20.1


  parent reply	other threads:[~2019-03-11 18:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-11 18:39 [pull request][net 00/10] Mellanox, mlx5 fixes 2019-03-11 Saeed Mahameed
2019-03-11 18:39 ` [net 01/10] net/mlx5: Fix multiple updates of steering rules in parallel Saeed Mahameed
2019-03-11 18:39 ` [net 02/10] net/mlx5: Add modify FTE helper function Saeed Mahameed
2019-03-11 18:39 ` [net 03/10] net/mlx5: Add a locked flag to node removal functions Saeed Mahameed
2019-03-11 18:39 ` [net 04/10] net/mlx5: Consolidate update FTE for all removal changes Saeed Mahameed
2019-03-11 18:39 ` [net 05/10] net/mlx5e: Properly get the PF number phys port name ndo Saeed Mahameed
2019-03-11 18:39 ` [net 06/10] net/mlx5: Remove redundant lag function to get pf num Saeed Mahameed
2019-03-11 18:39 ` Saeed Mahameed [this message]
2019-03-11 18:39 ` [net 08/10] net/mlx5e: Fix access to non-existing receive queue Saeed Mahameed
2019-03-11 18:39 ` [net 09/10] net/mlx5: Avoid panic when setting vport mac, getting vport config Saeed Mahameed
2019-03-11 18:39 ` [net 10/10] net/mlx5: Avoid panic when setting vport rate Saeed Mahameed
2019-03-11 23:40 ` [pull request][net 00/10] Mellanox, mlx5 fixes 2019-03-11 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190311183929.12796-8-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=ferasda@mellanox.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.