linux/drivers/net/ethernet/mellanox/mlx4
Jack Morgenstein f4ec9e9531 mlx4_core: Change bitmap allocator to work in round-robin fashion
Under most circumstances, the bitmap allocator does not allocate the
same full 24-bit QP number immediately after a QP is destroyed.

This works by using the upper bits of a 24-bit QP number, beyond the
number of QPs that are actually available in the low level driver.
For example, say that the HCA is willing to allocate a maximum of 64K
qps.  We use the bits 23..16 as a "counter" which is incremented by 1
at each allocation so that even if the same physical QP is
re-allocated, it will not receive the same 24-bit QP number.

However, we have seen the following scenario:
1. Allocate, say, 255 QPs in succession.  This will cause a wrap of the "counter".
2. Destroy the first QP allocated, then allocate a new QP.  The new QP,
   because of the counter wraparound, will get the same FULL QP number as
   the QP just destroyed!

This is a problem because packets in transit can be erroneously
delivered to the new QP when they were meant for the old (destroyed)
QP, because the full QP number of the new QP is identical to the
destroyed QP.  (The "counter" mechanism is meant to prevent this by
having the full 24-bit QP numbers differ even if the physical QP on
the HCA is the same.  As we see above, however, this mechanism does
not always work).

The best fix for this problem is to allocate QPs in round-robin mode,
so that the physical QP numbers are not immediately re-used.

Found-by:  Matthew Finlay <matt@mellanox.com>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <roland@purestorage.com>
2012-05-14 13:44:38 -07:00
..
alloc.c mlx4_core: Change bitmap allocator to work in round-robin fashion 2012-05-14 13:44:38 -07:00
catas.c mlx4_core: adjust catas operation for SRIOV mode 2011-12-13 13:56:08 -05:00
cmd.c mlx4_core: fix race on comm channel 2012-03-19 18:02:05 -04:00
cq.c mlx4_core: removed function index from vf. 2012-01-22 15:08:43 -05:00
en_cq.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-01-02 18:56:49 -05:00
en_ethtool.c mlx4_en: eth statistics modification 2012-01-22 15:08:43 -05:00
en_main.c mlx4_en: set number of rx rings used by RSS using ethtool 2012-01-18 16:07:34 -05:00
en_netdev.c net/mlx4_en: Saving mem access on data path 2012-03-06 15:19:17 -05:00
en_port.c mlx4: Ethernet port management modifications 2011-12-13 13:56:07 -05:00
en_port.h mlx4: Ethernet port management modifications 2011-12-13 13:56:07 -05:00
en_resources.c net/mlx4: move RSS related definitions to be global 2011-11-27 17:17:03 -05:00
en_rx.c net/mlx4: fix sparse warnings on wrong type for RSS keys 2012-03-06 15:19:17 -05:00
en_selftest.c mlx4_core: Add "native" argument to mlx4_cmd and its callers (where needed) 2011-12-13 13:56:05 -05:00
en_tx.c net/mlx4: fix sparse warnings on TX blue flame buffer 2012-03-06 15:19:17 -05:00
eq.c InfiniBand/RDMA changes for the 3.4 merge window. Nothing big really 2012-03-21 10:33:42 -07:00
fw.c mlx4_core: Add second capabilities flags field 2012-05-08 11:54:32 -07:00
fw.h mlx4_core: Add second capabilities flags field 2012-05-08 11:54:32 -07:00
icm.c mlx4_core: Add "native" argument to mlx4_cmd and its callers (where needed) 2011-12-13 13:56:05 -05:00
icm.h
intf.c mlx4_core: adjust catas operation for SRIOV mode 2011-12-13 13:56:08 -05:00
Kconfig
main.c mlx4_core: Add second capabilities flags field 2012-05-08 11:54:32 -07:00
Makefile mlx4_core: resource tracking for HCA resources used by guests 2011-12-13 13:56:07 -05:00
mcg.c mlx4: attach multicast with correct flag 2012-02-14 14:11:58 -05:00
mlx4_en.h mlx4: allocate just enough pages instead of always 4 pages 2012-04-04 20:34:29 -04:00
mlx4.h InfiniBand/RDMA changes for the 3.4 merge window. Nothing big really 2012-03-21 10:33:42 -07:00
mr.c InfiniBand/RDMA changes for the 3.4 merge window. Nothing big really 2012-03-21 10:33:42 -07:00
pd.c mlx4_core: removed function index from vf. 2012-01-22 15:08:43 -05:00
port.c InfiniBand/RDMA changes for the 3.4 merge window. Nothing big really 2012-03-21 10:33:42 -07:00
profile.c mlx4_core: Scale size of MTT table with system RAM 2012-03-12 16:24:59 -07:00
qp.c mlx4_core: remove buggy sched_queue masking 2012-03-06 14:43:50 -05:00
reset.c
resource_tracker.c mlx4_core: fix bug in modify_cq wrapper for resize flow. 2012-03-08 00:28:01 -08:00
sense.c mlx4_core: Add "native" argument to mlx4_cmd and its callers (where needed) 2011-12-13 13:56:05 -05:00
srq.c mlx4_core: removed function index from vf. 2012-01-22 15:08:43 -05:00