From patchwork Tue Feb 6 02:49:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Damato X-Patchwork-Id: 197147 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1285269dyb; Mon, 5 Feb 2024 18:50:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IGz7ZX2a/nEgvXwqgQjoeDluR9AALaQdsuk9VsVURMbF8AHmy4PGBeWdbC9BZYcYmOZvFJO X-Received: by 2002:a05:6214:21ee:b0:68c:aac7:35ae with SMTP id p14-20020a05621421ee00b0068caac735aemr1460351qvj.58.1707187830327; Mon, 05 Feb 2024 18:50:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707187830; cv=pass; d=google.com; s=arc-20160816; b=pNI+US7ZLhpWo8cKUE8oC0RaVGzL30JPYc7dIN3qUksQTXXfBY+utp/S9jHPwE+Kzy ekLA3imfkTSpN0591EIbSOntxnfDiOOjUoMA9dpxraj4kCbjwFZ9rylypb6ajtl/fxsu UIhUl891YERgO2BUcl8mAW0CGqbo6oz2Wi/xDN1e3XdKc8R+6+BcWlja87sdD4to3HSY H9CERbUZDV5KCF+hLOWjpRYqzCHHxFgdQHjBHLgyMrAVz/u+VT9QoNIvgj92NePclk57 vVO8LKSrDgJiDmbiUloThq3laJfgZ+Aw2+jY0mCdsX5lo4SuN6ySMLydcBG47zL0Iug+ SYXg== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=JJkjxH38Uhgs1HJr1sxIS+LBkWjcT6n/hQYPdpyBCSE=; fh=iiU6hoXuE7ZZP/G0u03K2lTA301Nh2KHiK77w2M2HIg=; b=AHLpR7l9sz9gBZJHFvSNy2gO95PalA6lRmav2mY/QnerXbhGAh47MtyVuJ+PrYoKCt ToWN6/ISqZQ1mm2ynEfFvtyuZdqYNRi1/QkxC4oFOR45PEIoq//mL6ijEBHUWTbP1U3D OBhlLJYCizxlJr+NzHtX97ZkmOTDvGK1GXiT2XI7LhWOemU1KU717cwVzP49PoLWroBS eCbwPVg1TZAQzg24G5Zp6TNw8+n7LEcDEHS6leHftkHLXD1ixUaPJw301GCSvg2THOhm 2F0zvIrFeRx3c6Ezl8h8xwxzrF5cTy4OwodG7pBHGEHaeyrDW3aGwjRNKXJzmCZP+8OA Q9kA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fastly.com header.s=google header.b="EtuCx8/M"; 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-54216-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54216-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fastly.com X-Forwarded-Encrypted: i=1; AJvYcCUczRJQ1CZJUPsC3Y8fpvNOb025TgD/hBSVKKYCYkeUs+Awq6JVKjZ9UCKR5Snrw8pyMaeALhGfrJE0p+1Sib6wq74xkg== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id o3-20020a056214180300b0068c9d2739fbsi1378723qvw.421.2024.02.05.18.50.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 18:50:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54216-ouuuleilei=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="EtuCx8/M"; 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-54216-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54216-ouuuleilei=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 218891C239D2 for ; Tue, 6 Feb 2024 02:50:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5053A6E2BB; Tue, 6 Feb 2024 02:50:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b="EtuCx8/M" Received: from mail-yb1-f174.google.com (mail-yb1-f174.google.com [209.85.219.174]) (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 D12566DCED for ; Tue, 6 Feb 2024 02:50:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707187810; cv=none; b=BpHiDY6dgq1SPWVfB1B8sY5A3B7Myus72W1sfH8WJt/slfGO38MZuL0gjBwXWl6BGleZQKgeYKySJGMiOR9dpXwXml1IryZfkuV3Gxje0LQZGAZdLZ+2Ma+4qudA5B9FRwZjbLKfZAFviQ4anGjOy3DSNEzU9/CB+uPp9nsoBU8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707187810; c=relaxed/simple; bh=1HBNNAYfLvO5heOb8sLvN65cw04szM3AWpje0fS40Ik=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=aALWmr+H2EvV/R5aBwkYxcLoEakUacvHsPNLckU49RsnoEqG6QHIPnhFLVMg7an+kaFnE4M2/GO3anFz1Kzf0ug6tDWCi2gwQveCSTHuUxak7fqxxRlyv/uay6ufmpRiECHBdfF+wH3SDb4EmWSRnr+pDsHmlRfCfYd3zp1fXq4= 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=EtuCx8/M; arc=none smtp.client-ip=209.85.219.174 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-yb1-f174.google.com with SMTP id 3f1490d57ef6-dc6d5206e96so4693871276.0 for ; Mon, 05 Feb 2024 18:50:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1707187807; x=1707792607; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=JJkjxH38Uhgs1HJr1sxIS+LBkWjcT6n/hQYPdpyBCSE=; b=EtuCx8/M9ZbaEfpoZa2BcS2Jk3Zoo5h+8NNKqpTP3UmFN7RMAgQ4GgzWrwLIdRjU00 XPmjKPYc72q7EM9t+O8yxbos9EjdXzq3UAZQ16lIfQoCv86PGCViuYrxB4EOsb9BzaPE UiF8n1uba5HtFLK08ueCpjVJQMzZyz01CDZCQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707187807; x=1707792607; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JJkjxH38Uhgs1HJr1sxIS+LBkWjcT6n/hQYPdpyBCSE=; b=jf7AL4323z8/+w7disGAJtzYnFXvNMPT6eZyjiOEWI2qxsni1tcVbrjWN7qAs1PjGu W/vJdjaW8SnEg6Q23zSEKYxTefdBZ27upyGE22IfbIJt396hBtxGwPlXRrYDliAhDBqE tkyPNIf8IVfO0TMv6CtOWgONolNdPuv0UO1Jybzlf0HTjs8scsXVsDb+h2/jtjBsS5kc E3nXKxEQJq7T3rtczxEOV33qFgY1xBUauQK4212yE440+Oh79AeN5swd5diuMithbrxy FXqm2+a9S4hNFP4iPp4Ru8qP2yR5OiVw1wnhTRC6V4mePoMIUhEs9zp9Wb8RMjyGr2ZK 1Dag== X-Gm-Message-State: AOJu0YyzuACgJJm8bA3VghIG2GDVJTwzakpm540Y/2UZgCVvZwsfx7iA fMJnkvEw9Ft+opTk4wfoq7Hxq+tZ2syUO8REaHAd3P5vzX2aXwu5bO1K/9YhQVrEZ0NbLpANygR Q6EevG2UKqHL5rKyifPEEeg8rZWESg8IhNidVLMP/xrpd9B7d5hnoFjLv03bZoJ7YnpCz4IQX5A BfCWTpV4BiJCF/Oxcj/Vx3c1rR22wjBkvBgMrVMrgz9SE= X-Received: by 2002:a25:2690:0:b0:dc7:185b:1132 with SMTP id m138-20020a252690000000b00dc7185b1132mr363745ybm.41.1707187807526; Mon, 05 Feb 2024 18:50:07 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCVv4wnQSNPXC8zMK3Dy26VgjJD8YW4Jnwj6s3rd+Ssg183B6QV0ko24jtdnSPr86KlGdwRAu43+WJlnY1+s1LPMix404WxHwj9Fb1CzyQVQKplXOAUYba6CLXMtjlWm7jzgcwrHeSJMQuL2XIXxQeoX1hbbhAyhweRK+9o1UPqLEnyuLqUeGXxTd7mDZTazULctG0PnNtUlhB4bPz2Jr/tIUbzVqhxeMT0Vp3WYvwk5Rlzp/bdr6KQvd6eDfVtkai4NK2WYmTZKrjus8SNN5u12mc6/iiSv5O9hZtKvG8WWZY5yfRqkCin1fIhBMImU4hHjBMCZ9uVoPcbNNPuhtdQ9 Received: from localhost.localdomain ([2620:11a:c018:0:ea8:be91:8d1:f59b]) by smtp.gmail.com with ESMTPSA id ca40-20020a056a0206a800b005dc1281f21fsm692254pgb.2.2024.02.05.18.50.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 18:50:07 -0800 (PST) From: Joe Damato To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: tariqt@nvidia.com, rrameshbabu@nvidia.com, Joe Damato , Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-rdma@vger.kernel.org (open list:MELLANOX MLX5 core VPI driver) Subject: [PATCH net-next v2] eth: mlx5: link NAPI instances to queues and IRQs Date: Tue, 6 Feb 2024 02:49:56 +0000 Message-Id: <20240206024956.226452-1-jdamato@fastly.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790116186627531282 X-GMAIL-MSGID: 1790116186627531282 Make mlx5 compatible with the newly added netlink queue GET APIs. v1 -> v2: - Move netlink NULL code to mlx5e_deactivate_channel - Move netif_napi_set_irq to mlx5e_open_channel and avoid storing the irq, after netif_napi_add which itself sets the IRQ to -1. - Fix white space where IRQ is stored in mlx5e_open_channel Signed-off-by: Joe Damato --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index c8e8f512803e..3e74c7de6050 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -2560,6 +2560,7 @@ static int mlx5e_open_channel(struct mlx5e_priv *priv, int ix, c->lag_port = mlx5e_enumerate_lag_port(priv->mdev, ix); netif_napi_add(netdev, &c->napi, mlx5e_napi_poll); + netif_napi_set_irq(&c->napi, irq); err = mlx5e_open_queues(c, params, cparam); if (unlikely(err)) @@ -2602,6 +2603,9 @@ static void mlx5e_activate_channel(struct mlx5e_channel *c) mlx5e_activate_xsk(c); else mlx5e_activate_rq(&c->rq); + + netif_queue_set_napi(c->netdev, c->ix, NETDEV_QUEUE_TYPE_TX, &c->napi); + netif_queue_set_napi(c->netdev, c->ix, NETDEV_QUEUE_TYPE_RX, &c->napi); } static void mlx5e_deactivate_channel(struct mlx5e_channel *c) @@ -2619,6 +2623,9 @@ static void mlx5e_deactivate_channel(struct mlx5e_channel *c) mlx5e_deactivate_txqsq(&c->sq[tc]); mlx5e_qos_deactivate_queues(c); + netif_queue_set_napi(c->netdev, c->ix, NETDEV_QUEUE_TYPE_TX, NULL); + netif_queue_set_napi(c->netdev, c->ix, NETDEV_QUEUE_TYPE_RX, NULL); + napi_disable(&c->napi); }