Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp135522pxy; Wed, 21 Apr 2021 21:15:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFNv2qrjW5BH+BlaeBaOoGYVKqpzULg20MuW5v5TAQ7aOleaDYL9cTcMqz6rMxrj25enen X-Received: by 2002:a50:e848:: with SMTP id k8mr1290010edn.179.1619064943646; Wed, 21 Apr 2021 21:15:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619064943; cv=none; d=google.com; s=arc-20160816; b=zIQPdpbUt4AiHzz4n7sY/qngQbMHy9ftU6liBTJdF3KXw4DPanCCC2SIdnaCQII593 J0gLVuAacAieUZ0k9ZWMbQsAG6vZ3gGKfJIGrIDzAmePQeQ6RllGfyEeE4QCg+L38eZa 1DQf0ElL/0fDAcckNMtelIZb1w0N8CcoOXWJ6DDwpxXH/RX3Ds+kMahCPVSdrNVIykLE ZZu7alAKgzpZtWA4JO87O1c7DPweSNSHEzIGxWWjvmlQHHS6we3HhpEy7JtQlp9msOTU wtYszTXTMgx2Y4qIllsfdj6/P4IZm0PmdxAm3GIie/EJj6sH8BQrhPeJfjRGS330SVsQ SBOQ== 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=mpHFvhVstRat21oM0gV+xZuTGkFLULz7ukrF5iEyIK0=; b=YERtaTmE2J+1J/wMNUsoFEQBIBe9dkzFYumqtn1YsN4N0s8FZTbWTY/UQWsoXfFo83 d0PjpOkHUpkiy5zMAt/1TSnoYvFCZoTOpf1QgwpT8mru35LJ8hG4FPgjVS1HDAGy6Gdl AG8SsOUpdDRIWatxod7pCkjVQFZYpTJ0jzoiqYoIj7EFsPQ7xGwkNy6R5hKqiaDY/x/4 vvctSjHLgvWIFFFM1tIZwlSQ4UfKSCxV5b9UmV73BXUC4X5f9e7ff3R4RdqlNKgkknmA IOdWsZ4Re5L+lm7OdGDDIV322ejJIwBVqpThyNYdofeV5yKenxDBA5TWDkpgRF2Enbge UJsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PnrB1ws8; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t20si1052497edq.484.2021.04.21.21.15.19; Wed, 21 Apr 2021 21:15:43 -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=@gmail.com header.s=20161025 header.b=PnrB1ws8; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234941AbhDVEKh (ORCPT + 99 others); Thu, 22 Apr 2021 00:10:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231539AbhDVEKS (ORCPT ); Thu, 22 Apr 2021 00:10:18 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C38D9C06138C; Wed, 21 Apr 2021 21:09:42 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id lr7so4455537pjb.2; Wed, 21 Apr 2021 21:09:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mpHFvhVstRat21oM0gV+xZuTGkFLULz7ukrF5iEyIK0=; b=PnrB1ws8mNHmD5BVxLJuU6qLG9r7t5ta+3Ni6Wf3OeJnmyznhMtLE3gvDqHKIyHkVz KdG5FCaNorsqk+1Lk26cuTsNMI2MEhAdWhk07+ul4DTUwNQIjuPXiNJ5lmqRz3wiRZ6P SJziggGOJFWqmfJNEqZA0C57yQo5uqc7ZfWoIQ0yufqd9CRGlCH7kAVioi9Nc3PIscMF LLqL8egeN2TpZymJgpf99bfY/UytmdTb0Zi8ai/AJEprzxMyxcvEC/ny3HqJQzO0PBIY ZfU9gTgUcfaamT1VNm4MbmmgoviZP4BSiYh4WS2J6YQyD9YuIhdV2ps0Kl5Scnb75Gin 92bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mpHFvhVstRat21oM0gV+xZuTGkFLULz7ukrF5iEyIK0=; b=b44MNQiZvGua9/0RWdqrOOkzmUNKysE6l5E4NyI3PpS+jOsB1ZmsyQ1KIswGQzO6w0 nlCuSw5w/dsKd33TaHwaj4MY6a2b8Zm0m02nos3Wdq815sy3W0EaHJ+adnwqY5AJx9W2 YQYm6z/Fy3BtCqtQiAUI/oWNQBp6TkjOOz1jIZ8KhnjI7+QGooYu2vJ7SqH6kAX7bPfd kQanWUUMla1IUlbuiNeYqOzfUcbnW0OjlKnR7eiW6eMbrcXZ8fcr3V5Duqo5EhQKeTxj ia0aB+QShEypFj7wpRdPzTwDv+aIVupub7RX5oKYe6sm6Jl1x6iDzgDXzWoXqBHFCLDh BmFw== X-Gm-Message-State: AOAM531aPFxCiii3fRnJlaDoyENLr7gV00I5QEmzPSDkvoCxfFxHZ+FR D8jTVn5Y6jzJAoY5KOPQpAo= X-Received: by 2002:a17:902:b18f:b029:ec:7ac0:fd1a with SMTP id s15-20020a170902b18fb02900ec7ac0fd1amr1414045plr.84.1619064582317; Wed, 21 Apr 2021 21:09:42 -0700 (PDT) Received: from z640-arch.lan ([2602:61:7344:f100::678]) by smtp.gmail.com with ESMTPSA id i17sm635354pfd.84.2021.04.21.21.09.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Apr 2021 21:09:42 -0700 (PDT) From: Ilya Lipnitskiy To: Felix Fietkau , John Crispin , Sean Wang , Mark Lee , "David S. Miller" , Jakub Kicinski , Matthias Brugger , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: Ilya Lipnitskiy Subject: [PATCH net-next 06/14] net: ethernet: mtk_eth_soc: remove unnecessary TX queue stops Date: Wed, 21 Apr 2021 21:09:06 -0700 Message-Id: <20210422040914.47788-7-ilya.lipnitskiy@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210422040914.47788-1-ilya.lipnitskiy@gmail.com> References: <20210422040914.47788-1-ilya.lipnitskiy@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Felix Fietkau When running short on descriptors, only stop the queue for the netdev that tx was attempted for. By the time something tries to send on the other netdev, the ring might have some more room already. Signed-off-by: Felix Fietkau Signed-off-by: Ilya Lipnitskiy --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index a3958e99a29f..223131645a37 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -1129,17 +1129,6 @@ static void mtk_wake_queue(struct mtk_eth *eth) } } -static void mtk_stop_queue(struct mtk_eth *eth) -{ - int i; - - for (i = 0; i < MTK_MAC_COUNT; i++) { - if (!eth->netdev[i]) - continue; - netif_stop_queue(eth->netdev[i]); - } -} - static netdev_tx_t mtk_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct mtk_mac *mac = netdev_priv(dev); @@ -1160,7 +1149,7 @@ static netdev_tx_t mtk_start_xmit(struct sk_buff *skb, struct net_device *dev) tx_num = mtk_cal_txd_req(skb); if (unlikely(atomic_read(&ring->free_count) <= tx_num)) { - mtk_stop_queue(eth); + netif_stop_queue(dev); netif_err(eth, tx_queued, dev, "Tx Ring full when queue awake!\n"); spin_unlock(ð->page_lock); @@ -1186,7 +1175,7 @@ static netdev_tx_t mtk_start_xmit(struct sk_buff *skb, struct net_device *dev) goto drop; if (unlikely(atomic_read(&ring->free_count) <= ring->thresh)) - mtk_stop_queue(eth); + netif_stop_queue(dev); spin_unlock(ð->page_lock); -- 2.31.1