@@ -767,7 +767,7 @@ struct mlx5e_channel {
spinlock_t async_icosq_lock;
/* data path - accessed per napi poll */
- const struct cpumask *aff_mask;
+ unsigned int irq;
struct mlx5e_ch_stats *stats;
/* control */
@@ -2684,8 +2684,8 @@ static int mlx5e_open_channel(struct mlx5e_priv *priv, int ix,
c->mkey_be = cpu_to_be32(mdev->mlx5e_res.hw_objs.mkey);
c->num_tc = mlx5e_get_dcb_num_tc(params);
c->xdp = !!params->xdp_prog;
+ c->irq = irq;
c->stats = &priv->channel_stats[ix]->ch;
- 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);
@@ -39,13 +39,6 @@
#include "en/xsk/tx.h"
#include "en_accel/ktls_txrx.h"
-static inline bool mlx5e_channel_no_affinity_change(struct mlx5e_channel *c)
-{
- int current_cpu = smp_processor_id();
-
- return cpumask_test_cpu(current_cpu, c->aff_mask);
-}
-
static void mlx5e_handle_tx_dim(struct mlx5e_txqsq *sq)
{
struct mlx5e_sq_stats *stats = sq->stats;
@@ -201,7 +194,7 @@ int mlx5e_napi_poll(struct napi_struct *napi, int budget)
busy |= busy_xsk;
if (busy) {
- if (likely(mlx5e_channel_no_affinity_change(c))) {
+ if (likely(napi_affinity_no_change(c->irq))) {
work_done = budget;
goto out;
}
Use napi_affinity_no_change instead of mlx5's internal implementation, simplifying and centralizing the logic. Signed-off-by: Joe Damato <jdamato@fastly.com> --- drivers/net/ethernet/mellanox/mlx5/core/en.h | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c | 9 +-------- 3 files changed, 3 insertions(+), 10 deletions(-)