IB/core: Add ordered workqueue for RoCE GID management
authorMajd Dibbiny <majd@mellanox.com>
Tue, 30 May 2017 06:58:06 +0000 (09:58 +0300)
committerDoug Ledford <dledford@redhat.com>
Tue, 18 Jul 2017 01:21:25 +0000 (21:21 -0400)
commit8fe8bacb92f249c91a1407b48aa1cb98067fe19d
tree095c7eea7f03591ca4c5a6615e7257c31c80be41
parent12cc1a027341338f54d8d3fcf5d188ae2b39c30d
IB/core: Add ordered workqueue for RoCE GID management

Currently the RoCE GID management uses the ib_wq to do add and delete new GIDs
according to the netdev events.

The ib_wq isn't an ordered workqueue and thus two work elements can be executed
concurrently which will result in unexpected behavior and inconsistency of the
GIDs cache content.

Example:
ifconfig eth1 11.11.11.11/16 up

This command will invoke the following netdev events in the following order:
1. NETDEV_UP
2. NETDEV_DOWN
3. NETDEV_UP

If (2) and (3) will be executed concurrently or in reverse order, instead of
having a new GID with 11.11.11.11 IP, we will end up without any new GIDs.

Signed-off-by: Majd Dibbiny <majd@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/roce_gid_mgmt.c