Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1559884pxb; Sat, 16 Apr 2022 12:39:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQgLRAl8ahK8UETSvMbeC1uweHGn1TXcGrr0EH+tl3/I7/O7M4QyFH/O/FMSL2BgsQRpbY X-Received: by 2002:a63:2b4f:0:b0:398:49ba:a268 with SMTP id r76-20020a632b4f000000b0039849baa268mr3940448pgr.546.1650137977838; Sat, 16 Apr 2022 12:39:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650137977; cv=none; d=google.com; s=arc-20160816; b=KvhrCLQWBtjlEi+YGCsGLX0/tQYoVs6HXMX7804PLJrVe5pA0YwWXPTx1Ds+2djIG8 yV5BqBzSPXtUO/K2Pns7NSj6QEF6FZXa+9B8lKAMg+vgE1wca6Ef5GQP6QqjxMJhQjyj q91tMPr/KKYDC6o8cchzMdWJ0U4hTejiU4ksnLiG0KdWbpY2VUhepsTfH+OHjW99jtic iyAWziQ2Kxw9RlwW8izVwUNe6M8dXFNnJN6k8wzJ8RhP3AyT2fG/l9iw0mZkj3PQStFC XtuKBxrl7eB6WsC0y7CESvcAC49xDi+rNwz4YpRy941mpbuzFPoRzHLZlIGOAlM7Ly6s 6zXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=uEhSMDHJtiuwdrj4dJJyu97KIVJOOD+nk/JiQfVUpZY=; b=j/A6Zcv73M7UK2U9pYDQVI7Sg9vKiWvV9bsO1UNT1sQrZ0gQWanY7fXe6kwEsa/MTl bf3TyJICKOwEQOsS1WoheM8gn7Ls/GyfrpWaqsE852SGIFBSFLvEdsmaMOqkiF17ub0Q jblKiCKuEC46EVCvWHKqYDAEjj6XbVGn55fEj0pyprDDSLwJjqz/8GeWkBpi3emFtBI9 PcuyupRg3CsT32Oqo/tmIDT5g8f4A3iUz1vMj43wnjX8sOtPDj7b2weLD019k0LAHQrS kwndQiRyLFcnsOiQeuPCM1HPMctu3s/cNoUVipGFQ+joZbO0tU7wvLIJ8M29B0B0LENJ qYfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="dAvG/VUO"; 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 nb16-20020a17090b35d000b001cb8336d612si4614578pjb.91.2022.04.16.12.39.22; Sat, 16 Apr 2022 12:39:37 -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="dAvG/VUO"; 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 S231724AbiDPLRp (ORCPT + 99 others); Sat, 16 Apr 2022 07:17:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231740AbiDPLRf (ORCPT ); Sat, 16 Apr 2022 07:17:35 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 119861C93A; Sat, 16 Apr 2022 04:15:02 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id n126-20020a1c2784000000b0038e8af3e788so6286580wmn.1; Sat, 16 Apr 2022 04:15:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uEhSMDHJtiuwdrj4dJJyu97KIVJOOD+nk/JiQfVUpZY=; b=dAvG/VUOiUi0sXwkQHoF+5NVAuiQMfKZcP1vqgjbrBMkds32W4S/eU8nfu9IqtPPMh RAk15ZLBRCzkyRWKkGVGJpTDzaSReBgjw+tB0S7YEMHgWwyGmXlgdNTTvue7wzattbWH 6/vvwJXkAwZvshn54gexQbZcinhpcI4xzvXg3WLmsxJL7y0INjgfbhPUZKVTWaVHWPZs hUMyU6iVTLqHlA8iSHqeZj8/wn8dBw8KYI6VkbA5YMmL7AkLk5GoX42GmWcNeitGY8lq 2LT9Kqd1NhYAjJYGdAgPh9rKu9HOKoKFVzLMflSZnl+3U1TQg8kn1sKUX7Tgj0kUP149 66lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uEhSMDHJtiuwdrj4dJJyu97KIVJOOD+nk/JiQfVUpZY=; b=qh+bPghtsryiXw4+hE19bCotLpBxtz2JaRNrlFiuKhuGQ+eq0uORnrneCqtN20KkA0 pxrhSD8aGp77LsVBoFU5FcVnc3cjhlkyBMZbdjiFYBD5uJz2xzdOwnT0FTn64qvyKgVh Z3bp3Nam2+/FOOJAE4EGz8/MSAsTjrzRQNbncRP3lu37Yhac7qKqFHWJuo1jSwwT4bVC ucX4eUIo0NlhqDm2YXguct9Z1+f6gqtc89c7mcbWuyPORjQ7g1ktHGFuRnGnzyWBHJ7a fO2/P39f+qsND0zvbx+GFTWUmEKz5+XAB0o6AusS8GcYbq5MAEjMG8zy1P6JIhM5yXnE K9Mw== X-Gm-Message-State: AOAM5315ULPVazWXMF/BwNha9rWcYZgaR8sKZuLUMfCRm0DFDK1VDBSJ K3OcSC1Xk5cXUdsYR9l3q4k= X-Received: by 2002:a05:600c:1e8a:b0:38e:d57d:a3fe with SMTP id be10-20020a05600c1e8a00b0038ed57da3femr7027147wmb.59.1650107700553; Sat, 16 Apr 2022 04:15:00 -0700 (PDT) Received: from alaa-emad ([197.57.90.163]) by smtp.gmail.com with ESMTPSA id 2-20020a1c1902000000b00380d3873d6asm7344196wmz.43.2022.04.16.04.15.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Apr 2022 04:15:00 -0700 (PDT) From: Alaa Mohamed To: outreachy@lists.linux.dev Cc: jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ira.weiny@intel.com, eng.alaamohamedsoliman.am@gmail.com Subject: [PATCH v3] intel: igb: igb_ethtool.c: Convert kmap() to kmap_local_page() Date: Sat, 16 Apr 2022 13:14:57 +0200 Message-Id: <20220416111457.5868-1-eng.alaamohamedsoliman.am@gmail.com> X-Mailer: git-send-email 2.35.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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,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 Convert kmap() to kmap_local_page() With kmap_local_page(), the mapping is per thread, CPU local and not globally visible. Signed-off-by: Alaa Mohamed --- changes in V2: fix kunmap_local path value to take address of the mapped page. --- changes in V3: edit commit message to be clearer --- drivers/net/ethernet/intel/igb/igb_ethtool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c index 2a5782063f4c..c14fc871dd41 100644 --- a/drivers/net/ethernet/intel/igb/igb_ethtool.c +++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c @@ -1798,14 +1798,14 @@ static int igb_check_lbtest_frame(struct igb_rx_buffer *rx_buffer, frame_size >>= 1; - data = kmap(rx_buffer->page); + data = kmap_local_page(rx_buffer->page); 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.35.2