filter: Add SKF_AD_QUEUE instruction
Subsystems (5)
PATCH 1/1 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.
---
include/linux/filter.h +2 -1
@@ -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)
net/core/filter.c +3 -0
@@ -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;
From: Eric Dumazet <[email protected]>
Date: Fri, 16 Oct 2009 19:10:46 +0200
Quoted 9 lines
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 thatnetif_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 <[email protected]>
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