Skip to content

Commit

Permalink
net_sched: cls_flow: add key rxhash
Browse files Browse the repository at this point in the history
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 <xiaosuo@gmail.com>
Acked-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Changli Gao authored and David S. Miller committed Aug 22, 2010
1 parent 81ce790 commit 739a91e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/linux/pkt_cls.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ enum {
FLOW_KEY_SKUID,
FLOW_KEY_SKGID,
FLOW_KEY_VLAN_TAG,
FLOW_KEY_RXHASH,
__FLOW_KEY_MAX,
};

Expand Down
7 changes: 7 additions & 0 deletions net/sched/cls_flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 739a91e

Please sign in to comment.