Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d19742fb authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

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: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ad959e76
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -124,7 +124,8 @@ struct sock_fprog /* Required for SO_ATTACH_FILTER. */
#define SKF_AD_NLATTR	12
#define SKF_AD_NLATTR	12
#define SKF_AD_NLATTR_NEST	16
#define SKF_AD_NLATTR_NEST	16
#define SKF_AD_MARK 	20
#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_NET_OFF   (-0x100000)
#define SKF_LL_OFF    (-0x200000)
#define SKF_LL_OFF    (-0x200000)


+3 −0
Original line number Original line Diff line number Diff line
@@ -306,6 +306,9 @@ unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int
		case SKF_AD_MARK:
		case SKF_AD_MARK:
			A = skb->mark;
			A = skb->mark;
			continue;
			continue;
		case SKF_AD_QUEUE:
			A = skb->queue_mapping;
			continue;
		case SKF_AD_NLATTR: {
		case SKF_AD_NLATTR: {
			struct nlattr *nla;
			struct nlattr *nla;