From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH net-next 0/9] net: Kernel side filtering for route dumps Date: Thu, 11 Oct 2018 08:26:37 -0700 Message-ID: <20181011082637.3e7833c9@xeon-e3> References: <20181011150627.4010-1-dsahern@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, davem@davemloft.net, David Ahern To: David Ahern Return-path: Received: from mail-pf1-f196.google.com ([209.85.210.196]:36338 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726189AbeJKWy0 (ORCPT ); Thu, 11 Oct 2018 18:54:26 -0400 Received: by mail-pf1-f196.google.com with SMTP id l81-v6so4602008pfg.3 for ; Thu, 11 Oct 2018 08:26:46 -0700 (PDT) In-Reply-To: <20181011150627.4010-1-dsahern@kernel.org> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, 11 Oct 2018 08:06:18 -0700 David Ahern wrote: > From: David Ahern > > Implement kernel side filtering of route dumps by protocol (e.g., which > routing daemon installed the route), route type (e.g., unicast), table > id and nexthop device. > > iproute2 has been doing this filtering in userspace for years; pushing > the filters to the kernel side reduces the amount of data the kernel > sends and reduces wasted cycles on both sides processing unwanted data. > These initial options provide a huge improvement for efficiently > examining routes on large scale systems. > > David Ahern (9): > net: Add struct for fib dump filter > net/ipv4: Plumb support for filtering route dumps > net/ipv6: Plumb support for filtering route dumps > net/mpls: Plumb support for filtering route dumps > net: Plumb support for filtering ipv4 and ipv6 multicast route dumps > net: Enable kernel side filtering of route dumps > net/mpls: Handle kernel side filtering of route dumps > net/ipv6: Bail early if user only wants cloned entries > net/ipv4: Bail early if user only wants prefix entries > > include/linux/mroute_base.h | 5 +-- > include/net/ip6_route.h | 1 + > include/net/ip_fib.h | 14 ++++++-- > net/ipv4/fib_frontend.c | 64 +++++++++++++++++++++++++++------ > net/ipv4/fib_trie.c | 37 +++++++++++++------ > net/ipv4/ipmr.c | 8 +++-- > net/ipv4/ipmr_base.c | 33 ++++++++++++++++- > net/ipv6/ip6_fib.c | 17 +++++++-- > net/ipv6/ip6mr.c | 7 ++-- > net/ipv6/route.c | 40 ++++++++++++++++----- > net/mpls/af_mpls.c | 86 +++++++++++++++++++++++++++++++++++++++------ > 11 files changed, 262 insertions(+), 50 deletions(-) > You can do the something like this already with BPF socket filters. But writing BPF for multi-part messages is hard. Maybe a generic eBPF filter mechanism would be more flexible?