From: David Ahern <dsa@cumulusnetworks.com>
To: netdev@vger.kernel.org, stephen@networkplumber.org
Cc: dsahern@gmail.com, David Ahern <dsa@cumulusnetworks.com>
Subject: [PATCH] ip neigh: Add ifindex to request when filtering dumps by device
Date: Wed, 7 Oct 2015 10:23:24 -0700 [thread overview]
Message-ID: <1444238604-12632-1-git-send-email-dsa@cumulusnetworks.com> (raw)
Add ifindex to dump request when filtering by device. If the kernel
supports it adding the index to the request limits the amount of data
the kernel pushes to userpsace.
The feature exists in userspace already, so no need to warn the user
if kernel side support does not exist. Using the kernel side filter
makes the request more efficient.
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
---
Kernel support was just picked up, 16660f0bd942, so here is the ip
patch. This one depends on the earlier refactoring done for filtering
by master device.
ip/ipneigh.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/ip/ipneigh.c b/ip/ipneigh.c
index b8973a2d0a08..ded514da642d 100644
--- a/ip/ipneigh.c
+++ b/ip/ipneigh.c
@@ -419,6 +419,7 @@ static int do_show_or_flush(int argc, char **argv, int flush)
fprintf(stderr, "Cannot find device \"%s\"\n", filter_dev);
return -1;
}
+ addattr32(&req.n, sizeof(req), NDA_IFINDEX, filter.index);
}
if (flush) {
--
1.9.1
next reply other threads:[~2015-10-07 17:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-07 17:23 David Ahern [this message]
2015-10-12 16:44 ` [PATCH] ip neigh: Add ifindex to request when filtering dumps by device Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1444238604-12632-1-git-send-email-dsa@cumulusnetworks.com \
--to=dsa@cumulusnetworks.com \
--cc=dsahern@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).