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 DADECCCA480 for ; Thu, 30 Jun 2022 15:21:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235723AbiF3PVP (ORCPT ); Thu, 30 Jun 2022 11:21:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235238AbiF3PVO (ORCPT ); Thu, 30 Jun 2022 11:21:14 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B251B381B9; Thu, 30 Jun 2022 08:21:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656602473; x=1688138473; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=IV4NsOLZ4pseLjE+Zgo99/IZslsFn8JpLQVKMjQpu2s=; b=mWkAN/kVzTURRBM8V4BDAg3hUO9Nu8Lm4efh9/iesXOlkTL2xcIsqzz6 SYnoH4yw/FF0a/VWICxdiTcCjBY9nEcMHZeNS8PKqBzmL7iELdoxGEeVL cNsZD+EVGy2YJGvjbcLvSlirGpirRpzEpsHjWWcPPTk01ukVly0A5BBgS Sg6W+sj+gpCBYvSg1wIkogwDN/+QDEke8MOCNy3qDHM0CSmNTdrTbHlMe A3CUtHlBq6tJJ1/d6A7TESXoCrMQlCwG0fgO6MZaN4soLd3dr/dvu55Zf BgVzJqWXwK45ZIGOPCd1GrvucFqMMjO4MRBAKY8Q/6L36LPa40Edag34v Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10393"; a="279923360" X-IronPort-AV: E=Sophos;i="5.92,234,1650956400"; d="scan'208";a="279923360" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2022 08:21:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,234,1650956400"; d="scan'208";a="918087557" Received: from boxer.igk.intel.com (HELO boxer) ([10.102.20.173]) by fmsmga005.fm.intel.com with ESMTP; 30 Jun 2022 08:21:09 -0700 Date: Thu, 30 Jun 2022 17:21:08 +0200 From: Maciej Fijalkowski To: Alexander Duyck Cc: "Fabio M. De Francesco" , Jesper Dangaard Brouer , Daniel Borkmann , intel-wired-lan , Alexander Duyck , John Fastabend , Jesse Brandeburg , Alexei Starovoitov , Eric Dumazet , Netdev , Jakub Kicinski , bpf , Paolo Abeni , Ira Weiny , "David S. Miller" , LKML Subject: Re: [Intel-wired-lan] [PATCH] ixgbe: Use kmap_local_page in ixgbe_check_lbtest_frame() Message-ID: References: <20220629085836.18042-1-fmdefrancesco@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 30, 2022 at 08:17:24AM -0700, Alexander Duyck wrote: > On Thu, Jun 30, 2022 at 3:10 AM Maciej Fijalkowski > wrote: > > > > On Wed, Jun 29, 2022 at 10:58:36AM +0200, Fabio M. De Francesco wrote: > > > The use of kmap() is being deprecated in favor of kmap_local_page(). > > > > > > With kmap_local_page(), the mapping is per thread, CPU local and not > > > globally visible. Furthermore, the mapping can be acquired from any context > > > (including interrupts). > > > > > > Therefore, use kmap_local_page() in ixgbe_check_lbtest_frame() because > > > this mapping is per thread, CPU local, and not globally visible. > > > > Hi, > > > > I'd like to ask why kmap was there in the first place and not plain > > page_address() ? > > > > Alex? > > The page_address function only works on architectures that have access > to all of physical memory via virtual memory addresses. The kmap > function is meant to take care of highmem which will need to be mapped > before it can be accessed. > > For non-highmem pages kmap just calls the page_address function. > https://elixir.bootlin.com/linux/latest/source/include/linux/highmem-internal.h#L40 I knew the second part but not the first, thanks. So basically it is advised to convert the page_address() usage in similar loopback testing code that other Intel drivers have, I'll do that later. > > Thanks, > > - Alex