linux/drivers/net
Johannes Berg 3b0f31f2b8 genetlink: make policy common to family
Since maxattr is common, the policy can't really differ sanely,
so make it common as well.

The only user that did in fact manage to make a non-common policy
is taskstats, which has to be really careful about it (since it's
still using a common maxattr!). This is no longer supported, but
we can fake it using pre_doit.

This reduces the size of e.g. nl80211.o (which has lots of commands):

   text	   data	    bss	    dec	    hex	filename
 398745	  14323	   2240	 415308	  6564c	net/wireless/nl80211.o (before)
 397913	  14331	   2240	 414484	  65314	net/wireless/nl80211.o (after)
--------------------------------
   -832      +8       0    -824

Which is obviously just 8 bytes for each command, and an added 8
bytes for the new policy pointer. I'm not sure why the ops list is
counted as .text though.

Most of the code transformations were done using the following spatch:
    @ops@
    identifier OPS;
    expression POLICY;
    @@
    struct genl_ops OPS[] = {
    ...,
     {
    -	.policy = POLICY,
     },
    ...
    };

    @@
    identifier ops.OPS;
    expression ops.POLICY;
    identifier fam;
    expression M;
    @@
    struct genl_family fam = {
            .ops = OPS,
            .maxattr = M,
    +       .policy = POLICY,
            ...
    };

This also gets rid of devlink_nl_cmd_region_read_dumpit() accessing
the cb->data as ops, which we want to change in a later genl patch.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-03-22 10:38:23 -04:00
..
appletalk net: appletalk: cops: mark expected switch fall-through 2019-02-08 11:53:42 -08:00
arcnet
bonding net: remove 'fallback' argument from dev->ndo_select_queue() 2019-03-20 11:18:55 -07:00
caif net: caif: pass struct device to DMA API functions 2019-02-12 12:09:23 -05:00
can peak_usb: fix clang build warning 2019-03-07 09:39:46 -08:00
dsa net: dsa: bcm_sf2: Remove print of base address 2019-03-21 13:32:35 -07:00
ethernet r8169: use netif_start_queue instead of netif_wake_qeueue in rtl8169_start_xmit 2019-03-22 10:35:25 -04:00
fddi Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-02-08 15:00:17 -08:00
fjes
hamradio net: hamradio: remove unused hweight*() defines 2019-02-18 12:10:02 -08:00
hippi
hyperv net: remove 'fallback' argument from dev->ndo_select_queue() 2019-03-20 11:18:55 -07:00
ieee802154 genetlink: make policy common to family 2019-03-22 10:38:23 -04:00
ipvlan Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-02-24 12:06:19 -08:00
netdevsim bpf: offload: add priv field for drivers 2019-02-12 17:07:09 +01:00
phy net: phy: aquantia: add downshift support 2019-03-22 10:26:21 -04:00
plip
ppp pptp: dst_release sk_dst_cache in pptp_sock_destruct 2019-03-13 14:22:49 -07:00
slip
team genetlink: make policy common to family 2019-03-22 10:38:23 -04:00
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-03-04 13:26:15 -08:00
vmxnet3
wan net: wan: z85230: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles 2019-02-25 14:36:15 -08:00
wimax wimax/i2400m: use struct_size() helper 2019-02-08 22:57:28 -08:00
wireless genetlink: make policy common to family 2019-03-22 10:38:23 -04:00
xen-netback net: remove 'fallback' argument from dev->ndo_select_queue() 2019-03-20 11:18:55 -07:00
Kconfig gtp: change NET_UDP_TUNNEL dependency to select 2019-03-18 16:54:42 -07:00
LICENSE.SRC
Makefile
Space.c
dummy.c
eql.c
geneve.c geneve: correctly handle ipv6.disable module parameter 2019-03-01 22:07:56 -08:00
gtp.c genetlink: make policy common to family 2019-03-22 10:38:23 -04:00
ifb.c
loopback.c
macsec.c genetlink: make policy common to family 2019-03-22 10:38:23 -04:00
macvlan.c macvlan: pass get_ts_info and SIOC[SG]HWTSTAMP ioctl to real device 2019-03-20 11:04:41 -07:00
macvtap.c
mdio.c
mii.c
net_failover.c net: remove 'fallback' argument from dev->ndo_select_queue() 2019-03-20 11:18:55 -07:00
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c sb1000: fix a couple of indentation issues and remove assignment in if statements 2019-01-17 21:51:36 -08:00
sungem_phy.c
tap.c net: Don't set transport offset to invalid value 2019-02-22 12:55:31 -08:00
thunderbolt.c
tun.c tun: Remove unused first parameter of tun_get_iff() 2019-03-21 13:19:15 -07:00
veth.c veth: Fix -Wformat-truncation 2019-02-23 13:44:58 -08:00
virtio_net.c virtio_net: remove hcpu from virtnet_clean_affinity 2019-03-18 22:26:23 -07:00
vrf.c net: vrf: remove MTU limits for vrf device 2019-02-21 13:10:08 -08:00
vsockmon.c
vxlan.c vxlan: Don't call gro_cells_destroy() before device is unregistered 2019-03-18 17:07:27 -07:00
xen-netfront.c net: remove 'fallback' argument from dev->ndo_select_queue() 2019-03-20 11:18:55 -07:00