Implement CHANNELS_SET netlink request to set channel counts of a network device. These are traditionally set with ETHTOOL_SCHANNELS ioctl request. Like the ioctl implementation, the generic ethtool code checks if supplied values do not exceed driver defined limits; if they do, first offending attribute is reported using extack. Checks preventing removing channels used for RX indirection table or zerocopy AF_XDP socket are also implemented. Move ethtool_get_max_rxfh_channel() helper into common.c so that it can be used by both ioctl and netlink code. v2: - fix netdev reference leak in error path (found by Jakub Kicinsky)
Showing the changes to include/uapi/linux (1 of 8 files). Show all
Unified · Split
| @@ -31,6 +31,7 @@ enum { · 30 unmodified lines | ||
| 31 | 31 | ETHTOOL_MSG_RINGS_GET, |
| 32 | 32 | ETHTOOL_MSG_RINGS_SET, |
| 33 | 33 | ETHTOOL_MSG_CHANNELS_GET, |
| 34 | + ETHTOOL_MSG_CHANNELS_SET, | |
| 34 | 35 | |
| 35 | 36 | /* add new constants above here */ |
| 36 | 37 | __ETHTOOL_MSG_USER_CNT, |