]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
filter: Add SKF_AD_QUEUE instruction
authorEric Dumazet <eric.dumazet@gmail.com>
Tue, 20 Oct 2009 08:06:22 +0000 (01:06 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Oct 2009 08:06:22 +0000 (01:06 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/filter.h
net/core/filter.c

index 909193e253953709335d344841fdf8315e0fc722..bb3b4352978a44e69be6122c585ccdcae752ca80 100644 (file)
@@ -124,7 +124,8 @@ struct sock_fprog   /* Required for SO_ATTACH_FILTER. */
 #define SKF_AD_NLATTR  12
 #define SKF_AD_NLATTR_NEST     16
 #define SKF_AD_MARK    20
-#define SKF_AD_MAX     24
+#define SKF_AD_QUEUE   24
+#define SKF_AD_MAX     28
 #define SKF_NET_OFF   (-0x100000)
 #define SKF_LL_OFF    (-0x200000)
 
index e3987e1d4839384569e1e618bbaa7b83932ccec0..08db7b9143a35709f61babe2932e5d7ff6754cea 100644 (file)
@@ -306,6 +306,9 @@ load_b:
                case SKF_AD_MARK:
                        A = skb->mark;
                        continue;
+               case SKF_AD_QUEUE:
+                       A = skb->queue_mapping;
+                       continue;
                case SKF_AD_NLATTR: {
                        struct nlattr *nla;