[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190530110840.794ba98b@hermes.lan>
Date: Thu, 30 May 2019 11:08:40 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Davide Caratti <dcaratti@...hat.com>
Cc: Eric Dumazet <eric.dumazet@...il.com>,
Cong Wang <xiyou.wangcong@...il.com>,
Jiri Pirko <jiri@...nulli.us>,
Jamal Hadi Salim <jhs@...atatu.com>,
"David S . Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
shuali@...hat.com, Eli Britstein <elibr@...lanox.com>
Subject: Re: [PATCH net v2 1/3] net/sched: act_csum: pull all VLAN headers
before checksumming
On Thu, 30 May 2019 20:03:41 +0200
Davide Caratti <dcaratti@...hat.com> wrote:
>
> +static inline int tc_skb_pull_vlans(struct sk_buff *skb,
> + unsigned int *hdr_count,
> + __be16 *proto)
> +{
> + if (skb_vlan_tag_present(skb))
> + *proto = skb->protocol;
> +
> + while (eth_type_vlan(*proto)) {
> + struct vlan_hdr *vlan;
> +
> + if (unlikely(!pskb_may_pull(skb, VLAN_HLEN)))
> + return -ENOMEM;
> +
> + vlan = (struct vlan_hdr *)skb->data;
> + *proto = vlan->h_vlan_encapsulated_proto;
> + skb_pull(skb, VLAN_HLEN);
> + skb_reset_network_header(skb);
> + (*hdr_count)++;
> + }
> + return 0;
> +}
Does this really need to be an inline, or could it just be
part of the sched_api?
Powered by blists - more mailing lists