linux/drivers/infiniband/hw
Jack Morgenstein c576405568 IB/mlx4: Use correct subnet-prefix in QP1 mads under SR-IOV
commit 8ec07bf8a8 upstream.

When sending QP1 MAD packets which use a GRH, the source GID
(which consists of the 64-bit subnet prefix, and the 64 bit port GUID)
must be included in the packet GRH.

For SR-IOV, a GID cache is used, since the source GID needs to be the
slave's source GID, and not the Hypervisor's GID. This cache also
included a subnet_prefix. Unfortunately, the subnet_prefix field in
the cache was never initialized (to the default subnet prefix 0xfe80::0).
As a result, this field remained all zeroes.  Therefore, when SR-IOV
was active, all QP1 packets which included a GRH had a source GID
subnet prefix of all-zeroes.

However, the subnet-prefix should initially be 0xfe80::0 (the default
subnet prefix). In addition, if OpenSM modifies a port's subnet prefix,
the new subnet prefix must be used in the GRH when sending QP1 packets.
To fix this we now initialize the subnet prefix in the SR-IOV GID cache
to the default subnet prefix. We update the cached value if/when OpenSM
modifies the port's subnet prefix. We take this cached value when sending
QP1 packets when SR-IOV is active.

Note that the value is stored as an atomic64. This eliminates any need
for locking when the subnet prefix is being updated.

Note also that we depend on the FW generating the "port management change"
event for tracking subnet-prefix changes performed by OpenSM. If running
early FW (before 2.9.4630), subnet prefix changes will not be tracked (but
the default subnet prefix still will be stored in the cache; therefore
users who do not modify the subnet prefix will not have a problem).
IF there is a need for such tracking also for early FW, we will add that
capability in a subsequent patch.

Fixes: 1ffeb2eb8b ("IB/mlx4: SR-IOV IB context objects and proxy/tunnel SQP support")
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2016-11-20 01:17:31 +00:00
..
amso1100 IB: Refactor umem to use linear SG table 2014-03-04 10:34:28 -08:00
cxgb3 RDMA/cxgb3: device driver frees DMA memory with different size 2016-08-22 22:38:05 +01:00
cxgb4 RDMA/iw_cxgb4: Always wake up waiter in c4iw_peer_abort_intr() 2016-08-22 22:37:59 +01:00
ehca Merge branches 'core', 'cxgb4', 'ip-roce', 'iser', 'misc', 'mlx4', 'nes', 'ocrdma', 'qib', 'sgwrapper', 'srp' and 'usnic' into for-next 2014-04-03 08:30:17 -07:00
ipath IB/security: Restrict use of the write() interface 2016-06-15 21:29:28 +01:00
mlx4 IB/mlx4: Use correct subnet-prefix in QP1 mads under SR-IOV 2016-11-20 01:17:31 +00:00
mlx5 IB/mlx5: Fix post send fence logic 2016-08-22 22:38:18 +01:00
mthca IB/mthca: Use pci_enable_msix_exact() instead of pci_enable_msix() 2014-04-10 18:41:34 -07:00
nes RDMA/nes: Add support for iWARP Port Mapper user space service 2014-06-10 10:12:06 -07:00
ocrdma RDMA/ocrdma: Convert to use simple_open() 2014-05-19 17:55:54 -07:00
qib IB/security: Restrict use of the write() interface 2016-06-15 21:29:28 +01:00
usnic Merge branches 'core', 'cxgb3', 'cxgb4', 'iser', 'iwpm', 'misc', 'mlx4', 'mlx5', 'noio', 'ocrdma', 'qib', 'srp' and 'usnic' into for-next 2014-06-10 10:12:14 -07:00
Makefile IB: Allow build of hw/ and ulp/ subdirectories independently 2014-06-02 14:51:12 -07:00