All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tc: add meta match on receive hash
@ 2010-08-23 20:08 Stephen Hemminger
  2010-08-23 23:25 ` Changli Gao
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2010-08-23 20:08 UTC (permalink / raw)
  To: David Miller, jamal, Thomas Graf; +Cc: netdev

Trivial extension to existing meta data match rules to allow
matching on skb receive hash value.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--- a/include/linux/tc_ematch/tc_em_meta.h	2010-08-22 11:28:09.208550912 -0700
+++ b/include/linux/tc_ematch/tc_em_meta.h	2010-08-22 11:28:20.560321846 -0700
@@ -79,6 +79,7 @@ enum {
  	TCF_META_ID_SK_SENDMSG_OFF,
  	TCF_META_ID_SK_WRITE_PENDING,
 	TCF_META_ID_VLAN_TAG,
+	TCF_META_ID_RXHASH,
 	__TCF_META_ID_MAX
 };
 #define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1)
--- a/net/sched/em_meta.c	2010-08-22 11:23:29.394155391 -0700
+++ b/net/sched/em_meta.c	2010-08-22 11:25:16.088029057 -0700
@@ -223,6 +223,11 @@ META_COLLECTOR(int_maclen)
 	dst->value = skb->mac_len;
 }
 
+META_COLLECTOR(int_rxhash)
+{
+	dst->value = skb->rxhash;
+}
+
 /**************************************************************************
  * Netfilter
  **************************************************************************/
@@ -541,6 +546,7 @@ static struct meta_ops __meta_ops[TCF_ME
 		[META_ID(SK_SENDMSG_OFF)]	= META_FUNC(int_sk_sendmsg_off),
 		[META_ID(SK_WRITE_PENDING)]	= META_FUNC(int_sk_write_pend),
 		[META_ID(VLAN_TAG)]		= META_FUNC(int_vlan_tag),
+		[META_ID(RXHASH)]		= META_FUNC(int_rxhash),
 	}
 };
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tc: add meta match on receive hash
  2010-08-23 20:08 [PATCH] tc: add meta match on receive hash Stephen Hemminger
@ 2010-08-23 23:25 ` Changli Gao
  2010-08-24  3:44   ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Changli Gao @ 2010-08-23 23:25 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David Miller, jamal, Thomas Graf, netdev

On Tue, Aug 24, 2010 at 4:08 AM, Stephen Hemminger
<shemminger@vyatta.com> wrote:
> Trivial extension to existing meta data match rules to allow
> matching on skb receive hash value.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
> --- a/include/linux/tc_ematch/tc_em_meta.h      2010-08-22 11:28:09.208550912 -0700
> +++ b/include/linux/tc_ematch/tc_em_meta.h      2010-08-22 11:28:20.560321846 -0700
> @@ -79,6 +79,7 @@ enum {
>        TCF_META_ID_SK_SENDMSG_OFF,
>        TCF_META_ID_SK_WRITE_PENDING,
>        TCF_META_ID_VLAN_TAG,
> +       TCF_META_ID_RXHASH,
>        __TCF_META_ID_MAX
>  };
>  #define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1)
> --- a/net/sched/em_meta.c       2010-08-22 11:23:29.394155391 -0700
> +++ b/net/sched/em_meta.c       2010-08-22 11:25:16.088029057 -0700
> @@ -223,6 +223,11 @@ META_COLLECTOR(int_maclen)
>        dst->value = skb->mac_len;
>  }
>
> +META_COLLECTOR(int_rxhash)
> +{
> +       dst->value = skb->rxhash;
> +}

How about using skb_get_rxhash instead. It returns the rxhash anyway.

> +
>  /**************************************************************************
>  * Netfilter
>  **************************************************************************/
> @@ -541,6 +546,7 @@ static struct meta_ops __meta_ops[TCF_ME
>                [META_ID(SK_SENDMSG_OFF)]       = META_FUNC(int_sk_sendmsg_off),
>                [META_ID(SK_WRITE_PENDING)]     = META_FUNC(int_sk_write_pend),
>                [META_ID(VLAN_TAG)]             = META_FUNC(int_vlan_tag),
> +               [META_ID(RXHASH)]               = META_FUNC(int_rxhash),
>        }
>  };
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



-- 
Regards,
Changli Gao(xiaosuo@gmail.com)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tc: add meta match on receive hash
  2010-08-23 23:25 ` Changli Gao
@ 2010-08-24  3:44   ` David Miller
  2010-08-24 18:14     ` Stephen Hemminger
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2010-08-24  3:44 UTC (permalink / raw)
  To: xiaosuo; +Cc: shemminger, hadi, tgraf, netdev

From: Changli Gao <xiaosuo@gmail.com>
Date: Tue, 24 Aug 2010 07:25:19 +0800

> On Tue, Aug 24, 2010 at 4:08 AM, Stephen Hemminger
>> @@ -223,6 +223,11 @@ META_COLLECTOR(int_maclen)
>>        dst->value = skb->mac_len;
>>  }
>>
>> +META_COLLECTOR(int_rxhash)
>> +{
>> +       dst->value = skb->rxhash;
>> +}
> 
> How about using skb_get_rxhash instead. It returns the rxhash anyway.

Agreed.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tc: add meta match on receive hash
  2010-08-24  3:44   ` David Miller
@ 2010-08-24 18:14     ` Stephen Hemminger
  2010-08-24 21:48       ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2010-08-24 18:14 UTC (permalink / raw)
  To: David Miller; +Cc: xiaosuo, hadi, tgraf, netdev

Trivial extension to existing meta data match rules to allow
matching on skb receive hash value.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

---
This versions uses skb_get_rxhash()

--- a/include/linux/tc_ematch/tc_em_meta.h	2010-08-24 08:35:29.555651482 -0700
+++ b/include/linux/tc_ematch/tc_em_meta.h	2010-08-24 08:36:51.038237590 -0700
@@ -79,6 +79,7 @@ enum {
  	TCF_META_ID_SK_SENDMSG_OFF,
  	TCF_META_ID_SK_WRITE_PENDING,
 	TCF_META_ID_VLAN_TAG,
+	TCF_META_ID_RXHASH,
 	__TCF_META_ID_MAX
 };
 #define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1)
--- a/net/sched/em_meta.c	2010-08-24 08:35:29.535662209 -0700
+++ b/net/sched/em_meta.c	2010-08-24 08:38:07.191510604 -0700
@@ -223,6 +223,11 @@ META_COLLECTOR(int_maclen)
 	dst->value = skb->mac_len;
 }
 
+META_COLLECTOR(int_rxhash)
+{
+	dst->value = skb_get_rxhash(skb);
+}
+
 /**************************************************************************
  * Netfilter
  **************************************************************************/
@@ -541,6 +546,7 @@ static struct meta_ops __meta_ops[TCF_ME
 		[META_ID(SK_SENDMSG_OFF)]	= META_FUNC(int_sk_sendmsg_off),
 		[META_ID(SK_WRITE_PENDING)]	= META_FUNC(int_sk_write_pend),
 		[META_ID(VLAN_TAG)]		= META_FUNC(int_vlan_tag),
+		[META_ID(RXHASH)]		= META_FUNC(int_rxhash),
 	}
 };
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tc: add meta match on receive hash
  2010-08-24 18:14     ` Stephen Hemminger
@ 2010-08-24 21:48       ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2010-08-24 21:48 UTC (permalink / raw)
  To: shemminger; +Cc: xiaosuo, hadi, tgraf, netdev

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Tue, 24 Aug 2010 11:14:40 -0700

> Trivial extension to existing meta data match rules to allow
> matching on skb receive hash value.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Applied, thanks Stephen.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-08-24 21:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-23 20:08 [PATCH] tc: add meta match on receive hash Stephen Hemminger
2010-08-23 23:25 ` Changli Gao
2010-08-24  3:44   ` David Miller
2010-08-24 18:14     ` Stephen Hemminger
2010-08-24 21:48       ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.