diff options
author | Greg Rose <gregory.v.rose@intel.com> | 2012-02-21 16:54:48 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-02-21 16:56:45 -0500 |
commit | 115c9b81928360d769a76c632bae62d15206a94a (patch) | |
tree | bbbe349bdf3803439cf3a757b9f2a839726348f5 /include/net | |
parent | 84338a6c9dbb6ff3de4749864020f8f25d86fc81 (diff) | |
download | linux-3.10-115c9b81928360d769a76c632bae62d15206a94a.tar.gz linux-3.10-115c9b81928360d769a76c632bae62d15206a94a.tar.bz2 linux-3.10-115c9b81928360d769a76c632bae62d15206a94a.zip |
rtnetlink: Fix problem with buffer allocation
Implement a new netlink attribute type IFLA_EXT_MASK. The mask
is a 32 bit value that can be used to indicate to the kernel that
certain extended ifinfo values are requested by the user application.
At this time the only mask value defined is RTEXT_FILTER_VF to
indicate that the user wants the ifinfo dump to send information
about the VFs belonging to the interface.
This patch fixes a bug in which certain applications do not have
large enough buffers to accommodate the extra information returned
by the kernel with large numbers of SR-IOV virtual functions.
Those applications will not send the new netlink attribute with
the interface info dump request netlink messages so they will
not get unexpectedly large request buffers returned by the kernel.
Modifies the rtnl_calcit function to traverse the list of net
devices and compute the minimum buffer size that can hold the
info dumps of all matching devices based upon the filter passed
in via the new netlink attribute filter mask. If no filter
mask is sent then the buffer allocation defaults to NLMSG_GOODSIZE.
With this change it is possible to add yet to be defined netlink
attributes to the dump request which should make it fairly extensible
in the future.
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/rtnetlink.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h index 678f1ffaf84..37029390197 100644 --- a/include/net/rtnetlink.h +++ b/include/net/rtnetlink.h @@ -6,7 +6,7 @@ typedef int (*rtnl_doit_func)(struct sk_buff *, struct nlmsghdr *, void *); typedef int (*rtnl_dumpit_func)(struct sk_buff *, struct netlink_callback *); -typedef u16 (*rtnl_calcit_func)(struct sk_buff *); +typedef u16 (*rtnl_calcit_func)(struct sk_buff *, struct nlmsghdr *); extern int __rtnl_register(int protocol, int msgtype, rtnl_doit_func, rtnl_dumpit_func, |