Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH v4 for-4.13 2/6] mlx5: move affinity hints assignments to generic code
Date: Wed, 7 Jun 2017 10:22:00 +0200	[thread overview]
Message-ID: <20170607082200.GB24774@lst.de> (raw)
In-Reply-To: <1496814868-22070-3-git-send-email-sagi@grimberg.me>

On Wed, Jun 07, 2017@08:54:24AM +0300, Sagi Grimberg wrote:
> generic api takes care of spreading affinity similar to
> what mlx5 open coded (and even handles better asymmetric
> configurations). Ask the generic API to spread affinity
> for us, and feed him pre_vectors that do not participate
> in affinity settings (which is an improvement to what we
> had before).
> 
> The affinity assignments should match what mlx5 tried to
> do earlier but now we do not set affinity to async, cmd
> and pages dedicated vectors.
> 
> Also, remove mlx5e_get_cpu routine as we have generic helpers
> to get cpumask and node given a irq vector, so use them
> directly.
> 
> Reviewed-by: Christoph Hellwig <hch at lst.de>
> Acked-by: Leon Romanovsky <leonro at mellanox.com>
> Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 12 ++--
>  drivers/net/ethernet/mellanox/mlx5/core/main.c    | 83 ++---------------------
>  include/linux/mlx5/driver.h                       |  1 -
>  3 files changed, 10 insertions(+), 86 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> index 2a3c59e55dcf..ebfda1eae6b4 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> @@ -1565,11 +1565,6 @@ static void mlx5e_close_cq(struct mlx5e_cq *cq)
>  	mlx5e_free_cq(cq);
>  }
>  
> -static int mlx5e_get_cpu(struct mlx5e_priv *priv, int ix)
> -{
> -	return cpumask_first(priv->mdev->priv.irq_info[ix].mask);
> -}
> -
>  static int mlx5e_open_tx_cqs(struct mlx5e_channel *c,
>  			     struct mlx5e_params *params,
>  			     struct mlx5e_channel_param *cparam)
> @@ -1718,11 +1713,11 @@ static int mlx5e_open_channel(struct mlx5e_priv *priv, int ix,
>  {
>  	struct mlx5e_cq_moder icocq_moder = {0, 0};
>  	struct net_device *netdev = priv->netdev;
> -	int cpu = mlx5e_get_cpu(priv, ix);
>  	struct mlx5e_channel *c;
>  	int err;
>  
> -	c = kzalloc_node(sizeof(*c), GFP_KERNEL, cpu_to_node(cpu));
> +	c = kzalloc_node(sizeof(*c), GFP_KERNEL,
> +		pci_irq_get_node(priv->mdev->pdev, MLX5_EQ_VEC_COMP_BASE + ix));
>  	if (!c)
>  		return -ENOMEM;
>  
> @@ -1730,7 +1725,8 @@ static int mlx5e_open_channel(struct mlx5e_priv *priv, int ix,
>  	c->mdev     = priv->mdev;
>  	c->tstamp   = &priv->tstamp;
>  	c->ix       = ix;
> -	c->cpu      = cpu;
> +	c->cpu      = cpumask_first(pci_irq_get_affinity(priv->mdev->pdev,
> +			MLX5_EQ_VEC_COMP_BASE + ix));

->cpu is only used to call cpu_to_node on it.  So remove it and switch
the users to

	pci_irq_get_node(priv->mdev->pdev)

instead.

  reply	other threads:[~2017-06-07  8:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-07  5:54 [PATCH v4 for-4.13 0/6] Automatic affinity settings for nvme over rdma Sagi Grimberg
2017-06-07  5:54 ` [PATCH v4 for-4.13 1/6] mlx5: convert to generic pci_alloc_irq_vectors Sagi Grimberg
2017-06-07  8:20   ` Christoph Hellwig
2017-06-07 10:22     ` Sagi Grimberg
2017-06-07  5:54 ` [PATCH v4 for-4.13 2/6] mlx5: move affinity hints assignments to generic code Sagi Grimberg
2017-06-07  8:22   ` Christoph Hellwig [this message]
2017-06-07  9:56     ` Sagi Grimberg
2017-06-07  5:54 ` [PATCH v4 for-4.13 3/6] RDMA/core: expose affinity mappings per completion vector Sagi Grimberg
2017-06-07  5:54 ` [PATCH v4 for-4.13 4/6] mlx5: support ->get_vector_affinity Sagi Grimberg
2017-06-07  5:54 ` [PATCH v4 for-4.13 5/6] block: Add rdma affinity based queue mapping helper Sagi Grimberg
2017-06-07  5:54 ` [PATCH v4 for-4.13 6/6] nvme-rdma: use intelligent affinity based queue mappings Sagi Grimberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170607082200.GB24774@lst.de \
    --to=hch@lst.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox