diff options
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_ib.c | 3 | ||||
-rw-r--r-- | drivers/infiniband/ulp/iser/iscsi_iser.c | 18 | ||||
-rw-r--r-- | drivers/infiniband/ulp/iser/iscsi_iser.h | 1 | ||||
-rw-r--r-- | drivers/infiniband/ulp/iser/iser_initiator.c | 42 | ||||
-rw-r--r-- | drivers/infiniband/ulp/iser/iser_verbs.c | 12 | ||||
-rw-r--r-- | drivers/infiniband/ulp/srp/ib_srp.c | 103 |
6 files changed, 82 insertions, 97 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 4115be54ba3b..5c1bc995e560 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c | |||
@@ -296,7 +296,8 @@ static void ipoib_ib_handle_rx_wc(struct net_device *dev, struct ib_wc *wc) | |||
296 | dev->stats.rx_bytes += skb->len; | 296 | dev->stats.rx_bytes += skb->len; |
297 | 297 | ||
298 | skb->dev = dev; | 298 | skb->dev = dev; |
299 | if ((dev->features & NETIF_F_RXCSUM) && likely(wc->csum_ok)) | 299 | if ((dev->features & NETIF_F_RXCSUM) && |
300 | likely(wc->wc_flags & IB_WC_IP_CSUM_OK)) | ||
300 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 301 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
301 | 302 | ||
302 | napi_gro_receive(&priv->napi, skb); | 303 | napi_gro_receive(&priv->napi, skb); |
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c index 9a43cb07f294..db43b3117168 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.c +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c | |||
@@ -364,6 +364,9 @@ iscsi_iser_conn_bind(struct iscsi_cls_session *cls_session, | |||
364 | } | 364 | } |
365 | ib_conn = ep->dd_data; | 365 | ib_conn = ep->dd_data; |
366 | 366 | ||
367 | if (iser_alloc_rx_descriptors(ib_conn)) | ||
368 | return -ENOMEM; | ||
369 | |||
367 | /* binds the iSER connection retrieved from the previously | 370 | /* binds the iSER connection retrieved from the previously |
368 | * connected ep_handle to the iSCSI layer connection. exchanges | 371 | * connected ep_handle to the iSCSI layer connection. exchanges |
369 | * connection pointers */ | 372 | * connection pointers */ |
@@ -398,19 +401,6 @@ iscsi_iser_conn_stop(struct iscsi_cls_conn *cls_conn, int flag) | |||
398 | iser_conn->ib_conn = NULL; | 401 | iser_conn->ib_conn = NULL; |
399 | } | 402 | } |
400 | 403 | ||
401 | static int | ||
402 | iscsi_iser_conn_start(struct iscsi_cls_conn *cls_conn) | ||
403 | { | ||
404 | struct iscsi_conn *conn = cls_conn->dd_data; | ||
405 | int err; | ||
406 | |||
407 | err = iser_conn_set_full_featured_mode(conn); | ||
408 | if (err) | ||
409 | return err; | ||
410 | |||
411 | return iscsi_conn_start(cls_conn); | ||
412 | } | ||
413 | |||
414 | static void iscsi_iser_session_destroy(struct iscsi_cls_session *cls_session) | 404 | static void iscsi_iser_session_destroy(struct iscsi_cls_session *cls_session) |
415 | { | 405 | { |
416 | struct Scsi_Host *shost = iscsi_session_to_shost(cls_session); | 406 | struct Scsi_Host *shost = iscsi_session_to_shost(cls_session); |
@@ -724,7 +714,7 @@ static struct iscsi_transport iscsi_iser_transport = { | |||
724 | .get_conn_param = iscsi_conn_get_param, | 714 | .get_conn_param = iscsi_conn_get_param, |
725 | .get_ep_param = iscsi_iser_get_ep_param, | 715 | .get_ep_param = iscsi_iser_get_ep_param, |
726 | .get_session_param = iscsi_session_get_param, | 716 | .get_session_param = iscsi_session_get_param, |
727 | .start_conn = iscsi_iser_conn_start, | 717 | .start_conn = iscsi_conn_start, |
728 | .stop_conn = iscsi_iser_conn_stop, | 718 | .stop_conn = iscsi_iser_conn_stop, |
729 | /* iscsi host params */ | 719 | /* iscsi host params */ |
730 | .get_host_param = iscsi_host_get_param, | 720 | .get_host_param = iscsi_host_get_param, |
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h index db7ea3704da7..296be431a0e9 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.h +++ b/drivers/infiniband/ulp/iser/iscsi_iser.h | |||
@@ -366,4 +366,5 @@ int iser_dma_map_task_data(struct iscsi_iser_task *iser_task, | |||
366 | void iser_dma_unmap_task_data(struct iscsi_iser_task *iser_task); | 366 | void iser_dma_unmap_task_data(struct iscsi_iser_task *iser_task); |
367 | int iser_initialize_task_headers(struct iscsi_task *task, | 367 | int iser_initialize_task_headers(struct iscsi_task *task, |
368 | struct iser_tx_desc *tx_desc); | 368 | struct iser_tx_desc *tx_desc); |
369 | int iser_alloc_rx_descriptors(struct iser_conn *ib_conn); | ||
369 | #endif | 370 | #endif |
diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c index a607542fc796..a00ccd1ca333 100644 --- a/drivers/infiniband/ulp/iser/iser_initiator.c +++ b/drivers/infiniband/ulp/iser/iser_initiator.c | |||
@@ -170,7 +170,7 @@ static void iser_create_send_desc(struct iser_conn *ib_conn, | |||
170 | } | 170 | } |
171 | 171 | ||
172 | 172 | ||
173 | static int iser_alloc_rx_descriptors(struct iser_conn *ib_conn) | 173 | int iser_alloc_rx_descriptors(struct iser_conn *ib_conn) |
174 | { | 174 | { |
175 | int i, j; | 175 | int i, j; |
176 | u64 dma_addr; | 176 | u64 dma_addr; |
@@ -220,18 +220,6 @@ void iser_free_rx_descriptors(struct iser_conn *ib_conn) | |||
220 | struct iser_rx_desc *rx_desc; | 220 | struct iser_rx_desc *rx_desc; |
221 | struct iser_device *device = ib_conn->device; | 221 | struct iser_device *device = ib_conn->device; |
222 | 222 | ||
223 | if (ib_conn->login_buf) { | ||
224 | if (ib_conn->login_req_dma) | ||
225 | ib_dma_unmap_single(device->ib_device, | ||
226 | ib_conn->login_req_dma, | ||
227 | ISCSI_DEF_MAX_RECV_SEG_LEN, DMA_TO_DEVICE); | ||
228 | if (ib_conn->login_resp_dma) | ||
229 | ib_dma_unmap_single(device->ib_device, | ||
230 | ib_conn->login_resp_dma, | ||
231 | ISER_RX_LOGIN_SIZE, DMA_FROM_DEVICE); | ||
232 | kfree(ib_conn->login_buf); | ||
233 | } | ||
234 | |||
235 | if (!ib_conn->rx_descs) | 223 | if (!ib_conn->rx_descs) |
236 | return; | 224 | return; |
237 | 225 | ||
@@ -242,23 +230,24 @@ void iser_free_rx_descriptors(struct iser_conn *ib_conn) | |||
242 | kfree(ib_conn->rx_descs); | 230 | kfree(ib_conn->rx_descs); |
243 | } | 231 | } |
244 | 232 | ||
245 | /** | 233 | static int iser_post_rx_bufs(struct iscsi_conn *conn, struct iscsi_hdr *req) |
246 | * iser_conn_set_full_featured_mode - (iSER API) | ||
247 | */ | ||
248 | int iser_conn_set_full_featured_mode(struct iscsi_conn *conn) | ||
249 | { | 234 | { |
250 | struct iscsi_iser_conn *iser_conn = conn->dd_data; | 235 | struct iscsi_iser_conn *iser_conn = conn->dd_data; |
251 | 236 | ||
252 | iser_dbg("Initially post: %d\n", ISER_MIN_POSTED_RX); | 237 | iser_dbg("req op %x flags %x\n", req->opcode, req->flags); |
253 | 238 | /* check if this is the last login - going to full feature phase */ | |
254 | /* Check that there is no posted recv or send buffers left - */ | 239 | if ((req->flags & ISCSI_FULL_FEATURE_PHASE) != ISCSI_FULL_FEATURE_PHASE) |
255 | /* they must be consumed during the login phase */ | 240 | return 0; |
256 | BUG_ON(iser_conn->ib_conn->post_recv_buf_count != 0); | ||
257 | BUG_ON(atomic_read(&iser_conn->ib_conn->post_send_buf_count) != 0); | ||
258 | 241 | ||
259 | if (iser_alloc_rx_descriptors(iser_conn->ib_conn)) | 242 | /* |
260 | return -ENOMEM; | 243 | * Check that there is one posted recv buffer (for the last login |
244 | * response) and no posted send buffers left - they must have been | ||
245 | * consumed during previous login phases. | ||
246 | */ | ||
247 | WARN_ON(iser_conn->ib_conn->post_recv_buf_count != 1); | ||
248 | WARN_ON(atomic_read(&iser_conn->ib_conn->post_send_buf_count) != 0); | ||
261 | 249 | ||
250 | iser_dbg("Initially post: %d\n", ISER_MIN_POSTED_RX); | ||
262 | /* Initial post receive buffers */ | 251 | /* Initial post receive buffers */ |
263 | if (iser_post_recvm(iser_conn->ib_conn, ISER_MIN_POSTED_RX)) | 252 | if (iser_post_recvm(iser_conn->ib_conn, ISER_MIN_POSTED_RX)) |
264 | return -ENOMEM; | 253 | return -ENOMEM; |
@@ -438,6 +427,9 @@ int iser_send_control(struct iscsi_conn *conn, | |||
438 | err = iser_post_recvl(iser_conn->ib_conn); | 427 | err = iser_post_recvl(iser_conn->ib_conn); |
439 | if (err) | 428 | if (err) |
440 | goto send_control_error; | 429 | goto send_control_error; |
430 | err = iser_post_rx_bufs(conn, task->hdr); | ||
431 | if (err) | ||
432 | goto send_control_error; | ||
441 | } | 433 | } |
442 | 434 | ||
443 | err = iser_post_send(iser_conn->ib_conn, mdesc); | 435 | err = iser_post_send(iser_conn->ib_conn, mdesc); |
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index e28877c4ce15..14224ba44fd8 100644 --- a/drivers/infiniband/ulp/iser/iser_verbs.c +++ b/drivers/infiniband/ulp/iser/iser_verbs.c | |||
@@ -274,6 +274,18 @@ static int iser_free_ib_conn_res(struct iser_conn *ib_conn, int can_destroy_id) | |||
274 | ib_conn->cma_id = NULL; | 274 | ib_conn->cma_id = NULL; |
275 | kfree(ib_conn->page_vec); | 275 | kfree(ib_conn->page_vec); |
276 | 276 | ||
277 | if (ib_conn->login_buf) { | ||
278 | if (ib_conn->login_req_dma) | ||
279 | ib_dma_unmap_single(ib_conn->device->ib_device, | ||
280 | ib_conn->login_req_dma, | ||
281 | ISCSI_DEF_MAX_RECV_SEG_LEN, DMA_TO_DEVICE); | ||
282 | if (ib_conn->login_resp_dma) | ||
283 | ib_dma_unmap_single(ib_conn->device->ib_device, | ||
284 | ib_conn->login_resp_dma, | ||
285 | ISER_RX_LOGIN_SIZE, DMA_FROM_DEVICE); | ||
286 | kfree(ib_conn->login_buf); | ||
287 | } | ||
288 | |||
277 | return 0; | 289 | return 0; |
278 | } | 290 | } |
279 | 291 | ||
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 0bfa545675b8..bcbf22ee0aa7 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c | |||
@@ -30,6 +30,8 @@ | |||
30 | * SOFTWARE. | 30 | * SOFTWARE. |
31 | */ | 31 | */ |
32 | 32 | ||
33 | #define pr_fmt(fmt) PFX fmt | ||
34 | |||
33 | #include <linux/module.h> | 35 | #include <linux/module.h> |
34 | #include <linux/init.h> | 36 | #include <linux/init.h> |
35 | #include <linux/slab.h> | 37 | #include <linux/slab.h> |
@@ -165,7 +167,7 @@ static void srp_free_iu(struct srp_host *host, struct srp_iu *iu) | |||
165 | 167 | ||
166 | static void srp_qp_event(struct ib_event *event, void *context) | 168 | static void srp_qp_event(struct ib_event *event, void *context) |
167 | { | 169 | { |
168 | printk(KERN_ERR PFX "QP event %d\n", event->event); | 170 | pr_debug("QP event %d\n", event->event); |
169 | } | 171 | } |
170 | 172 | ||
171 | static int srp_init_qp(struct srp_target_port *target, | 173 | static int srp_init_qp(struct srp_target_port *target, |
@@ -472,6 +474,21 @@ static void srp_free_req_data(struct srp_target_port *target) | |||
472 | } | 474 | } |
473 | } | 475 | } |
474 | 476 | ||
477 | /** | ||
478 | * srp_del_scsi_host_attr() - Remove attributes defined in the host template. | ||
479 | * @shost: SCSI host whose attributes to remove from sysfs. | ||
480 | * | ||
481 | * Note: Any attributes defined in the host template and that did not exist | ||
482 | * before invocation of this function will be ignored. | ||
483 | */ | ||
484 | static void srp_del_scsi_host_attr(struct Scsi_Host *shost) | ||
485 | { | ||
486 | struct device_attribute **attr; | ||
487 | |||
488 | for (attr = shost->hostt->shost_attrs; attr && *attr; ++attr) | ||
489 | device_remove_file(&shost->shost_dev, *attr); | ||
490 | } | ||
491 | |||
475 | static void srp_remove_work(struct work_struct *work) | 492 | static void srp_remove_work(struct work_struct *work) |
476 | { | 493 | { |
477 | struct srp_target_port *target = | 494 | struct srp_target_port *target = |
@@ -484,6 +501,7 @@ static void srp_remove_work(struct work_struct *work) | |||
484 | list_del(&target->list); | 501 | list_del(&target->list); |
485 | spin_unlock(&target->srp_host->target_lock); | 502 | spin_unlock(&target->srp_host->target_lock); |
486 | 503 | ||
504 | srp_del_scsi_host_attr(target->scsi_host); | ||
487 | srp_remove_host(target->scsi_host); | 505 | srp_remove_host(target->scsi_host); |
488 | scsi_remove_host(target->scsi_host); | 506 | scsi_remove_host(target->scsi_host); |
489 | ib_destroy_cm_id(target->cm_id); | 507 | ib_destroy_cm_id(target->cm_id); |
@@ -1676,10 +1694,6 @@ static ssize_t show_id_ext(struct device *dev, struct device_attribute *attr, | |||
1676 | { | 1694 | { |
1677 | struct srp_target_port *target = host_to_target(class_to_shost(dev)); | 1695 | struct srp_target_port *target = host_to_target(class_to_shost(dev)); |
1678 | 1696 | ||
1679 | if (target->state == SRP_TARGET_DEAD || | ||
1680 | target->state == SRP_TARGET_REMOVED) | ||
1681 | return -ENODEV; | ||
1682 | |||
1683 | return sprintf(buf, "0x%016llx\n", | 1697 | return sprintf(buf, "0x%016llx\n", |
1684 | (unsigned long long) be64_to_cpu(target->id_ext)); | 1698 | (unsigned long long) be64_to_cpu(target->id_ext)); |
1685 | } | 1699 | } |
@@ -1689,10 +1703,6 @@ static ssize_t show_ioc_guid(struct device *dev, struct device_attribute *attr, | |||
1689 | { | 1703 | { |
1690 | struct srp_target_port *target = host_to_target(class_to_shost(dev)); | 1704 | struct srp_target_port *target = host_to_target(class_to_shost(dev)); |
1691 | 1705 | ||
1692 | if (target->state == SRP_TARGET_DEAD || | ||
1693 | target->state == SRP_TARGET_REMOVED) | ||
1694 | return -ENODEV; | ||
1695 | |||
1696 | return sprintf(buf, "0x%016llx\n", | 1706 | return sprintf(buf, "0x%016llx\n", |
1697 | (unsigned long long) be64_to_cpu(target->ioc_guid)); | 1707 | (unsigned long long) be64_to_cpu(target->ioc_guid)); |
1698 | } | 1708 | } |
@@ -1702,10 +1712,6 @@ static ssize_t show_service_id(struct device *dev, | |||
1702 | { | 1712 | { |
1703 | struct srp_target_port *target = host_to_target(class_to_shost(dev)); | 1713 | struct srp_target_port *target = host_to_target(class_to_shost(dev)); |
1704 | 1714 | ||
1705 | if (target->state == SRP_TARGET_DEAD || | ||
1706 | target->state == SRP_TARGET_REMOVED) | ||
1707 | return -ENODEV; | ||
1708 | |||
1709 | return sprintf(buf, "0x%016llx\n", | 1715 | return sprintf(buf, "0x%016llx\n", |
1710 | (unsigned long long) be64_to_cpu(target->service_id)); | 1716 | (unsigned long long) be64_to_cpu(target->service_id)); |
1711 | } | 1717 | } |
@@ -1715,10 +1721,6 @@ static ssize_t show_pkey(struct device *dev, struct device_attribute *attr, | |||
1715 | { | 1721 | { |
1716 | struct srp_target_port *target = host_to_target(class_to_shost(dev)); | 1722 | struct srp_target_port *target = host_to_target(class_to_shost(dev)); |
1717 | 1723 | ||
1718 | if (target->state == SRP_TARGET_DEAD || | ||
1719 | target->state == SRP_TARGET_REMOVED) | ||
1720 | return -ENODEV; | ||
1721 | |||
1722 | return sprintf(buf, "0x%04x\n", be16_to_cpu(target->path.pkey)); | 1724 | return sprintf(buf, "0x%04x\n", be16_to_cpu(target->path.pkey)); |
1723 | } | 1725 | } |
1724 | 1726 | ||
@@ -1727,10 +1729,6 @@ static ssize_t show_dgid(struct device *dev, struct device_attribute *attr, | |||
1727 | { | 1729 | { |
1728 | struct srp_target_port *target = host_to_target(class_to_shost(dev)); | 1730 | struct srp_target_port *target = host_to_target(class_to_shost(dev)); |
1729 | 1731 | ||
1730 | if (target->state == SRP_TARGET_DEAD || | ||
1731 | target->state == SRP_TARGET_REMOVED) | ||
1732 | return -ENODEV; | ||
1733 | |||
1734 | return sprintf(buf, "%pI6\n", target->path.dgid.raw); | 1732 | return sprintf(buf, "%pI6\n", target->path.dgid.raw); |
1735 | } | 1733 | } |
1736 | 1734 | ||
@@ -1739,10 +1737,6 @@ static ssize_t show_orig_dgid(struct device *dev, | |||
1739 | { | 1737 | { |
1740 | struct srp_target_port *target = host_to_target(class_to_shost(dev)); | 1738 | struct srp_target_port *target = host_to_target(class_to_shost(dev)); |
1741 | 1739 | ||
1742 | if (target->state == SRP_TARGET_DEAD || | ||
1743 | target->state == SRP_TARGET_REMOVED) | ||
1744 | return -ENODEV; | ||
1745 | |||
1746 | return sprintf(buf, "%pI6\n", target->orig_dgid); | 1740 | return sprintf(buf, "%pI6\n", target->orig_dgid); |
1747 | } | 1741 | } |
1748 | 1742 | ||
@@ -1751,10 +1745,6 @@ static ssize_t show_req_lim(struct device *dev, | |||
1751 | { | 1745 | { |
1752 | struct srp_target_port *target = host_to_target(class_to_shost(dev)); | 1746 | struct srp_target_port *target = host_to_target(class_to_shost(dev)); |
1753 | 1747 | ||
1754 | if (target->state == SRP_TARGET_DEAD || | ||
1755 | target->state == SRP_TARGET_REMOVED) | ||
1756 | return -ENODEV; | ||
1757 | |||
1758 | return sprintf(buf, "%d\n", target->req_lim); | 1748 | return sprintf(buf, "%d\n", target->req_lim); |
1759 | } | 1749 | } |
1760 | 1750 | ||
@@ -1763,10 +1753,6 @@ static ssize_t show_zero_req_lim(struct device *dev, | |||
1763 | { | 1753 | { |
1764 | struct srp_target_port *target = host_to_target(class_to_shost(dev)); | 1754 | struct srp_target_port *target = host_to_target(class_to_shost(dev)); |
1765 | 1755 | ||
1766 | if (target->state == SRP_TARGET_DEAD || | ||
1767 | target->state == SRP_TARGET_REMOVED) | ||
1768 | return -ENODEV; | ||
1769 | |||
1770 | return sprintf(buf, "%d\n", target->zero_req_lim); | 1756 | return sprintf(buf, "%d\n", target->zero_req_lim); |
1771 | } | 1757 | } |
1772 | 1758 | ||
@@ -1989,7 +1975,7 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
1989 | goto out; | 1975 | goto out; |
1990 | } | 1976 | } |
1991 | if (strlen(p) != 32) { | 1977 | if (strlen(p) != 32) { |
1992 | printk(KERN_WARNING PFX "bad dest GID parameter '%s'\n", p); | 1978 | pr_warn("bad dest GID parameter '%s'\n", p); |
1993 | kfree(p); | 1979 | kfree(p); |
1994 | goto out; | 1980 | goto out; |
1995 | } | 1981 | } |
@@ -2004,7 +1990,7 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
2004 | 1990 | ||
2005 | case SRP_OPT_PKEY: | 1991 | case SRP_OPT_PKEY: |
2006 | if (match_hex(args, &token)) { | 1992 | if (match_hex(args, &token)) { |
2007 | printk(KERN_WARNING PFX "bad P_Key parameter '%s'\n", p); | 1993 | pr_warn("bad P_Key parameter '%s'\n", p); |
2008 | goto out; | 1994 | goto out; |
2009 | } | 1995 | } |
2010 | target->path.pkey = cpu_to_be16(token); | 1996 | target->path.pkey = cpu_to_be16(token); |
@@ -2023,7 +2009,7 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
2023 | 2009 | ||
2024 | case SRP_OPT_MAX_SECT: | 2010 | case SRP_OPT_MAX_SECT: |
2025 | if (match_int(args, &token)) { | 2011 | if (match_int(args, &token)) { |
2026 | printk(KERN_WARNING PFX "bad max sect parameter '%s'\n", p); | 2012 | pr_warn("bad max sect parameter '%s'\n", p); |
2027 | goto out; | 2013 | goto out; |
2028 | } | 2014 | } |
2029 | target->scsi_host->max_sectors = token; | 2015 | target->scsi_host->max_sectors = token; |
@@ -2031,7 +2017,8 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
2031 | 2017 | ||
2032 | case SRP_OPT_MAX_CMD_PER_LUN: | 2018 | case SRP_OPT_MAX_CMD_PER_LUN: |
2033 | if (match_int(args, &token)) { | 2019 | if (match_int(args, &token)) { |
2034 | printk(KERN_WARNING PFX "bad max cmd_per_lun parameter '%s'\n", p); | 2020 | pr_warn("bad max cmd_per_lun parameter '%s'\n", |
2021 | p); | ||
2035 | goto out; | 2022 | goto out; |
2036 | } | 2023 | } |
2037 | target->scsi_host->cmd_per_lun = min(token, SRP_CMD_SQ_SIZE); | 2024 | target->scsi_host->cmd_per_lun = min(token, SRP_CMD_SQ_SIZE); |
@@ -2039,14 +2026,14 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
2039 | 2026 | ||
2040 | case SRP_OPT_IO_CLASS: | 2027 | case SRP_OPT_IO_CLASS: |
2041 | if (match_hex(args, &token)) { | 2028 | if (match_hex(args, &token)) { |
2042 | printk(KERN_WARNING PFX "bad IO class parameter '%s' \n", p); | 2029 | pr_warn("bad IO class parameter '%s'\n", p); |
2043 | goto out; | 2030 | goto out; |
2044 | } | 2031 | } |
2045 | if (token != SRP_REV10_IB_IO_CLASS && | 2032 | if (token != SRP_REV10_IB_IO_CLASS && |
2046 | token != SRP_REV16A_IB_IO_CLASS) { | 2033 | token != SRP_REV16A_IB_IO_CLASS) { |
2047 | printk(KERN_WARNING PFX "unknown IO class parameter value" | 2034 | pr_warn("unknown IO class parameter value %x specified (use %x or %x).\n", |
2048 | " %x specified (use %x or %x).\n", | 2035 | token, SRP_REV10_IB_IO_CLASS, |
2049 | token, SRP_REV10_IB_IO_CLASS, SRP_REV16A_IB_IO_CLASS); | 2036 | SRP_REV16A_IB_IO_CLASS); |
2050 | goto out; | 2037 | goto out; |
2051 | } | 2038 | } |
2052 | target->io_class = token; | 2039 | target->io_class = token; |
@@ -2064,7 +2051,8 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
2064 | 2051 | ||
2065 | case SRP_OPT_CMD_SG_ENTRIES: | 2052 | case SRP_OPT_CMD_SG_ENTRIES: |
2066 | if (match_int(args, &token) || token < 1 || token > 255) { | 2053 | if (match_int(args, &token) || token < 1 || token > 255) { |
2067 | printk(KERN_WARNING PFX "bad max cmd_sg_entries parameter '%s'\n", p); | 2054 | pr_warn("bad max cmd_sg_entries parameter '%s'\n", |
2055 | p); | ||
2068 | goto out; | 2056 | goto out; |
2069 | } | 2057 | } |
2070 | target->cmd_sg_cnt = token; | 2058 | target->cmd_sg_cnt = token; |
@@ -2072,7 +2060,7 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
2072 | 2060 | ||
2073 | case SRP_OPT_ALLOW_EXT_SG: | 2061 | case SRP_OPT_ALLOW_EXT_SG: |
2074 | if (match_int(args, &token)) { | 2062 | if (match_int(args, &token)) { |
2075 | printk(KERN_WARNING PFX "bad allow_ext_sg parameter '%s'\n", p); | 2063 | pr_warn("bad allow_ext_sg parameter '%s'\n", p); |
2076 | goto out; | 2064 | goto out; |
2077 | } | 2065 | } |
2078 | target->allow_ext_sg = !!token; | 2066 | target->allow_ext_sg = !!token; |
@@ -2081,15 +2069,16 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
2081 | case SRP_OPT_SG_TABLESIZE: | 2069 | case SRP_OPT_SG_TABLESIZE: |
2082 | if (match_int(args, &token) || token < 1 || | 2070 | if (match_int(args, &token) || token < 1 || |
2083 | token > SCSI_MAX_SG_CHAIN_SEGMENTS) { | 2071 | token > SCSI_MAX_SG_CHAIN_SEGMENTS) { |
2084 | printk(KERN_WARNING PFX "bad max sg_tablesize parameter '%s'\n", p); | 2072 | pr_warn("bad max sg_tablesize parameter '%s'\n", |
2073 | p); | ||
2085 | goto out; | 2074 | goto out; |
2086 | } | 2075 | } |
2087 | target->sg_tablesize = token; | 2076 | target->sg_tablesize = token; |
2088 | break; | 2077 | break; |
2089 | 2078 | ||
2090 | default: | 2079 | default: |
2091 | printk(KERN_WARNING PFX "unknown parameter or missing value " | 2080 | pr_warn("unknown parameter or missing value '%s' in target creation request\n", |
2092 | "'%s' in target creation request\n", p); | 2081 | p); |
2093 | goto out; | 2082 | goto out; |
2094 | } | 2083 | } |
2095 | } | 2084 | } |
@@ -2100,9 +2089,8 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
2100 | for (i = 0; i < ARRAY_SIZE(srp_opt_tokens); ++i) | 2089 | for (i = 0; i < ARRAY_SIZE(srp_opt_tokens); ++i) |
2101 | if ((srp_opt_tokens[i].token & SRP_OPT_ALL) && | 2090 | if ((srp_opt_tokens[i].token & SRP_OPT_ALL) && |
2102 | !(srp_opt_tokens[i].token & opt_mask)) | 2091 | !(srp_opt_tokens[i].token & opt_mask)) |
2103 | printk(KERN_WARNING PFX "target creation request is " | 2092 | pr_warn("target creation request is missing parameter '%s'\n", |
2104 | "missing parameter '%s'\n", | 2093 | srp_opt_tokens[i].pattern); |
2105 | srp_opt_tokens[i].pattern); | ||
2106 | 2094 | ||
2107 | out: | 2095 | out: |
2108 | kfree(options); | 2096 | kfree(options); |
@@ -2149,7 +2137,7 @@ static ssize_t srp_create_target(struct device *dev, | |||
2149 | 2137 | ||
2150 | if (!host->srp_dev->fmr_pool && !target->allow_ext_sg && | 2138 | if (!host->srp_dev->fmr_pool && !target->allow_ext_sg && |
2151 | target->cmd_sg_cnt < target->sg_tablesize) { | 2139 | target->cmd_sg_cnt < target->sg_tablesize) { |
2152 | printk(KERN_WARNING PFX "No FMR pool and no external indirect descriptors, limiting sg_tablesize to cmd_sg_cnt\n"); | 2140 | pr_warn("No FMR pool and no external indirect descriptors, limiting sg_tablesize to cmd_sg_cnt\n"); |
2153 | target->sg_tablesize = target->cmd_sg_cnt; | 2141 | target->sg_tablesize = target->cmd_sg_cnt; |
2154 | } | 2142 | } |
2155 | 2143 | ||
@@ -2309,8 +2297,7 @@ static void srp_add_one(struct ib_device *device) | |||
2309 | return; | 2297 | return; |
2310 | 2298 | ||
2311 | if (ib_query_device(device, dev_attr)) { | 2299 | if (ib_query_device(device, dev_attr)) { |
2312 | printk(KERN_WARNING PFX "Query device failed for %s\n", | 2300 | pr_warn("Query device failed for %s\n", device->name); |
2313 | device->name); | ||
2314 | goto free_attr; | 2301 | goto free_attr; |
2315 | } | 2302 | } |
2316 | 2303 | ||
@@ -2429,6 +2416,7 @@ static void srp_remove_one(struct ib_device *device) | |||
2429 | 2416 | ||
2430 | list_for_each_entry_safe(target, tmp_target, | 2417 | list_for_each_entry_safe(target, tmp_target, |
2431 | &host->target_list, list) { | 2418 | &host->target_list, list) { |
2419 | srp_del_scsi_host_attr(target->scsi_host); | ||
2432 | srp_remove_host(target->scsi_host); | 2420 | srp_remove_host(target->scsi_host); |
2433 | scsi_remove_host(target->scsi_host); | 2421 | scsi_remove_host(target->scsi_host); |
2434 | srp_disconnect_target(target); | 2422 | srp_disconnect_target(target); |
@@ -2459,7 +2447,7 @@ static int __init srp_init_module(void) | |||
2459 | BUILD_BUG_ON(FIELD_SIZEOF(struct ib_wc, wr_id) < sizeof(void *)); | 2447 | BUILD_BUG_ON(FIELD_SIZEOF(struct ib_wc, wr_id) < sizeof(void *)); |
2460 | 2448 | ||
2461 | if (srp_sg_tablesize) { | 2449 | if (srp_sg_tablesize) { |
2462 | printk(KERN_WARNING PFX "srp_sg_tablesize is deprecated, please use cmd_sg_entries\n"); | 2450 | pr_warn("srp_sg_tablesize is deprecated, please use cmd_sg_entries\n"); |
2463 | if (!cmd_sg_entries) | 2451 | if (!cmd_sg_entries) |
2464 | cmd_sg_entries = srp_sg_tablesize; | 2452 | cmd_sg_entries = srp_sg_tablesize; |
2465 | } | 2453 | } |
@@ -2468,14 +2456,15 @@ static int __init srp_init_module(void) | |||
2468 | cmd_sg_entries = SRP_DEF_SG_TABLESIZE; | 2456 | cmd_sg_entries = SRP_DEF_SG_TABLESIZE; |
2469 | 2457 | ||
2470 | if (cmd_sg_entries > 255) { | 2458 | if (cmd_sg_entries > 255) { |
2471 | printk(KERN_WARNING PFX "Clamping cmd_sg_entries to 255\n"); | 2459 | pr_warn("Clamping cmd_sg_entries to 255\n"); |
2472 | cmd_sg_entries = 255; | 2460 | cmd_sg_entries = 255; |
2473 | } | 2461 | } |
2474 | 2462 | ||
2475 | if (!indirect_sg_entries) | 2463 | if (!indirect_sg_entries) |
2476 | indirect_sg_entries = cmd_sg_entries; | 2464 | indirect_sg_entries = cmd_sg_entries; |
2477 | else if (indirect_sg_entries < cmd_sg_entries) { | 2465 | else if (indirect_sg_entries < cmd_sg_entries) { |
2478 | printk(KERN_WARNING PFX "Bumping up indirect_sg_entries to match cmd_sg_entries (%u)\n", cmd_sg_entries); | 2466 | pr_warn("Bumping up indirect_sg_entries to match cmd_sg_entries (%u)\n", |
2467 | cmd_sg_entries); | ||
2479 | indirect_sg_entries = cmd_sg_entries; | 2468 | indirect_sg_entries = cmd_sg_entries; |
2480 | } | 2469 | } |
2481 | 2470 | ||
@@ -2486,7 +2475,7 @@ static int __init srp_init_module(void) | |||
2486 | 2475 | ||
2487 | ret = class_register(&srp_class); | 2476 | ret = class_register(&srp_class); |
2488 | if (ret) { | 2477 | if (ret) { |
2489 | printk(KERN_ERR PFX "couldn't register class infiniband_srp\n"); | 2478 | pr_err("couldn't register class infiniband_srp\n"); |
2490 | srp_release_transport(ib_srp_transport_template); | 2479 | srp_release_transport(ib_srp_transport_template); |
2491 | return ret; | 2480 | return ret; |
2492 | } | 2481 | } |
@@ -2495,7 +2484,7 @@ static int __init srp_init_module(void) | |||
2495 | 2484 | ||
2496 | ret = ib_register_client(&srp_client); | 2485 | ret = ib_register_client(&srp_client); |
2497 | if (ret) { | 2486 | if (ret) { |
2498 | printk(KERN_ERR PFX "couldn't register IB client\n"); | 2487 | pr_err("couldn't register IB client\n"); |
2499 | srp_release_transport(ib_srp_transport_template); | 2488 | srp_release_transport(ib_srp_transport_template); |
2500 | ib_sa_unregister_client(&srp_sa_client); | 2489 | ib_sa_unregister_client(&srp_sa_client); |
2501 | class_unregister(&srp_class); | 2490 | class_unregister(&srp_class); |