Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1675174pxb; Sat, 16 Apr 2022 17:13:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwq8wCiRcHOElV5TeQx4nbn9WOBM0Kgu+ZphI2S/+KW8WPU3vL7xM9ppwu2D3HiFg7j74Aj X-Received: by 2002:a63:d017:0:b0:39d:82c5:a86e with SMTP id z23-20020a63d017000000b0039d82c5a86emr4609941pgf.73.1650154382952; Sat, 16 Apr 2022 17:13:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650154382; cv=none; d=google.com; s=arc-20160816; b=oqEyCOlT7Wxd4ZNtSp1SfZ8eH5qN9wFucl1UJJ4Ju36VoxyqrkJeudQ33PRm+NGMK6 hfhUSmstd980KFQ4Ui6gjOi2E4Cn9yntPOoMGrDD0jhbH6Eke/1a3YEcqzL012oOhRwF VGj2KG6eytxopYhc3qvK64D3HraFclW8HAt1GH8SgHGWlC+5A2ZtLrCLf93f4lrDOvIq Yiv9lv6u4GxI0LMrrpvdqUUaTIpFjP1H957gErlC9r9OAw8lvPSIuDlmQ/ETOygaoI0B Wi7cK+m0ujSUmVN7/MnyivRhPp/kZy2fMYN1kemG5xSkz738GNSzbr+F6KMcIuipqdtX 0m1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=z9A4gkqrnB2OxeVyXP/QAPVgh7qVm2HOgeHFVAA094w=; b=GYasLFlSJsTEn0MVdkzcqGQ2y6/lE+e4wsDHtrbnTH9SIwzhoXNf5HeKvSeBR9TGEi ArS7xYmt6/lnSNeQ1+/zbBlZlDDGCKW0C6nhmsXPVduW8KE/RWRLmkaDSIr0wV83yqxs ZrD9D/kcocfIcNt+3gbfE2E+7FzWznQk5wBakGOM0zjHdX5GJ+pedoIILyDxjWf4TiRH 7/yz/JzFqHRBQw5mx7GxK1EB6bTu00sxjTP1s1fnkRkJb1e/3qLFGLFSpGbxJkqXshQz 6AUr4krDnvL/d9BF3eu1m+k/JlcgpwKVm2iTNrkqYUukX+Ek26c37/7h5LFKogIl46yV A9Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=EtwyZYsy; 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=inria.fr Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o7-20020a1709026b0700b00156bdbdedf4si4735278plk.269.2022.04.16.17.12.47; Sat, 16 Apr 2022 17:13:02 -0700 (PDT) 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=@inria.fr header.s=dc header.b=EtwyZYsy; 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=inria.fr Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231793AbiDPLec (ORCPT + 99 others); Sat, 16 Apr 2022 07:34:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231786AbiDPLeb (ORCPT ); Sat, 16 Apr 2022 07:34:31 -0400 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2F2840A3E; Sat, 16 Apr 2022 04:31:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=z9A4gkqrnB2OxeVyXP/QAPVgh7qVm2HOgeHFVAA094w=; b=EtwyZYsyeWT0eBa/S5Z0d8LtdEbsVCfwjtKMIRvCu6lScgMV94c3RkSR 26n/GJ1ZI1NquP9Pbilvv2vFFtY4aZh8Porxi6383xy6oQAHKawiyJ39j Y9ujjtHPSd8sMrWt9d5itN2mcUE++kFGD5xtQnHAXLMUHUAMmIwRIZ+/l M=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=julia.lawall@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="5.90,264,1643670000"; d="scan'208";a="11697161" Received: from 203.107.68.85.rev.sfr.net (HELO hadrien) ([85.68.107.203]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2022 13:31:56 +0200 Date: Sat, 16 Apr 2022 13:31:56 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Alaa Mohamed cc: outreachy@lists.linux.dev, jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ira.weiny@intel.com Subject: Re: [PATCH v3] intel: igb: igb_ethtool.c: Convert kmap() to kmap_local_page() In-Reply-To: <20220416111457.5868-1-eng.alaamohamedsoliman.am@gmail.com> Message-ID: References: <20220416111457.5868-1-eng.alaamohamedsoliman.am@gmail.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Sat, 16 Apr 2022, Alaa Mohamed wrote: > Convert kmap() to kmap_local_page() > > With kmap_local_page(), the mapping is per thread, CPU local and not > globally visible. It's not clearer. This is a general statement about the function. You need to explain why it is appropriate to use it here. Unless it is the case that all calls to kmap should be converted to call kmap_local_page. julia > > Signed-off-by: Alaa Mohamed > --- > changes in V2: > fix kunmap_local path value to take address of the mapped page. > --- > changes in V3: > edit commit message to be clearer > --- > drivers/net/ethernet/intel/igb/igb_ethtool.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c > index 2a5782063f4c..c14fc871dd41 100644 > --- a/drivers/net/ethernet/intel/igb/igb_ethtool.c > +++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c > @@ -1798,14 +1798,14 @@ static int igb_check_lbtest_frame(struct igb_rx_buffer *rx_buffer, > > frame_size >>= 1; > > - data = kmap(rx_buffer->page); > + data = kmap_local_page(rx_buffer->page); > > if (data[3] != 0xFF || > data[frame_size + 10] != 0xBE || > data[frame_size + 12] != 0xAF) > match = false; > > - kunmap(rx_buffer->page); > + kunmap_local(data); > > return match; > } > -- > 2.35.2 > > >