All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@netronome.com>
To: Jiri Pirko <jiri@resnulli.us>
Cc: netdev@vger.kernel.org, davem@davemloft.net, jhs@mojatatu.com,
	pshelar@nicira.com, therbert@google.com, edumazet@google.com,
	willemb@google.com, dborkman@redhat.com, mst@redhat.com,
	fw@strlen.de, Paul.Durrant@citrix.com, tgraf@suug.ch,
	cwang@twopensource.com
Subject: Re: [patch net-next v4 1/9] openvswitch: actions: use skb_postpull_rcsum when possible
Date: Thu, 20 Nov 2014 10:52:16 +0900	[thread overview]
Message-ID: <20141120015213.GA16056@vergenet.net> (raw)
In-Reply-To: <1416402303-25341-2-git-send-email-jiri@resnulli.us>

On Wed, Nov 19, 2014 at 02:04:55PM +0100, Jiri Pirko wrote:
> Replace duplicated code by calling skb_postpull_rcsum
> 
> Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
> Acked-by: Pravin B Shelar <pshelar@nicira.com>

I believe this may have originally been my handiwork:

Acked-by: Simon Horman <simon.horman@netronome.com>

> ---
>  net/openvswitch/actions.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
> index 394efa6..749a301 100644
> --- a/net/openvswitch/actions.c
> +++ b/net/openvswitch/actions.c
> @@ -175,10 +175,7 @@ static int pop_mpls(struct sk_buff *skb, struct sw_flow_key *key,
>  	if (unlikely(err))
>  		return err;
>  
> -	if (skb->ip_summed == CHECKSUM_COMPLETE)
> -		skb->csum = csum_sub(skb->csum,
> -				     csum_partial(skb_mpls_header(skb),
> -						  MPLS_HLEN, 0));
> +	skb_postpull_rcsum(skb, skb_mpls_header(skb), MPLS_HLEN);
>  
>  	memmove(skb_mac_header(skb) + MPLS_HLEN, skb_mac_header(skb),
>  		skb->mac_len);
> @@ -230,9 +227,7 @@ static int __pop_vlan_tci(struct sk_buff *skb, __be16 *current_tci)
>  	if (unlikely(err))
>  		return err;
>  
> -	if (skb->ip_summed == CHECKSUM_COMPLETE)
> -		skb->csum = csum_sub(skb->csum, csum_partial(skb->data
> -					+ (2 * ETH_ALEN), VLAN_HLEN, 0));
> +	skb_postpull_rcsum(skb, skb->data + (2 * ETH_ALEN), VLAN_HLEN);
>  
>  	vhdr = (struct vlan_hdr *)(skb->data + ETH_HLEN);
>  	*current_tci = vhdr->h_vlan_TCI;
> -- 
> 1.9.3
> 
> --
> 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
> 

  reply	other threads:[~2014-11-20  1:52 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-19 13:04 [patch net-next v4 0/9] sched: introduce vlan action Jiri Pirko
2014-11-19 13:04 ` [patch net-next v4 1/9] openvswitch: actions: use skb_postpull_rcsum when possible Jiri Pirko
2014-11-20  1:52   ` Simon Horman [this message]
2014-11-19 13:04 ` [patch net-next v4 2/9] vlan: make __vlan_hwaccel_put_tag return void Jiri Pirko
2014-11-19 13:04 ` [patch net-next v4 3/9] vlan: kill vlan_put_tag helper Jiri Pirko
2014-11-19 13:04 ` [patch net-next v4 4/9] vlan: rename __vlan_put_tag to vlan_insert_tag_set_proto Jiri Pirko
2014-11-19 13:04 ` [patch net-next v4 5/9] vlan: introduce *vlan_hwaccel_push_inside helpers Jiri Pirko
2014-11-19 20:32   ` Pravin Shelar
2014-11-19 13:05 ` [patch net-next v4 6/9] vlan: introduce __vlan_insert_tag helper which does not free skb Jiri Pirko
2014-11-19 13:05 ` [patch net-next v4 7/9] net: move make_writable helper into common code Jiri Pirko
2014-11-19 13:05 ` [patch net-next v4 8/9] net: move vlan pop/push functions " Jiri Pirko
2014-11-21 16:11   ` Pravin Shelar
2014-11-21 18:05     ` Jiri Pirko
2014-11-21 18:41       ` Pravin Shelar
2014-11-21 19:08         ` Jiri Pirko
2014-11-21 19:29         ` Jiri Benc
2014-12-04  0:33           ` Pravin Shelar
2014-12-04 16:57             ` Jiri Benc
2014-11-19 13:05 ` [patch net-next v4 9/9] sched: introduce vlan action Jiri Pirko
2014-11-19 13:08 ` [patch iproute2 v4] tc: add support for vlan tc action Jiri Pirko
2014-11-21 11:31   ` [patch iproute2 v4.1] " Jiri Pirko
2014-12-03 17:35   ` [patch iproute2 v4] " Stephen Hemminger
2014-11-21 19:21 ` [patch net-next v4 0/9] sched: introduce vlan action David Miller
2014-11-21 23:52   ` Jiri Pirko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141120015213.GA16056@vergenet.net \
    --to=simon.horman@netronome.com \
    --cc=Paul.Durrant@citrix.com \
    --cc=cwang@twopensource.com \
    --cc=davem@davemloft.net \
    --cc=dborkman@redhat.com \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@nicira.com \
    --cc=tgraf@suug.ch \
    --cc=therbert@google.com \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.