From patchwork Tue Feb 12 08:52:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= X-Patchwork-Id: 1040455 X-Patchwork-Delegate: jeffrey.t.kirsher@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=osuosl.org (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Hv+oBV37"; dkim-atps=neutral Received: from fraxinus.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 ozlabs.org (Postfix) with ESMTPS id 43zGfR0ZwFz9sMl for ; Tue, 12 Feb 2019 19:53:51 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9C93084B08; Tue, 12 Feb 2019 08:53:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1_-i3TYy89Js; Tue, 12 Feb 2019 08:53:39 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id EB72D858FB; Tue, 12 Feb 2019 08:53:28 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id E46AD1BF964 for ; Tue, 12 Feb 2019 08:52:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E10A722794 for ; Tue, 12 Feb 2019 08:52:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IbrOJTAmujjc for ; Tue, 12 Feb 2019 08:52:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by silver.osuosl.org (Postfix) with ESMTPS id 303EB2263E for ; Tue, 12 Feb 2019 08:52:34 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id z15so241588pfa.2 for ; Tue, 12 Feb 2019 00:52:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2BpwbKu37r4ICnJFpO01tcc8bs7Y4w/gT82xHbJR6nE=; b=Hv+oBV37sFyZRwsaM/K+qfnkEv9JTCqCQldESCX9sfi1UILd+lQDwh0ZJYi+GSfdKM AjB/utikFbjt7M0n0/DWVttdRqrJ6CSw5+i4hm0AgN7D1mtFVp7xdU99JWvVGjgbweig q3Ys23M6Z6r6CdffGn6COOVOAJ2/xefAsV2CILymKqr2NPEdakyNgWfwMZczVe02rH8W 81oWomvO6lJ+mPj+3MiVEBXwpbaPv5hzNXPQRVz1DNfwMGQUD15ZOs8Jgy/iMfIRTZos U2nywZ0IfLvD6gqLdiJKeJQ/QPOcjsegLr8p8bEq00raxngI+uF+uPdO5lHXfYMrvDsn pVrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2BpwbKu37r4ICnJFpO01tcc8bs7Y4w/gT82xHbJR6nE=; b=aOtqwzRFOETne5bD3sUL2PJ66FxvvmksT1In+TMMDh2cX5cYsZjbFhsgGjMG4COqUh /ELcgagRoMQ8wkbsDSJ/LVsoF5WmYVzPcsoJ6QNiKJd9jmslAMknryDD07JL6iOVllTD ZauRJap/lQm1/l5D34JYZCk+qBjIBplxRO3k0voKETQk3A3RD+ZvG7Bt3P0bDAj7PP8a 7f4yqIdjm7x/90hmO6R2VuGwdYSYKezyzah/Zdm3/sUO6PEis4Ge2t+4nezoDb/KwWXB k9y06lq4nOMVAvFlWrpfpnAsGDTivrVW4UJwgrpMw2wCmCOCD5T3f/VVNP90i3oMdFBN Fk8Q== X-Gm-Message-State: AHQUAuZkOwOCvPS9gfa0HnyhE6PerKsfao3WSgDNm1iGCrEO2KPfde5v pj2UDDSW2CE50Cq98mg5eSdLW7G8HmuMjA== X-Google-Smtp-Source: AHgI3IYaLRItC9NcP5n4GOF6YSA0x3A/OyOt+WRZvUOKJzY4Y6lMu3XG+u4IHZt6ES5sM5WgQvueEA== X-Received: by 2002:a62:569b:: with SMTP id h27mr2815161pfj.163.1549961553643; Tue, 12 Feb 2019 00:52:33 -0800 (PST) Received: from btopel-mobl.ger.intel.com ([134.134.139.83]) by smtp.gmail.com with ESMTPSA id u73sm24461606pfa.169.2019.02.12.00.52.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Feb 2019 00:52:33 -0800 (PST) From: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= To: intel-wired-lan@lists.osuosl.org Date: Tue, 12 Feb 2019 09:52:04 +0100 Message-Id: <20190212085205.7848-2-bjorn.topel@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190212085205.7848-1-bjorn.topel@gmail.com> References: <20190212085205.7848-1-bjorn.topel@gmail.com> MIME-Version: 1.0 Subject: [Intel-wired-lan] [PATCH 1/2] i40e: move i40e_xsk_umem function 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: netdev@vger.kernel.org, =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , magnus.karlsson@intel.com Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" From: Björn Töpel The i40e_xsk_umem function was explicitly inlined in i40e.h. There is no reason for that, so move it to i40e_main.c instead. Signed-off-by: Björn Töpel Tested-by: Aaron Brown --- drivers/net/ethernet/intel/i40e/i40e.h | 14 -------------- drivers/net/ethernet/intel/i40e/i40e_main.c | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h index d684998ba2b0..cc583ad5236b 100644 --- a/drivers/net/ethernet/intel/i40e/i40e.h +++ b/drivers/net/ethernet/intel/i40e/i40e.h @@ -1096,20 +1096,6 @@ static inline bool i40e_enabled_xdp_vsi(struct i40e_vsi *vsi) return !!vsi->xdp_prog; } -static inline struct xdp_umem *i40e_xsk_umem(struct i40e_ring *ring) -{ - bool xdp_on = i40e_enabled_xdp_vsi(ring->vsi); - int qid = ring->queue_index; - - if (ring_is_xdp(ring)) - qid -= ring->vsi->alloc_queue_pairs; - - if (!xdp_on) - return NULL; - - return xdp_get_umem_from_qid(ring->vsi->netdev, qid); -} - int i40e_create_queue_channel(struct i40e_vsi *vsi, struct i40e_channel *ch); int i40e_set_bw_limit(struct i40e_vsi *vsi, u16 seid, u64 max_tx_rate); int i40e_add_del_cloud_filter(struct i40e_vsi *vsi, diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 44856a84738d..ba1a84a2c8e5 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -3063,6 +3063,26 @@ static void i40e_config_xps_tx_ring(struct i40e_ring *ring) ring->queue_index); } +/** + * i40e_xsk_umem - Retrieve the AF_XDP ZC if XDP and ZC is enabled + * @ring: The Tx or Rx ring + * + * Returns the UMEM or NULL. + **/ +static struct xdp_umem *i40e_xsk_umem(struct i40e_ring *ring) +{ + bool xdp_on = i40e_enabled_xdp_vsi(ring->vsi); + int qid = ring->queue_index; + + if (ring_is_xdp(ring)) + qid -= ring->vsi->alloc_queue_pairs; + + if (!xdp_on) + return NULL; + + return xdp_get_umem_from_qid(ring->vsi->netdev, qid); +} + /** * i40e_configure_tx_ring - Configure a transmit ring context and rest * @ring: The Tx ring to configure