Commit 739a91ef authored by Changli Gao's avatar Changli Gao Committed by David S. Miller

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: default avatarChangli Gao <xiaosuo@gmail.com>
Acked-by: default avatarJamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 81ce790b
...@@ -332,6 +332,7 @@ enum { ...@@ -332,6 +332,7 @@ enum {
FLOW_KEY_SKUID, FLOW_KEY_SKUID,
FLOW_KEY_SKGID, FLOW_KEY_SKGID,
FLOW_KEY_VLAN_TAG, FLOW_KEY_VLAN_TAG,
FLOW_KEY_RXHASH,
__FLOW_KEY_MAX, __FLOW_KEY_MAX,
}; };
......
...@@ -306,6 +306,11 @@ static u32 flow_get_vlan_tag(const struct sk_buff *skb) ...@@ -306,6 +306,11 @@ static u32 flow_get_vlan_tag(const struct sk_buff *skb)
return tag & VLAN_VID_MASK; 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) static u32 flow_key_get(struct sk_buff *skb, int key)
{ {
switch (key) { switch (key) {
...@@ -343,6 +348,8 @@ static u32 flow_key_get(struct sk_buff *skb, int key) ...@@ -343,6 +348,8 @@ static u32 flow_key_get(struct sk_buff *skb, int key)
return flow_get_skgid(skb); return flow_get_skgid(skb);
case FLOW_KEY_VLAN_TAG: case FLOW_KEY_VLAN_TAG:
return flow_get_vlan_tag(skb); return flow_get_vlan_tag(skb);
case FLOW_KEY_RXHASH:
return flow_get_rxhash(skb);
default: default:
WARN_ON(1); WARN_ON(1);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment