Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3839942pxv; Mon, 28 Jun 2021 14:21:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHyORu7npwv+QY1PX3uKvJpri+qEk9ehaX3CDPULrM6wJcaiTQGTM+xdmzeHOGsBWxEdOR X-Received: by 2002:a6b:8f8d:: with SMTP id r135mr1187327iod.67.1624915315038; Mon, 28 Jun 2021 14:21:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624915315; cv=none; d=google.com; s=arc-20160816; b=e2KZiy+PBuzD+wGiSkHSXIkEOxx6NoJHKAmd4vMAK0UXjZCskkxNsxFDJsuACck562 REx9k+fUp1NAZZiw9xFRnCDu12eWrCwrSSs4ByCwJz+MXbkB4Rhd7pbGxhem8OtVgQWa 9HCmIMh0J+vhfnZKP5mLfpDSy3+NDs3di993FZEs2a0DUgkcAAisQewmSWNQIp+uLMSZ WR4/3LkmwmP9+NoVbmPWjad6Ot4X2hLzMQHValaXHJoCSsKDgvTEhQm7O9Djzd1mMsMj cO7NGgG2OzVf+7cBeuP06aD328V0j/irNUXWNpd5e+USoYM4owyhDfAh5oL+QvYEPpST QpBQ== 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=5XPmRpG+6m0SivCeK4DG9VjrH5e09sOojzfnYGKgO38=; b=vj8+6C9mZMX95LFPvePaRrrfe8JGyTcjkWG9J2b4Jw0cMJODK+LxG+Mslm1p/LOjXS CtbMJnswidHz5JGzJ+zrX8L9WRNa66EOKmlgPeQPScWUksg7X7cHwaKEwi30r3Y/cyT2 p5DT8X3rZSn+9jAp9+l6py56vrWxqdJucD6+pYiTEaBO3RJXsMaQrfI+a0JpiFXg23RZ OB0CPcT5MTkWEy8hj0oPXRItZgXUNilNAst++s2UT5dnI0AInygHzWr4u2KRslA4dsYA 7I4/pQmY1/pTqMDLFOd4pt3eU4GCHZDrc5ArMFoJcn9iaCq07Tu7Y3Rbg8QVGrupN7pW y0Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KKgiJO2B; 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 o192si9560426jao.55.2021.06.28.14.21.41; Mon, 28 Jun 2021 14:21: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=KKgiJO2B; 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 S237817AbhF1P0C (ORCPT + 99 others); Mon, 28 Jun 2021 11:26:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:36468 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236380AbhF1PCN (ORCPT ); Mon, 28 Jun 2021 11:02:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E990C61D7A; Mon, 28 Jun 2021 14:41:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624891263; bh=lvFlG8+judcj9sNrUT0sHgsSwhWp2Q59TCC2ubJC0uY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KKgiJO2Bi6GhKuDKsaqXYVi6L+jCb1jYApr1Dq2xGWD57Or3MS62nebIJjY6AWYwD GiI4jlsKSwt0ZwMM5XS5jM7INkJICFFUJUsbfYw0nybyF8Dl/Z8Bzaqg9BMg4OAyni frDMiaXg+sgWIv23PO9DTAQwGtL67oc7E1AwuBytpFS/5BR5uRPaP+jdwDAQQUiIHA /a7MA59YIFCA/D2ESl+aq5+Y+Da0B1WxqIUvjPMR6BaRln7/nMu3eVO3P5x+G8Y2NX zCcLo3BYmzN469+0zElAvkZyWyFWrH65YEVFXCQYs69mHDh2CPxAfQrAzsq+HGeX5A s1EdfBt/8M5tw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Esben Haabendal , "David S . Miller" , Sasha Levin Subject: [PATCH 4.9 68/71] net: ll_temac: Avoid ndo_start_xmit returning NETDEV_TX_BUSY Date: Mon, 28 Jun 2021 10:40:00 -0400 Message-Id: <20210628144003.34260-69-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210628144003.34260-1-sashal@kernel.org> References: <20210628144003.34260-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.274-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-4.9.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.9.274-rc1 X-KernelTest-Deadline: 2021-06-30T14:39+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 545f60877bb7..9ba36c930ce3 100644 --- a/drivers/net/ethernet/xilinx/ll_temac_main.c +++ b/drivers/net/ethernet/xilinx/ll_temac_main.c @@ -735,6 +735,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