diff options
author | Jack Morgenstein <jackm@dev.mellanox.co.il> | 2014-03-12 14:00:40 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-03-12 23:57:15 +0400 |
commit | 2f5bb473681b88819a9de28ac3a47e7737815a92 (patch) | |
tree | 74fe948339b3eca5dc0e03be4e9fd7b7b4372c38 /include/linux/mlx4/cmd.h | |
parent | b6ffaeffaea4d92f05f5ba1ef54df407cb7c8517 (diff) | |
download | linux-2f5bb473681b88819a9de28ac3a47e7737815a92.tar.xz |
mlx4: Add ref counting to port MAC table for RoCE
The IB side of RoCE requires the MAC table index of the
MAC address used by its QPs.
To obtain the real MAC index, the IB side registers the
MAC (increasing its ref count, and also returning the
real MAC index) during the modify-qp sequence.
This protects against the ETH side deleting or modifying
that MAC table entry while the QP is active.
Note that until the modify-qp command returns success,
the MAC and VLAN information only has "candidate" status.
If the modify-qp succeeds, the "candidate" info is promoted
to the operational MAC/VLAN info for the qp. If the modify fails,
the candidate MAC/VLAN is unregistered, and the old qp info
is preserved.
The patch is a bit complex, because there are multiple qp
transitions where the primary-path information may be
modified: INIT-to-RTR, and SQD-to-SQD.
Similarly for the alternate path information.
Therefore the code must handle cases where path information
has already been entered into the QP context by previous
qp transitions.
For the MAC address, the success logic is as follows:
1. If there was no previous MAC, simply move the candidate
MAC information to the operational information, and reset
the candidate MAC info.
2. If there was a previous MAC, unregister it. Then move
the MAC information from candidate to operational, and
reset the candidate info (as in 1. above).
The MAC address failure logic is the same for all cases:
- Unregister the candidate MAC, and reset the candidate MAC info.
For Vlan registration, the logic is similar.
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>
Diffstat (limited to 'include/linux/mlx4/cmd.h')
0 files changed, 0 insertions, 0 deletions