Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp67106lfe; Fri, 15 Apr 2022 19:51:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwYELcZZweqlwSSg4bRU5jDMlr8mKfcs0IdKbgKMUi2yL1ULeRIAMwHyzyniIVLc6uYS/B X-Received: by 2002:a05:6a02:283:b0:342:703e:1434 with SMTP id bk3-20020a056a02028300b00342703e1434mr1450258pgb.74.1650077467193; Fri, 15 Apr 2022 19:51:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650077467; cv=none; d=google.com; s=arc-20160816; b=Yo2R11rjK0LEI+EjpuOcLZwkf4B0yy3d1J9SRxJmzV7zGSvG3O+i9zP6hDjkxeJKN3 ZZdrFFJW0d6QIDAIy5Lr2eOlXoDr5JC2zjVdADp1Jmtr3avLgGJvtM/elTRsZdKIUziC +tiPLb60h7pruJOSJpl+HcJtRcBBZBZpBf5FanxkDS8aWlYE1sqlki32AHdlRrBtgo6g JTi4FdKk1kT1DPsxFPv7sjpWmj9cwvAp7KGKM7wDXoWP0OuK4NqdQ+e+0RSC1dQe/F4s swMZgfAueQeBRUc33XisWF3/mfk8Vf+n9GwQwAGD0qJp13JNSHPDOukpCVmDpSPVqdQ4 WErQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=K661SeVjfjm40/ajBVyDtl5qfOYlfB+1y0XGeMywF+w=; b=oyqrzfOUlaFL/giI8Qfp/v4cF504zdkaOGxQ0RGeeUkmLsnSHtMsBm86msQfYCqhQE IcJpu8Kl4OxfyUSEOov0YPuWU4/puvyKrGeMkxWE1zKDJ8MFsw5ywDIj6GwWJYigDi7m u8JGIh/RvoznvRiFXSOYbSwGHFrMU9fAzjseUmmgqBlo+Me+OyDqTUcEkjjx7qUD0IaJ xepleOkwuVb7FBxb+SHmGQrNOUcdiGdt28ub2amca8pQbKZLZQpBfK9Wx9E9mOaF73tx M/kv1+2wbj2NQKARhGIMugdFy0syZJmbaRrBa8a9jTJejtF8VInHsFonjY13tOZOpdjc zzhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="XpLM2Q/7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id ng7-20020a17090b1a8700b001c61582eda2si6679823pjb.165.2022.04.15.19.51.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 19:51:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="XpLM2Q/7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3F102237DB; Fri, 15 Apr 2022 19:08:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229659AbiDPCJV (ORCPT + 99 others); Fri, 15 Apr 2022 22:09:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbiDPCHE (ORCPT ); Fri, 15 Apr 2022 22:07:04 -0400 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 755693A738; Fri, 15 Apr 2022 19:04:08 -0700 (PDT) Received: by mail-ed1-x52a.google.com with SMTP id b15so11726849edn.4; Fri, 15 Apr 2022 19:04:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=K661SeVjfjm40/ajBVyDtl5qfOYlfB+1y0XGeMywF+w=; b=XpLM2Q/7Ny4osrW3Ec9ro1rQR9RBXNcdhRPgPczdiPb9ze20vSUvjSzhPUKlMX+2Dc rDBjB+dfEU4qJv+2FJ/uoo8JkpvF3oHd+cWRq6AKY07HKcy8CPBfezLm3ilNKrIeg+k2 2Vjv5PUwWu6SK9jouPsQ2sZZvXDo7V6loHSjz20aialUkIg6U7x9VqfjFDv6oyBrLNTB nW+nMeQYp2kOs8ejApvuGGsY/S61Uon7NyT+ZgFOm16vRlJu2OQhFzJ9C8d4RfLBm3/f 1TZuNYvRyapTmNk8MIKehKZfpq+eyGJo5hyZlmPFqNeekF68PKaLATovp3Xnf0d7GtTS JIlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=K661SeVjfjm40/ajBVyDtl5qfOYlfB+1y0XGeMywF+w=; b=1yDcT5vj7AsYExz7NVHK884gX9301MwKdrqfQ8IK6Hk5CUXATa7TZAbagkovSh5ZTi Dh3bCyvY+T5pCW5LueXDmT22gKBtyq4SH8ex2VEDDzZoi/81QhIwM9R+xXNorwkRqrUU vPJf1fSkHIbCWF6cVLcRLdUptKAHsKcBNv5uUQnw7SqsOm0w4iBM2g5rV2ZKZ/QANvCk 2XI9hg2q870uO0JkBA12ogTPdmtMb+nPe9/xZ1qYdhML4ML2QgoeiGYwwXfin6wAko3s xj8lPr2HrFf6yNziaXilwfRmZwONTyt1oQMmQbLXpDaHXwzB64uSAI3m7IdVWlcTYHrN V5SA== X-Gm-Message-State: AOAM532+7wpi3ehmR030KNsRmSku71OU73GURrQpvhODXzqTvAyAPu2b xGH5W4yGCn6B1X58ZBAB83OvN+8kTK84qA== X-Received: by 2002:a05:6000:14d:b0:207:a75a:ae0c with SMTP id r13-20020a056000014d00b00207a75aae0cmr990788wrx.398.1650072820100; Fri, 15 Apr 2022 18:33:40 -0700 (PDT) Received: from [192.168.1.14] ([197.57.90.163]) by smtp.gmail.com with ESMTPSA id bs12-20020a056000070c00b00207a2c698b1sm4708190wrb.40.2022.04.15.18.33.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 Apr 2022 18:33:39 -0700 (PDT) Message-ID: <78253f3a-cdca-166a-ee54-e2173b2be5a7@gmail.com> Date: Sat, 16 Apr 2022 03:33:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] intel: igb: igb_ethtool.c: Convert kmap() to kmap_local_page() Content-Language: en-US To: Ira Weiny 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 References: <20220415205307.675650-1-eng.alaamohamedsoliman.am@gmail.com> From: Alaa Mohamed In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 ١٥‏/٤‏/٢٠٢٢ ٢٣:٤٠, Ira Weiny wrote: > On Fri, Apr 15, 2022 at 10:53:07PM +0200, 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. >> >> 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); > kunmap_local() is different from kunmap(). It takes an address within the > mapped page. From the kdoc: > > /** > * kunmap_local - Unmap a page mapped via kmap_local_page(). > * @__addr: An address within the page mapped > * > * @__addr can be any address within the mapped page. Commonly it is the > * address return from kmap_local_page(), but it can also include offsets. > * > * Unmapping should be done in the reverse order of the mapping. See > * kmap_local_page() for details. > */ > #define kunmap_local(__addr) \ > ... Got it , Thanks > > > Ira > >> >> return match; >> } >> -- >> 2.35.2 >>