From 8e2faf945a13fc73711a5227af8a1077523b590f Mon Sep 17 00:00:00 2001 From: Lorenzo Bianconi Date: Mon, 31 Aug 2026 08:48:33 +0200 Subject: [PATCH] net: stmmac: drop the queue-0 pinning for GSO frames stmmac_select_queue() forces every GSO frame (TCPv4/TCPv6/UDP-L4) onto TX queue 0, relying on the legacy assumption that at least queue 0 is always TSO/USO capable. This is no longer needed since stmmac_features_check() already validates each GSO frame against the capabilities of the queue it is mapped to, clearing the checksum and GSO features for queues that cannot perform TSO (e.g. TBS queues or queues without TX checksum offload support). Remove stmmac_select_queue() so GSO frames are selected through the regular queue selection path (XPS, flow hashing and priority mapping) and can be spread across all TX queues. This also fixes the case where queue 0 is not TSO-capable while other queues are, which previously forced all TSO traffic into software GSO. Non-GSO traffic is unaffected, since the core already falls back to netdev_pick_tx() when ndo_select_queue is not set. Signed-off-by: Lorenzo Bianconi Link: https://patch.msgid.link/20260831-stmmac_select_queue-tso-fix-v3-1-d9c215fe7a85@oss.qualcomm.com Signed-off-by: Paolo Abeni --- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index d4ef05672aa6..5603d2cdc5c0 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -6428,24 +6428,6 @@ 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) -{ - int gso = skb_shinfo(skb)->gso_type; - - if (gso & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6 | SKB_GSO_UDP_L4)) { - /* - * There is no way to determine the number of TSO/USO - * capable Queues. Let's use always the Queue 0 - * because if TSO/USO is supported then at least this - * one will be capable. - */ - return 0; - } - - return netdev_pick_tx(dev, skb, NULL) % dev->real_num_tx_queues; -} - static int stmmac_set_mac_address(struct net_device *ndev, void *addr) { struct stmmac_priv *priv = netdev_priv(ndev); @@ -7314,7 +7296,6 @@ static const struct net_device_ops stmmac_netdev_ops = { .ndo_eth_ioctl = stmmac_ioctl, .ndo_get_stats64 = stmmac_get_stats64, .ndo_setup_tc = stmmac_setup_tc, - .ndo_select_queue = stmmac_select_queue, .ndo_set_mac_address = stmmac_set_mac_address, .ndo_vlan_rx_add_vid = stmmac_vlan_rx_add_vid, .ndo_vlan_rx_kill_vid = stmmac_vlan_rx_kill_vid,