Subject: Re: [PATCH net v2 1/3] net/sched: act_csum: pull all VLAN headers before checksumming

From: Stephen Hemminger <[email-masked]>
Date: Thu, 30 May 2019 11:08:40 -0700

On Thu, 30 May 2019 20:03:41 +0200
Davide Caratti <[email-masked]> 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?