WSL2-Linux-Kernel/net/openvswitch
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
..
Kconfig netfilter: nat: merge nf_nat_ipv4,6 into nat core 2019-02-27 10:49:55 +01:00
Makefile openvswitch: Add meter infrastructure 2017-11-13 10:37:07 +09:00
actions.c OVS: remove use of VLAN_TAG_PRESENT 2018-11-08 19:49:31 -08:00
conntrack.c genetlink: make policy common to family 2019-03-22 10:38:23 -04:00
conntrack.h openvswitch: Support conntrack zone limit 2018-05-25 16:45:19 -04:00
datapath.c genetlink: make policy common to family 2019-03-22 10:38:23 -04:00
datapath.h openvswitch: Support conntrack zone limit 2018-05-25 16:45:19 -04:00
dp_notify.c openvswitch: reliable interface indentification in port dumps 2017-11-05 21:49:17 +09:00
flow.c openvswitch: Fix IPv6 later frags parsing 2019-01-04 13:00:02 -08:00
flow.h openvswitch: convert to kvmalloc 2019-03-12 10:04:02 -07:00
flow_netlink.c openvswitch: Avoid OOB read when parsing flow nlattrs 2019-01-16 13:35:21 -08:00
flow_netlink.h openvswitch: convert to kvmalloc 2019-03-12 10:04:02 -07:00
flow_table.c openvswitch: convert to kvmalloc 2019-03-12 10:04:02 -07:00
flow_table.h openvswitch: convert to kvmalloc 2019-03-12 10:04:02 -07:00
meter.c genetlink: make policy common to family 2019-03-22 10:38:23 -04:00
meter.h openvswitch: Add meter infrastructure 2017-11-13 10:37:07 +09:00
vport-geneve.c net: core: dev: Add extack argument to dev_change_flags() 2018-12-06 13:26:07 -08:00
vport-gre.c net: core: dev: Add extack argument to dev_change_flags() 2018-12-06 13:26:07 -08:00
vport-internal_dev.c net: ovs: fix return type of ndo_start_xmit function 2018-09-28 10:25:11 -07:00
vport-internal_dev.h
vport-netdev.c openvswitch: remove BUG_ON from get_dpdev 2018-11-08 17:14:59 -08:00
vport-netdev.h
vport-vxlan.c net: core: dev: Add extack argument to dev_change_flags() 2018-12-06 13:26:07 -08:00
vport.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
vport.h