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: 13546544 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.177]) (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 9BFD16DCE4 for ; Tue, 6 Feb 2024 02:50:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707187810; cv=none; b=IvWYrriLKVSGHeVK3in6QbHdA0H0N20W4vlfb0JR4fQ8+hvmqaMOOjE0K8poKiIGGC7J59dFE7tm9ZfDGJuXsF+MVMme3t7SgvoyP4NJ4DKQ16JwcNEMT1Zt/wpyEjKt0LDfDIgZXB6utCtr2DD3ZZ0m7Vpec//TDnAlPtO7Cd8= 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.177 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b="EtuCx8/M" Received: by mail-yb1-f177.google.com with SMTP id 3f1490d57ef6-dc6d94b9961so4981952276.3 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=ez1HFHIrmskZI9Fsk6AZZ7gdDg0M+8BPPKwPUsrjcVUFEP3VmKWPVPmont5NU8arAr 5T8Dr+PaOF46mwYuv/wXVPgBmjnMjHpJf2SkxIWttbgkmFfE2VEUe74urE8+keSX7tjw C7HfM5NhcwGMJ2SSQ2Pt/+YsJUTSbsgIqWdfPmY02boK9txkX2T2z7ShI9xAtctkmkQb l8G7A6Cu5CPNw5ZJY3pJJ7hYtW4/XRETs/DFKiSR0OQ0O18Z+Kt15tDhzDDSIO+YIpMl 9TnJOyxKIghyqIBmMefwx+ZiG7d5r2j5MJE4X4ps46/XiWYn1UW4/WsRaPAIMg9mh9aZ auqg== X-Gm-Message-State: AOJu0Yzx/6fvApF8gQK1paWmffoynziajPekpGMrkTv4TqArgSSmKFMs Yu/3jHo1fjN8CfGzQITmHvUPr9SOQ1DykWyItH6gzClruA1pzdRHaFf7ngjvXEM= X-Google-Smtp-Source: AGHT+IFAtHPElgovm6gSahZhs1VJbTYiPrwcpJgR4+4MYwGtbqVkQWnA+txthGyjmPbN2L0S/sLxlg== 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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org 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); }