Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp97018lqo; Thu, 9 May 2024 13:51:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWFmr9kzpodbzBY4BHkYNQquXRBNuIp6wOV0qLThxqS0LXZevzTupqshlNWGfl12JPINW5NkCFqITwOPAqMKUQMolIjp7O1gxG/JC5qEg== X-Google-Smtp-Source: AGHT+IFGVs+EsZDQffbmR26TkzpNFzNimt44dGVFcCUWrF2XBuzklOdheYUIVN+xJxKqzEsnh5T9 X-Received: by 2002:a19:8c49:0:b0:51d:d78:4952 with SMTP id 2adb3069b0e04-522102758edmr342155e87.65.1715287918729; Thu, 09 May 2024 13:51:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715287918; cv=pass; d=google.com; s=arc-20160816; b=rW7+la9sJGHlyX8uIOk1PqsCIBl40NA0qmmJHwNU9Gcxh9J5iFEEICONtLQyAAt6JK aqQDHl18oNibb3+77tC6Bzhp+zlOytn1dzoC9pZN/18UHmzVfeXTydxIVspGl4xZQNKz HH+I/l9hi20GGA642+/DIR08ABXH0XfXkcpmZXFc0WKwVGLZ+EQtj4h1DiXg38tKzHq3 MEBm7TAV2x3yLO+hmInFQz26NcKLqCeRrAVC5yDDV6SEyEg4Y5K6Ls4z14OvkoVhRl5b N02FBrybBiLhrEd6nY9Z//50+ZX7ziTPxvmuxDNjFZKozp8ImPdLcTEGc4wrOkG+WYP6 mM3A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=KmgZyGJ6WZhyygeOTuBznvTKrsssXOFJdYN+KnXDyKU=; fh=hmGd2JdG5LlDRMGCzOvlsI5CSYYfE1r2C1boWxEUOkg=; b=qye1pdlzYFcbFqYBA8Nbwox2z3fWLNwoh5iWv4apAREovzwCJweC6IEIXZOTlS6pYm d7sEplJ1lWOVUVA7liPbB1HfQj880OMV+FDgPceU0BlY8m40YKk+CTl/Fh8Wi76tzwuc UNplEYTNEAnhaDqwl1RrmNQyrSjb02N/ToOqlzdaTKB9cY5gRYRNrp1TG/l4dhXxSf53 7d9hUZLFb7Vh+5coHw+4zLN2J5HcKzhmxsMu+ceoCNGNomO0ZpTdz1O+ngvNXk1mBaZo xOHHO9lmd87lYJG7NUNJj+q5eRGwnxtFXsZRQtPjZe4iFsAiNKb/XBs5ej3KZ3d5xxUe taRw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b=qKSiSiwN; arc=pass (i=1 spf=pass spfdomain=fastly.com dkim=pass dkdomain=fastly.com dmarc=pass fromdomain=fastly.com); spf=pass (google.com: domain of linux-kernel+bounces-174955-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174955-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fastly.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733beac645si1124282a12.98.2024.05.09.13.51.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 13:51:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174955-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b=qKSiSiwN; arc=pass (i=1 spf=pass spfdomain=fastly.com dkim=pass dkdomain=fastly.com dmarc=pass fromdomain=fastly.com); spf=pass (google.com: domain of linux-kernel+bounces-174955-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174955-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fastly.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 733C81F21A2D for ; Thu, 9 May 2024 20:51:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 66A551272C0; Thu, 9 May 2024 20:51:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b="qKSiSiwN" Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C93955338D for ; Thu, 9 May 2024 20:51:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715287871; cv=none; b=CafvHOcRHcDFdVKdPhlpkIlY4tgBZn0MTRtLe/B1OvLO7M4taFg7vpX5/ZX6fyU6Pj5tO/fMinw6Yq/HOe00HLOG0tyfrH/XWFxOxn2Zd94sCc+QjGX26lKCqlzSdn0eDHBjiGSBPrM/DyBw4m7kM1xYLKxgAKPs9oqrC2732TA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715287871; c=relaxed/simple; bh=gCbabcQaR8Ix1K97TkMliO2FSC7RBAC3W9/BPXaCzC8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=p3AJ3cJ0ovu6roR2tVj6yRlHxif4v+vIOhpAuO5cG8P6IAeUGT3qOOHdV+Et3qm/x265MvDF3I4zDuamNeJEWmrn1buKm5dM6IVOD0tifY5mYxtQmd1R+AcrXhOZRhiqmAsigKqY8YkQkp6ZRBziz/Qr6brPEUNTcjZDaZLY1Q4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fastly.com; spf=pass smtp.mailfrom=fastly.com; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b=qKSiSiwN; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fastly.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastly.com Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1ed835f3c3cso11423555ad.3 for ; Thu, 09 May 2024 13:51:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1715287868; x=1715892668; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KmgZyGJ6WZhyygeOTuBznvTKrsssXOFJdYN+KnXDyKU=; b=qKSiSiwNW1uI8ORsZds65zVBrjsrTwxnHMSNcSTWaLJ4RTCfIFfa4i+/rOoRyAchtZ u93CRfrF+wrqfHIqnGIZ2GGeL+41X57AWe4PkWxYRlZXqKYqpBippEgUA+entGOvGxLN ciQYslYIIw6GhPwhMYnJDx0Qih0fBxovHA0As= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715287868; x=1715892668; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KmgZyGJ6WZhyygeOTuBznvTKrsssXOFJdYN+KnXDyKU=; b=Ol7dQOvRhUy7d3zpr136veA5U00nhNkybpxIHlA2SXCaOOrRJ7zL0FHsqBHDppY7Uk GLeVyx1H178GvN8CnPuW5jlTajBqnmng0WGFsKZTcWFqb+r6D61dX/JrhF5l/JNsfJ6A Q/fpZHb3Z9UKHeqKUhaHt2sgWOchrBC5C5tu7j0iMpaApF7RG0N9spZYdmE5nRL5nQqj hQjgEBnXrbDhEDMVkQfgosPI0aZFHH1jddHNhcOUnVJbhPdp+wRj4XChNq9SHfpbymBH pNnia2g4V5cueB/1Lr4i9Z8O9Ujl0acY2rV2QNZuIPC2t+oSfgK3eP9TIdCEoyoSH0EN Xokg== X-Gm-Message-State: AOJu0YywLSsg6HNZTRdOY9kjUbQFKfTO9CLqulbBttBdoHKrWcYxDHx2 tQo5+VvheudRe15cFrjw23EDagyLXplsk7YgKiBhWKmVsHmh8N6oab55URkUDcbKfJnyjw1hfqb nkPVTBBYdSaur7lA8NpZaSuSbgp25VDMUq8JtU6dzz6OVfj+r9YbNM6urSUjAS8/u+WV6XFDCwa r1cZGx+29chx8LchROaP/o37Oao0JyZmsCXKIk+YTbDXU= X-Received: by 2002:a17:902:d4c2:b0:1ec:ad62:fe87 with SMTP id d9443c01a7336-1ef44059628mr10146585ad.56.1715287867290; Thu, 09 May 2024 13:51:07 -0700 (PDT) Received: from localhost.localdomain ([2620:11a:c019:0:65e:3115:2f58:c5fd]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ef0badb959sm18677365ad.85.2024.05.09.13.51.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 13:51:06 -0700 (PDT) From: Joe Damato To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: mkarsten@uwaterloo.ca, nalramli@fastly.com, Joe Damato , Jakub Kicinski , Tariq Toukan , "David S. Miller" , Eric Dumazet , Paolo Abeni , linux-rdma@vger.kernel.org (open list:MELLANOX MLX4 core VPI driver) Subject: [PATCH net-next v4 2/3] net/mlx4: link NAPI instances to queues and IRQs Date: Thu, 9 May 2024 20:50:55 +0000 Message-Id: <20240509205057.246191-3-jdamato@fastly.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240509205057.246191-1-jdamato@fastly.com> References: <20240509205057.246191-1-jdamato@fastly.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Make mlx4 compatible with the newly added netlink queue GET APIs. Signed-off-by: Joe Damato Tested-by: Martin Karsten Acked-by: Jakub Kicinski --- drivers/net/ethernet/mellanox/mlx4/en_cq.c | 14 ++++++++++++++ drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 1 + 2 files changed, 15 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx4/en_cq.c b/drivers/net/ethernet/mellanox/mlx4/en_cq.c index 1184ac5751e1..461cc2c79c71 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_cq.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_cq.c @@ -126,6 +126,7 @@ int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq, cq_idx = cq_idx % priv->rx_ring_num; rx_cq = priv->rx_cq[cq_idx]; cq->vector = rx_cq->vector; + irq = mlx4_eq_get_irq(mdev->dev, cq->vector); } if (cq->type == RX) @@ -142,18 +143,23 @@ int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq, if (err) goto free_eq; + cq->cq_idx = cq_idx; cq->mcq.event = mlx4_en_cq_event; switch (cq->type) { case TX: cq->mcq.comp = mlx4_en_tx_irq; netif_napi_add_tx(cq->dev, &cq->napi, mlx4_en_poll_tx_cq); + netif_napi_set_irq(&cq->napi, irq); napi_enable(&cq->napi); + netif_queue_set_napi(cq->dev, cq_idx, NETDEV_QUEUE_TYPE_TX, &cq->napi); break; case RX: cq->mcq.comp = mlx4_en_rx_irq; netif_napi_add(cq->dev, &cq->napi, mlx4_en_poll_rx_cq); + netif_napi_set_irq(&cq->napi, irq); napi_enable(&cq->napi); + netif_queue_set_napi(cq->dev, cq_idx, NETDEV_QUEUE_TYPE_RX, &cq->napi); break; case TX_XDP: /* nothing regarding napi, it's shared with rx ring */ @@ -189,6 +195,14 @@ void mlx4_en_destroy_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq **pcq) void mlx4_en_deactivate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq) { if (cq->type != TX_XDP) { + enum netdev_queue_type qtype; + + if (cq->type == RX) + qtype = NETDEV_QUEUE_TYPE_RX; + else + qtype = NETDEV_QUEUE_TYPE_TX; + + netif_queue_set_napi(cq->dev, cq->cq_idx, qtype, NULL); napi_disable(&cq->napi); netif_napi_del(&cq->napi); } diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h index cd70df22724b..28b70dcc652e 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h @@ -380,6 +380,7 @@ struct mlx4_en_cq { #define MLX4_EN_OPCODE_ERROR 0x1e const struct cpumask *aff_mask; + int cq_idx; }; struct mlx4_en_port_profile { -- 2.25.1