diff mbox series

[v3,15/16] net: stmmac: dwmac-loongson: Use single queue for GMAC

Message ID 5b0d7b0b9f454af94cf8ee334763cb871fb838d1.1691047285.git.chenfeiyang@loongson.cn (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series stmmac: Add Loongson platform support | expand

Checks

Context Check Description
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Feiyang Chen Aug. 3, 2023, 11:30 a.m. UTC
GMAC should use single queue, so add use_single_queue flag for it.

Signed-off-by: Feiyang Chen <chenfeiyang@loongson.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 mbox series

Patch

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