IB/mlx4: Invoke UPDATE_QP for proxy QP1 on MAC changes
authorMatan Barak <matanb@mellanox.com>
Thu, 15 May 2014 12:29:28 +0000 (15:29 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 May 2014 19:12:45 +0000 (15:12 -0400)
commit9433c188915c1383ee36259119bc3a9c6f98cfc3
tree9ff27f9b0cd1c0c205e7c68ebb9457efae518683
parentce8d9e0d6746ff67c1870386b7121a4448f21130
IB/mlx4: Invoke UPDATE_QP for proxy QP1 on MAC changes

When we receive a netdev event indicating a netdev change and/or
a netdev address change, we must change the MAC index used by the
proxy QP1 (in the QP context), otherwise RoCE CM packets sent by the
VF will not carry the same source MAC address as the non-CM packets.

We use the UPDATE_QP command to perform this change.

In order to avoid modifying a QP context based on netdev event,
while the driver attempts to destroy this QP (e.g either the mlx4_ib
or ib_mad modules are unloaded), we use mutex locking in both flows.

Since the relevant mlx4 proxy GSI QP is created indirectly by the
mad module when they create their GSI QP, the mlx4 didn't need to
keep track on that QP prior to this change.

Now, when QP modifications are needed to this QP from within the
driver, we added refernece to it.

Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/infiniband/hw/mlx4/main.c
drivers/infiniband/hw/mlx4/mlx4_ib.h
drivers/infiniband/hw/mlx4/qp.c