[Acked] [Trusty SRU] Provide compat macro for skb_get_hash

Andy Whitcroft apw at canonical.com
Mon Aug 18 11:11:53 UTC 2014


On Mon, Aug 18, 2014 at 12:28:50PM +0200, Stefan Bader wrote:
> I think this should do the trick. Not tested, so given it looks so
> simple, maybe it is wrong.
> 
> -Stefan 

For clarity, consumers of this kernel API such as compat-* will not
expect this API change in trusty as the upstream change was 3.14 or so.
They could either become all conditional on Ubuntu ABI levels, or
perhaps more simply we could provide this compatibility interface.

> From 4dcc78d81761d175433fbd0570373b3005464bbe Mon Sep 17 00:00:00 2001
> From: Stefan Bader <stefan.bader at canonical.com>
> Date: Mon, 18 Aug 2014 10:29:32 +0200
> Subject: [PATCH] UBUNTU: SAUCE: Add compat macro for skb_get_hash
> 
> Commit df4530d690a14dd net: Change skb_get_rxhash to skb_get_hash
> changed a function that is part of the 3.13 kernel API to pull in
> some newer driver code.
> In order for external modules (which check the LINUX_VERSION_CODE
> to find out which API functions to use) to still compile correctly,
> add a compat definition for the old name.
> 
> BugLink: http://bugs.launchpad.net/bugs/1358162
> 
> Signed-off-by: Stefan Bader <stefan.bader at canonical.com>
> ---
>  include/linux/skbuff.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index e9b1a3c..fa71ce2 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -751,6 +751,7 @@ static inline __u32 skb_get_hash(struct sk_buff *skb)
>  
>  	return skb->rxhash;
>  }
> +#define skb_get_rxhash	skb_get_hash
>  
>  static inline void skb_clear_hash(struct sk_buff *skb)
>  {

>From the commit description it does seem to be a simple rename:

  commit 3958afa1b272eb07109fd31549e69193b4d7c364
  Author: Tom Herbert <therbert at google.com>
  Date:   Sun Dec 15 22:12:06 2013 -0800

    net: Change skb_get_rxhash to skb_get_hash
    
    Changing name of function as part of making the hash in skbuff to be
    generic property, not just for receive path.

And the diff seems to agree, the signature is the same:

  -void __skb_get_rxhash(struct sk_buff *skb);
  -static inline __u32 skb_get_rxhash(struct sk_buff *skb)
  +void __skb_get_hash(struct sk_buff *skb);
  +static inline __u32 skb_get_hash(struct sk_buff *skb)

So this seems sufficient:

Acked-by: Andy Whitcroft <apw at canonical.com>

-apw




More information about the kernel-team mailing list