Subject: Re: [PATCH net-next v6 2/8] net: wangxun: libwx add rx offload functions

From: Jakub Kicinski <[email-masked]>
Date: Tue, 23 May 2023 21:04:54 -0700

On Tue, 23 May 2023 11:06:52 +0800 Mengyuan Lou wrote:
> +static inline struct wx_dec_ptype wx_decode_ptype(const u8 ptype)
> +{
> +	return wx_ptype_lookup[ptype];
> +}

No need for inline keyword here, compiler will definitely inline this.

> +	/* If there is an outer header present that might contain a checksum
> +	 * we need to bump the checksum level by 1 to reflect the fact that
> +	 * we are indicating we validated the inner checksum.
> +	 */
> +	if (dptype.etype >= WX_DEC_PTYPE_ETYPE_IG) {
> +		skb->csum_level = 1;
> +		skb->encapsulation = 1;
> +	}

That's not right, you shouldn't set encapsulation, that field means skb
encap state / fields are valid. Just use
__skb_incr_checksum_unnecessary() please, it will do the right thing.

-- 
pw-bot: cr