Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp417683iog; Thu, 30 Jun 2022 03:23:26 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u1V7sfbqprho85qxBiQAlEuhdUs2Dmmb5NmCg2VYLPOrRr1HiSNjZ5XXimZ0gwbHPpmW8U X-Received: by 2002:a05:6a00:1306:b0:512:ca3d:392f with SMTP id j6-20020a056a00130600b00512ca3d392fmr13778410pfu.79.1656584606283; Thu, 30 Jun 2022 03:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656584606; cv=none; d=google.com; s=arc-20160816; b=x5tkJrH4PdyOx1l827nqoBNJnxxMg3PAeViwdrqVNA0qa6Q2PdDtlJUs9YRe/Ss27l 8kofXmf8KPU37OINag0+RSb531E+qJKkS/MvQFhTNm4HfGVCTbrHv3lQLUoOf/N4Lbn5 o0eg4h5a9EnWtnhK7RrsdpbY/G/TnCbUGWzVb5r+TMfnm4QElnTWdSWrMlEKKif0KMBg NP71n8ezrgc7z8G3PJOkUrQ/Z2WXvkw/TQ5ulbQZZKz6at4yUdhuNaYRCkxSDYfNW1aS TIuZqFJW8SzImNTHL0B1BsBQHrv8avnd+Mut5PJXkmjj2M5FkY7cw62JeXfzMW4ZwQaH 94VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ss8NleTaYvog3sMDYcEXvT5UqpI9Eli6z0bxZFs86Ok=; b=Lj6i+zGmjqjPescdj2uakJxVCJzhTTxvaaI9ymfB68lWt5JCyNhUlTniIyifXd1+8e 6wSwA7pN5S89Es619yGE3Ac+0q23pVJ0rG7EaJNUURGwvLN3OluBW+L54Nyi4NCNQGlP YjRnKhYFiZdFVwvwzMVePEWlCjtbaqAPhypHkvVQq0awin8c4oiN8mDw+ok2gPgO3X0S NS9B9N13jhhwHOCeikoXhXwyPsACxCiJ1vjrYTldRKW+4uXEBwyjoCTzRCdahjnkvTkK pO5uzfSxsefby/0wVauHkYtnktmcZ0uM52Tj6ffJcdvV6NnAmDDev/BhdOuC/G9H5Iv/ VyVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HOGc3X8x; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 5-20020a630105000000b0040554635271si21996443pgb.703.2022.06.30.03.23.13; Thu, 30 Jun 2022 03:23:26 -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=@intel.com header.s=Intel header.b=HOGc3X8x; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234781AbiF3KKa (ORCPT + 99 others); Thu, 30 Jun 2022 06:10:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232276AbiF3KK2 (ORCPT ); Thu, 30 Jun 2022 06:10:28 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B182D273; Thu, 30 Jun 2022 03:10:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656583827; x=1688119827; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=XzV8lb39RqU/gtzU+hmSRVGu76gzswS57eUcYcMU+Qs=; b=HOGc3X8xeVZh6WkdnPNtYMDqFZ+uKYO34O77F0/UFVnVpPctzdsj0OVX /ZJ4UymAqvO2zDiGSUNOH19ZGYWzdRxH8KtHU1GzhmzZWECOSbVfYGRgC wFGwL4CnOI7TsRUESlF0CbATIwfeV13stui9dqRihtcwsEqZbx2Y8Kp0D jIacfifir3O1avIrQ8Dneiriv3p/XM+pqfKk77yS7+l/SLwQMP5dto4bZ azYv8Ph6zwGmGKIR+GNTkQKW9qbsE96+OoN4aJzBmqn7qiEAVtOJCNbWx upBuH4r7i5xfsIYI4hSXFsSFAxar1WRKMxooY/0aCuYRtwEWGka5WmscM w==; X-IronPort-AV: E=McAfee;i="6400,9594,10393"; a="265342094" X-IronPort-AV: E=Sophos;i="5.92,233,1650956400"; d="scan'208";a="265342094" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2022 03:10:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,233,1650956400"; d="scan'208";a="680918936" Received: from boxer.igk.intel.com (HELO boxer) ([10.102.20.173]) by FMSMGA003.fm.intel.com with ESMTP; 30 Jun 2022 03:10:23 -0700 Date: Thu, 30 Jun 2022 12:10:22 +0200 From: Maciej Fijalkowski To: "Fabio M. De Francesco" Cc: Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Ira Weiny , alexanderduyck@fb.com Subject: Re: [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: <20220629085836.18042-1-fmdefrancesco@gmail.com> X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE 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 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? > > Suggested-by: Ira Weiny > Signed-off-by: Fabio M. De Francesco > --- > drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c > index 628d0eb0599f..e64d40482bfd 100644 > --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c > +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c > @@ -1966,14 +1966,14 @@ static bool ixgbe_check_lbtest_frame(struct ixgbe_rx_buffer *rx_buffer, > > frame_size >>= 1; > > - data = kmap(rx_buffer->page) + rx_buffer->page_offset; > + data = kmap_local_page(rx_buffer->page) + rx_buffer->page_offset; > > if (data[3] != 0xFF || > data[frame_size + 10] != 0xBE || > data[frame_size + 12] != 0xAF) > match = false; > > - kunmap(rx_buffer->page); > + kunmap_local(data); > > return match; > } > -- > 2.36.1 >