Skip to content

Commit

Permalink
net/smc: use device link provided in qp_context
Browse files Browse the repository at this point in the history
The device field of the IB event structure does not always point to the
SMC IB device. Load the pointer from the qp_context which is always
provided to smc_ib_qp_event_handler() in the priv field. And for qp
events the affected port is given in the qp structure of the ibevent,
derive it from there.

Signed-off-by: Karsten Graul <[email protected]>
Signed-off-by: Ursula Braun <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
karstengr authored and davem330 committed Feb 1, 2019
1 parent 2dee25a commit e5f3aa0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/smc/smc_ib.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,16 +289,16 @@ int smc_ib_create_protection_domain(struct smc_link *lnk)

static void smc_ib_qp_event_handler(struct ib_event *ibevent, void *priv)
{
struct smc_ib_device *smcibdev =
(struct smc_ib_device *)ibevent->device;
struct smc_link *lnk = (struct smc_link *)priv;
struct smc_ib_device *smcibdev = lnk->smcibdev;
u8 port_idx;

switch (ibevent->event) {
case IB_EVENT_DEVICE_FATAL:
case IB_EVENT_GID_CHANGE:
case IB_EVENT_PORT_ERR:
case IB_EVENT_QP_ACCESS_ERR:
port_idx = ibevent->element.port_num - 1;
port_idx = ibevent->element.qp->port - 1;
set_bit(port_idx, &smcibdev->port_event_mask);
schedule_work(&smcibdev->port_event_work);
break;
Expand Down

0 comments on commit e5f3aa0

Please sign in to comment.