aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx4
diff options
context:
space:
mode:
authorAlex Vesker <valex@mellanox.com>2016-09-12 12:16:18 -0400
committerDoug Ledford <dledford@redhat.com>2016-09-16 14:14:08 -0400
commite5ac40cd66c2f3cd11bc5edc658f012661b16347 (patch)
treed4ca888de8fffae37a2195a29e77507e5838a6b0 /drivers/infiniband/hw/mlx4
parent344bacca8cd811809fc33a249f2738ab757d327f (diff)
IB/mlx4: Fix incorrect MC join state bit-masking on SR-IOV
Because of an incorrect bit-masking done on the join state bits, when handling a join request we failed to detect a difference between the group join state and the request join state when joining as send only full member (0x8). This caused the MC join request not to be sent. This issue is relevant only when SRIOV is enabled and SM supports send only full member. This fix separates scope bits and join states bits a nibble each. Fixes: b9c5d6a64358 ('IB/mlx4: Add multicast group (MCG) paravirtualization for SR-IOV') Signed-off-by: Alex Vesker <valex@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4')
-rw-r--r--drivers/infiniband/hw/mlx4/mcg.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/infiniband/hw/mlx4/mcg.c b/drivers/infiniband/hw/mlx4/mcg.c
index 8f7ad07915b0..097bfcc4ee99 100644
--- a/drivers/infiniband/hw/mlx4/mcg.c
+++ b/drivers/infiniband/hw/mlx4/mcg.c
@@ -489,7 +489,7 @@ static u8 get_leave_state(struct mcast_group *group)
489 if (!group->members[i]) 489 if (!group->members[i])
490 leave_state |= (1 << i); 490 leave_state |= (1 << i);
491 491
492 return leave_state & (group->rec.scope_join_state & 7); 492 return leave_state & (group->rec.scope_join_state & 0xf);
493} 493}
494 494
495static int join_group(struct mcast_group *group, int slave, u8 join_mask) 495static int join_group(struct mcast_group *group, int slave, u8 join_mask)
@@ -564,8 +564,8 @@ static void mlx4_ib_mcg_timeout_handler(struct work_struct *work)
564 } else 564 } else
565 mcg_warn_group(group, "DRIVER BUG\n"); 565 mcg_warn_group(group, "DRIVER BUG\n");
566 } else if (group->state == MCAST_LEAVE_SENT) { 566 } else if (group->state == MCAST_LEAVE_SENT) {
567 if (group->rec.scope_join_state & 7) 567 if (group->rec.scope_join_state & 0xf)
568 group->rec.scope_join_state &= 0xf8; 568 group->rec.scope_join_state &= 0xf0;
569 group->state = MCAST_IDLE; 569 group->state = MCAST_IDLE;
570 mutex_unlock(&group->lock); 570 mutex_unlock(&group->lock);
571 if (release_group(group, 1)) 571 if (release_group(group, 1))
@@ -605,7 +605,7 @@ static int handle_leave_req(struct mcast_group *group, u8 leave_mask,
605static int handle_join_req(struct mcast_group *group, u8 join_mask, 605static int handle_join_req(struct mcast_group *group, u8 join_mask,
606 struct mcast_req *req) 606 struct mcast_req *req)
607{ 607{
608 u8 group_join_state = group->rec.scope_join_state & 7; 608 u8 group_join_state = group->rec.scope_join_state & 0xf;
609 int ref = 0; 609 int ref = 0;
610 u16 status; 610 u16 status;
611 struct ib_sa_mcmember_data *sa_data = (struct ib_sa_mcmember_data *)req->sa_mad.data; 611 struct ib_sa_mcmember_data *sa_data = (struct ib_sa_mcmember_data *)req->sa_mad.data;
@@ -690,8 +690,8 @@ static void mlx4_ib_mcg_work_handler(struct work_struct *work)
690 u8 cur_join_state; 690 u8 cur_join_state;
691 691
692 resp_join_state = ((struct ib_sa_mcmember_data *) 692 resp_join_state = ((struct ib_sa_mcmember_data *)
693 group->response_sa_mad.data)->scope_join_state & 7; 693 group->response_sa_mad.data)->scope_join_state & 0xf;
694 cur_join_state = group->rec.scope_join_state & 7; 694 cur_join_state = group->rec.scope_join_state & 0xf;
695 695
696 if (method == IB_MGMT_METHOD_GET_RESP) { 696 if (method == IB_MGMT_METHOD_GET_RESP) {
697 /* successfull join */ 697 /* successfull join */
@@ -710,7 +710,7 @@ process_requests:
710 req = list_first_entry(&group->pending_list, struct mcast_req, 710 req = list_first_entry(&group->pending_list, struct mcast_req,
711 group_list); 711 group_list);
712 sa_data = (struct ib_sa_mcmember_data *)req->sa_mad.data; 712 sa_data = (struct ib_sa_mcmember_data *)req->sa_mad.data;
713 req_join_state = sa_data->scope_join_state & 0x7; 713 req_join_state = sa_data->scope_join_state & 0xf;
714 714
715 /* For a leave request, we will immediately answer the VF, and 715 /* For a leave request, we will immediately answer the VF, and
716 * update our internal counters. The actual leave will be sent 716 * update our internal counters. The actual leave will be sent