History

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.

Alex Vesker committed 10 years ago

Commit e5ac40c1 parent 344bacc1 file · +7 −7Browse files

Unified · Split

drivers/infiniband/hw/mlx4/mcg.c+7−7
@@ -489,7 +489,7 @@ static u8 get_leave_state(struct mcast_group *group) · 488 unmodified lines
489489 if (!group->members[i])
490490 leave_state |= (1 << i);
491491
492− return leave_state & (group->rec.scope_join_state & 7);
492+ return leave_state & (group->rec.scope_join_state & 0xf);
493493 }
494494
495495 static 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) · 68 unmodified lines
564564 } else
565565 mcg_warn_group(group, "DRIVER BUG\n");
566566 } else if (group->state == MCAST_LEAVE_SENT) {
567− if (group->rec.scope_join_state & 7)
568− group->rec.scope_join_state &= 0xf8;
567+ if (group->rec.scope_join_state & 0xf)
568+ group->rec.scope_join_state &= 0xf0;
569569 group->state = MCAST_IDLE;
570570 mutex_unlock(&group->lock);
571571 if (release_group(group, 1))
@@ -605,7 +605,7 @@ static int handle_leave_req(struct mcast_group *group, u8 leave_mask, · 33 unmodified lines
605605 static int handle_join_req(struct mcast_group *group, u8 join_mask,
606606 struct mcast_req *req)
607607 {
608− u8 group_join_state = group->rec.scope_join_state & 7;
608+ u8 group_join_state = group->rec.scope_join_state & 0xf;
609609 int ref = 0;
610610 u16 status;
611611 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) · 78 unmodified lines
690690 u8 cur_join_state;
691691
692692 resp_join_state = ((struct ib_sa_mcmember_data *)
693− group->response_sa_mad.data)->scope_join_state & 7;
694− cur_join_state = group->rec.scope_join_state & 7;
693+ group->response_sa_mad.data)->scope_join_state & 0xf;
694+ cur_join_state = group->rec.scope_join_state & 0xf;
695695
696696 if (method == IB_MGMT_METHOD_GET_RESP) {
697697 /* successfull join */
@@ -710,7 +710,7 @@ process_requests: · 12 unmodified lines
710710 req = list_first_entry(&group->pending_list, struct mcast_req,
711711 group_list);
712712 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;
714714
715715 /* For a leave request, we will immediately answer the VF, and
716716 * update our internal counters. The actual leave will be sent