Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

filter: Add SKF_AD_QUEUE instruction

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>

authored by

Eric Dumazet and committed by
David S. Miller
d19742fb ad959e76

+5 -1
+2 -1
include/linux/filter.h
··· 124 124 #define SKF_AD_NLATTR 12 125 125 #define SKF_AD_NLATTR_NEST 16 126 126 #define SKF_AD_MARK 20 127 - #define SKF_AD_MAX 24 127 + #define SKF_AD_QUEUE 24 128 + #define SKF_AD_MAX 28 128 129 #define SKF_NET_OFF (-0x100000) 129 130 #define SKF_LL_OFF (-0x200000) 130 131
+3
net/core/filter.c
··· 306 306 case SKF_AD_MARK: 307 307 A = skb->mark; 308 308 continue; 309 + case SKF_AD_QUEUE: 310 + A = skb->queue_mapping; 311 + continue; 309 312 case SKF_AD_NLATTR: { 310 313 struct nlattr *nla; 311 314