netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next-2.6] filter: Add SKF_AD_QUEUE instruction
@ 2009-10-16 17:10 Eric Dumazet
  2009-10-20  8:08 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2009-10-16 17:10 UTC (permalink / raw)
  To: David S. Miller, Linux Netdev List

It can help being able to filter packets on their queue_mapping.

If filter performance is not good, we could add a "numqueue" field
in struct packet_type, so that netif_nit_deliver() and other functions
can directly ignore packets with not expected queue number.

Lets experiment this simple filter extension first.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---

diff --git a/include/linux/filter.h b/include/linux/filter.h
index 1354aaf..a93f885 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -123,7 +123,8 @@ struct sock_fprog	/* Required for SO_ATTACH_FILTER. */
 #define SKF_AD_IFINDEX 	8
 #define SKF_AD_NLATTR	12
 #define SKF_AD_NLATTR_NEST	16
-#define SKF_AD_MAX	20
+#define SKF_AD_QUEUE	20
+#define SKF_AD_MAX	24
 #define SKF_NET_OFF   (-0x100000)
 #define SKF_LL_OFF    (-0x200000)
 
diff --git a/net/core/filter.c b/net/core/filter.c
index d1d779c..0fc83f7 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -303,6 +303,9 @@ load_b:
 		case SKF_AD_IFINDEX:
 			A = skb->dev->ifindex;
 			continue;
+		case SKF_AD_QUEUE:
+			A = skb->queue_mapping;
+			continue;
 		case SKF_AD_NLATTR: {
 			struct nlattr *nla;
 

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

* Re: [PATCH net-next-2.6] filter: Add SKF_AD_QUEUE instruction
  2009-10-16 17:10 [PATCH net-next-2.6] filter: Add SKF_AD_QUEUE instruction Eric Dumazet
@ 2009-10-20  8:08 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-10-20  8:08 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 16 Oct 2009 19:10:46 +0200

> It can help being able to filter packets on their queue_mapping.
> 
> If filter performance is not good, we could add a "numqueue" field
> in struct packet_type, so that netif_nit_deliver() and other functions
> can directly ignore packets with not expected queue number.
> 
> Lets experiment this simple filter extension first.
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied, I had to adjust the SKF_AD_* number due to a conflict
with Jamal's SKF_AD_MARK patch which is also applied to net-next-2.6

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

end of thread, other threads:[~2009-10-20  8:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-16 17:10 [PATCH net-next-2.6] filter: Add SKF_AD_QUEUE instruction Eric Dumazet
2009-10-20  8:08 ` David Miller

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