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
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) · 68 unmodified lines
564 } else564 } 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, · 33 unmodified lines
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) · 78 unmodified lines
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: · 12 unmodified lines
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, and715 /* For a leave request, we will immediately answer the VF, and
716 * update our internal counters. The actual leave will be sent716 * update our internal counters. The actual leave will be sent