Commit 9385e669 authored by Dmitry Bogdanov's avatar Dmitry Bogdanov Committed by Greg Kroah-Hartman

net: aquantia: fix LRO with FCS error

[ Upstream commit eaeb3b74 ]

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: bab6de8f ("net: ethernet: aquantia: Atlantic A0 and B0 specific functions.")
Signed-off-by: default avatarIgor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: default avatarDmitry Bogdanov <dmitry.bogdanov@aquantia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 4a6ff3e2
...@@ -702,7 +702,7 @@ static int hw_atl_b0_hw_ring_rx_receive(struct aq_hw_s *self, ...@@ -702,7 +702,7 @@ static int hw_atl_b0_hw_ring_rx_receive(struct aq_hw_s *self,
if ((rx_stat & BIT(0)) || rxd_wb->type & 0x1000U) { if ((rx_stat & BIT(0)) || rxd_wb->type & 0x1000U) {
/* MAC error or DMA error */ /* MAC error or DMA error */
buff->is_error = 1U; buff->is_error = 1U;
} else { }
if (self->aq_nic_cfg->is_rss) { if (self->aq_nic_cfg->is_rss) {
/* last 4 byte */ /* last 4 byte */
u16 rss_type = rxd_wb->type & 0xFU; u16 rss_type = rxd_wb->type & 0xFU;
...@@ -722,6 +722,10 @@ static int hw_atl_b0_hw_ring_rx_receive(struct aq_hw_s *self, ...@@ -722,6 +722,10 @@ static int hw_atl_b0_hw_ring_rx_receive(struct aq_hw_s *self,
buff->next = 0U; buff->next = 0U;
buff->is_eop = 1U; buff->is_eop = 1U;
} else { } 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 & if (HW_ATL_B0_RXD_WB_STAT2_RSCCNT &
rxd_wb->status) { rxd_wb->status) {
/* LRO */ /* LRO */
...@@ -736,7 +740,6 @@ static int hw_atl_b0_hw_ring_rx_receive(struct aq_hw_s *self, ...@@ -736,7 +740,6 @@ static int hw_atl_b0_hw_ring_rx_receive(struct aq_hw_s *self,
} }
} }
} }
}
return aq_hw_err_from_flags(self); return aq_hw_err_from_flags(self);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment