mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
net: core: Add ethool config option
Add this config option to reduce memory usage, if it was not necessary. ./ksize.sh net before size: 739668 Bytes after size: 716596 Bytes save size: 23073 Bytes Signed-off-by: David Wu <david.wu@rock-chips.com> Change-Id: I3e3c515f6b88d2ebf04cb8976d061591caca201e
This commit is contained in:
@@ -161,6 +161,7 @@ struct ethtool_link_ksettings {
|
||||
#define ethtool_link_ksettings_test_link_mode(ptr, name, mode) \
|
||||
test_bit(ETHTOOL_LINK_MODE_ ## mode ## _BIT, (ptr)->link_modes.name)
|
||||
|
||||
#ifdef CONFIG_ETHTOOL
|
||||
extern int
|
||||
__ethtool_get_link_ksettings(struct net_device *dev,
|
||||
struct ethtool_link_ksettings *link_ksettings);
|
||||
@@ -181,6 +182,33 @@ void ethtool_convert_legacy_u32_to_link_mode(unsigned long *dst,
|
||||
/* return false if src had higher bits set. lower bits always updated. */
|
||||
bool ethtool_convert_link_mode_to_legacy_u32(u32 *legacy_u32,
|
||||
const unsigned long *src);
|
||||
#else
|
||||
static inline int
|
||||
__ethtool_get_link_ksettings(struct net_device *dev,
|
||||
struct ethtool_link_ksettings *link_ksettings)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline
|
||||
void ethtool_intersect_link_masks(struct ethtool_link_ksettings *dst,
|
||||
struct ethtool_link_ksettings *src)
|
||||
{
|
||||
}
|
||||
|
||||
static inline
|
||||
void ethtool_convert_legacy_u32_to_link_mode(unsigned long *dst,
|
||||
u32 legacy_u32)
|
||||
{
|
||||
}
|
||||
|
||||
static inline
|
||||
bool ethtool_convert_link_mode_to_legacy_u32(u32 *legacy_u32,
|
||||
const unsigned long *src)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* struct ethtool_ops - optional netdev operations
|
||||
|
||||
@@ -309,6 +309,13 @@ config BPF_STREAM_PARSER
|
||||
It can be used to enforce socket policy, implement socket redirects,
|
||||
etc.
|
||||
|
||||
config ETHTOOL
|
||||
bool "enable ethtool"
|
||||
default y
|
||||
help
|
||||
This selects ethtool function, default is Y. If say N, ethtool function
|
||||
is not implemented.
|
||||
|
||||
config NET_FLOW_LIMIT
|
||||
bool
|
||||
depends on RPS
|
||||
|
||||
@@ -8,11 +8,12 @@ obj-y := sock.o request_sock.o skbuff.o datagram.o stream.o scm.o \
|
||||
|
||||
obj-$(CONFIG_SYSCTL) += sysctl_net_core.o
|
||||
|
||||
obj-y += dev.o ethtool.o dev_addr_lists.o dst.o netevent.o \
|
||||
obj-y += dev.o dev_addr_lists.o dst.o netevent.o \
|
||||
neighbour.o rtnetlink.o utils.o link_watch.o filter.o \
|
||||
sock_diag.o dev_ioctl.o tso.o sock_reuseport.o \
|
||||
fib_notifier.o xdp.o
|
||||
|
||||
obj-$(CONFIG_ETHTOOL) += ethtool.o
|
||||
obj-y += net-sysfs.o
|
||||
obj-$(CONFIG_PAGE_POOL) += page_pool.o
|
||||
obj-$(CONFIG_PROC_FS) += net-procfs.o
|
||||
|
||||
@@ -417,6 +417,7 @@ int dev_ioctl(struct net *net, unsigned int cmd, struct ifreq *ifr, bool *need_c
|
||||
*colon = ':';
|
||||
return ret;
|
||||
|
||||
#ifdef CONFIG_ETHTOOL
|
||||
case SIOCETHTOOL:
|
||||
dev_load(net, ifr->ifr_name);
|
||||
rtnl_lock();
|
||||
@@ -425,6 +426,7 @@ int dev_ioctl(struct net *net, unsigned int cmd, struct ifreq *ifr, bool *need_c
|
||||
if (colon)
|
||||
*colon = ':';
|
||||
return ret;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* These ioctl calls:
|
||||
|
||||
@@ -243,6 +243,7 @@ static int proc_do_dev_weight(struct ctl_table *table, int write,
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ETHTOOL
|
||||
static int proc_do_rss_key(struct ctl_table *table, int write,
|
||||
void __user *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
@@ -254,6 +255,7 @@ static int proc_do_rss_key(struct ctl_table *table, int write,
|
||||
fake_table.maxlen = sizeof(buf);
|
||||
return proc_dostring(&fake_table, write, buffer, lenp, ppos);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BPF_JIT
|
||||
static int proc_dointvec_minmax_bpf_enable(struct ctl_table *table, int write,
|
||||
@@ -368,6 +370,7 @@ static struct ctl_table net_core_table[] = {
|
||||
.mode = 0644,
|
||||
.proc_handler = proc_dointvec
|
||||
},
|
||||
#ifdef CONFIG_ETHTOOL
|
||||
{
|
||||
.procname = "netdev_rss_key",
|
||||
.data = &netdev_rss_key,
|
||||
@@ -375,6 +378,7 @@ static struct ctl_table net_core_table[] = {
|
||||
.mode = 0444,
|
||||
.proc_handler = proc_do_rss_key,
|
||||
},
|
||||
#endif
|
||||
#ifdef CONFIG_BPF_JIT
|
||||
{
|
||||
.procname = "bpf_jit_enable",
|
||||
|
||||
Reference in New Issue
Block a user