From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83F1715B8 for ; Wed, 24 May 2023 04:04:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D569C433D2; Wed, 24 May 2023 04:04:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684901095; bh=h0GPloYU1VAGgpUh/tie+7wVESLUBSFraCBtAuT3854=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=HhkszsfZ6rTKFmLO70MxjxjEyH5t5GLtXOzqSyFg3csKk5knmXCzal/ZPLDFwBbZa 2rueLngCuYe5u99GHxsN+rmG20BcOvQjtt7NKqLejKL55Gq1qggCaGDbduq3PYo/Ca RtGfNqygXL5l5XtiFAOl1dVFiG58XdCmjR1B8Ej5rziJkymRaOfsY5/3sz5qbzPIZe atadsjt7JzAZjSTL/dAZFmywe6xT9KUAfY8BAgHBZfDAcWCX6ILxJarc99lXcaYLvl gweyk2KB3e0G4p5hRQ1Gwc0+i8vW7Ia6XWA6HQPKfkYwllN98cDj078OhiKKBm7RyD NWzwNXZ2VylMQ== Date: Tue, 23 May 2023 21:04:54 -0700 From: Jakub Kicinski To: Mengyuan Lou Cc: netdev@vger.kernel.org, jiawenwu@trustnetic.com Subject: Re: [PATCH net-next v6 2/8] net: wangxun: libwx add rx offload functions Message-ID: <20230523210454.12963d67@kernel.org> In-Reply-To: <20230523030658.17738-3-mengyuanlou@net-swift.com> References: <20230523030658.17738-1-mengyuanlou@net-swift.com> <20230523030658.17738-3-mengyuanlou@net-swift.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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