]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: stmmac: Drop useless code related to ethtool rx-copybreak
authorFurong Xu <0x1207@gmail.com>
Wed, 18 Dec 2024 08:34:07 +0000 (16:34 +0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 20 Dec 2024 03:14:01 +0000 (19:14 -0800)
After commit 2af6106ae949 ("net: stmmac: Introducing support for Page
Pool"), the driver always copies frames to get a better performance,
zero-copy for RX frames is no more, then these code turned to be
useless and users of ethtool may get confused about the unhandled
rx-copybreak parameter.

This patch mostly reverts
commit 22ad38381547 ("stmmac: do not perform zero-copy for rx frames")

Signed-off-by: Furong Xu <0x1207@gmail.com>
Link: https://patch.msgid.link/20241218083407.390509-1-0x1207@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac.h
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 1d86439b8a14f99a3fb1c954ee1ca041e868a71c..b8d631e559c0eea7de72ee7d4516f49a676c3015 100644 (file)
@@ -126,7 +126,6 @@ struct stmmac_rx_queue {
        unsigned int cur_rx;
        unsigned int dirty_rx;
        unsigned int buf_alloc_num;
-       u32 rx_zeroc_thresh;
        dma_addr_t dma_rx_phy;
        u32 rx_tail_addr;
        unsigned int state_saved;
@@ -266,7 +265,6 @@ struct stmmac_priv {
        int sph_cap;
        u32 sarc_type;
 
-       unsigned int rx_copybreak;
        u32 rx_riwt[MTL_MAX_TX_QUEUES];
        int hwts_rx_en;
 
index 1d77389ce95332ac83f9f9aa57768d465931ee2f..16b4d8c21c905738f4544ad2ea791bda0d88f508 100644 (file)
@@ -1227,43 +1227,6 @@ static int stmmac_get_ts_info(struct net_device *dev,
                return ethtool_op_get_ts_info(dev, info);
 }
 
-static int stmmac_get_tunable(struct net_device *dev,
-                             const struct ethtool_tunable *tuna, void *data)
-{
-       struct stmmac_priv *priv = netdev_priv(dev);
-       int ret = 0;
-
-       switch (tuna->id) {
-       case ETHTOOL_RX_COPYBREAK:
-               *(u32 *)data = priv->rx_copybreak;
-               break;
-       default:
-               ret = -EINVAL;
-               break;
-       }
-
-       return ret;
-}
-
-static int stmmac_set_tunable(struct net_device *dev,
-                             const struct ethtool_tunable *tuna,
-                             const void *data)
-{
-       struct stmmac_priv *priv = netdev_priv(dev);
-       int ret = 0;
-
-       switch (tuna->id) {
-       case ETHTOOL_RX_COPYBREAK:
-               priv->rx_copybreak = *(u32 *)data;
-               break;
-       default:
-               ret = -EINVAL;
-               break;
-       }
-
-       return ret;
-}
-
 static int stmmac_get_mm(struct net_device *ndev,
                         struct ethtool_mm_state *state)
 {
@@ -1390,8 +1353,6 @@ static const struct ethtool_ops stmmac_ethtool_ops = {
        .set_per_queue_coalesce = stmmac_set_per_queue_coalesce,
        .get_channels = stmmac_get_channels,
        .set_channels = stmmac_set_channels,
-       .get_tunable = stmmac_get_tunable,
-       .set_tunable = stmmac_set_tunable,
        .get_link_ksettings = stmmac_ethtool_get_link_ksettings,
        .set_link_ksettings = stmmac_ethtool_set_link_ksettings,
        .get_mm = stmmac_get_mm,
index 16b8bcfa8b111bfca72fa231ef7fbcc96358ba58..6bc10ffe7a2bca00d30faa9c0eaacda1d10b335f 100644 (file)
@@ -77,7 +77,6 @@ module_param(phyaddr, int, 0444);
 MODULE_PARM_DESC(phyaddr, "Physical device address");
 
 #define STMMAC_TX_THRESH(x)    ((x)->dma_conf.dma_tx_size / 4)
-#define STMMAC_RX_THRESH(x)    ((x)->dma_conf.dma_rx_size / 4)
 
 /* Limit to make sure XDP TX and slow path can coexist */
 #define STMMAC_XSK_TX_BUDGET_MAX       256
@@ -107,8 +106,6 @@ static int buf_sz = DEFAULT_BUFSIZE;
 module_param(buf_sz, int, 0644);
 MODULE_PARM_DESC(buf_sz, "DMA buffer size");
 
-#define        STMMAC_RX_COPYBREAK     256
-
 static const u32 default_msg_level = (NETIF_MSG_DRV | NETIF_MSG_PROBE |
                                      NETIF_MSG_LINK | NETIF_MSG_IFUP |
                                      NETIF_MSG_IFDOWN | NETIF_MSG_TIMER);
@@ -3927,8 +3924,6 @@ static int __stmmac_open(struct net_device *dev,
                }
        }
 
-       priv->rx_copybreak = STMMAC_RX_COPYBREAK;
-
        buf_sz = dma_conf->dma_buf_sz;
        for (int i = 0; i < MTL_MAX_TX_QUEUES; i++)
                if (priv->dma_conf.tx_queue[i].tbs & STMMAC_TBS_EN)