Commit e5f3aa04 authored by Karsten Graul's avatar Karsten Graul Committed by David S. Miller

net/smc: use device link provided in qp_context

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: default avatarKarsten Graul <kgraul@linux.ibm.com>
Signed-off-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2dee25af
...@@ -289,8 +289,8 @@ int smc_ib_create_protection_domain(struct smc_link *lnk) ...@@ -289,8 +289,8 @@ int smc_ib_create_protection_domain(struct smc_link *lnk)
static void smc_ib_qp_event_handler(struct ib_event *ibevent, void *priv) static void smc_ib_qp_event_handler(struct ib_event *ibevent, void *priv)
{ {
struct smc_ib_device *smcibdev = struct smc_link *lnk = (struct smc_link *)priv;
(struct smc_ib_device *)ibevent->device; struct smc_ib_device *smcibdev = lnk->smcibdev;
u8 port_idx; u8 port_idx;
switch (ibevent->event) { switch (ibevent->event) {
...@@ -298,7 +298,7 @@ static void smc_ib_qp_event_handler(struct ib_event *ibevent, void *priv) ...@@ -298,7 +298,7 @@ static void smc_ib_qp_event_handler(struct ib_event *ibevent, void *priv)
case IB_EVENT_GID_CHANGE: case IB_EVENT_GID_CHANGE:
case IB_EVENT_PORT_ERR: case IB_EVENT_PORT_ERR:
case IB_EVENT_QP_ACCESS_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); set_bit(port_idx, &smcibdev->port_event_mask);
schedule_work(&smcibdev->port_event_work); schedule_work(&smcibdev->port_event_work);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment