Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: stmmac: Drop useless code related to ethtool rx-copybreak

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>

authored by

Furong Xu and committed by
Jakub Kicinski
5c98e89d f6038d91

-46
-2
drivers/net/ethernet/stmicro/stmmac/stmmac.h
··· 126 126 unsigned int cur_rx; 127 127 unsigned int dirty_rx; 128 128 unsigned int buf_alloc_num; 129 - u32 rx_zeroc_thresh; 130 129 dma_addr_t dma_rx_phy; 131 130 u32 rx_tail_addr; 132 131 unsigned int state_saved; ··· 265 266 int sph_cap; 266 267 u32 sarc_type; 267 268 268 - unsigned int rx_copybreak; 269 269 u32 rx_riwt[MTL_MAX_TX_QUEUES]; 270 270 int hwts_rx_en; 271 271
-39
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
··· 1227 1227 return ethtool_op_get_ts_info(dev, info); 1228 1228 } 1229 1229 1230 - static int stmmac_get_tunable(struct net_device *dev, 1231 - const struct ethtool_tunable *tuna, void *data) 1232 - { 1233 - struct stmmac_priv *priv = netdev_priv(dev); 1234 - int ret = 0; 1235 - 1236 - switch (tuna->id) { 1237 - case ETHTOOL_RX_COPYBREAK: 1238 - *(u32 *)data = priv->rx_copybreak; 1239 - break; 1240 - default: 1241 - ret = -EINVAL; 1242 - break; 1243 - } 1244 - 1245 - return ret; 1246 - } 1247 - 1248 - static int stmmac_set_tunable(struct net_device *dev, 1249 - const struct ethtool_tunable *tuna, 1250 - const void *data) 1251 - { 1252 - struct stmmac_priv *priv = netdev_priv(dev); 1253 - int ret = 0; 1254 - 1255 - switch (tuna->id) { 1256 - case ETHTOOL_RX_COPYBREAK: 1257 - priv->rx_copybreak = *(u32 *)data; 1258 - break; 1259 - default: 1260 - ret = -EINVAL; 1261 - break; 1262 - } 1263 - 1264 - return ret; 1265 - } 1266 - 1267 1230 static int stmmac_get_mm(struct net_device *ndev, 1268 1231 struct ethtool_mm_state *state) 1269 1232 { ··· 1353 1390 .set_per_queue_coalesce = stmmac_set_per_queue_coalesce, 1354 1391 .get_channels = stmmac_get_channels, 1355 1392 .set_channels = stmmac_set_channels, 1356 - .get_tunable = stmmac_get_tunable, 1357 - .set_tunable = stmmac_set_tunable, 1358 1393 .get_link_ksettings = stmmac_ethtool_get_link_ksettings, 1359 1394 .set_link_ksettings = stmmac_ethtool_set_link_ksettings, 1360 1395 .get_mm = stmmac_get_mm,
-5
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 77 77 MODULE_PARM_DESC(phyaddr, "Physical device address"); 78 78 79 79 #define STMMAC_TX_THRESH(x) ((x)->dma_conf.dma_tx_size / 4) 80 - #define STMMAC_RX_THRESH(x) ((x)->dma_conf.dma_rx_size / 4) 81 80 82 81 /* Limit to make sure XDP TX and slow path can coexist */ 83 82 #define STMMAC_XSK_TX_BUDGET_MAX 256 ··· 105 106 static int buf_sz = DEFAULT_BUFSIZE; 106 107 module_param(buf_sz, int, 0644); 107 108 MODULE_PARM_DESC(buf_sz, "DMA buffer size"); 108 - 109 - #define STMMAC_RX_COPYBREAK 256 110 109 111 110 static const u32 default_msg_level = (NETIF_MSG_DRV | NETIF_MSG_PROBE | 112 111 NETIF_MSG_LINK | NETIF_MSG_IFUP | ··· 3923 3926 goto init_phy_error; 3924 3927 } 3925 3928 } 3926 - 3927 - priv->rx_copybreak = STMMAC_RX_COPYBREAK; 3928 3929 3929 3930 buf_sz = dma_conf->dma_buf_sz; 3930 3931 for (int i = 0; i < MTL_MAX_TX_QUEUES; i++)