diff mbox series

[net-next,v3,4/6] bnxt: use napi's irq affinity

Message ID 20250104004314.208259-5-ahmed.zaki@intel.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series net: napi: add CPU affinity to napi->config | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next, async
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit fail Errors and warnings before: 13 this patch: 12
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 1 maintainers not CCed: pavan.chebbi@broadcom.com
netdev/build_clang fail Errors and warnings before: 547 this patch: 522
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn fail Errors and warnings before: 643 this patch: 180
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 60 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 2 this patch: 2
netdev/source_inline success Was 0 now: 0

Commit Message

Ahmed Zaki Jan. 4, 2025, 12:43 a.m. UTC
Delete the driver CPU affinity info and use the core's napi config
instead.

Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 26 ++++-------------------
 drivers/net/ethernet/broadcom/bnxt/bnxt.h |  2 --
 2 files changed, 4 insertions(+), 24 deletions(-)

Comments

Kalesh Anakkur Purayil Jan. 5, 2025, 6:42 a.m. UTC | #1
On Sat, Jan 4, 2025 at 6:13 AM Ahmed Zaki <ahmed.zaki@intel.com> wrote:
>
> Delete the driver CPU affinity info and use the core's napi config
> instead.
>
> Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com>
> ---
>  drivers/net/ethernet/broadcom/bnxt/bnxt.c | 26 ++++-------------------
>  drivers/net/ethernet/broadcom/bnxt/bnxt.h |  2 --
>  2 files changed, 4 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index cc3ca3440b0a..fcf230fde1ec 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> @@ -11193,14 +11193,8 @@ static void bnxt_free_irq(struct bnxt *bp)
>                 int map_idx = bnxt_cp_num_to_irq_num(bp, i);
>
>                 irq = &bp->irq_tbl[map_idx];
> -               if (irq->requested) {
> -                       if (irq->have_cpumask) {
> -                               irq_update_affinity_hint(irq->vector, NULL);
> -                               free_cpumask_var(irq->cpu_mask);
> -                               irq->have_cpumask = 0;
> -                       }
> +               if (irq->requested)
>                         free_irq(irq->vector, bp->bnapi[i]);
> -               }
>
>                 irq->requested = 0;
>         }
> @@ -11229,21 +11223,6 @@ static int bnxt_request_irq(struct bnxt *bp)
>
>                 netif_napi_set_irq(&bp->bnapi[i]->napi, irq->vector);
>                 irq->requested = 1;
> -
> -               if (zalloc_cpumask_var(&irq->cpu_mask, GFP_KERNEL)) {
> -                       int numa_node = dev_to_node(&bp->pdev->dev);
> -
> -                       irq->have_cpumask = 1;
> -                       cpumask_set_cpu(cpumask_local_spread(i, numa_node),
> -                                       irq->cpu_mask);
> -                       rc = irq_update_affinity_hint(irq->vector, irq->cpu_mask);
> -                       if (rc) {
> -                               netdev_warn(bp->dev,
> -                                           "Update affinity hint failed, IRQ = %d\n",
> -                                           irq->vector);
> -                               break;
> -                       }
> -               }
>         }
>         return rc;
>  }
> @@ -13292,6 +13271,7 @@ static int bnxt_set_features(struct net_device *dev, netdev_features_t features)
>                                 bp->flags = old_flags;
>                 }
>         }
> +
This change looks unrelated, please remove.
>         return rc;
>  }
>
> @@ -16172,6 +16152,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>         dev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
>                             NETDEV_XDP_ACT_RX_SG;
>
> +       netif_enable_irq_affinity(dev);
> +
>  #ifdef CONFIG_BNXT_SRIOV
>         init_waitqueue_head(&bp->sriov_cfg_wait);
>  #endif
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
> index 094c9e95b463..7be2f90d0c05 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
> @@ -1228,9 +1228,7 @@ struct bnxt_irq {
>         irq_handler_t   handler;
>         unsigned int    vector;
>         u8              requested:1;
> -       u8              have_cpumask:1;
>         char            name[IFNAMSIZ + BNXT_IRQ_NAME_EXTRA];
> -       cpumask_var_t   cpu_mask;
>  };
>
>  #define HWRM_RING_ALLOC_TX     0x1
> --
> 2.43.0
>
>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index cc3ca3440b0a..fcf230fde1ec 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -11193,14 +11193,8 @@  static void bnxt_free_irq(struct bnxt *bp)
 		int map_idx = bnxt_cp_num_to_irq_num(bp, i);
 
 		irq = &bp->irq_tbl[map_idx];
-		if (irq->requested) {
-			if (irq->have_cpumask) {
-				irq_update_affinity_hint(irq->vector, NULL);
-				free_cpumask_var(irq->cpu_mask);
-				irq->have_cpumask = 0;
-			}
+		if (irq->requested)
 			free_irq(irq->vector, bp->bnapi[i]);
-		}
 
 		irq->requested = 0;
 	}
@@ -11229,21 +11223,6 @@  static int bnxt_request_irq(struct bnxt *bp)
 
 		netif_napi_set_irq(&bp->bnapi[i]->napi, irq->vector);
 		irq->requested = 1;
-
-		if (zalloc_cpumask_var(&irq->cpu_mask, GFP_KERNEL)) {
-			int numa_node = dev_to_node(&bp->pdev->dev);
-
-			irq->have_cpumask = 1;
-			cpumask_set_cpu(cpumask_local_spread(i, numa_node),
-					irq->cpu_mask);
-			rc = irq_update_affinity_hint(irq->vector, irq->cpu_mask);
-			if (rc) {
-				netdev_warn(bp->dev,
-					    "Update affinity hint failed, IRQ = %d\n",
-					    irq->vector);
-				break;
-			}
-		}
 	}
 	return rc;
 }
@@ -13292,6 +13271,7 @@  static int bnxt_set_features(struct net_device *dev, netdev_features_t features)
 				bp->flags = old_flags;
 		}
 	}
+
 	return rc;
 }
 
@@ -16172,6 +16152,8 @@  static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	dev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
 			    NETDEV_XDP_ACT_RX_SG;
 
+	netif_enable_irq_affinity(dev);
+
 #ifdef CONFIG_BNXT_SRIOV
 	init_waitqueue_head(&bp->sriov_cfg_wait);
 #endif
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index 094c9e95b463..7be2f90d0c05 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -1228,9 +1228,7 @@  struct bnxt_irq {
 	irq_handler_t	handler;
 	unsigned int	vector;
 	u8		requested:1;
-	u8		have_cpumask:1;
 	char		name[IFNAMSIZ + BNXT_IRQ_NAME_EXTRA];
-	cpumask_var_t	cpu_mask;
 };
 
 #define HWRM_RING_ALLOC_TX	0x1