Skip to content

Commit 5c98e89

Browse files
Furong Xukuba-moo
authored andcommitted
net: stmmac: Drop useless code related to ethtool rx-copybreak
After commit 2af6106 ("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 22ad383 ("stmmac: do not perform zero-copy for rx frames") Signed-off-by: Furong Xu <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent f6038d9 commit 5c98e89

File tree

3 files changed

+0
-46
lines changed

3 files changed

+0
-46
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ struct stmmac_rx_queue {
126126
unsigned int cur_rx;
127127
unsigned int dirty_rx;
128128
unsigned int buf_alloc_num;
129-
u32 rx_zeroc_thresh;
130129
dma_addr_t dma_rx_phy;
131130
u32 rx_tail_addr;
132131
unsigned int state_saved;
@@ -266,7 +265,6 @@ struct stmmac_priv {
266265
int sph_cap;
267266
u32 sarc_type;
268267

269-
unsigned int rx_copybreak;
270268
u32 rx_riwt[MTL_MAX_TX_QUEUES];
271269
int hwts_rx_en;
272270

drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,43 +1227,6 @@ static int stmmac_get_ts_info(struct net_device *dev,
12271227
return ethtool_op_get_ts_info(dev, info);
12281228
}
12291229

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-
12671230
static int stmmac_get_mm(struct net_device *ndev,
12681231
struct ethtool_mm_state *state)
12691232
{
@@ -1390,8 +1353,6 @@ static const struct ethtool_ops stmmac_ethtool_ops = {
13901353
.set_per_queue_coalesce = stmmac_set_per_queue_coalesce,
13911354
.get_channels = stmmac_get_channels,
13921355
.set_channels = stmmac_set_channels,
1393-
.get_tunable = stmmac_get_tunable,
1394-
.set_tunable = stmmac_set_tunable,
13951356
.get_link_ksettings = stmmac_ethtool_get_link_ksettings,
13961357
.set_link_ksettings = stmmac_ethtool_set_link_ksettings,
13971358
.get_mm = stmmac_get_mm,

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ module_param(phyaddr, int, 0444);
7777
MODULE_PARM_DESC(phyaddr, "Physical device address");
7878

7979
#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)
8180

8281
/* Limit to make sure XDP TX and slow path can coexist */
8382
#define STMMAC_XSK_TX_BUDGET_MAX 256
@@ -107,8 +106,6 @@ static int buf_sz = DEFAULT_BUFSIZE;
107106
module_param(buf_sz, int, 0644);
108107
MODULE_PARM_DESC(buf_sz, "DMA buffer size");
109108

110-
#define STMMAC_RX_COPYBREAK 256
111-
112109
static const u32 default_msg_level = (NETIF_MSG_DRV | NETIF_MSG_PROBE |
113110
NETIF_MSG_LINK | NETIF_MSG_IFUP |
114111
NETIF_MSG_IFDOWN | NETIF_MSG_TIMER);
@@ -3927,8 +3924,6 @@ static int __stmmac_open(struct net_device *dev,
39273924
}
39283925
}
39293926

3930-
priv->rx_copybreak = STMMAC_RX_COPYBREAK;
3931-
39323927
buf_sz = dma_conf->dma_buf_sz;
39333928
for (int i = 0; i < MTL_MAX_TX_QUEUES; i++)
39343929
if (priv->dma_conf.tx_queue[i].tbs & STMMAC_TBS_EN)

0 commit comments

Comments
 (0)