stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com>,
	Igor Russkikh <igor.russkikh@aquantia.com>,
	"David S . Miller" <davem@davemloft.net>,
	Sasha Levin <sashal@kernel.org>,
	netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 4.19 25/49] net: aquantia: fix LRO with FCS error
Date: Sat,  8 Jun 2019 07:42:06 -0400	[thread overview]
Message-ID: <20190608114232.8731-25-sashal@kernel.org> (raw)
In-Reply-To: <20190608114232.8731-1-sashal@kernel.org>

From: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com>

[ Upstream commit eaeb3b7494ba9159323814a8ce8af06a9277d99b ]

Driver stops producing skbs on ring if a packet with FCS error
was coalesced into LRO session. Ring gets hang forever.

Thats a logical error in driver processing descriptors:
When rx_stat indicates MAC Error, next pointer and eop flags
are not filled. This confuses driver so it waits for descriptor 0
to be filled by HW.

Solution is fill next pointer and eop flag even for packets with FCS error.

Fixes: bab6de8fd180b ("net: ethernet: aquantia: Atlantic A0 and B0 specific functions.")
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../aquantia/atlantic/hw_atl/hw_atl_b0.c      | 61 ++++++++++---------
 1 file changed, 32 insertions(+), 29 deletions(-)

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 56363ff5c891..51cd1f98bcf0 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
@@ -695,38 +695,41 @@ static int hw_atl_b0_hw_ring_rx_receive(struct aq_hw_s *self,
 		if ((rx_stat & BIT(0)) || rxd_wb->type & 0x1000U) {
 			/* MAC error or DMA error */
 			buff->is_error = 1U;
-		} else {
-			if (self->aq_nic_cfg->is_rss) {
-				/* last 4 byte */
-				u16 rss_type = rxd_wb->type & 0xFU;
-
-				if (rss_type && rss_type < 0x8U) {
-					buff->is_hash_l4 = (rss_type == 0x4 ||
-					rss_type == 0x5);
-					buff->rss_hash = rxd_wb->rss_hash;
-				}
+		}
+		if (self->aq_nic_cfg->is_rss) {
+			/* last 4 byte */
+			u16 rss_type = rxd_wb->type & 0xFU;
+
+			if (rss_type && rss_type < 0x8U) {
+				buff->is_hash_l4 = (rss_type == 0x4 ||
+				rss_type == 0x5);
+				buff->rss_hash = rxd_wb->rss_hash;
 			}
+		}
 
-			if (HW_ATL_B0_RXD_WB_STAT2_EOP & rxd_wb->status) {
-				buff->len = rxd_wb->pkt_len %
-					AQ_CFG_RX_FRAME_MAX;
-				buff->len = buff->len ?
-					buff->len : AQ_CFG_RX_FRAME_MAX;
-				buff->next = 0U;
-				buff->is_eop = 1U;
+		if (HW_ATL_B0_RXD_WB_STAT2_EOP & rxd_wb->status) {
+			buff->len = rxd_wb->pkt_len %
+				AQ_CFG_RX_FRAME_MAX;
+			buff->len = buff->len ?
+				buff->len : AQ_CFG_RX_FRAME_MAX;
+			buff->next = 0U;
+			buff->is_eop = 1U;
+		} else {
+			buff->len =
+				rxd_wb->pkt_len > AQ_CFG_RX_FRAME_MAX ?
+				AQ_CFG_RX_FRAME_MAX : rxd_wb->pkt_len;
+
+			if (HW_ATL_B0_RXD_WB_STAT2_RSCCNT &
+				rxd_wb->status) {
+				/* LRO */
+				buff->next = rxd_wb->next_desc_ptr;
+				++ring->stats.rx.lro_packets;
 			} else {
-				if (HW_ATL_B0_RXD_WB_STAT2_RSCCNT &
-					rxd_wb->status) {
-					/* LRO */
-					buff->next = rxd_wb->next_desc_ptr;
-					++ring->stats.rx.lro_packets;
-				} else {
-					/* jumbo */
-					buff->next =
-						aq_ring_next_dx(ring,
-								ring->hw_head);
-					++ring->stats.rx.jumbo_packets;
-				}
+				/* jumbo */
+				buff->next =
+					aq_ring_next_dx(ring,
+							ring->hw_head);
+				++ring->stats.rx.jumbo_packets;
 			}
 		}
 	}
-- 
2.20.1


  parent reply	other threads:[~2019-06-08 11:44 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-08 11:41 [PATCH AUTOSEL 4.19 01/49] iio: dac: ds4422/ds4424 fix chip verification Sasha Levin
2019-06-08 11:41 ` [PATCH AUTOSEL 4.19 02/49] iio: adc: ti-ads8688: fix timestamp is not updated in buffer Sasha Levin
2019-06-08 11:41 ` [PATCH AUTOSEL 4.19 03/49] Staging: vc04_services: Fix a couple error codes Sasha Levin
2019-06-08 11:41 ` [PATCH AUTOSEL 4.19 04/49] perf/x86/intel/ds: Fix EVENT vs. UEVENT PEBS constraints Sasha Levin
2019-06-08 11:41 ` [PATCH AUTOSEL 4.19 05/49] netfilter: nf_queue: fix reinject verdict handling Sasha Levin
2019-06-08 11:41 ` [PATCH AUTOSEL 4.19 06/49] ipvs: Fix use-after-free in ip_vs_in Sasha Levin
2019-06-08 11:41 ` [PATCH AUTOSEL 4.19 07/49] selftests: netfilter: missing error check when setting up veth interface Sasha Levin
2019-06-08 11:41 ` [PATCH AUTOSEL 4.19 08/49] clk: ti: clkctrl: Fix clkdm_clk handling Sasha Levin
2019-06-08 11:41 ` [PATCH AUTOSEL 4.19 09/49] powerpc/powernv: Return for invalid IMC domain Sasha Levin
2019-06-08 11:41 ` [PATCH AUTOSEL 4.19 10/49] usb: xhci: Fix a potential null pointer dereference in xhci_debugfs_create_endpoint() Sasha Levin
2019-06-08 11:41 ` [PATCH AUTOSEL 4.19 11/49] mISDN: make sure device name is NUL terminated Sasha Levin
2019-06-08 11:41 ` [PATCH AUTOSEL 4.19 12/49] x86/CPU/AMD: Don't force the CPB cap when running under a hypervisor Sasha Levin
2019-06-08 11:41 ` [PATCH AUTOSEL 4.19 13/49] perf/ring_buffer: Fix exposing a temporarily decreased data_head Sasha Levin
2019-06-08 11:41 ` [PATCH AUTOSEL 4.19 14/49] perf/ring_buffer: Add ordering to rb->nest increment Sasha Levin
2019-06-08 11:41 ` [PATCH AUTOSEL 4.19 15/49] perf/ring-buffer: Always use {READ,WRITE}_ONCE() for rb->user_page data Sasha Levin
2019-06-08 11:41 ` [PATCH AUTOSEL 4.19 16/49] gpio: fix gpio-adp5588 build errors Sasha Levin
2019-06-08 11:41 ` [PATCH AUTOSEL 4.19 17/49] efi/x86/Add missing error handling to old_memmap 1:1 mapping code Sasha Levin
2019-06-09 18:14   ` Ard Biesheuvel
2019-06-19 20:58     ` Sasha Levin
2019-06-08 11:41 ` [PATCH AUTOSEL 4.19 18/49] net: stmmac: update rx tail pointer register to fix rx dma hang issue Sasha Levin
2019-06-08 11:42 ` [PATCH AUTOSEL 4.19 19/49] net: tulip: de4x5: Drop redundant MODULE_DEVICE_TABLE() Sasha Levin
2019-06-08 11:42 ` [PATCH AUTOSEL 4.19 20/49] ACPI/PCI: PM: Add missing wakeup.flags.valid checks Sasha Levin
2019-06-08 11:42 ` [PATCH AUTOSEL 4.19 21/49] PCI: PM: Avoid possible suspend-to-idle issue Sasha Levin
2019-06-08 11:42 ` [PATCH AUTOSEL 4.19 22/49] loop: Don't change loop device under exclusive opener Sasha Levin
2019-06-10  9:00   ` Jan Kara
2019-06-08 11:42 ` [PATCH AUTOSEL 4.19 23/49] drm/etnaviv: lock MMU while dumping core Sasha Levin
2019-06-08 11:42 ` [PATCH AUTOSEL 4.19 24/49] net: aquantia: tx clean budget logic error Sasha Levin
2019-06-08 11:42 ` Sasha Levin [this message]
2019-06-08 11:42 ` [PATCH AUTOSEL 4.19 26/49] i2c: dev: fix potential memory leak in i2cdev_ioctl_rdwr Sasha Levin
2019-06-08 11:42 ` [PATCH AUTOSEL 4.19 27/49] i2c: mlxcpld: Fix wrong initialization order in probe Sasha Levin
2019-06-08 11:42 ` [PATCH AUTOSEL 4.19 28/49] ALSA: hda - Force polling mode on CNL for fixing codec communication Sasha Levin
2019-06-08 11:42 ` [PATCH AUTOSEL 4.19 29/49] configfs: Fix use-after-free when accessing sd->s_dentry Sasha Levin
2019-06-08 11:42 ` [PATCH AUTOSEL 4.19 30/49] perf data: Fix 'strncat may truncate' build failure with recent gcc Sasha Levin
2019-06-08 11:42 ` [PATCH AUTOSEL 4.19 31/49] perf namespace: Protect reading thread's namespace Sasha Levin
2019-06-08 11:42 ` [PATCH AUTOSEL 4.19 32/49] perf record: Fix s390 missing module symbol and warning for non-root users Sasha Levin
2019-06-08 11:42 ` [PATCH AUTOSEL 4.19 33/49] ia64: fix build errors by exporting paddr_to_nid() Sasha Levin
2019-06-08 11:42 ` [PATCH AUTOSEL 4.19 34/49] xen/pvcalls: Remove set but not used variable Sasha Levin
2019-06-08 11:42 ` [PATCH AUTOSEL 4.19 35/49] xenbus: Avoid deadlock during suspend due to open transactions Sasha Levin
2019-06-08 11:42 ` [PATCH AUTOSEL 4.19 36/49] KVM: PPC: Book3S: Use new mutex to synchronize access to rtas token list Sasha Levin
2019-06-08 11:42 ` [PATCH AUTOSEL 4.19 37/49] KVM: PPC: Book3S HV: Don't take kvm->lock around kvm_for_each_vcpu Sasha Levin
2019-06-08 11:42 ` [PATCH AUTOSEL 4.19 38/49] arm64: fix syscall_fn_t type Sasha Levin

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=20190608114232.8731-25-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dmitry.bogdanov@aquantia.com \
    --cc=igor.russkikh@aquantia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).