Skip to content

Commit e617790

Browse files
TaeheeYookuba-moo
authored andcommitted
net: ethtool: add ring parameter filtering
While the devmem is running, the tcp-data-split and hds-thresh configuration should not be changed. If user tries to change tcp-data-split and threshold value while the devmem is running, it fails and shows extack message. Reviewed-by: Jakub Kicinski <[email protected]> Tested-by: Stanislav Fomichev <[email protected]> Reviewed-by: Mina Almasry <[email protected]> Signed-off-by: Taehee Yoo <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent a08a5c9 commit e617790

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

net/ethtool/rings.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,19 @@ ethnl_set_rings(struct ethnl_req_info *req_info, struct genl_info *info)
252252
return -EINVAL;
253253
}
254254

255+
if (dev_get_min_mp_channel_count(dev)) {
256+
if (kernel_ringparam.tcp_data_split !=
257+
ETHTOOL_TCP_DATA_SPLIT_ENABLED) {
258+
NL_SET_ERR_MSG(info->extack,
259+
"can't disable tcp-data-split while device has memory provider enabled");
260+
return -EINVAL;
261+
} else if (kernel_ringparam.hds_thresh) {
262+
NL_SET_ERR_MSG(info->extack,
263+
"can't set non-zero hds_thresh while device is memory provider enabled");
264+
return -EINVAL;
265+
}
266+
}
267+
255268
/* ensure new ring parameters are within limits */
256269
if (ringparam.rx_pending > ringparam.rx_max_pending)
257270
err_attr = tb[ETHTOOL_A_RINGS_RX];

0 commit comments

Comments
 (0)