All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Belous <Pavel.Belous@aquantia.com>
To: "David S . Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, David Arcari <darcari@redhat.com>,
	Igor Russkikh <Igor.Russkikh@aquantia.com>,
	Nadezhda Krupnina <Nadezhda.Krupnina@aquantia.com>,
	Simon Edelhaus <simon.edelhaus@aquantia.com>,
	Pavel Belous <pavel.belous@aquantia.com>,
	Pavel Belous <Pavel.Belous@aquantia.com>
Subject: [PATCH net v2 3/6] net:ethernet:aquantia: Workaround for HW checksum bug.
Date: Mon, 28 Aug 2017 21:52:10 +0300	[thread overview]
Message-ID: <f9da8832eb2534b18fe228b736aac99e63279162.1503945861.git.pavel.belous@aquantia.com> (raw)
In-Reply-To: <cover.1503945861.git.pavel.belous@aquantia.com>

From: Pavel Belous <pavel.belous@aquantia.com>

The hardware has the HW Checksum Offload bug when small
TCP patckets (with length <= 60 bytes) has wrong "checksum valid" bit.

The solution is - ignore checksum valid bit for small packets
(with length <= 60 bytes) and mark this as CHECKSUM_NONE to allow
network stack recalculate checksum itself.

Fixes: ccf9a5ed14be ("net: ethernet: aquantia: Atlantic A0 and B0 specific functions.")
Signed-off-by: Pavel Belous <Pavel.Belous@aquantia.com>
---
 drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c | 6 ++++++
 drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
index faeb493..c5a02df 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
@@ -629,6 +629,12 @@ static int hw_atl_a0_hw_ring_rx_receive(struct aq_hw_s *self,
 				buff->is_udp_cso = (is_err & 0x10U) ? 0 : 1;
 			else if (0x0U == (pkt_type & 0x1CU))
 				buff->is_tcp_cso = (is_err & 0x10U) ? 0 : 1;
+
+			/* Checksum offload workaround for small packets */
+			if (rxd_wb->pkt_len <= 60) {
+				buff->is_ip_cso = 0U;
+				buff->is_cso_err = 0U;
+			}
 		}
 
 		is_err &= ~0x18U;
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
index 1bceb73..21784cc 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
@@ -645,6 +645,12 @@ static int hw_atl_b0_hw_ring_rx_receive(struct aq_hw_s *self,
 				buff->is_udp_cso = buff->is_cso_err ? 0U : 1U;
 			else if (0x0U == (pkt_type & 0x1CU))
 				buff->is_tcp_cso = buff->is_cso_err ? 0U : 1U;
+
+			/* Checksum offload workaround for small packets */
+			if (rxd_wb->pkt_len <= 60) {
+				buff->is_ip_cso = 0U;
+				buff->is_cso_err = 0U;
+			}
 		}
 
 		is_err &= ~0x18U;
-- 
2.7.4

  parent reply	other threads:[~2017-08-28 18:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-28 18:52 [PATCH net v2 0/6] net:ethernet:aquantia: Atlantic driver Update 2017-08-23 Pavel Belous
2017-08-28 18:52 ` [PATCH net v2 1/6] net:ethernet:aquantia: Extra spinlocks removed Pavel Belous
2017-08-28 18:52 ` [PATCH net v2 2/6] net:ethernet:aquantia: Fix for number of RSS queues Pavel Belous
2017-08-28 18:52 ` Pavel Belous [this message]
2017-08-28 18:52 ` [PATCH net v2 4/6] net:ethernet:aquantia: Fix for incorrect speed index Pavel Belous
2017-08-28 18:52 ` [PATCH net v2 5/6] net:ethernet:aquantia: Fix for multicast filter handling Pavel Belous
2017-08-28 18:52 ` [PATCH net v2 6/6] net:ethernet:aquantia: Show info message if bad firmware version detected Pavel Belous
2017-08-29 22:12 ` [PATCH net v2 0/6] net:ethernet:aquantia: Atlantic driver Update 2017-08-23 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=f9da8832eb2534b18fe228b736aac99e63279162.1503945861.git.pavel.belous@aquantia.com \
    --to=pavel.belous@aquantia.com \
    --cc=Igor.Russkikh@aquantia.com \
    --cc=Nadezhda.Krupnina@aquantia.com \
    --cc=darcari@redhat.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=simon.edelhaus@aquantia.com \
    /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.