Received: by 2002:ab2:1c04:0:b0:1f7:53ba:1ebe with SMTP id f4csp162979lqg; Fri, 26 Apr 2024 11:35:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWH0yxu5jCP+vmT0ndIU+PFqzAjcB36ZkyZ4d2mRU+CJdKGf1Ut+wooC09sbkAjSn/YCMy77jIXWkHYUIopDpyeOIBHto4ch8rNqhmJbg== X-Google-Smtp-Source: AGHT+IGifmnuwU5d9h7zeA5kzZx1q1NpPwDY9EGhpJBUBS7FPDckpfFLkNfPFYJdatPEQkSPVRtE X-Received: by 2002:a17:906:7181:b0:a58:a4d2:372d with SMTP id h1-20020a170906718100b00a58a4d2372dmr2764505ejk.10.1714156514104; Fri, 26 Apr 2024 11:35:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714156514; cv=pass; d=google.com; s=arc-20160816; b=I7DrGizLtbnmc9gX1sLKaLOoOHLOoebAr4bhAJdYj2ZJ1Fchvwi+xacZmOM6xFWkKm ZfjzbNPBgZNMiNiz1fiuCR6nung7uaA1Yy4KvdJRZvgWgQkhgbn4dJsbhozMa4yJdOPY MR03b4QpUDaP87ziUsGaUhie0qZ5E+HTQJmJaFcsoUmvUgM40nVLbmwoQKAUFsMDiRol /1tqFKf2XBq2R36xTpQrOKAWq3fH9D6xszekoE6rKeZs07LzNNBoMdy1fIzAZXk3+8Am UkSV2JQwYLp/987tKUHKXK0dz/qL7Ied74Bzz4b+k/p/ZBPf5lXk0o2RosaBSetPG7rT qpcg== 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=Fnj34GfYIADDHYe9QxZ0tA9OymLxhmbsRufEPA1lFlk=; fh=aDTS+bpspYtECWIZkV9sc23CsXTIDr2sIkz0LRDYvxk=; b=mqtiB1u5VdaW9J8Delo2UjWKE5fl9Q0AR9wP4hiib3GvWH1KHen2W8XBNoXWrtWlWy A1pkaSOC/JlbnfY0YvUATc+vx2LUridEHnTRNCU8Erf6zf/OKh+/Mo2xRrybtQ/H5aez a+E/Hv45jD8ITrD1HWM8Ny6dW9ecJ/UwS3uBqQq+eiywd1aJw8ahoAC8QX0uVhvQvyPO eRSODQ0pe+t8Xqgda6vW8TsYPmg3d5zFsfMHM55dhv3JxcJhgbYg3iv7WI9gCbC5Welu iShwdKYMtXi5LZUSVPaEYjYFw2W6g0MQVpPXdme/XPK7JjcFdwH47bhPAa3RnkncVr52 PBpw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b=KL+zdN+O; 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-160575-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160575-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 ko14-20020a170906aa0e00b00a523ca46639si10985067ejb.537.2024.04.26.11.35.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 11:35:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160575-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=KL+zdN+O; 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-160575-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160575-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 B1F171F24CB4 for ; Fri, 26 Apr 2024 18:35:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0EF6F23746; Fri, 26 Apr 2024 18:34:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b="KL+zdN+O" Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (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 CE8991B7FD for ; Fri, 26 Apr 2024 18:34:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714156452; cv=none; b=DBbM910UlNKUcS7NdnoAHDfSZjXlXRu3MO31VKL3yCPCofj410MuGYKUWyh5HbDRUvUFdSEeI1cXbZ1uwLaSqPZYp+//FsjZ9q1EcCnn7/bQpooZquQdYq24YPMX+3KOyTxhTVE5eOPVfeUjfd7BFKn6ff5/wezkb/JRzLxTdNg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714156452; c=relaxed/simple; bh=z7MYz1SqSvvk6nW/0aA7VzXJvv/C3aolR9fi0nj1t1s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=NtYN7llIxyovT5rG2lE+ZiP5IEsnGPGY+GLKGgp7NhqzFIJ+IHdSuspLcck1WF33K6cYU+H12UEeVfbdfzYIige7nOZDWq8xWNxpDNWlI6Z4Ppml34e90sKRXeR9SlfJn/v9XBX9KiyNuFQUqIIq9PsHU+w/n1kVVFusqeph9qM= 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=KL+zdN+O; arc=none smtp.client-ip=209.85.214.175 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-f175.google.com with SMTP id d9443c01a7336-1eab16c8d83so19387855ad.3 for ; Fri, 26 Apr 2024 11:34:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1714156450; x=1714761250; 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=Fnj34GfYIADDHYe9QxZ0tA9OymLxhmbsRufEPA1lFlk=; b=KL+zdN+OIMESqIa6bHCDBUP0MeSrePl/9WrD9dDeQyUV38WjUjwZVZkegN9eicu1n/ C5AlXmcUSk5/K+vhkRbKprDH9VKAUN18Rm5ObjKMNAU/jXidI+ZNCjk5daJjHc98tNbY CqDsu57b/mMsZ4aZPGRdRdfK+K8ijGo1FrVXc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714156450; x=1714761250; 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=Fnj34GfYIADDHYe9QxZ0tA9OymLxhmbsRufEPA1lFlk=; b=m56amYPJLQoGZrVX3k7KKEWe7lmg4/rU32LhtnvKMBu0dfUqre0Dc3suvZESbJrxA7 pdfBtd9rqGHp+55I4Py7IxxJvpWOCkdSWZNTlHzaM12+zepUkkt4cq5GIsyVjG9FUsFc jFXswcjpYf9r5VhPA8Zr/U4AzmYXX7sFMD6i3fldN+31dRxClFc+PFpUm4vh+0Lz2myF AeLG0rAsJKJ6ENefl7ofRNGU9WNLiW9JmykZ5cV4QFrNrFupD3+W9YG3eMXeHtrVdE+O ZNtK2vHFz042B3iwmDi6UBZEkUkyvYFocSCqTRA5mls1swH1OnquZGZrI+cagQ6jYokP zWqw== X-Gm-Message-State: AOJu0YyLTRZ2DvX9GVsCDzuNlJPgZDqBYJa4X3W9PMtxJSve1BlkiLQq iqClpYERzXzJQCeHRP0IX0JPeYo9rJnO8sxMjUOo638j692A9HFdlMQLOSjshcYhAqu8pUP/uK4 0ncBBsXQltS6EXEV0RNNcWDrp7WnC33ZqfRyAwyVbKVVmsEgD2ExKP1eGMqypNpdor39JehxORl qhf0dOaGxUs1mcJkIKwR56O/6Kgp+fw9rakqMbWh+/ZBw= X-Received: by 2002:a17:902:b20f:b0:1ea:fb65:a0c9 with SMTP id t15-20020a170902b20f00b001eafb65a0c9mr3018377plr.20.1714156449597; Fri, 26 Apr 2024 11:34:09 -0700 (PDT) Received: from localhost.localdomain ([2620:11a:c019:0:65e:3115:2f58:c5fd]) by smtp.gmail.com with ESMTPSA id j23-20020a170902759700b001deecb4f897sm15713152pll.100.2024.04.26.11.34.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 11:34:09 -0700 (PDT) From: Joe Damato To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, tariqt@nvidia.com, saeedm@nvidia.com Cc: mkarsten@uwaterloo.ca, gal@nvidia.com, nalramli@fastly.com, Joe Damato , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-rdma@vger.kernel.org (open list:MELLANOX MLX4 core VPI driver) Subject: [PATCH net-next v2 2/3] net/mlx4: link NAPI instances to queues and IRQs Date: Fri, 26 Apr 2024 18:33:54 +0000 Message-Id: <20240426183355.500364-3-jdamato@fastly.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240426183355.500364-1-jdamato@fastly.com> References: <20240426183355.500364-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 --- 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 efe3f97b874f..896f985549a4 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h @@ -379,6 +379,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