Re: [PATCH] include:linux:Optimizations to __skb_push
From: Tom Herbert
Date: Thu Jan 22 2015 - 13:21:55 EST
On Thu, Jan 22, 2015 at 10:02 AM, Mohammad Jamal
<md.jamalmohiuddin@xxxxxxxxx> wrote:
> This patch optimizes __skb_push function
>
> Signed-off-by: Mohammad Jamal <md.jamalmohiuddin@xxxxxxxxx>
> ---
> include/linux/skbuff.h | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index 85ab7d7..9acffb2 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -1671,9 +1671,8 @@ static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len)
> unsigned char *skb_push(struct sk_buff *skb, unsigned int len);
> static inline unsigned char *__skb_push(struct sk_buff *skb, unsigned int len)
> {
> - skb->data -= len;
> skb->len += len;
> - return skb->data;
> + return skb->data -= len;
> }
>
Hmm, this seems less readable to me. What is the effect of this patch?
Does the compiler even produce different assembly?
Thanks,
Tom
> unsigned char *skb_pull(struct sk_buff *skb, unsigned int len);
> --
> 1.7.9.5
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/