summaryrefslogtreecommitdiffstats
path: root/include/net/rtnetlink.h
diff options
context:
space:
mode:
authorArad, Ronen <ronen.arad@intel.com>2015-10-19 18:23:28 +0200
committerDavid S. Miller <davem@davemloft.net>2015-10-22 04:15:20 +0200
commitb1974ed05ea90264d534a200e8a13932ad55f8b8 (patch)
tree854bca789c6a4e38dadbb9e5373742b970830fe7 /include/net/rtnetlink.h
parentAdding switchdev ageing notification on port bridged (diff)
downloadlinux-b1974ed05ea90264d534a200e8a13932ad55f8b8.tar.xz
linux-b1974ed05ea90264d534a200e8a13932ad55f8b8.zip
netlink: Rightsize IFLA_AF_SPEC size calculation
if_nlmsg_size() overestimates the minimum allocation size of netlink dump request (when called from rtnl_calcit()) or the size of the message (when called from rtnl_getlink()). This is because ext_filter_mask is not supported by rtnl_link_get_af_size() and rtnl_link_get_size(). The over-estimation is significant when at least one netdev has many VLANs configured (8 bytes for each configured VLAN). This patch-set "rightsizes" the protocol specific attribute size calculation by propagating ext_filter_mask to rtnl_link_get_af_size() and adding this a argument to get_link_af_size op in rtnl_af_ops. Bridge module already used filtering aware sizing for notifications. br_get_link_af_size_filtered() is consistent with the modified get_link_af_size op so it replaces br_get_link_af_size() in br_af_ops. br_get_link_af_size() becomes unused and thus removed. Signed-off-by: Ronen Arad <ronen.arad@intel.com> Acked-by: Sridhar Samudrala <sridhar.samudrala@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/rtnetlink.h')
-rw-r--r--include/net/rtnetlink.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index aff6ceb891a9..2f87c1ba13de 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -124,7 +124,8 @@ struct rtnl_af_ops {
int (*fill_link_af)(struct sk_buff *skb,
const struct net_device *dev,
u32 ext_filter_mask);
- size_t (*get_link_af_size)(const struct net_device *dev);
+ size_t (*get_link_af_size)(const struct net_device *dev,
+ u32 ext_filter_mask);
int (*validate_link_af)(const struct net_device *dev,
const struct nlattr *attr);