Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp4119528imc; Thu, 14 Mar 2019 12:47:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRexV3k9wRsf9N9RWG9mxPwpYpavrDqZLODeFft9DTlcvSYEFf55UVPCaV6TIH2waXLPfG X-Received: by 2002:a63:ef05:: with SMTP id u5mr46986999pgh.177.1552592828491; Thu, 14 Mar 2019 12:47:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552592828; cv=none; d=google.com; s=arc-20160816; b=E03BNX2EuA5X9cUbdj3P7OzE3+OYLfnNgYJZ9Cqq4IiPNV57sAIDqCrLPO051k1MuM bjHerBPg2YuNP7N4Re8t2SIJ/E4KDf55tZCTYNy1B8K/XD1uaHqXL+ani3vayMnMOztV Vto7XH5I3RumxL7sE2g+fK0wcNzriEasmdK2SeDDaqF4XLXrzuJMsXkCweXU4EEKEiYk udIJDEVhSpwTwJuu/jrjI8FepWLPEQG8cnrTc07BoukFTrOEBTnKRcDYJ4ZwQAM/+wCo OXBhDuN0x8f8mDqv4qQZAGbaoQ/bGirH5bhA2g02JZjtmzII1TMijBjB2m57MH/Velcz 0U2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=oNJKpgIDpTv2lEgmElHbF3zodUQ8XXBDBtSCs0k+b8M=; b=A/oGXqvtO/4ToMlh6YzcxJWAlE+g5xtMto8uIdqXEShi1BKT4z4oyi1rQGMOv36MOn P0XJWPp3KXllERAhRe2PmoVjEYWPSAuDUtlC0/yuwQNTML/TmoCh8GBTuAsLWRzAIE0m QH18Ml+6RUUr1t5RlSCkcQi8Si8pTG3TqA4dh0yLAg6hrSupQEoIk/d8Z9fyNxllSpae P8KKM+Iu+8UUDHEHmZFpBul5XthEdmPOVxsHj8pPr5ox7Wpnnx2lEwKWd/U+7QXzWtmL nfFupjMwIqG7JHMhqMPuOzw4qSYcAfG9hAFRiPsaM/9EHQl3hpbjNkylNmg8reBqG2U0 eJ+Q== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=iki.fi Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x19si13470739pfa.130.2019.03.14.12.46.41; Thu, 14 Mar 2019 12:47:08 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=iki.fi Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727350AbfCNTpe (ORCPT + 99 others); Thu, 14 Mar 2019 15:45:34 -0400 Received: from emh02.mail.saunalahti.fi ([62.142.5.108]:53216 "EHLO emh02.mail.saunalahti.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727034AbfCNTpd (ORCPT ); Thu, 14 Mar 2019 15:45:33 -0400 Received: from localhost.localdomain (85-76-115-153-nat.elisa-mobile.fi [85.76.115.153]) by emh02.mail.saunalahti.fi (Postfix) with ESMTP id 989ED2001E; Thu, 14 Mar 2019 21:45:31 +0200 (EET) From: Aaro Koskinen To: "David S. Miller" , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Thor Thayer , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Aaro Koskinen Subject: [PATCH 2/2] net: stmmac: fix jumbo frame sending with non-linear skbs Date: Thu, 14 Mar 2019 21:43:20 +0200 Message-Id: <20190314194320.25566-2-aaro.koskinen@iki.fi> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190314194320.25566-1-aaro.koskinen@iki.fi> References: <20190314194320.25566-1-aaro.koskinen@iki.fi> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aaro Koskinen 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 --- 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 bc83ced94e1b..f936166d8910 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.17.0