Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1223502pxb; Sat, 16 Apr 2022 02:09:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9Mt0GFAobEJLsNkMUFNDVwF52EInEuMT1miyocwB0Lpmjixx+u5XWF3Q6ddM1TeSgSbt1 X-Received: by 2002:a05:6402:d0e:b0:413:3d99:f2d6 with SMTP id eb14-20020a0564020d0e00b004133d99f2d6mr2940400edb.189.1650100173642; Sat, 16 Apr 2022 02:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650100173; cv=none; d=google.com; s=arc-20160816; b=PMIxnQoIUUOmHJ72XI9IokoTKjzC6jW4V5aoTIN3nZaSBREZhyfobn/Xy1EMsNtilt 4fQAaX07hAlrSo1ZPqIhASVLNZOkWQFcI2hoff3yWZnYnUOlliV5F1R5emhapXvNuALt jbfxl+by1chCwyjwzRrPWg664lhsaBzhScekVDqZWQkicMoFAKUqTZU4R9TTqb1chYQu pVMFOLvHfsbcfKbXxZaiOKC/IN7wDbOGLf/OYTvF5iJfQap8lC+gFKDdUn44+rR9AqJy UPdOddTrja5YdfeZNtBa+97ifde/JMTjx4u+UfeH/BQDMYr23nh8sSpG3/uBUaQAQmyD d6AQ== 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=uNkcqohuYyDBM1uM8iaZqasZVYq+vCj2MnEBhaavjiY=; b=K0sxNM1eOYNmOvycPbztN6YfgfG9okGCw96R7utMJ4EpwY8c035Kpne8ohTiE1/0vX 5kJ31fe8OFCGRwqx/QmCNNiqSO5IOzrddtXLWqpPoRASV+5DoddFa2h4pxCkZxHXfRIg bGrsADiQKyanVTCm2+2FM5kn1Z89rsSL0pNJBzBlUvrrnsYAvZZQnw28vYVUR3tZq1c8 YcRN3wu/IO2LQVECDTvCtsXBLIRNzckeWh+MB87WRDk3GDEOK1ArEKtJ8+goxC/sL0zk JhOUjZaEFxTj/9G3DElW08DzHSEn2KVVcZ0WV1S1FXkFtab0JkQY6D6qqvEwnV0BRpb7 DQNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=bOUyhMkb; 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 z14-20020a170906944e00b006e7f908e9d6si2563231ejx.615.2022.04.16.02.09.08; Sat, 16 Apr 2022 02:09:33 -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=bOUyhMkb; 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 S230012AbiDPHkL (ORCPT + 99 others); Sat, 16 Apr 2022 03:40:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230002AbiDPHkJ (ORCPT ); Sat, 16 Apr 2022 03:40:09 -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 0A5F9E2F62; Sat, 16 Apr 2022 00:37:36 -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=uNkcqohuYyDBM1uM8iaZqasZVYq+vCj2MnEBhaavjiY=; b=bOUyhMkbovFHP9ui92W3xjlOSSKS64CpFVNDtR89Nmez9b4juIshm7jM bAyEtarlAiappoWHYePSBzNVBnqw5DCwZR3eZH4PANIg+Jn37/dQjcT3e FnpCMCeSQ3EgRk62JPUxZH/B4NdzZ2OsN85Qra3OCLMiZKbNUraCR168V I=; 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="11683753" 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 09:37:34 +0200 Date: Sat, 16 Apr 2022 09:37:33 +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] intel: igb: igb_ethtool.c: Convert kmap() to kmap_local_page() In-Reply-To: <20220415205307.675650-1-eng.alaamohamedsoliman.am@gmail.com> Message-ID: References: <20220415205307.675650-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 Fri, 15 Apr 2022, Alaa Mohamed wrote: > The use of kmap() is being deprecated in favor of kmap_local_page() > where it is feasible. And why is it feasible here? julia > > With kmap_local_page(), the mapping is per thread, CPU local and not > globally visible. > > Signed-off-by: Alaa Mohamed > --- > 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..ba93aa4ae6a0 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(rx_buffer->page); > > return match; > } > -- > 2.35.2 > > >