IB/core: Fix the validations of a multicast LID in attach or detach operations
authorNoa Osherovich <noaos@mellanox.com>
Mon, 12 Jun 2017 08:14:02 +0000 (11:14 +0300)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 26 Nov 2017 13:51:01 +0000 (13:51 +0000)
commita7f3619d51e620c157dad6361ce74143adb1903f
tree86f7d66c27bc3f7819f9ab406b227f741489cad8
parent8518814021e098a07b305a3c98620fc414ac0f20
IB/core: Fix the validations of a multicast LID in attach or detach operations

commit 5236333592244557a19694a51337df6ac018f0a7 upstream.

RoCE Annex (A16.9.10/11) declares that during attach (detach) QP to a
multicast group, if the QP is associated with a RoCE port, the
multicast group MLID is unused and is ignored.

During attach or detach multicast, when the QP is associated with a
port, it is enough to check the port's link layer and validate the
LID only if it is Infiniband. Otherwise, avoid validating the
multicast LID.

Fixes: 8561eae60ff9 ("IB/core: For multicast functions, verify that LIDs are multicast LIDs")
Signed-off-by: Noa Osherovich <noaos@mellanox.com>
Reviewed-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
[bwh: Backported to 3.2: use literal number instead of IB_MULTICAST_LID_BASE]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/infiniband/core/verbs.c