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 7A32BC433EF for ; Thu, 30 Jun 2022 16:09:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235775AbiF3QJh (ORCPT ); Thu, 30 Jun 2022 12:09:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235567AbiF3QJc (ORCPT ); Thu, 30 Jun 2022 12:09:32 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4B131EAFC; Thu, 30 Jun 2022 09:09:30 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id pk21so39992533ejb.2; Thu, 30 Jun 2022 09:09:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=W7SHta3R6YcleHmOphCvTADHKrbts/DoO7PiUh5TyAw=; b=leQQP/xhczwNdOGnF18R9mF1JXFj2pmiWegEIpuR/mn6I7XObmb8R/TeqQyM7hkH0F kYK75lbPEikoYA5d/mNMOo9I5X01TIWLhsFRp7GYYk4blQ9KDfwKc2R6hPys1gv31QZC 7vHGwCNZUN+IjHVGqL/BNxJzmdkkbru/xoOdG8X5yCdqqV0exGFQkXXtQdcDBQ5IPRBO Ks9mL31MeKBiF9JARxV/08FqW39PJuiX1sYOhBgCNdhcHsHkXHqyu36RSzhqg081jEJh mstGPi3BeGuxoB7S6rP1c6v9vJYkwQU5M8af5DrCcEhbq6GJXDOsa2sxpd3fswRdDhwP eb4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=W7SHta3R6YcleHmOphCvTADHKrbts/DoO7PiUh5TyAw=; b=T+D2AmOCNHdzK00YZRDUCYelNM5HmO5KsnCvANvXMIjovu+3clDmk0ra7JIfh/X1nz w1d248KJM9fl8na+XuPynb28A4vZXcHFjXUcYlM0Av4jrm3zLA2MmDQcV3QLGaZUHVhB q5vWK9kIGnvmRLc9nYo0jPnnK7UAyYOJuphP/Cz1aZhAptrfxdbqiRGd5rFuMTTFI4rr MeuokdjuMg1DhbTk8OxWLvowmLdIoN70NnNwmuNwMdsHBjIAht/btL7wQAH4oFapyOe4 LvrV24nYPQQSWs3bB4RxzTodPRpRCOe8XtL+E35p1XFNjaL9HubZk8kfg46QIfC/PI40 zh4A== X-Gm-Message-State: AJIora9SkLY6cS9XASW5R508D5XX5YjOkxl2twC6rH6bwXhEnOJ/PIZd wYSRS1lX/lzUfq5qklAZpXpZCpIKInIFdvwl9vI= X-Google-Smtp-Source: AGRyM1see/eF8lNqERI7kZvJTMTd5XDcrqHQx57Y8MmMZ80nmUey6lr33deQShd6xy8hmeSnHCAIpwbadHNwDYyAiBE= X-Received: by 2002:a17:907:d17:b0:726:a3be:bba4 with SMTP id gn23-20020a1709070d1700b00726a3bebba4mr9602604ejc.584.1656605369361; Thu, 30 Jun 2022 09:09:29 -0700 (PDT) MIME-Version: 1.0 References: <20220629085836.18042-1-fmdefrancesco@gmail.com> In-Reply-To: From: Alexander Duyck Date: Thu, 30 Jun 2022 09:09:18 -0700 Message-ID: Subject: Re: [Intel-wired-lan] [PATCH] ixgbe: Use kmap_local_page in ixgbe_check_lbtest_frame() To: Eric Dumazet Cc: Maciej Fijalkowski , "Fabio M. De Francesco" , Jesper Dangaard Brouer , Daniel Borkmann , intel-wired-lan , Alexander Duyck , John Fastabend , Jesse Brandeburg , Alexei Starovoitov , Netdev , Jakub Kicinski , bpf , Paolo Abeni , Ira Weiny , "David S. Miller" , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 30, 2022 at 8:25 AM Eric Dumazet wrote: > > On Thu, Jun 30, 2022 at 5:17 PM 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 > > > Sure, but drivers/net/ethernet/intel/ixgbe/ixgbe_main.c is allocating > pages that are not highmem ? > > This kmap() does not seem needed. Good point. So odds are page_address is fine to use. Actually there is a note to that effect in ixgbe_pull_tail. As such we could probably go through and update igb, and several of the other Intel drivers as well. - Alex 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 smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0FC98C433EF for ; Thu, 30 Jun 2022 16:09:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 939A541BEE; Thu, 30 Jun 2022 16:09:34 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 939A541BEE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1656605374; bh=MwNKZeQpxMUIshJbcpKeR887pUfEJCmIyHMAjLYbeH0=; h=References:In-Reply-To:From:Date:To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=O4QQrkHH+hGEurAzBlDLCj9pHTETMjfYYB+aJzdaxd61tqnSwTWHmLlsAIOq1t0TX TkAwl+2KuZxsxS2G6TQbDS/OLeM7vi0OTHhTdLuxgnVrc1dC9/24DkN6wX+tR3RQkq MXE5fs59VKXFUxbLo5rQfy0iU2tqlJ25SZcDTRTcIS7nv8pAdgfO1LdiTGik5Tx63s uWknJmaWoElamVM5Oa9eu2oJRxIBsbArJQTRjyWA3oVJqN5naUtx70r5HEW/A6ZUy1 76h8K3rUG4TpIQ3fXn8vSEvM67VG4IcKy10spP4WN0OkE2jBstbxUi65S0GQMuM6/W n7/HRvu+iGpEA== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Z_3otmimdfCQ; Thu, 30 Jun 2022 16:09:33 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 5215F42427; Thu, 30 Jun 2022 16:09:33 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 5215F42427 Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 9C1B41BF955 for ; Thu, 30 Jun 2022 16:09:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 752D640B1A for ; Thu, 30 Jun 2022 16:09:32 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 752D640B1A X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zw34yyvWPRtA for ; Thu, 30 Jun 2022 16:09:31 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 43BF640533 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by smtp2.osuosl.org (Postfix) with ESMTPS id 43BF640533 for ; Thu, 30 Jun 2022 16:09:31 +0000 (UTC) Received: by mail-ej1-x62d.google.com with SMTP id sb34so39855958ejc.11 for ; Thu, 30 Jun 2022 09:09:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=W7SHta3R6YcleHmOphCvTADHKrbts/DoO7PiUh5TyAw=; b=qo+1Mgt87WICuRODS9t890lF2CR24FdmPNmDfGYw0HahlW09XbhQ84gr3LR6YlcaT/ n9EEi1gkm0k09NrJzAXbNfxETATIIJobYsGpNFZ0FksLJpLhm4XK77WpqwjSSlGqsjvh nDyaBfbXj/iEwCBTupjkrbrueRGbY4TO/tdvZemXXPqqQZQl+EQZ8iIEWJuyn60Gd+a2 Qah+LUXq6aNj8e0KOVBHSR7Sh5+beJL8sJcHu2Dnb5nV1A/LulTk2f233hXY71JVG/p7 d9wTGxBz0nA7aMeQJoUsq50rAzKzPdex6p/Z3Ht4y8aEqJQ2QmnFV5T2HE9cNjH41lDt 0vVw== X-Gm-Message-State: AJIora82pbDSuo1L+SPHf/+fFxTpDDMyLTtma7fZwaqYWoAfM7Yd5FTk YMfL2XPBtIEHoBaOGXqfMt/vAjMZaJyv1J1pb6U= X-Google-Smtp-Source: AGRyM1see/eF8lNqERI7kZvJTMTd5XDcrqHQx57Y8MmMZ80nmUey6lr33deQShd6xy8hmeSnHCAIpwbadHNwDYyAiBE= X-Received: by 2002:a17:907:d17:b0:726:a3be:bba4 with SMTP id gn23-20020a1709070d1700b00726a3bebba4mr9602604ejc.584.1656605369361; Thu, 30 Jun 2022 09:09:29 -0700 (PDT) MIME-Version: 1.0 References: <20220629085836.18042-1-fmdefrancesco@gmail.com> In-Reply-To: From: Alexander Duyck Date: Thu, 30 Jun 2022 09:09:18 -0700 Message-ID: To: Eric Dumazet X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=W7SHta3R6YcleHmOphCvTADHKrbts/DoO7PiUh5TyAw=; b=leQQP/xhczwNdOGnF18R9mF1JXFj2pmiWegEIpuR/mn6I7XObmb8R/TeqQyM7hkH0F kYK75lbPEikoYA5d/mNMOo9I5X01TIWLhsFRp7GYYk4blQ9KDfwKc2R6hPys1gv31QZC 7vHGwCNZUN+IjHVGqL/BNxJzmdkkbru/xoOdG8X5yCdqqV0exGFQkXXtQdcDBQ5IPRBO Ks9mL31MeKBiF9JARxV/08FqW39PJuiX1sYOhBgCNdhcHsHkXHqyu36RSzhqg081jEJh mstGPi3BeGuxoB7S6rP1c6v9vJYkwQU5M8af5DrCcEhbq6GJXDOsa2sxpd3fswRdDhwP eb4g== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=leQQP/xh Subject: Re: [Intel-wired-lan] [PATCH] ixgbe: Use kmap_local_page in ixgbe_check_lbtest_frame() X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jesper Dangaard Brouer , Daniel Borkmann , "David S. Miller" , Netdev , Alexander Duyck , John Fastabend , Jesse Brandeburg , Alexei Starovoitov , intel-wired-lan , Jakub Kicinski , bpf , Paolo Abeni , "Fabio M. De Francesco" , Ira Weiny , LKML Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Thu, Jun 30, 2022 at 8:25 AM Eric Dumazet wrote: > > On Thu, Jun 30, 2022 at 5:17 PM 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 > > > Sure, but drivers/net/ethernet/intel/ixgbe/ixgbe_main.c is allocating > pages that are not highmem ? > > This kmap() does not seem needed. Good point. So odds are page_address is fine to use. Actually there is a note to that effect in ixgbe_pull_tail. As such we could probably go through and update igb, and several of the other Intel drivers as well. - Alex _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan