Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3445951rwb; Fri, 9 Dec 2022 14:48:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf6oHXbejP3C8SXT6inFo5MzpHvfRFfTkhncigLjgVklcRy56LypbhSqJmoglfmhi7gujvn4 X-Received: by 2002:a17:906:234b:b0:7c0:b4c5:a11d with SMTP id m11-20020a170906234b00b007c0b4c5a11dmr6368355eja.75.1670626139349; Fri, 09 Dec 2022 14:48:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670626139; cv=none; d=google.com; s=arc-20160816; b=lMqzGNBpOQsMhYUlGBgn3aaJ88ThwsIYZokzZby3XcX1yOZx/BeHd5R5Zv3GhGBGjT fEM8forgMb+T4dOCscp1o/J1bPNH28eckccANYUKeRia1VdVNVdodX/C4c9azW4o129P 4B0W2r/2CmHYzomQ8gkOtPrGSp5Jds5hdTsfI5aeh0foq/xdXx9ksPAL50SOIkaZDol6 y+Gn+gi9NJnbbUVtBeqhmJQgAA0p/fBbFv0JW6WTCxi/K7/hiNt4wJmP4809bjmVtX9C 8dtBXnJtOIW8r6EOM1PRZRhuaVBoUom7RN93xMzdEPf5FyIgNMMiF4LLvfGouqOjiFNT 9y8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=0NVZSUUNEVQOMsvR7cbM5lFFVjOzt0lmMSIbfAXJCNQ=; b=VfR8w+d4sDoALhbktzUSOLB3KPOAvmzoBaYZJvQhsGYzaIrvI1d5uoAGoAJie7YCvX upGLawJVu67HH/RvGmkBWRV24QP2uK47t65yiUMSQA/p5fmG1XyaE2B3GeGW0jm5Zz6Y Durb/AUuQm3rTUEEWhVlqjL6mlyHbC0XrPujMmoky+3+j+DGBJ4uzdcnu2LZJQKABN/A Pbujt7YWShRrI1Zf/Igs3oqnem/1+HDY47x5Foe3jN7egJTOXvLs5YxGNkrI85BGrpsi WfIHgvrvUWZzbl6s4FnttR1O5sk7z1SgYJQzE/ybaz5nBnTEsMJZ8Z3N1SEcmD/sqVQS ONYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=co1nMnjq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id du12-20020a17090772cc00b0078849a014e9si993196ejc.196.2022.12.09.14.48.40; Fri, 09 Dec 2022 14:48:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=co1nMnjq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229822AbiLIWf2 (ORCPT + 76 others); Fri, 9 Dec 2022 17:35:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbiLIWf0 (ORCPT ); Fri, 9 Dec 2022 17:35:26 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D836C6F0FA; Fri, 9 Dec 2022 14:35:25 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 237A56238D; Fri, 9 Dec 2022 22:35:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 400CAC433D2; Fri, 9 Dec 2022 22:35:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670625324; bh=UHqQw9ydItZXFG/qBe/IWzVLihWfiLX6WpPk/Cct0mw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=co1nMnjq4SCIIlBPX7AWGnx8mgz+EG4DmN7HOP44ZmphONWhxkm4XCShj9/9oHVLr q0ZhEAtGrT2H18wdLvDLIjNj2W2TndkPuFauDcpcvgkdcFTi34rgSWqXz5Vad0O9Mj hU7HgKy3rQ+izFpD4UWf1kh1Mx0hhjSXJUUiKNDiSpi+UnmSfZxtSY5wlDkH/1NQEg Lt92Oq0N8ee0eX+zGQYiCW58UXf5kK5KnbOCvu9zpuLJllwhn7wfmYTqLpwLqy/RCp x7BzJC15i1Rz6f1E6ZTQNIyc5JrsSoAu1SDfYTRXxFaa/iFYqV3cThMxO2X5gC3zfP IrbFzLl8bPkjQ== Date: Fri, 9 Dec 2022 14:35:23 -0800 From: Jakub Kicinski To: Yunsheng Lin Cc: , , , , , , Subject: Re: [PATCH net-next] net: tso: inline tso_count_descs() Message-ID: <20221209143523.03d9584b@kernel.org> In-Reply-To: References: <20221208024303.11191-1-linyunsheng@huawei.com> <20221208195721.698f68b6@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 9 Dec 2022 16:48:57 +0800 Yunsheng Lin wrote: > >> diff --git a/include/net/tso.h b/include/net/tso.h > >> index 62c98a9c60f1..ab6bbf56d984 100644 > >> --- a/include/net/tso.h > >> +++ b/include/net/tso.h > >> @@ -16,7 +16,13 @@ struct tso_t { > >> u32 tcp_seq; > >> }; > > > > no include for skbuff.h here > > Do you mean including skbuff.h explicitly in tso.h? > It seems ip.h included in tso.h has included skbuff.h. Yes, we need the definition of skb_shinfo() so let's include the header. Let's not depend on second-order includes, it makes refactoring harder. > >> -int tso_count_descs(const struct sk_buff *skb); > >> +/* Calculate expected number of TX descriptors */ > >> +static inline int tso_count_descs(const struct sk_buff *skb) > >> +{ > >> + /* The Marvell Way */ > > > > these comments should be rewritten as we move > > the function clearly calculates the worst case buffer count > > Will change to below: > /* Calculate the worst case buffer count */ Thanks, you can replace the comment about the function with this comment. No need to have two comments, and mentioning descriptors is slightly confusing because descriptor is not always equivalent to a buffer.