]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx4_core: Fix checking order in MR table init
authorJack Morgenstein <jackm@dev.mellanox.co.il>
Sun, 3 Nov 2013 08:03:22 +0000 (10:03 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 Nov 2013 21:19:07 +0000 (16:19 -0500)
commitc250f498852ca17556e789ba5bd4616061a12d63
tree2784d3165280560d4632ca7c196db8400249429e
parent9110455d1313f6a3edf568f98c64636bffd06755
net/mlx4_core: Fix checking order in MR table init

In procedure mlx4_init_mr_table(), slaves should do no processing,
but should return success. This initialization is hypervisor-only.

However, the check for num_mpts being a power-of-2 was performed
before the check to return immediately if the driver is for a slave.
This resulted in spurious failures.

The order of performing the checks is reversed, so that if the
driver is for a slave, no processing is done and success is returned.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/mr.c