From patchwork Sun Sep 8 16:06:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Damato X-Patchwork-Id: 13795553 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.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 4A28917BB1A for ; Sun, 8 Sep 2024 16:09:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725811745; cv=none; b=EXxzk3QO7v5IpuWGEpxm0phOthPB54Wl1rduKN6P3aONfic6uL4VLlHsd60+EE2ZPI7orCk3soFaqWqXNS7isi0Nu6uA6zy2xNN2X3iymAWLfuAdcOt9aCXtbeJqjDIrgRSmI/PnF9ZcUW/78CCuChW3qwA6Vi+wXtslcgaSyA4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725811745; c=relaxed/simple; bh=4HEYXckzb30ldYDuv6OJ1NZpctFxN6G/pxcTLPkqpU4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=I8rPdUbOeyMjjR261GujM1GHrt1mY9PJEc69FFQ1RZhno5d6nFIpmTb8qFw3hv53aw3pNNwKZ5QqqxMjLOyWlXtb6qm6Sb3gPailK8081FfbxPIbVJnHn9L2Yly5vpefcvZHtJdVo65XqTNv5E4WR5cuFXe+u7IdszRwEv9s05s= 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=W0eg9OPM; arc=none smtp.client-ip=209.85.214.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b="W0eg9OPM" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1fee6435a34so30451155ad.0 for ; Sun, 08 Sep 2024 09:09:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1725811743; x=1726416543; 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=gPqS0EtM6+tGmEgcYaXfQxu3vZbAasBMjVTJ7sHaKBI=; b=W0eg9OPMngSp6ybIFB5oq4IB6cv9G+mpQ0SAqvEzmC9MkxSjbxC5Xw3zXG67zs0jFk KbgUglMGRj2AQbmtWReAVdvJyCN3B5iCsNGaivaxZnNzyB528qdctatcSNonK+IYCiNP 6GKLdo12yk/oYHkC3d6yWJZf7laXTUU4fKElM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725811743; x=1726416543; 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=gPqS0EtM6+tGmEgcYaXfQxu3vZbAasBMjVTJ7sHaKBI=; b=IBXviGuPxhUTJT0bJF1qkyFiFVcQY9Rq+hItD/tbFnTGE4PVUPjfQt64CRyGjPPkRk WqX1EVPqWp45pJyyzCpMNe+uIZ7xw7s41K36gw2E2yFoCYhVBe9WlFQlpY4tmMC3UHtk jUbD+6ha+grOf8fK47ZH1T4cQ7mI6Mv6l6zB1ht5LftVsMrDkLFPVYVQCfMBMcfLBImm KiEMzU0ZgVrNg1nn7eSEMB6gH/zZbgwIOGI9LfQspBFvfDyCCyjfkOyQL1RwBNB9q0T+ GHQckQrxO8m9HNRaDOd3wnjF7r0j+2a5LtTUac8oeupKCo0muKtLJVklSnuNdv0iVGSu AIXA== X-Forwarded-Encrypted: i=1; AJvYcCVunT4e4bqQppvgdhpsadm5tpcVK6azQuDKUORhS2Phdto16xX/H2LiOOB9r4li5uyqF2nsbKDnpedA@vger.kernel.org X-Gm-Message-State: AOJu0YzHAr/GeYw50ygZwoxlWirwajcs3pqCbqlrtKnWy3ukV5fZPmpX XoaiC9HyHNE1kc6kiP/cMMT8O1pQsYv4QS/3qFD8MbbI0bUg74NDfoO2VZBBNeA= X-Google-Smtp-Source: AGHT+IGK4rR7SL/3525ecrLJrxwc+z1VKN6ygfWdTXmVhAnwErckliz5jxK7Lr6ScN1xS4HxwJmdDA== X-Received: by 2002:a17:902:f64e:b0:205:9220:aa37 with SMTP id d9443c01a7336-206f051e59emr78713005ad.22.1725811743466; Sun, 08 Sep 2024 09:09:03 -0700 (PDT) Received: from localhost.localdomain ([2620:11a:c019:0:65e:3115:2f58:c5fd]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20710f3179fsm21412535ad.258.2024.09.08.09.09.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Sep 2024 09:09:03 -0700 (PDT) From: Joe Damato To: netdev@vger.kernel.org Cc: mkarsten@uwaterloo.ca, kuba@kernel.org, skhawaja@google.com, sdf@fomichev.me, bjorn@rivosinc.com, amritha.nambiar@intel.com, sridhar.samudrala@intel.com, Joe Damato , Saeed Mahameed , Tariq Toukan , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Paolo Abeni , linux-rdma@vger.kernel.org (open list:MELLANOX MLX5 core VPI driver), linux-kernel@vger.kernel.org (open list) Subject: [RFC net-next v2 8/9] mlx5: Add support for napi storage Date: Sun, 8 Sep 2024 16:06:42 +0000 Message-Id: <20240908160702.56618-9-jdamato@fastly.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240908160702.56618-1-jdamato@fastly.com> References: <20240908160702.56618-1-jdamato@fastly.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use netif_napi_add_storage to assign per-NAPI storage when initializing NAPIs. Signed-off-by: Joe Damato --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 47e7a80d221b..2b718ee61140 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -2696,7 +2696,7 @@ static int mlx5e_open_channel(struct mlx5e_priv *priv, int ix, c->aff_mask = irq_get_effective_affinity_mask(irq); c->lag_port = mlx5e_enumerate_lag_port(mdev, ix); - netif_napi_add(netdev, &c->napi, mlx5e_napi_poll); + netif_napi_add_storage(netdev, &c->napi, mlx5e_napi_poll, NAPI_POLL_WEIGHT, ix); netif_napi_set_irq(&c->napi, irq); err = mlx5e_open_queues(c, params, cparam); From patchwork Sun Sep 8 16:06:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Damato X-Patchwork-Id: 13795554 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (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 B6C9C17C234 for ; Sun, 8 Sep 2024 16:09:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725811747; cv=none; b=F+dTITZr5A9TQnY/XRvzekNVeHP7Bi4DHAeXKewfjm6OajnMd5f4PumrzRA4ZGurYnd3IrDQP7uB+rqpyF7I99CBLqKhPpDyAkc+Bgqat7gTzrsihQMqEIM/+sZjMAIEfHQaWtoq9RS8KIoFHGCrh3NMF1FjsBe75nFkl1BaYPw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725811747; c=relaxed/simple; bh=HIV7bkoPSQ3rxlaFpK7J86ATOFDCNnMGhMFf+TgF5jE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=W4JyxgvzGj8kSsnY3WsMmZOxL5Y+Y2m21+2gumdkWv10pFq/QH5lI0dH+27MDUmNWRI1RmJlqlnPeHLbh0DJjR8b6LMMK05G3kfN8TPNS5uNS6EFGnh7QdYAQZ4BrA5OZtOLFa7YyeZjHUbbp8ntV8SnnxtonspLRun2qBbQI9w= 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=HWjZbpdC; arc=none smtp.client-ip=209.85.214.173 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="HWjZbpdC" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-2068acc8b98so32145665ad.3 for ; Sun, 08 Sep 2024 09:09:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1725811745; x=1726416545; 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=LGhj6cfvUKa56g6O8vcdWhred6v1jtnORdUuxs2iulk=; b=HWjZbpdC7/EXlidULkCI1N46DMduufGoO6rTjl3UCirvdYy7vu0090SK7CU5KXtYZt LULa/5pt6JfNsFH3Fvp2r+q60+X4ywZI50F4rPBhMuAUM5/X8mL+dP3NXOThjnejSvsX CIT5tqU7SGwlOqZPOzZsoBnGR9xT1bcQ5o8YU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725811745; x=1726416545; 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=LGhj6cfvUKa56g6O8vcdWhred6v1jtnORdUuxs2iulk=; b=VLomXTn0TPKGWBVdVjzpYQSV4f2WMBhBDJU5pm9aKk+HAqz7Ny0rMFV9H/2Tl5Z3lF j3CcClNE4XF/frvmFD1T/N4UysgROi7yAam6nOIoRkhyHdgfiLqOPG6YBQwCgIcSdzCB /ethyc2p/HF3bn7xIl8CInKMVa6+3uhav5J43XgWiKinkk+bQzS2Bjb8FlOQVAJnGK60 pEGBD+ECKIgVZNdE3Z1WF+WPb4sKNB36avtbxEnaw4snjDqoPca+LbpTEC5usxXEG9dN En1xfONC5RQ1qQ/UVOwmYiBvLuXyyCV3H4Pjk24vvA6PO2g3tL00p09EiOWM0Z1RJ7n2 oHOA== X-Forwarded-Encrypted: i=1; AJvYcCU2zzBzKyOoyqjySiiSCjVPzOswTovKoGrfINqDf8Csp4Q9crRGXexXIoO9dw5GdBeJ1Myo5tMewJu4@vger.kernel.org X-Gm-Message-State: AOJu0YzvNJo7kq3cOReMzaNrbwx46czZ72cYjvcy+HoU1PG1UmcOklN9 jo/5rq31qJGNADyahBuMJFgW422xefU8b24ThCsxdUrWl2Edm07yYEwcOE9f6qg= X-Google-Smtp-Source: AGHT+IFQURgAP0IwRMpYNE1DAaAqoQ3640I7A6bdcacvbt4VU16dYwn8Pnh0y3O4wA8pyPK8qtXIIA== X-Received: by 2002:a17:902:c94f:b0:207:c38:9fd7 with SMTP id d9443c01a7336-2070c38a075mr77160875ad.22.1725811745045; Sun, 08 Sep 2024 09:09:05 -0700 (PDT) Received: from localhost.localdomain ([2620:11a:c019:0:65e:3115:2f58:c5fd]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20710f3179fsm21412535ad.258.2024.09.08.09.09.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Sep 2024 09:09:04 -0700 (PDT) From: Joe Damato To: netdev@vger.kernel.org Cc: mkarsten@uwaterloo.ca, kuba@kernel.org, skhawaja@google.com, sdf@fomichev.me, bjorn@rivosinc.com, amritha.nambiar@intel.com, sridhar.samudrala@intel.com, Joe Damato , Tariq Toukan , "David S. Miller" , Eric Dumazet , Paolo Abeni , linux-rdma@vger.kernel.org (open list:MELLANOX MLX4 core VPI driver), linux-kernel@vger.kernel.org (open list) Subject: [RFC net-next v2 9/9] mlx4: Add support for napi storage to RX CQs Date: Sun, 8 Sep 2024 16:06:43 +0000 Message-Id: <20240908160702.56618-10-jdamato@fastly.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240908160702.56618-1-jdamato@fastly.com> References: <20240908160702.56618-1-jdamato@fastly.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use netif_napi_add_storage to assign per-NAPI storage when initializing RX CQ NAPIs. Presently, struct napi_storage only has support for two fields used for RX, so there is no need to support them with TX CQs, yet. Signed-off-by: Joe Damato --- drivers/net/ethernet/mellanox/mlx4/en_cq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/en_cq.c b/drivers/net/ethernet/mellanox/mlx4/en_cq.c index 461cc2c79c71..74f4d8b63ffb 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_cq.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_cq.c @@ -156,7 +156,8 @@ int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq, break; case RX: cq->mcq.comp = mlx4_en_rx_irq; - netif_napi_add(cq->dev, &cq->napi, mlx4_en_poll_rx_cq); + netif_napi_add_storage(cq->dev, &cq->napi, mlx4_en_poll_rx_cq, + NAPI_POLL_WEIGHT, cq_idx); 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);