Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3818442pxv; Mon, 28 Jun 2021 13:42:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6CgJPGtq3uOcm14eQe41kyxqVcnilYZmfixL2PwS+s8r117ldnVBbsAnILQmU4TMC4/gb X-Received: by 2002:a92:360e:: with SMTP id d14mr19567836ila.106.1624912975068; Mon, 28 Jun 2021 13:42:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624912975; cv=none; d=google.com; s=arc-20160816; b=M16RscCj6vO7UybuBsgxIc1Lrfe22X3gVQc+iLZNq2qu2JWzDtQj3i37DRen/QPhdo PQRCu0AXNU78kgju5Tfll0RIh7sRAlybf9frsW0IZI2g6PpgnDYSgSEwLpwqEXZ8/hJz +ScqvNK0K9aOp48LzeWRgrL9ogNXwBa6HVnHcm4ND8Sh75rBNlNCd5gJazZjYQzeXq16 DJXnf6/HjkvDlMUicPxPlylN5cKjDNlWIe2vDhnvqGCid+fU9q+d00QhZTqswt//tRb+ /CBcZ0wx/e1BhurWwX6EX9z7k+GVAuluZfs//530uWMTAjOWFaFGTvsuL2SEnz2R3BiS bi7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=q4oTnDFeJ4bghyOKZWBFpH0S4lMjSDaZr8bG6ur7QTE=; b=FULpMA/xd+cBszvNffZRsjC49PfFM1R6T0D/sdHUsu3mBdhyUMrYzGaQgMzoKp7lG7 dcM1m2G2aoOrOEikqyUdP4wub4GqDyi4awFxZKAzsvEOllvx+JfypvdHPsVLpk+owwBy EaXNcv+a5qUWYyt43JASt+NoRbQRj7wENkus/Y0zM79J9O4oXA4D6xZETiiOvc2N/QnL XB1jZd2umvy1djw2OzXOMTFEDaxDAwbquQ+kiR66nolT4FYyD/giVvu8HWcLieUj1aqo A0xMAbIajdUoPtAhIH+x7+P/stANeyNSUC/cViV3kA4IvvW8CcnBEVhJJkAY2uT+ie6b s07Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="lbO/NO1w"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n1si20372301ilt.140.2021.06.28.13.42.42; Mon, 28 Jun 2021 13:42:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="lbO/NO1w"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232975AbhF1PRS (ORCPT + 99 others); Mon, 28 Jun 2021 11:17:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:60248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236283AbhF1OzO (ORCPT ); Mon, 28 Jun 2021 10:55:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9270661CBF; Mon, 28 Jun 2021 14:37:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624891062; bh=Jqt3hR+Jp41pR6IvveiJL44RhOEw7yUt+5UF1OyRxm4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lbO/NO1wZjQkSr/xZDk5MHOXF6sHhXCK+iyG11fumhH6x3z7PlPN0QYpePpYs6cca 41g+j/92mHyPSy3EmjXB2aGV0LFpTIK2BFtY930ROoeLx8bjgsEm2jYrh+LeqRnQZ/ HMbzMdeYJXvg4pjPGhE+RvzS0lv2zoUQ/sV+lz76hPzPqP54UuNE5z7OunSPD41WL7 BInJE6fSU8bjRZ5v74XLXUS/cBGXmEigGGxUFKUJZByqmMEdrJjepo4J6Wtxo9kpn6 0bud/rBq04Si7rU001AR8yhwBt5m87dnjpP8H3ubM+fC/6v/dGUDk/Z7y0PdxkX6ky YLxhgulXClS9Q== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Esben Haabendal , "David S . Miller" , Sasha Levin Subject: [PATCH 4.14 84/88] net: ll_temac: Avoid ndo_start_xmit returning NETDEV_TX_BUSY Date: Mon, 28 Jun 2021 10:36:24 -0400 Message-Id: <20210628143628.33342-85-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210628143628.33342-1-sashal@kernel.org> References: <20210628143628.33342-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.14.238-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-4.14.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.14.238-rc1 X-KernelTest-Deadline: 2021-06-30T14:36+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Esben Haabendal [ Upstream commit f6396341194234e9b01cd7538bc2c6ac4501ab14 ] As documented in Documentation/networking/driver.rst, the ndo_start_xmit method must not return NETDEV_TX_BUSY under any normal circumstances, and as recommended, we simply stop the tx queue in advance, when there is a risk that the next xmit would cause a NETDEV_TX_BUSY return. Signed-off-by: Esben Haabendal Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/xilinx/ll_temac_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c index 2241f9897092..939de185bc6b 100644 --- a/drivers/net/ethernet/xilinx/ll_temac_main.c +++ b/drivers/net/ethernet/xilinx/ll_temac_main.c @@ -736,6 +736,11 @@ temac_start_xmit(struct sk_buff *skb, struct net_device *ndev) /* Kick off the transfer */ lp->dma_out(lp, TX_TAILDESC_PTR, tail_p); /* DMA start */ + if (temac_check_tx_bd_space(lp, MAX_SKB_FRAGS + 1)) { + netdev_info(ndev, "%s -> netif_stop_queue\n", __func__); + netif_stop_queue(ndev); + } + return NETDEV_TX_OK; } -- 2.30.2