diff options
author | Greg Rose <gregory.v.rose@intel.com> | 2011-06-09 21:27:09 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2011-06-09 23:38:07 -0400 |
commit | c7ac8679bec9397afe8918f788cbcef88c38da54 (patch) | |
tree | c152712de4c997ea79252ef9ac72aaedb8f88c18 /net/ipv4 | |
parent | 929dd047720785f099e12113780b3d7914ce6d9f (diff) |
rtnetlink: Compute and store minimum ifinfo dump size
The message size allocated for rtnl ifinfo dumps was limited to
a single page. This is not enough for additional interface info
available with devices that support SR-IOV and caused a bug in
which VF info would not be displayed if more than approximately
40 VFs were created per interface.
Implement a new function pointer for the rtnl_register service that will
calculate the amount of data required for the ifinfo dump and allocate
enough data to satisfy the request.
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/devinet.c | 6 | ||||
-rw-r--r-- | net/ipv4/fib_frontend.c | 6 | ||||
-rw-r--r-- | net/ipv4/inet_diag.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipmr.c | 3 | ||||
-rw-r--r-- | net/ipv4/route.c | 2 |
5 files changed, 10 insertions, 9 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 0d4a184af16f..37b3c188d8b3 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -1833,8 +1833,8 @@ void __init devinet_init(void) | |||
1833 | 1833 | ||
1834 | rtnl_af_register(&inet_af_ops); | 1834 | rtnl_af_register(&inet_af_ops); |
1835 | 1835 | ||
1836 | rtnl_register(PF_INET, RTM_NEWADDR, inet_rtm_newaddr, NULL); | 1836 | rtnl_register(PF_INET, RTM_NEWADDR, inet_rtm_newaddr, NULL, NULL); |
1837 | rtnl_register(PF_INET, RTM_DELADDR, inet_rtm_deladdr, NULL); | 1837 | rtnl_register(PF_INET, RTM_DELADDR, inet_rtm_deladdr, NULL, NULL); |
1838 | rtnl_register(PF_INET, RTM_GETADDR, NULL, inet_dump_ifaddr); | 1838 | rtnl_register(PF_INET, RTM_GETADDR, NULL, inet_dump_ifaddr, NULL); |
1839 | } | 1839 | } |
1840 | 1840 | ||
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 22524716fe70..92fc5f69f5da 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c | |||
@@ -1124,9 +1124,9 @@ static struct pernet_operations fib_net_ops = { | |||
1124 | 1124 | ||
1125 | void __init ip_fib_init(void) | 1125 | void __init ip_fib_init(void) |
1126 | { | 1126 | { |
1127 | rtnl_register(PF_INET, RTM_NEWROUTE, inet_rtm_newroute, NULL); | 1127 | rtnl_register(PF_INET, RTM_NEWROUTE, inet_rtm_newroute, NULL, NULL); |
1128 | rtnl_register(PF_INET, RTM_DELROUTE, inet_rtm_delroute, NULL); | 1128 | rtnl_register(PF_INET, RTM_DELROUTE, inet_rtm_delroute, NULL, NULL); |
1129 | rtnl_register(PF_INET, RTM_GETROUTE, NULL, inet_dump_fib); | 1129 | rtnl_register(PF_INET, RTM_GETROUTE, NULL, inet_dump_fib, NULL); |
1130 | 1130 | ||
1131 | register_pernet_subsys(&fib_net_ops); | 1131 | register_pernet_subsys(&fib_net_ops); |
1132 | register_netdevice_notifier(&fib_netdev_notifier); | 1132 | register_netdevice_notifier(&fib_netdev_notifier); |
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index 6ffe94ca5bc9..5ff47656fced 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c | |||
@@ -871,7 +871,7 @@ static int inet_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
871 | } | 871 | } |
872 | 872 | ||
873 | return netlink_dump_start(idiagnl, skb, nlh, | 873 | return netlink_dump_start(idiagnl, skb, nlh, |
874 | inet_diag_dump, NULL); | 874 | inet_diag_dump, NULL, 0); |
875 | } | 875 | } |
876 | 876 | ||
877 | return inet_diag_get_exact(skb, nlh); | 877 | return inet_diag_get_exact(skb, nlh); |
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 30a7763c400e..aae2bd8cd924 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -2544,7 +2544,8 @@ int __init ip_mr_init(void) | |||
2544 | goto add_proto_fail; | 2544 | goto add_proto_fail; |
2545 | } | 2545 | } |
2546 | #endif | 2546 | #endif |
2547 | rtnl_register(RTNL_FAMILY_IPMR, RTM_GETROUTE, NULL, ipmr_rtm_dumproute); | 2547 | rtnl_register(RTNL_FAMILY_IPMR, RTM_GETROUTE, |
2548 | NULL, ipmr_rtm_dumproute, NULL); | ||
2548 | return 0; | 2549 | return 0; |
2549 | 2550 | ||
2550 | #ifdef CONFIG_IP_PIMSM_V2 | 2551 | #ifdef CONFIG_IP_PIMSM_V2 |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 52b0b956508b..aa29c6291353 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -3295,7 +3295,7 @@ int __init ip_rt_init(void) | |||
3295 | xfrm_init(); | 3295 | xfrm_init(); |
3296 | xfrm4_init(ip_rt_max_size); | 3296 | xfrm4_init(ip_rt_max_size); |
3297 | #endif | 3297 | #endif |
3298 | rtnl_register(PF_INET, RTM_GETROUTE, inet_rtm_getroute, NULL); | 3298 | rtnl_register(PF_INET, RTM_GETROUTE, inet_rtm_getroute, NULL, NULL); |
3299 | 3299 | ||
3300 | #ifdef CONFIG_SYSCTL | 3300 | #ifdef CONFIG_SYSCTL |
3301 | register_pernet_subsys(&sysctl_route_ops); | 3301 | register_pernet_subsys(&sysctl_route_ops); |