diff options
| author | David S. Miller <davem@davemloft.net> | 2019-06-18 09:45:37 -0700 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2019-06-18 09:45:37 -0700 |
| commit | 2ae6b594fb610e0826f731ce52f264b9eef9310b (patch) | |
| tree | 5e01078bc464f8ab50f91c4b851c9efe80940d9c /include | |
| parent | 714a485aae9a1707edc8b6dcdb88b0e5b4ea8f0e (diff) | |
| parent | 12ee8220399995cc63fe590d9b01e94921478ad8 (diff) | |
Merge branch 'mlxsw-Improve-IPv6-route-insertion-rate'
Ido Schimmel says:
====================
mlxsw: Improve IPv6 route insertion rate
Unlike IPv4, an IPv6 multipath route in the kernel is composed from
multiple sibling routes, each representing a single nexthop.
Therefore, an addition of a multipath route with N nexthops translates
to N in-kernel notifications. This is inefficient for device drivers
that need to program the route to the underlying device. Each time a new
nexthop is appended, a new nexthop group needs to be constructed and the
old one deleted.
This patchset improves the situation by sending a single notification
for a multipath route addition / deletion instead of one per-nexthop.
When adding thousands of multipath routes with 16 nexthops, I measured
an improvement of about x10 in the insertion rate.
Patches #1-#3 add a flag that indicates that in-kernel notifications
need to be suppressed and extend the IPv6 FIB notification info with
information about the number of sibling routes that are being notified.
Patches #4-#5 adjust the two current listeners to these notifications to
ignore notifications about IPv6 multipath routes.
Patches #6-#7 adds add / delete notifications for IPv6 multipath routes.
Patches #8-#14 do the same for mlxsw.
Patch #15 finally removes the limitations added in patches #4-#5 and
stops the kernel from sending a notification for each added / deleted
nexthop.
Patch #16 adds test cases.
v2 (David Ahern):
* Remove patch adjusting netdevsim to consume resources for each
fib6_info. Instead, consume one resource for the entire multipath
route
* Remove 'multipath_rt' usage in patch #10
* Remove 'multipath_rt' from 'struct fib6_entry_notifier_info' in patch
#15. The member is only removed in this patch to prevent drivers from
processing multipath routes twice during the series
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/ip6_fib.h | 6 | ||||
| -rw-r--r-- | include/net/netlink.h | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 1e92f1500b87..87331f2c4af0 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h @@ -377,6 +377,7 @@ typedef struct rt6_info *(*pol_lookup_t)(struct net *, struct fib6_entry_notifier_info { struct fib_notifier_info info; /* must be first */ struct fib6_info *rt; + unsigned int nsiblings; }; /* @@ -450,6 +451,11 @@ int call_fib6_entry_notifiers(struct net *net, enum fib_event_type event_type, struct fib6_info *rt, struct netlink_ext_ack *extack); +int call_fib6_multipath_entry_notifiers(struct net *net, + enum fib_event_type event_type, + struct fib6_info *rt, + unsigned int nsiblings, + struct netlink_ext_ack *extack); void fib6_rt_update(struct net *net, struct fib6_info *rt, struct nl_info *info); void inet6_rt_notify(int event, struct fib6_info *rt, struct nl_info *info, diff --git a/include/net/netlink.h b/include/net/netlink.h index 28ece67f5312..e4650e5b64a1 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h @@ -378,13 +378,17 @@ struct nla_policy { /** * struct nl_info - netlink source information * @nlh: Netlink message header of original request + * @nl_net: Network namespace * @portid: Netlink PORTID of requesting application + * @skip_notify: Skip netlink notifications to user space + * @skip_notify_kernel: Skip selected in-kernel notifications */ struct nl_info { struct nlmsghdr *nlh; struct net *nl_net; u32 portid; - bool skip_notify; + u8 skip_notify:1, + skip_notify_kernel:1; }; /** |
