OSDN Git Service

mlx5: move affinity hints assignments to generic code
authorSagi Grimberg <sagi@grimberg.me>
Thu, 13 Jul 2017 08:09:40 +0000 (11:09 +0300)
committerDoug Ledford <dledford@redhat.com>
Tue, 8 Aug 2017 18:55:56 +0000 (14:55 -0400)
commita435393acafbf0ecff4deb3e3cb554b34f0d0664
tree67f659fdbe734dd5adf0c3c995ddd72f827814f1
parenta85e5474f4c783b252bf6b80571cdb2abb7d69d9
mlx5: move affinity hints assignments to generic code

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 and introduce mlx5e_get_node
(used for allocation purposes) and mlx5_get_vector_affinity
(for indirection table construction) as they provide the needed
information. Luckily, we have generic helpers to get cpumask
and node given a irq vector. mlx5_get_vector_affinity will
be used by mlx5_ib in a subsequent patch.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/mellanox/mlx5/core/main.c
include/linux/mlx5/driver.h