Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp7367724yba; Thu, 2 May 2019 08:41:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqz1qQTEPWdX05jzFyEVUuyW4RBYZtNCgq12mxIn1TxE6HaGTz13y9OiVhIFRE/da/b/2Y+R X-Received: by 2002:a62:b411:: with SMTP id h17mr4868211pfn.61.1556811719123; Thu, 02 May 2019 08:41:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556811719; cv=none; d=google.com; s=arc-20160816; b=KF6k2HLPQ2OQMaG6pcH3yHUHamq98VHPP8l/4I8/OHXa2xn6oGVRKsc757C2HCT6fK 0rBUgken7zEVPpeqhqS+EQvEPBab2PXd50JR3n67HCnkYyUSoGn6A793tKu/pKDzw2WF V4y/BrVSFCBQeZsQ+Pjl5lYfYA7QRoTWCQgrGml6EunesuDJkx7ht+ztM1Qf3IeW9Ho1 nB9/W9xgya1EjE367p7uS0ZR+GecJPcAeN5QriKYVAqpb6yQnBgnv2SCYOIwphm+iyPL k6ZyLYDPC9ZxXplsGl+Ywjb04a1AR0Il+xixumGbW94kc+UkAFV6/jSrr/xrnDxjB7YH uaUw== 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=E5zKU9YAcpF1noQ4k49ouq8/n3J16cVFRkGwTUX42IA=; b=P58sv4IzSaedWXs6GcwMbkv/Pa9v++PpnvAELnqfMaopoOVGWyX/I5wMTrIm8d4Mf8 Z3L3NtubQ0eeXUSgbcwFqTK/jqJiLRW94kSnG8g/me1pr4oivC0/arJ9mEkkAR18K8lj 2MywVNH/My5tElREon90xkwRQ6cKH4CjspIjD0Pr/9yXD5KKR24DWC6xToHLqV6lKnxs /K0wtPhPw+oBfPxUKE4cxRAD+3kLgC+aMR/JP56KtvofieYSWbprmcX8X1QVST1k/u41 cZCe23ewucwrPeRTa8c9rB9qFS92mh6WFT6GOhlcHzyvEfDEKbU/YGpnHZkZx47V9/8G JHfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QXg7bq2g; 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 m3si628129pld.29.2019.05.02.08.41.44; Thu, 02 May 2019 08:41:59 -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=QXg7bq2g; 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 S1727887AbfEBP3N (ORCPT + 99 others); Thu, 2 May 2019 11:29:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:46704 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727637AbfEBP3I (ORCPT ); Thu, 2 May 2019 11:29:08 -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 AD43021734; Thu, 2 May 2019 15:29:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556810948; bh=Y4XNUNO9m72VC4aWc7ww6A/+NV1nbcXL9btbHA7Dzec=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QXg7bq2griqvieN+/iKiZlv3+trAAmuWXzNi4NWLclJo9Ce5WuLXabjcChDP7JAve dvIElUaTz5rjmX4rTz9Xh8ExWK2tcfched+65O0awEJQnK6ODLOAGUiQW37kbcua6g uFQkVjxDQhhPTjchhe4ZK0q8fGgzrTR9/kG8XbLU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aaro Koskinen , Jose Abreu , "David S. Miller" , "Sasha Levin (Microsoft)" Subject: [PATCH 5.0 018/101] net: stmmac: fix jumbo frame sending with non-linear skbs Date: Thu, 2 May 2019 17:20:20 +0200 Message-Id: <20190502143341.207733001@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190502143339.434882399@linuxfoundation.org> References: <20190502143339.434882399@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 58f2ce6f61615dfd8dd3cc01c9e5bb54ed35637e ] When sending non-linear skbs with jumbo frames, we set up the non-paged data and mark that as a last segment, although the paged fragments are also prepared. This will stall the TX queue and trigger a watchdog warning (a simple reproducer is to run an iperf client mode TCP test with a large MTU - networking fails instantly). Fix by checking if the skb is non-linear. Signed-off-by: Aaro Koskinen Acked-by: Jose Abreu Signed-off-by: David S. Miller Signed-off-by: Sasha Levin (Microsoft) --- drivers/net/ethernet/stmicro/stmmac/ring_mode.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c index afed0f0f4027..4d9bcb4d0378 100644 --- a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c +++ b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c @@ -79,7 +79,8 @@ static int jumbo_frm(void *p, struct sk_buff *skb, int csum) desc->des3 = cpu_to_le32(des2 + BUF_SIZE_4KiB); stmmac_prepare_tx_desc(priv, desc, 0, len, csum, - STMMAC_RING_MODE, 1, true, skb->len); + STMMAC_RING_MODE, 1, !skb_is_nonlinear(skb), + skb->len); } else { des2 = dma_map_single(priv->device, skb->data, nopaged_len, DMA_TO_DEVICE); @@ -91,7 +92,8 @@ static int jumbo_frm(void *p, struct sk_buff *skb, int csum) tx_q->tx_skbuff_dma[entry].is_jumbo = true; desc->des3 = cpu_to_le32(des2 + BUF_SIZE_4KiB); stmmac_prepare_tx_desc(priv, desc, 1, nopaged_len, csum, - STMMAC_RING_MODE, 0, true, skb->len); + STMMAC_RING_MODE, 0, !skb_is_nonlinear(skb), + skb->len); } tx_q->cur_tx = entry; -- 2.19.1