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