net_sched: cls_flow: add key rxhash
Subsystems (3)
PATCH 1/1 net_sched: cls_flow: add key rxhash
We can use rxhash to classify the traffic into flows. As rxhash maybe supplied by NIC or RPS, it is cheaper.
Signed-off-by Changli Gao <[email protected]>
--- include/linux/pkt_cls.h | 1 + net/sched/cls_flow.c | 7 +++++++ 2 files changed, 8 insertions(+)
include/linux/pkt_cls.h +1 -0
@@ -332,6 +332,7 @@ enum {FLOW_KEY_SKUID ,FLOW_KEY_SKGID ,FLOW_KEY_VLAN_TAG , +FLOW_KEY_RXHASH , __FLOW_KEY_MAX, };
net/sched/cls_flow.c +7 -0
@@ -306,6 +306,11 @@ static u32 flow_get_vlan_tag(const struct sk_buff *skb)return tag &VLAN_VID_MASK ; } +static u32 flow_get_rxhash (struct sk_buff *skb) +{ +return skb_get_rxhash (skb); +} +static u32 flow_key_get (struct sk_buff *skb,int key) {switch (key) {
@@ -343,6 +348,8 @@ static u32 flow_key_get(struct sk_buff *skb, int key)return flow_get_skgid (skb);case FLOW_KEY_VLAN_TAG :return flow_get_vlan_tag (skb); +case FLOW_KEY_RXHASH : +return flow_get_rxhash (skb);default :WARN_ON (1 );return 0 ;
Quoted 4 lines · Changli Gao
We can use rxhash to classify the traffic into flows. As rxhash maybe supplied by NIC or RPS, it is cheaper.
Signed-off-by Changli Gao <[email protected]>
Nice idea.
Acked-by Jamal Hadi Salim <[email protected]>
cheers,
jamal
From: jamal <[email protected]>
Date: Sat, 21 Aug 2010 17:41:32 -0400
Quoted 8 lines · Changli Gao
Quoted 4 lines
We can use rxhash to classify the traffic into flows. As rxhash maybe supplied by NIC or RPS, it is cheaper.
Signed-off-by Changli Gao <[email protected]>Nice idea.
Acked-by Jamal Hadi Salim <[email protected]>
Sometimes the simplest patches are the best :-)
Applied, thanks Changli!