netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ip neigh: Add ifindex to request when filtering dumps by device
@ 2015-10-07 17:23 David Ahern
  2015-10-12 16:44 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: David Ahern @ 2015-10-07 17:23 UTC (permalink / raw)
  To: netdev, stephen; +Cc: dsahern, David Ahern

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-12 16:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-07 17:23 [PATCH] ip neigh: Add ifindex to request when filtering dumps by device David Ahern
2015-10-12 16:44 ` Stephen Hemminger

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).