Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2230936ybi; Thu, 20 Jun 2019 11:15:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxjgJZ89QhzxZSN1UErqzAZW5yS1GnH+tlHSnOK3f89xmkgAa/Qf+HK5ygYmKRv+xAwmFul X-Received: by 2002:a17:902:5ac4:: with SMTP id g4mr50180596plm.80.1561054554019; Thu, 20 Jun 2019 11:15:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561054554; cv=none; d=google.com; s=arc-20160816; b=TVPJPfFbjI+7xdECadbbVkl3jw29ILfiOJIXZ0tG/YjPKg5tQgnNy+2oZ3h3VAaw60 /yDhws+5X0npMzNY3A5teAti6mXbgrCQgf8qGh3I3Bs5EOA0bEvNf18ZKZEEHbLDOGhr uex46kVDjqwiG+SYdcAU6bLkjzJMBEyQAiWcuw3jamZwDWlmBN7wPk4ePzI4Vs7SVW8o Y33TeO8xUvx2wtvfZzEYRHBhZhVaZiBOa5F2gs1V9xrsIEoWcooxbwv5UdjQf4yhOBi6 +1JTO3ID83E0xuFC0ramAZ86xK6hFS3LYQXBXJn0VnQN6Lr2oWjmTxLxYWx3sRdtexnS 5k7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4M6H3D73Zha3kgzYLW8A5Z5oNccH9wTqqyqT4uJhAVw=; b=nQsAvposJB510rW7Dw1Wfwkai1oUhbMWlMQ1GOTaTcyUxY8dEdXpJBYaRGoPjdnuMK dV95qk+eOkUeWrl570TUN6e72x3+ZsPlu+jz8pmxkQuVd8bYq9XIgyCjeWa4v572SL4j i/dY3pD04B+mTWndIbEFuGloAD10XV394MpZcVLtBx9MoBn69ZAW3guG4H6IGMG/jbRy 6xzP2bYearM8inLHeRip8P5fLNHs2of+f7ON/r2QVJKmGHMnFGygcgkfTkMqGIBEjO/O GMTm/7WXOByUzVaAI74eW4jV9Cn73iFBNOWTLImGP9CEUUrSts14d/v53/1BHBwzWKcX p7Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bmGTNmgc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si208328pga.149.2019.06.20.11.15.39; Thu, 20 Jun 2019 11:15:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bmGTNmgc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729625AbfFTSPf (ORCPT + 99 others); Thu, 20 Jun 2019 14:15:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:44396 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729624AbfFTSPe (ORCPT ); Thu, 20 Jun 2019 14:15:34 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 05A0F2082C; Thu, 20 Jun 2019 18:15:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561054533; bh=fQMt85ABpQUQv5H4MnPX6OzQAlr02ROktdlDIMzOd6o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bmGTNmgciTG330BCL8w2VhH4o4whjTDGNuGto0wJCEv+LP6P8oqNWuJ99stUeGb1H xNIsnvlmVXvxU4yPHsq9rryGgr5/Z1HWFVUp6vT43IPUEUHscJQyV6l+jUNj543JHE U8ktk+KSIpCvwB4GxJcRXjGGRSJhOEp02Fz3U6Yc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Igor Russkikh , Dmitry Bogdanov , "David S. Miller" , Sasha Levin Subject: [PATCH 5.1 62/98] net: aquantia: fix LRO with FCS error Date: Thu, 20 Jun 2019 19:57:29 +0200 Message-Id: <20190620174352.205003505@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190620174349.443386789@linuxfoundation.org> References: <20190620174349.443386789@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ 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 Signed-off-by: Dmitry Bogdanov Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- .../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 b31dba1b1a55..ec302fdfec63 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 @@ -702,38 +702,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