Skip to content

Commit

Permalink
net/mlx4: Remove shared_ports variable at mlx4_enable_msi_x
Browse files Browse the repository at this point in the history
If we get MAX_MSIX interrupts would like to have each receive ring
with his own msix interrupt line. Do not need the shared_ports
variable at mlx4_enable_msix

Fixes: 9293267 ('net/mlx4_core: Capping number of requested MSIXs to MAX_MSIX')
Signed-off-by: Carol L Soto <clsoto@linux.vnet.ibm.com>
Acked-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Carol L Soto authored and David S. Miller committed Oct 8, 2015
1 parent 9d3a638 commit 85121d6
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions drivers/net/ethernet/mellanox/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2669,14 +2669,11 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev)

if (msi_x) {
int nreq = dev->caps.num_ports * num_online_cpus() + 1;
bool shared_ports = false;

nreq = min_t(int, dev->caps.num_eqs - dev->caps.reserved_eqs,
nreq);
if (nreq > MAX_MSIX) {
if (nreq > MAX_MSIX)
nreq = MAX_MSIX;
shared_ports = true;
}

entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL);
if (!entries)
Expand All @@ -2699,17 +2696,14 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev)
bitmap_zero(priv->eq_table.eq[MLX4_EQ_ASYNC].actv_ports.ports,
dev->caps.num_ports);

if (MLX4_IS_LEGACY_EQ_MODE(dev->caps))
shared_ports = true;

for (i = 0; i < dev->caps.num_comp_vectors + 1; i++) {
if (i == MLX4_EQ_ASYNC)
continue;

priv->eq_table.eq[i].irq =
entries[i + 1 - !!(i > MLX4_EQ_ASYNC)].vector;

if (shared_ports) {
if (MLX4_IS_LEGACY_EQ_MODE(dev->caps)) {
bitmap_fill(priv->eq_table.eq[i].actv_ports.ports,
dev->caps.num_ports);
/* We don't set affinity hint when there
Expand Down

0 comments on commit 85121d6

Please sign in to comment.