diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/cnic.c | 21 | ||||
-rw-r--r-- | drivers/net/cnic_if.h | 2 |
2 files changed, 17 insertions, 6 deletions
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c index 3a7d3ce6db7b..9f80fb40380a 100644 --- a/drivers/net/cnic.c +++ b/drivers/net/cnic.c @@ -279,6 +279,7 @@ static int cnic_send_nlmsg(struct cnic_local *cp, u32 type, u32 msg_type = ISCSI_KEVENT_IF_DOWN; struct cnic_ulp_ops *ulp_ops; struct cnic_uio_dev *udev = cp->udev; + int rc = 0, retry = 0; if (!udev || udev->uio_dev == -1) return -ENODEV; @@ -303,11 +304,21 @@ static int cnic_send_nlmsg(struct cnic_local *cp, u32 type, path_req.pmtu = csk->mtu; } - rcu_read_lock(); - ulp_ops = rcu_dereference(cnic_ulp_tbl[CNIC_ULP_ISCSI]); - if (ulp_ops) - ulp_ops->iscsi_nl_send_msg(cp->dev, msg_type, buf, len); - rcu_read_unlock(); + while (retry < 3) { + rc = 0; + rcu_read_lock(); + ulp_ops = rcu_dereference(cnic_ulp_tbl[CNIC_ULP_ISCSI]); + if (ulp_ops) + rc = ulp_ops->iscsi_nl_send_msg( + cp->ulp_handle[CNIC_ULP_ISCSI], + msg_type, buf, len); + rcu_read_unlock(); + if (rc == 0 || msg_type != ISCSI_KEVENT_PATH_REQ) + break; + + msleep(100); + retry++; + } return 0; } diff --git a/drivers/net/cnic_if.h b/drivers/net/cnic_if.h index 0dbeaec4f03a..33333e735f95 100644 --- a/drivers/net/cnic_if.h +++ b/drivers/net/cnic_if.h @@ -301,7 +301,7 @@ struct cnic_ulp_ops { void (*cm_abort_complete)(struct cnic_sock *); void (*cm_remote_close)(struct cnic_sock *); void (*cm_remote_abort)(struct cnic_sock *); - void (*iscsi_nl_send_msg)(struct cnic_dev *dev, u32 msg_type, + int (*iscsi_nl_send_msg)(void *ulp_ctx, u32 msg_type, char *data, u16 data_size); struct module *owner; atomic_t ref_count; |