Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp812815rwb; Tue, 29 Nov 2022 05:48:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf40n6yZVKS8XVKQ632jfp6iB1k7ChtcFiKgsQO6c8YJGs4A3Xjwo+RmebiNv0YgcVoLeA47 X-Received: by 2002:a17:906:b241:b0:7bc:1f2c:41b5 with SMTP id ce1-20020a170906b24100b007bc1f2c41b5mr19439909ejb.463.1669729707883; Tue, 29 Nov 2022 05:48:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669729707; cv=none; d=google.com; s=arc-20160816; b=oNw+BLx9eBYzZbc81AzcrSEG3oXSGm7yQN9/KcqC03lyy/2e+zO1xkIV3QWxM/NBog N0Fk0IXcchx003T3/JvuRETAdkpkzMzSE/sqa6QwwE0ZCVsRqerT56lPc81vA3ttIoA1 ojfBBuS4ukEf9Is721X8cJpFNVSN02EeI+mpSR21f6D6bap0ukwhD9IbDLMuAVJ0wVVf /wdKHMdYALm6Qhili0Hq//1bT2eZzEH+tsLiNCvVGJZPC3eV6kMXO5CTSFVePUH1McJu mt2AD93GqkPKfQe/AAQCBcC8SZvmb77HO5Ngb/w2oeyDnjMI42HV5Eqwas3o6BtzQF6K ojAQ== 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:date:subject:cc:to:from :dkim-signature; bh=98cyvTU7DO5QD5Lfz0jJ5n2mwJAJ5xQ5eMaypYq8Nc0=; b=DPPfQAURvgox81oJ394eVMVhCx3grY2OA1C/BDSRxE/OMT9DdiW8R005IXO8JSe+P7 MYiSLOot8hLWUXq1wEUIjRI6dG7UAiqKwmORgCe61fl/Xs9086/alTSQP+14H6WSBJUH IJWuRG1CLVBYTDzQyQ59dMYwRh3K1qbqHd+2LFL15cTBfuUEULUgu+AN+siiKdYNGWTQ nTVjLnZKBMVK+/cWWvZe3++76Ys2hfqlH+74xLEeRb/izyqrJ7AEUlcggy3s+euPvAWz rPBB87+jr0wnxzc/7RILwaWVrlOP9ZahtOUPxP4RFhJoKvtJElV4whYkSNxBVxuyqjTM /e1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EFaO2CMy; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xa3-20020a170906fd8300b0078e0e850902si11172252ejb.868.2022.11.29.05.48.07; Tue, 29 Nov 2022 05:48:27 -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=@intel.com header.s=Intel header.b=EFaO2CMy; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234045AbiK2Nmm (ORCPT + 83 others); Tue, 29 Nov 2022 08:42:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234982AbiK2NmT (ORCPT ); Tue, 29 Nov 2022 08:42:19 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 685206205C; Tue, 29 Nov 2022 05:42:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669729338; x=1701265338; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PG5xQuxDe7q39dDNmtpmF3QxaHI/8GT47yySIJeveVA=; b=EFaO2CMy57MmGWejh59hfSmwG+DfxDNNzeLJlG9MoOOl7vm2OtTg16Bf PzTtPKB6tNrBvt5+75auSFx2zvhXs5F8hg+YtwLO8RQy+2SU1v5h2C59N y4tdQc2e1vQNvZ2zgjurEnzdoWb90OPQcXlak5qE1djbD4Yc5XnX6kPQd YJORPmHLJg2oee63sk/gHj+5rcKVeokE54n6Qvd3PS2GVGxB9DlbIWiho aOuO15MlnjgGft8lN8rDngqU8mvlpzwnGMXMJK/eOaBXj/4hj7EAGDiH+ byflveN/8mkzdlzLJL6eUEgNm5zKP9r9F/LLW6dELzX8sAQLd3LcRlLTD g==; X-IronPort-AV: E=McAfee;i="6500,9779,10545"; a="401399975" X-IronPort-AV: E=Sophos;i="5.96,203,1665471600"; d="scan'208";a="401399975" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2022 05:42:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10545"; a="621457612" X-IronPort-AV: E=Sophos;i="5.96,203,1665471600"; d="scan'208";a="621457612" Received: from irvmail001.ir.intel.com ([10.43.11.63]) by orsmga006.jf.intel.com with ESMTP; 29 Nov 2022 05:42:15 -0800 Received: from newjersey.igk.intel.com (newjersey.igk.intel.com [10.102.20.203]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id 2ATDgD0U028461; Tue, 29 Nov 2022 13:42:13 GMT From: Alexander Lobakin To: Paolo Abeni Cc: Alexander Lobakin , Coco Li , "David S. Miller" , Hideaki YOSHIFUJI , David Ahern , Eric Dumazet , Jakub Kicinski , Michael Chan , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v2 1/2] IPv6/GRO: generic helper to remove temporary HBH/jumbo header in driver Date: Tue, 29 Nov 2022 14:41:20 +0100 Message-Id: <20221129134120.3084527-1-alexandr.lobakin@intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <9480856d183c88a205fd79d9dbc156a7fd3ea0d3.camel@redhat.com> References: <20221123191627.3442831-1-lixiaoyan@google.com> <9480856d183c88a205fd79d9dbc156a7fd3ea0d3.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 From: Paolo Abeni Date: Tue, 29 Nov 2022 10:33:59 +0100 > Hello, > > Only a couple of minor things below, reporting them as this is still a > RFC, right ? ;) > > On Wed, 2022-11-23 at 11:16 -0800, Coco Li wrote: [...] > > +static inline int ipv6_hopopt_jumbo_remove(struct sk_buff *skb) I thinks it's relatively small and inlineable enough to not make it an external function, right? I'd keep it inline just how the author does it, the compiler then will decide. > > +{ > > + const int hophdr_len = sizeof(struct hop_jumbo_hdr); > > + int nexthdr = ipv6_has_hopopt_jumbo(skb); > > + struct ipv6hdr *h6; > > + int err = 0; > > + > > + if (!nexthdr) > > + return err; > > You can help a bit the compiler avoiding err initialization: > > int err; > > if (!nexthdr) > return 0; Same with the end of the function, @err is unused after skb_cow_head() and always equal 0, so the end return could be just `return 0`. > > > + > > + err = skb_cow_head(skb, 0); > > + if (err) > > + return err; > > + > > + /* Remove the HBH header. > > + * Layout: [Ethernet header][IPv6 header][HBH][L4 Header] > > + */ > > + memmove(skb_mac_header(skb) + hophdr_len, skb_mac_header(skb), > > + skb_network_header(skb) - skb_mac_header(skb) + > > The have could be: > > skb_mac_header_len(skb) > > which is IMHO a little more clear. > > Thanks! > > Paolo Thanks, Olek