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/ipv6 | |
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/ipv6')
-rw-r--r-- | net/ipv6/addrconf.c | 16 | ||||
-rw-r--r-- | net/ipv6/addrlabel.c | 9 | ||||
-rw-r--r-- | net/ipv6/ip6_fib.c | 3 | ||||
-rw-r--r-- | net/ipv6/ip6mr.c | 3 | ||||
-rw-r--r-- | net/ipv6/route.c | 6 |
5 files changed, 23 insertions, 14 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 3e369425df58..05838c7fcf64 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -4727,16 +4727,20 @@ int __init addrconf_init(void) | |||
4727 | if (err < 0) | 4727 | if (err < 0) |
4728 | goto errout_af; | 4728 | goto errout_af; |
4729 | 4729 | ||
4730 | err = __rtnl_register(PF_INET6, RTM_GETLINK, NULL, inet6_dump_ifinfo); | 4730 | err = __rtnl_register(PF_INET6, RTM_GETLINK, NULL, inet6_dump_ifinfo, |
4731 | NULL); | ||
4731 | if (err < 0) | 4732 | if (err < 0) |
4732 | goto errout; | 4733 | goto errout; |
4733 | 4734 | ||
4734 | /* Only the first call to __rtnl_register can fail */ | 4735 | /* Only the first call to __rtnl_register can fail */ |
4735 | __rtnl_register(PF_INET6, RTM_NEWADDR, inet6_rtm_newaddr, NULL); | 4736 | __rtnl_register(PF_INET6, RTM_NEWADDR, inet6_rtm_newaddr, NULL, NULL); |
4736 | __rtnl_register(PF_INET6, RTM_DELADDR, inet6_rtm_deladdr, NULL); | 4737 | __rtnl_register(PF_INET6, RTM_DELADDR, inet6_rtm_deladdr, NULL, NULL); |
4737 | __rtnl_register(PF_INET6, RTM_GETADDR, inet6_rtm_getaddr, inet6_dump_ifaddr); | 4738 | __rtnl_register(PF_INET6, RTM_GETADDR, inet6_rtm_getaddr, |
4738 | __rtnl_register(PF_INET6, RTM_GETMULTICAST, NULL, inet6_dump_ifmcaddr); | 4739 | inet6_dump_ifaddr, NULL); |
4739 | __rtnl_register(PF_INET6, RTM_GETANYCAST, NULL, inet6_dump_ifacaddr); | 4740 | __rtnl_register(PF_INET6, RTM_GETMULTICAST, NULL, |
4741 | inet6_dump_ifmcaddr, NULL); | ||
4742 | __rtnl_register(PF_INET6, RTM_GETANYCAST, NULL, | ||
4743 | inet6_dump_ifacaddr, NULL); | ||
4740 | 4744 | ||
4741 | ipv6_addr_label_rtnl_register(); | 4745 | ipv6_addr_label_rtnl_register(); |
4742 | 4746 | ||
diff --git a/net/ipv6/addrlabel.c b/net/ipv6/addrlabel.c index c8993e5a337c..2d8ddba9ee58 100644 --- a/net/ipv6/addrlabel.c +++ b/net/ipv6/addrlabel.c | |||
@@ -592,8 +592,11 @@ out: | |||
592 | 592 | ||
593 | void __init ipv6_addr_label_rtnl_register(void) | 593 | void __init ipv6_addr_label_rtnl_register(void) |
594 | { | 594 | { |
595 | __rtnl_register(PF_INET6, RTM_NEWADDRLABEL, ip6addrlbl_newdel, NULL); | 595 | __rtnl_register(PF_INET6, RTM_NEWADDRLABEL, ip6addrlbl_newdel, |
596 | __rtnl_register(PF_INET6, RTM_DELADDRLABEL, ip6addrlbl_newdel, NULL); | 596 | NULL, NULL); |
597 | __rtnl_register(PF_INET6, RTM_GETADDRLABEL, ip6addrlbl_get, ip6addrlbl_dump); | 597 | __rtnl_register(PF_INET6, RTM_DELADDRLABEL, ip6addrlbl_newdel, |
598 | NULL, NULL); | ||
599 | __rtnl_register(PF_INET6, RTM_GETADDRLABEL, ip6addrlbl_get, | ||
600 | ip6addrlbl_dump, NULL); | ||
598 | } | 601 | } |
599 | 602 | ||
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index 4076a0b14b20..3030bdfd3ca4 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c | |||
@@ -1586,7 +1586,8 @@ int __init fib6_init(void) | |||
1586 | if (ret) | 1586 | if (ret) |
1587 | goto out_kmem_cache_create; | 1587 | goto out_kmem_cache_create; |
1588 | 1588 | ||
1589 | ret = __rtnl_register(PF_INET6, RTM_GETROUTE, NULL, inet6_dump_fib); | 1589 | ret = __rtnl_register(PF_INET6, RTM_GETROUTE, NULL, inet6_dump_fib, |
1590 | NULL); | ||
1590 | if (ret) | 1591 | if (ret) |
1591 | goto out_unregister_subsys; | 1592 | goto out_unregister_subsys; |
1592 | out: | 1593 | out: |
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 82a809901f8e..705c82886281 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c | |||
@@ -1354,7 +1354,8 @@ int __init ip6_mr_init(void) | |||
1354 | goto add_proto_fail; | 1354 | goto add_proto_fail; |
1355 | } | 1355 | } |
1356 | #endif | 1356 | #endif |
1357 | rtnl_register(RTNL_FAMILY_IP6MR, RTM_GETROUTE, NULL, ip6mr_rtm_dumproute); | 1357 | rtnl_register(RTNL_FAMILY_IP6MR, RTM_GETROUTE, NULL, |
1358 | ip6mr_rtm_dumproute, NULL); | ||
1358 | return 0; | 1359 | return 0; |
1359 | #ifdef CONFIG_IPV6_PIMSM_V2 | 1360 | #ifdef CONFIG_IPV6_PIMSM_V2 |
1360 | add_proto_fail: | 1361 | add_proto_fail: |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index de2b1decd786..216ff31a0cc9 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -2925,9 +2925,9 @@ int __init ip6_route_init(void) | |||
2925 | goto xfrm6_init; | 2925 | goto xfrm6_init; |
2926 | 2926 | ||
2927 | ret = -ENOBUFS; | 2927 | ret = -ENOBUFS; |
2928 | if (__rtnl_register(PF_INET6, RTM_NEWROUTE, inet6_rtm_newroute, NULL) || | 2928 | if (__rtnl_register(PF_INET6, RTM_NEWROUTE, inet6_rtm_newroute, NULL, NULL) || |
2929 | __rtnl_register(PF_INET6, RTM_DELROUTE, inet6_rtm_delroute, NULL) || | 2929 | __rtnl_register(PF_INET6, RTM_DELROUTE, inet6_rtm_delroute, NULL, NULL) || |
2930 | __rtnl_register(PF_INET6, RTM_GETROUTE, inet6_rtm_getroute, NULL)) | 2930 | __rtnl_register(PF_INET6, RTM_GETROUTE, inet6_rtm_getroute, NULL, NULL)) |
2931 | goto fib6_rules_init; | 2931 | goto fib6_rules_init; |
2932 | 2932 | ||
2933 | ret = register_netdevice_notifier(&ip6_route_dev_notifier); | 2933 | ret = register_netdevice_notifier(&ip6_route_dev_notifier); |