On 09/11/2015 03:04 AM, Sowmini Varadhan wrote:

Many commonly used functions like getifaddrs() invoke RTM_GETLINK
to dump the interface information, and do not need the
the AF_INET6 statististics that are always returned by default
from rtnl_fill_ifinfo().

Computing the statistics can be an expensive operation that impacts
scaling, so it is desirable to avoid this if the information is
not needed.

This patch adds a the RTEXT_FILTER_SKIP_STATS extended info flag that
can be passed with netlink_request() to avoid statistics computation
for the ifinfo path.

Signed-off-by: Sowmini Varadhan <sowmini.varad...@oracle.com>
---
v2: David Miller comments: pass u32 ext_filter_mask down.

  include/net/rtnetlink.h        |    3 ++-
  include/uapi/linux/rtnetlink.h |    1 +
  net/core/rtnetlink.c           |    2 +-
  net/ipv4/devinet.c             |    3 ++-
  net/ipv6/addrconf.c            |   13 +++++++++----
  5 files changed, 15 insertions(+), 7 deletions(-)

Sowmini, Thanks for the patch which is more cleaner way without
breaking current behaviour.

[ Though RTEXT_FILTER_NEED_STATS flag with reverse effect  would have
helped immediately :)]

/me waits for the RTEXT_FILTER_SKIP_STATS to be supported in
gccgo/golang, so that it can be used in docker newNetlinkRequest() to
exploit this.



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to