Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp96179rwb; Thu, 22 Sep 2022 15:03:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7kjtJ1ufLc1VS1CABpTFa5nvFg8g/ww2sBanu7qGJCfPaBWO/TAYi3iFR5PLyv8GVd2WG4 X-Received: by 2002:a63:e306:0:b0:42c:414a:95e9 with SMTP id f6-20020a63e306000000b0042c414a95e9mr5000842pgh.139.1663884224167; Thu, 22 Sep 2022 15:03:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663884224; cv=none; d=google.com; s=arc-20160816; b=ks2PqSK/uYceGxtGWCpqe+l8Suhqn4zr0CvhaSH9OCz/LW2VB6IV7d9shrfOp81p1F TjXZPdZyyYo6SK9t4jE4FlgWc3Nz4VHIrZpiF6rBwISV2fJeKXM+YIS6thMDgOgF1KDH Dc/OsKVQGDYBWK3hoLsNBkltm/knB6erXZiwUBeYDN6x0ISPGh4IxEvYQdRKH8sNc+S5 LfkykMs0w4pQCrIqG+CAVKE+dMY2vi4ItrRVLxcXdjUnjb1EyGUdtO7z9gnVqK/sKTG9 qfZemzu0yoJ9OSj0PpPCDDmxhOlJq6NrkOXlGGbOi+tR4TfF4mPEUMce5gJiHFx2hjPW wmwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=U3NGbjctdNtYZUAw53yWij8HwInl1GKHMSlSeRHwL2A=; b=EKsIP3SkYAhLaTugq6Cl0reCz2hXfm8VcWAT24GqMWY7UAEz8ITRD3ZFULbZakyblr DQWfBkpyzsVy/Hmr0SBjJKsaaC9/P2++DcdP1RPq6AzHZEoebAlZ1cpdHUDCmC69F8Jj FAPAkFfzt0U0ng58LkMreBx0WMVXlsMRAeJdShpHRlLsA/dZVb6sw7W/KbQjev7tvOxP Il8/bKkCfPKhnzQZ7LJ1qyaz09y0ejdS25oRuMlCbS8/lhYCrVL5V9AWZJU7K9ktFR3K Fx9l343DAc3UME610y28cl6vDnWB6XxqwU2vu2lnuxHBrrV1ZjUkcXsVCPCa2XQhAWik +NOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=O94ciy7H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v10-20020a63610a000000b0042b5ac13315si7219517pgb.463.2022.09.22.15.03.26; Thu, 22 Sep 2022 15:03:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=O94ciy7H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230035AbiIVU7H (ORCPT + 99 others); Thu, 22 Sep 2022 16:59:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbiIVU7E (ORCPT ); Thu, 22 Sep 2022 16:59:04 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EF1DD69C0; Thu, 22 Sep 2022 13:59:02 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id p1-20020a17090a2d8100b0020040a3f75eso3409013pjd.4; Thu, 22 Sep 2022 13:59:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=U3NGbjctdNtYZUAw53yWij8HwInl1GKHMSlSeRHwL2A=; b=O94ciy7HakFm25cgL9FxzuFEvodLFGdVNX4xWMGxwhnQ9kRVsEdnU9538O5Z6Y/zRM ICn2RYFoam+WVao99bv2zTAsu6If+eHCcUwdNR9e6QyjVNjif/fi0Y2Ww202HB7rPUzT 0OPBqhJK/p0JiJhAso96iAiGciuZLso6k1kwtZ1mHSHGqteBCxja3tlHDKWICjNWm62o k/2hRRnLCPl44cW/dPQqlJQKSWf4sgDTael/1STTxuhKVM2wmA72AziOr1vaq2umKCmt Sp9PyEXx5QrTBb35iqpqrkVcvFibgp8Tj4onsnkM2heTUouvjOyw+28ib2oiiHgIiEXV SXog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=U3NGbjctdNtYZUAw53yWij8HwInl1GKHMSlSeRHwL2A=; b=4lSK9l84I9syvKF6YEtOkFfnr8cLnvcWQAZ850OmBZ2cUEcv2trGSrZMb3i0vQdkEn WEzAJjOsDtiZrT/XSgBdu1uDQFlbAc0KLJMgHLia1kEFeM50Xt7bfe5nnyLa5JGPqPyT YmPydO0x0dk0NsfgbXFRjbiIgdw6fyHjVyi8tXAz/N3u1yRkwCy3s0XoeUwdq/T6ZtJ1 oxmpC77kZOXlP2oxi9QQujZmqL4zl3FycoImGvDn2jfQRZG8eIOBrnMlMZA1lUxK3Uq9 VfvpTLrhsZwnamNqVkkS1n8uiYSKtMg18UMPxuXQNnqLc1aSS1PQA3dtFNW3W7gYvtM5 ZYHw== X-Gm-Message-State: ACrzQf0GLN0DxpxTmtYWPuHL/xDB0rohU98nlP5zAx7FlcjByZNcaBYS Fw69lQix/hPAbyte6SI1UOPQ2KnKYx3BPWXYZ9k= X-Received: by 2002:a17:90b:3912:b0:203:c0a0:f582 with SMTP id ob18-20020a17090b391200b00203c0a0f582mr12014942pjb.141.1663880342080; Thu, 22 Sep 2022 13:59:02 -0700 (PDT) MIME-Version: 1.0 References: <20220629085836.18042-1-fmdefrancesco@gmail.com> <2254584.ElGaqSPkdT@opensuse> <2834855.e9J7NaK4W3@opensuse> In-Reply-To: From: Alexander Duyck Date: Thu, 22 Sep 2022 13:58:50 -0700 Message-ID: Subject: Re: [Intel-wired-lan] [PATCH] ixgbe: Use kmap_local_page in ixgbe_check_lbtest_frame() To: Anirudh Venkataramanan Cc: "Fabio M. De Francesco" , Jakub Kicinski , "David S. Miller" , Eric Dumazet , Netdev , Maciej Fijalkowski , Jesper Dangaard Brouer , Daniel Borkmann , intel-wired-lan , Alexander Duyck , John Fastabend , Jesse Brandeburg , Alexei Starovoitov , bpf , Paolo Abeni , Ira Weiny , LKML , Tony Nguyen Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Thu, Sep 22, 2022 at 1:07 PM Anirudh Venkataramanan wrote: > > > Following Fabio's patches, I made similar changes for e1000/e1000e and > submitted them to IWL [1]. > > Yesterday, Ira Weiny pointed me to some feedback from Dave Hansen on the > use of page_address() [2]. My understanding of this feedback is that > it's safer to use kmap_local_page() instead of page_address(), because > you don't always know how the underlying page was allocated. > > This approach (of using kmap_local_page() instead of page_address()) > makes sense to me. Any reason not to go this way? > > [1] > > https://patchwork.ozlabs.org/project/intel-wired-lan/patch/20220919180949.388785-1-anirudh.venkataramanan@intel.com/ > > https://patchwork.ozlabs.org/project/intel-wired-lan/patch/20220919180949.388785-2-anirudh.venkataramanan@intel.com/ > > [2] > https://lore.kernel.org/lkml/5d667258-b58b-3d28-3609-e7914c99b31b@intel.com/ > > Ani For the two patches you referenced the driver is the one allocating the pages. So in such a case the page_address should be acceptable. Specifically we are falling into alloc_page(GFP_ATOMIC) which should fall into the first case that Dave Hansen called out. If it was the Tx path that would be another matter, however these are Rx only pages so they are allocated by the driver directly and won't be allocated from HIGHMEM.