Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp10329lqd; Tue, 23 Apr 2024 12:50:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUE192vLVJ9+bKWJEu2DuBz1dmKq10oAruCf32hfXPI8XUjMcFgaXHxaYh03JIMLO5xV9LytSE4F4aGGdN7KBSIEvehENHLma6AugBRKA== X-Google-Smtp-Source: AGHT+IG2o+v1rjG9WleuHqm8r1cOy3f4MQ/WR/VvbamI+LZYd9Ge80MnPpC5RxfHZRtrV0Yg3njx X-Received: by 2002:a05:620a:1a:b0:78e:e5f2:214f with SMTP id j26-20020a05620a001a00b0078ee5f2214fmr504556qki.74.1713901829627; Tue, 23 Apr 2024 12:50:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713901829; cv=pass; d=google.com; s=arc-20160816; b=c3Eim71XYwdg02/DSGLGjZpbOlvwtg+lzqm7sLiJt1Ev/SL4McY0PrhoiZzWAAgXjU mwesC88XpoQzseNG3EseT2jnuCCA2Y2x5pSR0TYaljzRDOHU5cB/BC5cvOreLQyFJfD3 FHqKBlbqdyu0HUZMK+fvu6x5ll6ycVi6x18T1pk4jdEu1tYPlyWflqVU6xDeZKgB0wLa V8dUQwX0RtahWkmRKtwTRp+Em9PRyRh/xaJww9uGV1x145M1vXI0NAaN8//BoUG+Jfbi u56jH2bYPooNvQ+OENOXNhSz7BvgUA5v0qYsTTO3VQ4UtW6eyFkeWN4TcVJTgkiRRBwW e/AQ== 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=K3hn5TsRaFYOkcNTzS8vHf8VfDIP6F4sJqKqR0K4LTA=; fh=aDTS+bpspYtECWIZkV9sc23CsXTIDr2sIkz0LRDYvxk=; b=CLKzqBBz3zxrJBzQ/DmxaKmbQRTUdr39LJiA12zpAXB8942YfRZaNGJt4vP/1FE366 6jB6xlt3L7kmJZ+x2Z7bifGxb1Yxf32XBMI7zMFjG/Tk2XaitDvfm9TOdRP6rsu2/9po dYa9dYUw0Iv/5auazBtyu0t8YVG0G+AJek9f00nirolMLk4dLgog6oZH8N2xHCeN17de mYvSFVjJlA2aAIVP6osh+pxt9ffjdjC3Uy5e9L4ebfrkRKT3OM3qMef4N/b+0DAuuFxN jJ4kJoszkFmpTOkfCZKeO4Lq1RL/Myq4wLo8HZ5BbSqLW7cYVT3g0pifgf18XQJPLh3D KDWw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b=la4dsS6g; 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-155820-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155820-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fastly.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id wm18-20020a05620a581200b007905fb61c1esi9224115qkn.598.2024.04.23.12.50.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 12:50:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-155820-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b=la4dsS6g; 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-155820-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155820-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 466C71C222EA for ; Tue, 23 Apr 2024 19:50:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E38EB142658; Tue, 23 Apr 2024 19:49:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b="la4dsS6g" Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) (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 AD19814264D for ; Tue, 23 Apr 2024 19:49:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713901782; cv=none; b=q3HBhpj8DyBfUSi6H0fFemGpKCvRh3m5UpSQbCGTeN7DslNqIBn7TeAghWjT/qUYbfzF5vtwQFnSbqc9JzO81FWfoCSpqslq07lwvp0Jiv0ZvlSI+v1HNid1AieoeHLeZ5+t15Ayco6tfInezqY+/sKlEQuyNS3JBJz4viT71zo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713901782; c=relaxed/simple; bh=74FTgsNpDoGFaJwtMp1SRuD1D9Y0+Vbu/uFyRIKGcj0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fWAaN0crLbOmwRjGX/w72qp+wVTGryDO60ZRenLFa9R1vBBVCj8hMZd1cYYyGmn269xBt0URhjSeqW+3Iw6KkmeJiTwNWk8bF0Zm8JKG/qUZWmCi4yVhsw5/z9dASMgVi1P+lZmjR/Lgd5xw4hufscEldMpzqRQvqWS9MdjTCYs= 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=la4dsS6g; arc=none smtp.client-ip=209.85.215.169 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-pg1-f169.google.com with SMTP id 41be03b00d2f7-5d3912c9a83so4206025a12.3 for ; Tue, 23 Apr 2024 12:49:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1713901779; x=1714506579; 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=K3hn5TsRaFYOkcNTzS8vHf8VfDIP6F4sJqKqR0K4LTA=; b=la4dsS6gqn5SLEuThfDMJKmc7s1xtZMSnV8Ry3BKJ4KFvaGAqpd++96pseiKvwB9PO Nw5Zx8uEjp8I7ehigEplq+DAhc24MPHcg0XezJySlfiA+ZD6guZAgAoaoIIjKVq1Es5S ZzHpQzHxCIXvsrnj4dujLx0OefZme43bHod+M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713901779; x=1714506579; 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=K3hn5TsRaFYOkcNTzS8vHf8VfDIP6F4sJqKqR0K4LTA=; b=GZzvdtKekgUy919YM3YnkkzZMoPfFduG/Rl6Zmpuwccw0I+L8SOarRUOSlI6QIq5b+ +q85G1ynZwTbEN/oRnD4FJWSpTe+SjIgW9v8gw8cum0hip3ITa68Po3hs7Q3l9vZslyD Dsxw0iUAooedD2BxtyAdeNXi3xZYo43gesbZKtVjmkRShNDi50HteW/D1nh5dpvlhoUM ClGq22BvN8CFHwG1zVk9zyz0xCYcBNez0cco6uDmxHHitMAzYolJeEUoUsIP8QB2+hVx aIFxk035Cxb5BR9rjowigfMNa81LmIoxLESyjaVo+PJxUaKJb3tNiyrrtE0OFyYIYEFx 0Oyg== X-Gm-Message-State: AOJu0YyIb7IhvNOlEBcnoB+vTRSERY8NuEdZGwGJWI7aHsAIAKk0Vstz tiG28Nqch/4rICB1OzQYHdUH4Gg7oo0NBSRC3ToWJ4flMFchoVvtg3DrFofYUy6PFKcUqP9zYRI 70pSVKb2xV+ffi9tw3UXFcmCltSf5SV3+mLyD5b9SJlJzr9sfkOK/ZO7+dGEfK/eLnm/7ckzzNe hgEC/9oqJTKeZ1XgNuPkKmqSk4l2Mwio7mA2uHaaR38VM= X-Received: by 2002:a05:6a21:348b:b0:1a7:aecd:9785 with SMTP id yo11-20020a056a21348b00b001a7aecd9785mr386439pzb.25.1713901779138; Tue, 23 Apr 2024 12:49:39 -0700 (PDT) Received: from localhost.localdomain ([2620:11a:c019:0:65e:3115:2f58:c5fd]) by smtp.gmail.com with ESMTPSA id q3-20020a056a00084300b006ecc6c1c67asm9995672pfk.215.2024.04.23.12.49.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 12:49:38 -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 2/3] net/mlx4: link NAPI instances to queues and IRQs Date: Tue, 23 Apr 2024 19:49:29 +0000 Message-Id: <20240423194931.97013-3-jdamato@fastly.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240423194931.97013-1-jdamato@fastly.com> References: <20240423194931.97013-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..d212ed9bfd60 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 */ @@ -188,7 +194,15 @@ 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) { + enum netdev_queue_type qtype; + if (cq->type != TX_XDP) { + if (cq->type == RX) + qtype = NETDEV_QUEUE_TYPE_RX; + else if (cq->type == TX) + 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