From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E99ABC433F5 for ; Mon, 18 Apr 2022 07:13:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234235AbiDRHQH (ORCPT ); Mon, 18 Apr 2022 03:16:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229962AbiDRHQC (ORCPT ); Mon, 18 Apr 2022 03:16:02 -0400 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 802FC167EA; Mon, 18 Apr 2022 00:13:24 -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=Hq9bPJDCmmJJcYYhZgQX3k8+qqkaJlpzQFcim9Pzz90=; b=fp+ShII2FH5Zajc7vrhDG75aWUm6Chzn6IvA0E608xpaOcYpGygiBL0e iNZi8aqlnWxwTzb080fQ7nE+YA/j/WRtWx2X0ACDuNURtDLR+YaJGTVWD FCdf1Ku646SoTptPcWoN697q7OMOrYx9VJx35sKMPOK2xSUjbrFZl1PSW Y=; Authentication-Results: mail2-relais-roc.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,269,1643670000"; d="scan'208";a="32129822" Received: from 203.107.68.85.rev.sfr.net (HELO hadrien) ([85.68.107.203]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2022 09:13:23 +0200 Date: Mon, 18 Apr 2022 09:13:22 +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 v4] intel: igb: igb_ethtool.c: Convert kmap() to kmap_local_page() In-Reply-To: <20220418061430.6605-1-eng.alaamohamedsoliman.am@gmail.com> Message-ID: References: <20220418061430.6605-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 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, 18 Apr 2022, Alaa Mohamed wrote: > The use of kmap() is being deprecated in favor of kmap_local_page() > where it is feasible. > > With kmap_local_page(), the mapping is per thread, CPU local and not > globally visible. Therefore igb_check_lbtest_frame() is a function > where the use of kmap_local_page() in place of kmap() is correctly > suited. Same comment as the previous one. What is it about igb_check_lbtest_frame that makes this the right choice? The subject line also does not look correct. Normally, one does not put an extension on a file name in a subject line, ie igb_ethtool.c. Have you used git log --oneline to see what subject line others have used for this driver? 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 > --- > changes in V4: > edit the commit message > --- > 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 > > >