[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <5b0d7b0b9f454af94cf8ee334763cb871fb838d1.1691047285.git.chenfeiyang@loongson.cn>
Date: Thu, 3 Aug 2023 19:30:36 +0800
From: Feiyang Chen <chenfeiyang@...ngson.cn>
To: andrew@...n.ch,
hkallweit1@...il.com,
peppe.cavallaro@...com,
alexandre.torgue@...s.st.com,
joabreu@...opsys.com,
chenhuacai@...ngson.cn
Cc: Feiyang Chen <chenfeiyang@...ngson.cn>,
linux@...linux.org.uk,
dongbiao@...ngson.cn,
loongson-kernel@...ts.loongnix.cn,
netdev@...r.kernel.org,
loongarch@...ts.linux.dev,
chris.chenfeiyang@...il.com
Subject: [PATCH v3 15/16] net: stmmac: dwmac-loongson: Use single queue for GMAC
GMAC should use single queue, so add use_single_queue flag for it.
Signed-off-by: Feiyang Chen <chenfeiyang@...ngson.cn>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | 1 +
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +++-
include/linux/stmmac.h | 1 +
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
index 40eddadd0bd2..d3ade3ae9014 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
@@ -96,6 +96,7 @@ static int loongson_gmac_config(struct pci_dev *pdev,
plat->dma_reset_times = 5;
plat->disable_flow_control = true;
+ plat->use_single_queue = true;
return 0;
}
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 65ee5a681dcf..692f41a7a175 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -6063,9 +6063,11 @@ static int stmmac_setup_tc(struct net_device *ndev, enum tc_setup_type type,
static u16 stmmac_select_queue(struct net_device *dev, struct sk_buff *skb,
struct net_device *sb_dev)
{
+ struct stmmac_priv *priv = netdev_priv(dev);
int gso = skb_shinfo(skb)->gso_type;
- if (gso & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6 | SKB_GSO_UDP_L4)) {
+ if ((gso & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6 | SKB_GSO_UDP_L4)) ||
+ priv->plat->use_single_queue) {
/*
* There is no way to determine the number of TSO/USO
* capable Queues. Let's use always the Queue 0
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 07570d808edb..9afee011839a 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -361,5 +361,6 @@ struct plat_stmmacenet_data {
u32 control_value;
u32 irq_flags;
bool disable_flow_control;
+ bool use_single_queue;
};
#endif
--
2.39.3
Powered by blists - more mailing lists