]> git.baikalelectronics.ru Git - kernel.git/commit
IB/core: Don't allow default GID addition at non reseved slots
authorParav Pandit <parav@mellanox.com>
Mon, 23 Apr 2018 13:58:17 +0000 (16:58 +0300)
committerDoug Ledford <dledford@redhat.com>
Mon, 23 Apr 2018 21:26:04 +0000 (17:26 -0400)
commitf0422a323c8f1836e09fdf028d224fad6ad8e29d
treebb0cc0dc546ff035f1dbe51e6a6033694ab01011
parent9beb02a1fd813414dea51a805078f46ee9c6ded5
IB/core: Don't allow default GID addition at non reseved slots

Default GIDs are marked reserved at the start of the GID table at index
0 and 1 by gid_table_reserve_default().  Currently when default GID is
requested, it can still allocates an empty slot which was not marked as
RESERVED for default GID, which is incorrect.

At least in current code flow of roce_gid_mgmt.c, in theory we can
still request to allocate more than one/two default GIDs depending
on how upper devices are setup.

Therefore, it is better for cache layer to only allow our reserved slots
to be used by default GID allocation requests.

Fixes: 0e321826e718 ("IB/core: Refactor GID modify code for RoCE")
Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/cache.c