From: planck kernel size experiment Subject: net: sysctl and sysfs without the removed ethtool, RSS key and TCP ULP 070 (ethtool), 170 (TCP ULP) and the flow-dissector removal take out code that three procfs/sysfs files still call: /proc/sys/net/core/netdev_rss_key, /proc/sys/net/ipv4/tcp_available_ulp, and the speed and duplex attributes in /sys/class/net//. A box without PROC_SYSCTL and SYSFS (the svn box, the log box) never compiles those files; a box that needs both (the NAS box: ZFS registers its tunables through sysctl, zpool reads /sys/block) failed to link. The two sysctl entries go with their handlers; speed and duplex answer -EINVAL, as for a NIC without link settings. diff -u -r a/net/core/net-sysfs.c b/net/core/net-sysfs.c --- a/net/core/net-sysfs.c 2026-10-05 08:00:17.953817593 +0200 +++ b/net/core/net-sysfs.c 2026-10-05 08:00:17.960817538 +0200 @@ -338,70 +338,14 @@ static ssize_t speed_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct net_device *netdev = to_net_dev(dev); - int ret = -EINVAL; - - /* The check is also done in __ethtool_get_link_ksettings; this helps - * returning early without hitting the locking section below. - */ - if (!netdev->ethtool_ops->get_link_ksettings) - return ret; - - ret = sysfs_rtnl_lock(&dev->kobj, &attr->attr, netdev); - if (ret) - return ret; - - ret = -EINVAL; - if (netif_running(netdev)) { - struct ethtool_link_ksettings cmd; - - if (!__ethtool_get_link_ksettings(netdev, &cmd)) - ret = sysfs_emit(buf, fmt_dec, cmd.base.speed); - } - rtnl_unlock(); - return ret; + return -EINVAL; /* planck: ethtool is removed, no link settings to report */ } static DEVICE_ATTR_RO(speed); static ssize_t duplex_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct net_device *netdev = to_net_dev(dev); - int ret = -EINVAL; - - /* The check is also done in __ethtool_get_link_ksettings; this helps - * returning early without hitting the locking section below. - */ - if (!netdev->ethtool_ops->get_link_ksettings) - return ret; - - ret = sysfs_rtnl_lock(&dev->kobj, &attr->attr, netdev); - if (ret) - return ret; - - ret = -EINVAL; - if (netif_running(netdev)) { - struct ethtool_link_ksettings cmd; - - if (!__ethtool_get_link_ksettings(netdev, &cmd)) { - const char *duplex; - - switch (cmd.base.duplex) { - case DUPLEX_HALF: - duplex = "half"; - break; - case DUPLEX_FULL: - duplex = "full"; - break; - default: - duplex = "unknown"; - break; - } - ret = sysfs_emit(buf, "%s\n", duplex); - } - } - rtnl_unlock(); - return ret; + return -EINVAL; /* planck: ethtool is removed, no link settings to report */ } static DEVICE_ATTR_RO(duplex); diff -u -r a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c --- a/net/core/sysctl_net_core.c 2026-10-05 08:00:17.953817593 +0200 +++ b/net/core/sysctl_net_core.c 2026-10-05 08:00:17.959817546 +0200 @@ -322,18 +322,6 @@ return ret; } -static int proc_do_rss_key(const struct ctl_table *table, int write, - void *buffer, size_t *lenp, loff_t *ppos) -{ - struct ctl_table fake_table; - char buf[NETDEV_RSS_KEY_LEN * 3]; - - snprintf(buf, sizeof(buf), "%*phC", NETDEV_RSS_KEY_LEN, netdev_rss_key); - fake_table.data = buf; - fake_table.maxlen = sizeof(buf); - return proc_dostring(&fake_table, write, buffer, lenp, ppos); -} - #ifdef CONFIG_BPF_JIT static int proc_dointvec_minmax_bpf_enable(const struct ctl_table *table, int write, void *buffer, size_t *lenp, @@ -436,13 +424,6 @@ .mode = 0644, .proc_handler = proc_dointvec }, - { - .procname = "netdev_rss_key", - .data = &netdev_rss_key, - .maxlen = sizeof(int), - .mode = 0444, - .proc_handler = proc_do_rss_key, - }, #ifdef CONFIG_BPF_JIT { .procname = "bpf_jit_enable", diff -u -r a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c --- a/net/ipv4/sysctl_net_ipv4.c 2026-10-05 08:00:17.955817577 +0200 +++ b/net/ipv4/sysctl_net_ipv4.c 2026-10-05 08:00:28.135738965 +0200 @@ -374,23 +374,6 @@ return ret; } -static int proc_tcp_available_ulp(const struct ctl_table *ctl, - int write, void *buffer, size_t *lenp, - loff_t *ppos) -{ - struct ctl_table tbl = { .maxlen = TCP_ULP_BUF_MAX, }; - int ret; - - tbl.data = kmalloc(tbl.maxlen, GFP_USER); - if (!tbl.data) - return -ENOMEM; - tcp_get_available_ulp(tbl.data, TCP_ULP_BUF_MAX); - ret = proc_dostring(&tbl, write, buffer, lenp, ppos); - kfree(tbl.data); - - return ret; -} - static int proc_tcp_ehash_entries(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { @@ -601,12 +584,6 @@ }, #endif /* CONFIG_NETLABEL */ { - .procname = "tcp_available_ulp", - .maxlen = TCP_ULP_BUF_MAX, - .mode = 0444, - .proc_handler = proc_tcp_available_ulp, - }, - { .procname = "udp_mem", .data = &sysctl_udp_mem, .maxlen = sizeof(sysctl_udp_mem),