diff options
| author | Doug Ledford <dledford@redhat.com> | 2014-10-20 18:25:15 -0400 |
|---|---|---|
| committer | Doug Ledford <dledford@redhat.com> | 2015-04-15 16:06:54 -0400 |
| commit | 9f5d32af09b9a36ca1476c9932aac675051670c8 (patch) | |
| tree | e966827a11efac056b38c367a86e3db8edbf7759 /drivers/infiniband/ulp/srpt | |
| parent | 56b5390caf73694b2f50a042542f0b43c29d5ca8 (diff) | |
ib_srpt: convert printk's to pr_* functions
The driver already defined the pr_format, it just hadn't
been converted to use pr_info, pr_warn, and pr_err instead
of the equivalent printks. Convert so that messages from
the driver are now properly tagged with their driver name
and can be more easily debugged.
In addition, a number of these printk's were not newline
terminated, so fix that at the same time.
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/ulp/srpt')
| -rw-r--r-- | drivers/infiniband/ulp/srpt/ib_srpt.c | 188 |
1 files changed, 91 insertions, 97 deletions
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index 6e0a477681e9..4b9b866e6b0d 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c | |||
| @@ -207,7 +207,7 @@ static void srpt_event_handler(struct ib_event_handler *handler, | |||
| 207 | } | 207 | } |
| 208 | break; | 208 | break; |
| 209 | default: | 209 | default: |
| 210 | printk(KERN_ERR "received unrecognized IB event %d\n", | 210 | pr_err("received unrecognized IB event %d\n", |
| 211 | event->event); | 211 | event->event); |
| 212 | break; | 212 | break; |
| 213 | } | 213 | } |
| @@ -218,7 +218,7 @@ static void srpt_event_handler(struct ib_event_handler *handler, | |||
| 218 | */ | 218 | */ |
| 219 | static void srpt_srq_event(struct ib_event *event, void *ctx) | 219 | static void srpt_srq_event(struct ib_event *event, void *ctx) |
| 220 | { | 220 | { |
| 221 | printk(KERN_INFO "SRQ event %d\n", event->event); | 221 | pr_info("SRQ event %d\n", event->event); |
| 222 | } | 222 | } |
| 223 | 223 | ||
| 224 | /** | 224 | /** |
| @@ -242,8 +242,7 @@ static void srpt_qp_event(struct ib_event *event, struct srpt_rdma_ch *ch) | |||
| 242 | ch->sess_name, srpt_get_ch_state(ch)); | 242 | ch->sess_name, srpt_get_ch_state(ch)); |
| 243 | break; | 243 | break; |
| 244 | default: | 244 | default: |
| 245 | printk(KERN_ERR "received unrecognized IB QP event %d\n", | 245 | pr_err("received unrecognized IB QP event %d\n", event->event); |
| 246 | event->event); | ||
| 247 | break; | 246 | break; |
| 248 | } | 247 | } |
| 249 | } | 248 | } |
| @@ -602,7 +601,7 @@ static void srpt_unregister_mad_agent(struct srpt_device *sdev) | |||
| 602 | sport = &sdev->port[i - 1]; | 601 | sport = &sdev->port[i - 1]; |
| 603 | WARN_ON(sport->port != i); | 602 | WARN_ON(sport->port != i); |
| 604 | if (ib_modify_port(sdev->device, i, 0, &port_modify) < 0) | 603 | if (ib_modify_port(sdev->device, i, 0, &port_modify) < 0) |
| 605 | printk(KERN_ERR "disabling MAD processing failed.\n"); | 604 | pr_err("disabling MAD processing failed.\n"); |
| 606 | if (sport->mad_agent) { | 605 | if (sport->mad_agent) { |
| 607 | ib_unregister_mad_agent(sport->mad_agent); | 606 | ib_unregister_mad_agent(sport->mad_agent); |
| 608 | sport->mad_agent = NULL; | 607 | sport->mad_agent = NULL; |
| @@ -810,7 +809,7 @@ static int srpt_post_send(struct srpt_rdma_ch *ch, | |||
| 810 | 809 | ||
| 811 | ret = -ENOMEM; | 810 | ret = -ENOMEM; |
| 812 | if (unlikely(atomic_dec_return(&ch->sq_wr_avail) < 0)) { | 811 | if (unlikely(atomic_dec_return(&ch->sq_wr_avail) < 0)) { |
| 813 | printk(KERN_WARNING "IB send queue full (needed 1)\n"); | 812 | pr_warn("IB send queue full (needed 1)\n"); |
| 814 | goto out; | 813 | goto out; |
| 815 | } | 814 | } |
| 816 | 815 | ||
| @@ -912,7 +911,7 @@ static int srpt_get_desc_tbl(struct srpt_send_ioctx *ioctx, | |||
| 912 | 911 | ||
| 913 | if (ioctx->n_rbuf > | 912 | if (ioctx->n_rbuf > |
| 914 | (srp_cmd->data_out_desc_cnt + srp_cmd->data_in_desc_cnt)) { | 913 | (srp_cmd->data_out_desc_cnt + srp_cmd->data_in_desc_cnt)) { |
| 915 | printk(KERN_ERR "received unsupported SRP_CMD request" | 914 | pr_err("received unsupported SRP_CMD request" |
| 916 | " type (%u out + %u in != %u / %zu)\n", | 915 | " type (%u out + %u in != %u / %zu)\n", |
| 917 | srp_cmd->data_out_desc_cnt, | 916 | srp_cmd->data_out_desc_cnt, |
| 918 | srp_cmd->data_in_desc_cnt, | 917 | srp_cmd->data_in_desc_cnt, |
| @@ -1432,7 +1431,7 @@ static void srpt_handle_send_comp(struct srpt_rdma_ch *ch, | |||
| 1432 | srpt_unmap_sg_to_ib_sge(ch, ioctx); | 1431 | srpt_unmap_sg_to_ib_sge(ch, ioctx); |
| 1433 | transport_generic_free_cmd(&ioctx->cmd, 0); | 1432 | transport_generic_free_cmd(&ioctx->cmd, 0); |
| 1434 | } else { | 1433 | } else { |
| 1435 | printk(KERN_ERR "IB completion has been received too late for" | 1434 | pr_err("IB completion has been received too late for" |
| 1436 | " wr_id = %u.\n", ioctx->ioctx.index); | 1435 | " wr_id = %u.\n", ioctx->ioctx.index); |
| 1437 | } | 1436 | } |
| 1438 | } | 1437 | } |
| @@ -1457,7 +1456,7 @@ static void srpt_handle_rdma_comp(struct srpt_rdma_ch *ch, | |||
| 1457 | SRPT_STATE_DATA_IN)) | 1456 | SRPT_STATE_DATA_IN)) |
| 1458 | target_execute_cmd(&ioctx->cmd); | 1457 | target_execute_cmd(&ioctx->cmd); |
| 1459 | else | 1458 | else |
| 1460 | printk(KERN_ERR "%s[%d]: wrong state = %d\n", __func__, | 1459 | pr_err("%s[%d]: wrong state = %d\n", __func__, |
| 1461 | __LINE__, srpt_get_cmd_state(ioctx)); | 1460 | __LINE__, srpt_get_cmd_state(ioctx)); |
| 1462 | } else if (opcode == SRPT_RDMA_ABORT) { | 1461 | } else if (opcode == SRPT_RDMA_ABORT) { |
| 1463 | ioctx->rdma_aborted = true; | 1462 | ioctx->rdma_aborted = true; |
| @@ -1481,7 +1480,7 @@ static void srpt_handle_rdma_err_comp(struct srpt_rdma_ch *ch, | |||
| 1481 | switch (opcode) { | 1480 | switch (opcode) { |
| 1482 | case SRPT_RDMA_READ_LAST: | 1481 | case SRPT_RDMA_READ_LAST: |
| 1483 | if (ioctx->n_rdma <= 0) { | 1482 | if (ioctx->n_rdma <= 0) { |
| 1484 | printk(KERN_ERR "Received invalid RDMA read" | 1483 | pr_err("Received invalid RDMA read" |
| 1485 | " error completion with idx %d\n", | 1484 | " error completion with idx %d\n", |
| 1486 | ioctx->ioctx.index); | 1485 | ioctx->ioctx.index); |
| 1487 | break; | 1486 | break; |
| @@ -1490,14 +1489,13 @@ static void srpt_handle_rdma_err_comp(struct srpt_rdma_ch *ch, | |||
| 1490 | if (state == SRPT_STATE_NEED_DATA) | 1489 | if (state == SRPT_STATE_NEED_DATA) |
| 1491 | srpt_abort_cmd(ioctx); | 1490 | srpt_abort_cmd(ioctx); |
| 1492 | else | 1491 | else |
| 1493 | printk(KERN_ERR "%s[%d]: wrong state = %d\n", | 1492 | pr_err("%s[%d]: wrong state = %d\n", |
| 1494 | __func__, __LINE__, state); | 1493 | __func__, __LINE__, state); |
| 1495 | break; | 1494 | break; |
| 1496 | case SRPT_RDMA_WRITE_LAST: | 1495 | case SRPT_RDMA_WRITE_LAST: |
| 1497 | break; | 1496 | break; |
| 1498 | default: | 1497 | default: |
| 1499 | printk(KERN_ERR "%s[%d]: opcode = %u\n", __func__, | 1498 | pr_err("%s[%d]: opcode = %u\n", __func__, __LINE__, opcode); |
| 1500 | __LINE__, opcode); | ||
| 1501 | break; | 1499 | break; |
| 1502 | } | 1500 | } |
| 1503 | } | 1501 | } |
| @@ -1549,8 +1547,8 @@ static int srpt_build_cmd_rsp(struct srpt_rdma_ch *ch, | |||
| 1549 | BUILD_BUG_ON(MIN_MAX_RSP_SIZE <= sizeof(*srp_rsp)); | 1547 | BUILD_BUG_ON(MIN_MAX_RSP_SIZE <= sizeof(*srp_rsp)); |
| 1550 | max_sense_len = ch->max_ti_iu_len - sizeof(*srp_rsp); | 1548 | max_sense_len = ch->max_ti_iu_len - sizeof(*srp_rsp); |
| 1551 | if (sense_data_len > max_sense_len) { | 1549 | if (sense_data_len > max_sense_len) { |
| 1552 | printk(KERN_WARNING "truncated sense data from %d to %d" | 1550 | pr_warn("truncated sense data from %d to %d" |
| 1553 | " bytes\n", sense_data_len, max_sense_len); | 1551 | " bytes\n", sense_data_len, max_sense_len); |
| 1554 | sense_data_len = max_sense_len; | 1552 | sense_data_len = max_sense_len; |
| 1555 | } | 1553 | } |
| 1556 | 1554 | ||
| @@ -1628,8 +1626,8 @@ static uint64_t srpt_unpack_lun(const uint8_t *lun, int len) | |||
| 1628 | int addressing_method; | 1626 | int addressing_method; |
| 1629 | 1627 | ||
| 1630 | if (unlikely(len < 2)) { | 1628 | if (unlikely(len < 2)) { |
| 1631 | printk(KERN_ERR "Illegal LUN length %d, expected 2 bytes or " | 1629 | pr_err("Illegal LUN length %d, expected 2 bytes or more\n", |
| 1632 | "more", len); | 1630 | len); |
| 1633 | goto out; | 1631 | goto out; |
| 1634 | } | 1632 | } |
| 1635 | 1633 | ||
| @@ -1663,7 +1661,7 @@ static uint64_t srpt_unpack_lun(const uint8_t *lun, int len) | |||
| 1663 | 1661 | ||
| 1664 | case SCSI_LUN_ADDR_METHOD_EXTENDED_LUN: | 1662 | case SCSI_LUN_ADDR_METHOD_EXTENDED_LUN: |
| 1665 | default: | 1663 | default: |
| 1666 | printk(KERN_ERR "Unimplemented LUN addressing method %u", | 1664 | pr_err("Unimplemented LUN addressing method %u\n", |
| 1667 | addressing_method); | 1665 | addressing_method); |
| 1668 | break; | 1666 | break; |
| 1669 | } | 1667 | } |
| @@ -1672,8 +1670,7 @@ out: | |||
| 1672 | return res; | 1670 | return res; |
| 1673 | 1671 | ||
| 1674 | out_err: | 1672 | out_err: |
| 1675 | printk(KERN_ERR "Support for multi-level LUNs has not yet been" | 1673 | pr_err("Support for multi-level LUNs has not yet been implemented\n"); |
| 1676 | " implemented"); | ||
| 1677 | goto out; | 1674 | goto out; |
| 1678 | } | 1675 | } |
| 1679 | 1676 | ||
| @@ -1723,7 +1720,7 @@ static int srpt_handle_cmd(struct srpt_rdma_ch *ch, | |||
| 1723 | } | 1720 | } |
| 1724 | 1721 | ||
| 1725 | if (srpt_get_desc_tbl(send_ioctx, srp_cmd, &dir, &data_len)) { | 1722 | if (srpt_get_desc_tbl(send_ioctx, srp_cmd, &dir, &data_len)) { |
| 1726 | printk(KERN_ERR "0x%llx: parsing SRP descriptor table failed.\n", | 1723 | pr_err("0x%llx: parsing SRP descriptor table failed.\n", |
| 1727 | srp_cmd->tag); | 1724 | srp_cmd->tag); |
| 1728 | ret = TCM_INVALID_CDB_FIELD; | 1725 | ret = TCM_INVALID_CDB_FIELD; |
| 1729 | goto send_sense; | 1726 | goto send_sense; |
| @@ -1912,7 +1909,7 @@ static void srpt_handle_new_iu(struct srpt_rdma_ch *ch, | |||
| 1912 | srpt_handle_tsk_mgmt(ch, recv_ioctx, send_ioctx); | 1909 | srpt_handle_tsk_mgmt(ch, recv_ioctx, send_ioctx); |
| 1913 | break; | 1910 | break; |
| 1914 | case SRP_I_LOGOUT: | 1911 | case SRP_I_LOGOUT: |
| 1915 | printk(KERN_ERR "Not yet implemented: SRP_I_LOGOUT\n"); | 1912 | pr_err("Not yet implemented: SRP_I_LOGOUT\n"); |
| 1916 | break; | 1913 | break; |
| 1917 | case SRP_CRED_RSP: | 1914 | case SRP_CRED_RSP: |
| 1918 | pr_debug("received SRP_CRED_RSP\n"); | 1915 | pr_debug("received SRP_CRED_RSP\n"); |
| @@ -1921,10 +1918,10 @@ static void srpt_handle_new_iu(struct srpt_rdma_ch *ch, | |||
| 1921 | pr_debug("received SRP_AER_RSP\n"); | 1918 | pr_debug("received SRP_AER_RSP\n"); |
| 1922 | break; | 1919 | break; |
| 1923 | case SRP_RSP: | 1920 | case SRP_RSP: |
| 1924 | printk(KERN_ERR "Received SRP_RSP\n"); | 1921 | pr_err("Received SRP_RSP\n"); |
| 1925 | break; | 1922 | break; |
| 1926 | default: | 1923 | default: |
| 1927 | printk(KERN_ERR "received IU with unknown opcode 0x%x\n", | 1924 | pr_err("received IU with unknown opcode 0x%x\n", |
| 1928 | srp_cmd->opcode); | 1925 | srp_cmd->opcode); |
| 1929 | break; | 1926 | break; |
| 1930 | } | 1927 | } |
| @@ -1948,12 +1945,12 @@ static void srpt_process_rcv_completion(struct ib_cq *cq, | |||
| 1948 | 1945 | ||
| 1949 | req_lim = atomic_dec_return(&ch->req_lim); | 1946 | req_lim = atomic_dec_return(&ch->req_lim); |
| 1950 | if (unlikely(req_lim < 0)) | 1947 | if (unlikely(req_lim < 0)) |
| 1951 | printk(KERN_ERR "req_lim = %d < 0\n", req_lim); | 1948 | pr_err("req_lim = %d < 0\n", req_lim); |
| 1952 | ioctx = sdev->ioctx_ring[index]; | 1949 | ioctx = sdev->ioctx_ring[index]; |
| 1953 | srpt_handle_new_iu(ch, ioctx, NULL); | 1950 | srpt_handle_new_iu(ch, ioctx, NULL); |
| 1954 | } else { | 1951 | } else { |
| 1955 | printk(KERN_INFO "receiving failed for idx %u with status %d\n", | 1952 | pr_info("receiving failed for idx %u with status %d\n", |
| 1956 | index, wc->status); | 1953 | index, wc->status); |
| 1957 | } | 1954 | } |
| 1958 | } | 1955 | } |
| 1959 | 1956 | ||
| @@ -1993,12 +1990,12 @@ static void srpt_process_send_completion(struct ib_cq *cq, | |||
| 1993 | } | 1990 | } |
| 1994 | } else { | 1991 | } else { |
| 1995 | if (opcode == SRPT_SEND) { | 1992 | if (opcode == SRPT_SEND) { |
| 1996 | printk(KERN_INFO "sending response for idx %u failed" | 1993 | pr_info("sending response for idx %u failed" |
| 1997 | " with status %d\n", index, wc->status); | 1994 | " with status %d\n", index, wc->status); |
| 1998 | srpt_handle_send_err_comp(ch, wc->wr_id); | 1995 | srpt_handle_send_err_comp(ch, wc->wr_id); |
| 1999 | } else if (opcode != SRPT_RDMA_MID) { | 1996 | } else if (opcode != SRPT_RDMA_MID) { |
| 2000 | printk(KERN_INFO "RDMA t %d for idx %u failed with" | 1997 | pr_info("RDMA t %d for idx %u failed with" |
| 2001 | " status %d", opcode, index, wc->status); | 1998 | " status %d\n", opcode, index, wc->status); |
| 2002 | srpt_handle_rdma_err_comp(ch, send_ioctx, opcode); | 1999 | srpt_handle_rdma_err_comp(ch, send_ioctx, opcode); |
| 2003 | } | 2000 | } |
| 2004 | } | 2001 | } |
| @@ -2062,15 +2059,15 @@ static int srpt_compl_thread(void *arg) | |||
| 2062 | 2059 | ||
| 2063 | ch = arg; | 2060 | ch = arg; |
| 2064 | BUG_ON(!ch); | 2061 | BUG_ON(!ch); |
| 2065 | printk(KERN_INFO "Session %s: kernel thread %s (PID %d) started\n", | 2062 | pr_info("Session %s: kernel thread %s (PID %d) started\n", |
| 2066 | ch->sess_name, ch->thread->comm, current->pid); | 2063 | ch->sess_name, ch->thread->comm, current->pid); |
| 2067 | while (!kthread_should_stop()) { | 2064 | while (!kthread_should_stop()) { |
| 2068 | wait_event_interruptible(ch->wait_queue, | 2065 | wait_event_interruptible(ch->wait_queue, |
| 2069 | (srpt_process_completion(ch->cq, ch), | 2066 | (srpt_process_completion(ch->cq, ch), |
| 2070 | kthread_should_stop())); | 2067 | kthread_should_stop())); |
| 2071 | } | 2068 | } |
| 2072 | printk(KERN_INFO "Session %s: kernel thread %s (PID %d) stopped\n", | 2069 | pr_info("Session %s: kernel thread %s (PID %d) stopped\n", |
| 2073 | ch->sess_name, ch->thread->comm, current->pid); | 2070 | ch->sess_name, ch->thread->comm, current->pid); |
| 2074 | return 0; | 2071 | return 0; |
| 2075 | } | 2072 | } |
| 2076 | 2073 | ||
| @@ -2097,7 +2094,7 @@ retry: | |||
| 2097 | ch->rq_size + srp_sq_size, 0); | 2094 | ch->rq_size + srp_sq_size, 0); |
| 2098 | if (IS_ERR(ch->cq)) { | 2095 | if (IS_ERR(ch->cq)) { |
| 2099 | ret = PTR_ERR(ch->cq); | 2096 | ret = PTR_ERR(ch->cq); |
| 2100 | printk(KERN_ERR "failed to create CQ cqe= %d ret= %d\n", | 2097 | pr_err("failed to create CQ cqe= %d ret= %d\n", |
| 2101 | ch->rq_size + srp_sq_size, ret); | 2098 | ch->rq_size + srp_sq_size, ret); |
| 2102 | goto out; | 2099 | goto out; |
| 2103 | } | 2100 | } |
| @@ -2123,7 +2120,7 @@ retry: | |||
| 2123 | goto retry; | 2120 | goto retry; |
| 2124 | } | 2121 | } |
| 2125 | } | 2122 | } |
| 2126 | printk(KERN_ERR "failed to create_qp ret= %d\n", ret); | 2123 | pr_err("failed to create_qp ret= %d\n", ret); |
| 2127 | goto err_destroy_cq; | 2124 | goto err_destroy_cq; |
| 2128 | } | 2125 | } |
| 2129 | 2126 | ||
| @@ -2143,7 +2140,7 @@ retry: | |||
| 2143 | 2140 | ||
| 2144 | ch->thread = kthread_run(srpt_compl_thread, ch, "ib_srpt_compl"); | 2141 | ch->thread = kthread_run(srpt_compl_thread, ch, "ib_srpt_compl"); |
| 2145 | if (IS_ERR(ch->thread)) { | 2142 | if (IS_ERR(ch->thread)) { |
| 2146 | printk(KERN_ERR "failed to create kernel thread %ld\n", | 2143 | pr_err("failed to create kernel thread %ld\n", |
| 2147 | PTR_ERR(ch->thread)); | 2144 | PTR_ERR(ch->thread)); |
| 2148 | ch->thread = NULL; | 2145 | ch->thread = NULL; |
| 2149 | goto err_destroy_qp; | 2146 | goto err_destroy_qp; |
| @@ -2204,7 +2201,7 @@ static void __srpt_close_ch(struct srpt_rdma_ch *ch) | |||
| 2204 | /* fall through */ | 2201 | /* fall through */ |
| 2205 | case CH_LIVE: | 2202 | case CH_LIVE: |
| 2206 | if (ib_send_cm_dreq(ch->cm_id, NULL, 0) < 0) | 2203 | if (ib_send_cm_dreq(ch->cm_id, NULL, 0) < 0) |
| 2207 | printk(KERN_ERR "sending CM DREQ failed.\n"); | 2204 | pr_err("sending CM DREQ failed.\n"); |
| 2208 | break; | 2205 | break; |
| 2209 | case CH_DISCONNECTING: | 2206 | case CH_DISCONNECTING: |
| 2210 | break; | 2207 | break; |
| @@ -2291,7 +2288,7 @@ static void srpt_drain_channel(struct ib_cm_id *cm_id) | |||
| 2291 | 2288 | ||
| 2292 | ret = srpt_ch_qp_err(ch); | 2289 | ret = srpt_ch_qp_err(ch); |
| 2293 | if (ret < 0) | 2290 | if (ret < 0) |
| 2294 | printk(KERN_ERR "Setting queue pair in error state" | 2291 | pr_err("Setting queue pair in error state" |
| 2295 | " failed: %d\n", ret); | 2292 | " failed: %d\n", ret); |
| 2296 | } | 2293 | } |
| 2297 | } | 2294 | } |
| @@ -2435,17 +2432,17 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, | |||
| 2435 | 2432 | ||
| 2436 | it_iu_len = be32_to_cpu(req->req_it_iu_len); | 2433 | it_iu_len = be32_to_cpu(req->req_it_iu_len); |
| 2437 | 2434 | ||
| 2438 | printk(KERN_INFO "Received SRP_LOGIN_REQ with i_port_id 0x%llx:0x%llx," | 2435 | pr_info("Received SRP_LOGIN_REQ with i_port_id 0x%llx:0x%llx," |
| 2439 | " t_port_id 0x%llx:0x%llx and it_iu_len %d on port %d" | 2436 | " t_port_id 0x%llx:0x%llx and it_iu_len %d on port %d" |
| 2440 | " (guid=0x%llx:0x%llx)\n", | 2437 | " (guid=0x%llx:0x%llx)\n", |
| 2441 | be64_to_cpu(*(__be64 *)&req->initiator_port_id[0]), | 2438 | be64_to_cpu(*(__be64 *)&req->initiator_port_id[0]), |
| 2442 | be64_to_cpu(*(__be64 *)&req->initiator_port_id[8]), | 2439 | be64_to_cpu(*(__be64 *)&req->initiator_port_id[8]), |
| 2443 | be64_to_cpu(*(__be64 *)&req->target_port_id[0]), | 2440 | be64_to_cpu(*(__be64 *)&req->target_port_id[0]), |
| 2444 | be64_to_cpu(*(__be64 *)&req->target_port_id[8]), | 2441 | be64_to_cpu(*(__be64 *)&req->target_port_id[8]), |
| 2445 | it_iu_len, | 2442 | it_iu_len, |
| 2446 | param->port, | 2443 | param->port, |
| 2447 | be64_to_cpu(*(__be64 *)&sdev->port[param->port - 1].gid.raw[0]), | 2444 | be64_to_cpu(*(__be64 *)&sdev->port[param->port - 1].gid.raw[0]), |
| 2448 | be64_to_cpu(*(__be64 *)&sdev->port[param->port - 1].gid.raw[8])); | 2445 | be64_to_cpu(*(__be64 *)&sdev->port[param->port - 1].gid.raw[8])); |
| 2449 | 2446 | ||
| 2450 | rsp = kzalloc(sizeof *rsp, GFP_KERNEL); | 2447 | rsp = kzalloc(sizeof *rsp, GFP_KERNEL); |
| 2451 | rej = kzalloc(sizeof *rej, GFP_KERNEL); | 2448 | rej = kzalloc(sizeof *rej, GFP_KERNEL); |
| @@ -2460,7 +2457,7 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, | |||
| 2460 | rej->reason = __constant_cpu_to_be32( | 2457 | rej->reason = __constant_cpu_to_be32( |
| 2461 | SRP_LOGIN_REJ_REQ_IT_IU_LENGTH_TOO_LARGE); | 2458 | SRP_LOGIN_REJ_REQ_IT_IU_LENGTH_TOO_LARGE); |
| 2462 | ret = -EINVAL; | 2459 | ret = -EINVAL; |
| 2463 | printk(KERN_ERR "rejected SRP_LOGIN_REQ because its" | 2460 | pr_err("rejected SRP_LOGIN_REQ because its" |
| 2464 | " length (%d bytes) is out of range (%d .. %d)\n", | 2461 | " length (%d bytes) is out of range (%d .. %d)\n", |
| 2465 | it_iu_len, 64, srp_max_req_size); | 2462 | it_iu_len, 64, srp_max_req_size); |
| 2466 | goto reject; | 2463 | goto reject; |
| @@ -2470,7 +2467,7 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, | |||
| 2470 | rej->reason = __constant_cpu_to_be32( | 2467 | rej->reason = __constant_cpu_to_be32( |
| 2471 | SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES); | 2468 | SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES); |
| 2472 | ret = -EINVAL; | 2469 | ret = -EINVAL; |
| 2473 | printk(KERN_ERR "rejected SRP_LOGIN_REQ because the target port" | 2470 | pr_err("rejected SRP_LOGIN_REQ because the target port" |
| 2474 | " has not yet been enabled\n"); | 2471 | " has not yet been enabled\n"); |
| 2475 | goto reject; | 2472 | goto reject; |
| 2476 | } | 2473 | } |
| @@ -2516,7 +2513,7 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, | |||
| 2516 | rej->reason = __constant_cpu_to_be32( | 2513 | rej->reason = __constant_cpu_to_be32( |
| 2517 | SRP_LOGIN_REJ_UNABLE_ASSOCIATE_CHANNEL); | 2514 | SRP_LOGIN_REJ_UNABLE_ASSOCIATE_CHANNEL); |
| 2518 | ret = -ENOMEM; | 2515 | ret = -ENOMEM; |
| 2519 | printk(KERN_ERR "rejected SRP_LOGIN_REQ because it" | 2516 | pr_err("rejected SRP_LOGIN_REQ because it" |
| 2520 | " has an invalid target port identifier.\n"); | 2517 | " has an invalid target port identifier.\n"); |
| 2521 | goto reject; | 2518 | goto reject; |
| 2522 | } | 2519 | } |
| @@ -2525,7 +2522,7 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, | |||
| 2525 | if (!ch) { | 2522 | if (!ch) { |
| 2526 | rej->reason = __constant_cpu_to_be32( | 2523 | rej->reason = __constant_cpu_to_be32( |
| 2527 | SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES); | 2524 | SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES); |
| 2528 | printk(KERN_ERR "rejected SRP_LOGIN_REQ because no memory.\n"); | 2525 | pr_err("rejected SRP_LOGIN_REQ because no memory.\n"); |
| 2529 | ret = -ENOMEM; | 2526 | ret = -ENOMEM; |
| 2530 | goto reject; | 2527 | goto reject; |
| 2531 | } | 2528 | } |
| @@ -2562,7 +2559,7 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, | |||
| 2562 | if (ret) { | 2559 | if (ret) { |
| 2563 | rej->reason = __constant_cpu_to_be32( | 2560 | rej->reason = __constant_cpu_to_be32( |
| 2564 | SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES); | 2561 | SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES); |
| 2565 | printk(KERN_ERR "rejected SRP_LOGIN_REQ because creating" | 2562 | pr_err("rejected SRP_LOGIN_REQ because creating" |
| 2566 | " a new RDMA channel failed.\n"); | 2563 | " a new RDMA channel failed.\n"); |
| 2567 | goto free_ring; | 2564 | goto free_ring; |
| 2568 | } | 2565 | } |
| @@ -2571,7 +2568,7 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, | |||
| 2571 | if (ret) { | 2568 | if (ret) { |
| 2572 | rej->reason = __constant_cpu_to_be32( | 2569 | rej->reason = __constant_cpu_to_be32( |
| 2573 | SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES); | 2570 | SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES); |
| 2574 | printk(KERN_ERR "rejected SRP_LOGIN_REQ because enabling" | 2571 | pr_err("rejected SRP_LOGIN_REQ because enabling" |
| 2575 | " RTR failed (error code = %d)\n", ret); | 2572 | " RTR failed (error code = %d)\n", ret); |
| 2576 | goto destroy_ib; | 2573 | goto destroy_ib; |
| 2577 | } | 2574 | } |
| @@ -2586,8 +2583,8 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, | |||
| 2586 | 2583 | ||
| 2587 | nacl = srpt_lookup_acl(sport, ch->i_port_id); | 2584 | nacl = srpt_lookup_acl(sport, ch->i_port_id); |
| 2588 | if (!nacl) { | 2585 | if (!nacl) { |
| 2589 | printk(KERN_INFO "Rejected login because no ACL has been" | 2586 | pr_info("Rejected login because no ACL has been" |
| 2590 | " configured yet for initiator %s.\n", ch->sess_name); | 2587 | " configured yet for initiator %s.\n", ch->sess_name); |
| 2591 | rej->reason = __constant_cpu_to_be32( | 2588 | rej->reason = __constant_cpu_to_be32( |
| 2592 | SRP_LOGIN_REJ_CHANNEL_LIMIT_REACHED); | 2589 | SRP_LOGIN_REJ_CHANNEL_LIMIT_REACHED); |
| 2593 | goto destroy_ib; | 2590 | goto destroy_ib; |
| @@ -2631,7 +2628,7 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, | |||
| 2631 | 2628 | ||
| 2632 | ret = ib_send_cm_rep(cm_id, rep_param); | 2629 | ret = ib_send_cm_rep(cm_id, rep_param); |
| 2633 | if (ret) { | 2630 | if (ret) { |
| 2634 | printk(KERN_ERR "sending SRP_LOGIN_REQ response failed" | 2631 | pr_err("sending SRP_LOGIN_REQ response failed" |
| 2635 | " (error code = %d)\n", ret); | 2632 | " (error code = %d)\n", ret); |
| 2636 | goto release_channel; | 2633 | goto release_channel; |
| 2637 | } | 2634 | } |
| @@ -2679,7 +2676,7 @@ out: | |||
| 2679 | 2676 | ||
| 2680 | static void srpt_cm_rej_recv(struct ib_cm_id *cm_id) | 2677 | static void srpt_cm_rej_recv(struct ib_cm_id *cm_id) |
| 2681 | { | 2678 | { |
| 2682 | printk(KERN_INFO "Received IB REJ for cm_id %p.\n", cm_id); | 2679 | pr_info("Received IB REJ for cm_id %p.\n", cm_id); |
| 2683 | srpt_drain_channel(cm_id); | 2680 | srpt_drain_channel(cm_id); |
| 2684 | } | 2681 | } |
| 2685 | 2682 | ||
| @@ -2714,13 +2711,13 @@ static void srpt_cm_rtu_recv(struct ib_cm_id *cm_id) | |||
| 2714 | 2711 | ||
| 2715 | static void srpt_cm_timewait_exit(struct ib_cm_id *cm_id) | 2712 | static void srpt_cm_timewait_exit(struct ib_cm_id *cm_id) |
| 2716 | { | 2713 | { |
| 2717 | printk(KERN_INFO "Received IB TimeWait exit for cm_id %p.\n", cm_id); | 2714 | pr_info("Received IB TimeWait exit for cm_id %p.\n", cm_id); |
| 2718 | srpt_drain_channel(cm_id); | 2715 | srpt_drain_channel(cm_id); |
| 2719 | } | 2716 | } |
| 2720 | 2717 | ||
| 2721 | static void srpt_cm_rep_error(struct ib_cm_id *cm_id) | 2718 | static void srpt_cm_rep_error(struct ib_cm_id *cm_id) |
| 2722 | { | 2719 | { |
| 2723 | printk(KERN_INFO "Received IB REP error for cm_id %p.\n", cm_id); | 2720 | pr_info("Received IB REP error for cm_id %p.\n", cm_id); |
| 2724 | srpt_drain_channel(cm_id); | 2721 | srpt_drain_channel(cm_id); |
| 2725 | } | 2722 | } |
| 2726 | 2723 | ||
| @@ -2755,9 +2752,9 @@ static void srpt_cm_dreq_recv(struct ib_cm_id *cm_id) | |||
| 2755 | 2752 | ||
| 2756 | if (send_drep) { | 2753 | if (send_drep) { |
| 2757 | if (ib_send_cm_drep(ch->cm_id, NULL, 0) < 0) | 2754 | if (ib_send_cm_drep(ch->cm_id, NULL, 0) < 0) |
| 2758 | printk(KERN_ERR "Sending IB DREP failed.\n"); | 2755 | pr_err("Sending IB DREP failed.\n"); |
| 2759 | printk(KERN_INFO "Received DREQ and sent DREP for session %s.\n", | 2756 | pr_info("Received DREQ and sent DREP for session %s.\n", |
| 2760 | ch->sess_name); | 2757 | ch->sess_name); |
| 2761 | } | 2758 | } |
| 2762 | } | 2759 | } |
| 2763 | 2760 | ||
| @@ -2766,8 +2763,7 @@ static void srpt_cm_dreq_recv(struct ib_cm_id *cm_id) | |||
| 2766 | */ | 2763 | */ |
| 2767 | static void srpt_cm_drep_recv(struct ib_cm_id *cm_id) | 2764 | static void srpt_cm_drep_recv(struct ib_cm_id *cm_id) |
| 2768 | { | 2765 | { |
| 2769 | printk(KERN_INFO "Received InfiniBand DREP message for cm_id %p.\n", | 2766 | pr_info("Received InfiniBand DREP message for cm_id %p.\n", cm_id); |
| 2770 | cm_id); | ||
| 2771 | srpt_drain_channel(cm_id); | 2767 | srpt_drain_channel(cm_id); |
| 2772 | } | 2768 | } |
| 2773 | 2769 | ||
| @@ -2811,14 +2807,13 @@ static int srpt_cm_handler(struct ib_cm_id *cm_id, struct ib_cm_event *event) | |||
| 2811 | srpt_cm_rep_error(cm_id); | 2807 | srpt_cm_rep_error(cm_id); |
| 2812 | break; | 2808 | break; |
| 2813 | case IB_CM_DREQ_ERROR: | 2809 | case IB_CM_DREQ_ERROR: |
| 2814 | printk(KERN_INFO "Received IB DREQ ERROR event.\n"); | 2810 | pr_info("Received IB DREQ ERROR event.\n"); |
| 2815 | break; | 2811 | break; |
| 2816 | case IB_CM_MRA_RECEIVED: | 2812 | case IB_CM_MRA_RECEIVED: |
| 2817 | printk(KERN_INFO "Received IB MRA event\n"); | 2813 | pr_info("Received IB MRA event\n"); |
| 2818 | break; | 2814 | break; |
| 2819 | default: | 2815 | default: |
| 2820 | printk(KERN_ERR "received unrecognized IB CM event %d\n", | 2816 | pr_err("received unrecognized IB CM event %d\n", event->event); |
| 2821 | event->event); | ||
| 2822 | break; | 2817 | break; |
| 2823 | } | 2818 | } |
| 2824 | 2819 | ||
| @@ -2848,8 +2843,8 @@ static int srpt_perform_rdmas(struct srpt_rdma_ch *ch, | |||
| 2848 | ret = -ENOMEM; | 2843 | ret = -ENOMEM; |
| 2849 | sq_wr_avail = atomic_sub_return(n_rdma, &ch->sq_wr_avail); | 2844 | sq_wr_avail = atomic_sub_return(n_rdma, &ch->sq_wr_avail); |
| 2850 | if (sq_wr_avail < 0) { | 2845 | if (sq_wr_avail < 0) { |
| 2851 | printk(KERN_WARNING "IB send queue full (needed %d)\n", | 2846 | pr_warn("IB send queue full (needed %d)\n", |
| 2852 | n_rdma); | 2847 | n_rdma); |
| 2853 | goto out; | 2848 | goto out; |
| 2854 | } | 2849 | } |
| 2855 | } | 2850 | } |
| @@ -2889,7 +2884,7 @@ static int srpt_perform_rdmas(struct srpt_rdma_ch *ch, | |||
| 2889 | } | 2884 | } |
| 2890 | 2885 | ||
| 2891 | if (ret) | 2886 | if (ret) |
| 2892 | printk(KERN_ERR "%s[%d]: ib_post_send() returned %d for %d/%d", | 2887 | pr_err("%s[%d]: ib_post_send() returned %d for %d/%d\n", |
| 2893 | __func__, __LINE__, ret, i, n_rdma); | 2888 | __func__, __LINE__, ret, i, n_rdma); |
| 2894 | if (ret && i > 0) { | 2889 | if (ret && i > 0) { |
| 2895 | wr.num_sge = 0; | 2890 | wr.num_sge = 0; |
| @@ -2897,12 +2892,12 @@ static int srpt_perform_rdmas(struct srpt_rdma_ch *ch, | |||
| 2897 | wr.send_flags = IB_SEND_SIGNALED; | 2892 | wr.send_flags = IB_SEND_SIGNALED; |
| 2898 | while (ch->state == CH_LIVE && | 2893 | while (ch->state == CH_LIVE && |
| 2899 | ib_post_send(ch->qp, &wr, &bad_wr) != 0) { | 2894 | ib_post_send(ch->qp, &wr, &bad_wr) != 0) { |
| 2900 | printk(KERN_INFO "Trying to abort failed RDMA transfer [%d]", | 2895 | pr_info("Trying to abort failed RDMA transfer [%d]\n", |
| 2901 | ioctx->ioctx.index); | 2896 | ioctx->ioctx.index); |
| 2902 | msleep(1000); | 2897 | msleep(1000); |
| 2903 | } | 2898 | } |
| 2904 | while (ch->state != CH_RELEASING && !ioctx->rdma_aborted) { | 2899 | while (ch->state != CH_RELEASING && !ioctx->rdma_aborted) { |
| 2905 | printk(KERN_INFO "Waiting until RDMA abort finished [%d]", | 2900 | pr_info("Waiting until RDMA abort finished [%d]\n", |
| 2906 | ioctx->ioctx.index); | 2901 | ioctx->ioctx.index); |
| 2907 | msleep(1000); | 2902 | msleep(1000); |
| 2908 | } | 2903 | } |
| @@ -2923,17 +2918,17 @@ static int srpt_xfer_data(struct srpt_rdma_ch *ch, | |||
| 2923 | 2918 | ||
| 2924 | ret = srpt_map_sg_to_ib_sge(ch, ioctx); | 2919 | ret = srpt_map_sg_to_ib_sge(ch, ioctx); |
| 2925 | if (ret) { | 2920 | if (ret) { |
| 2926 | printk(KERN_ERR "%s[%d] ret=%d\n", __func__, __LINE__, ret); | 2921 | pr_err("%s[%d] ret=%d\n", __func__, __LINE__, ret); |
| 2927 | goto out; | 2922 | goto out; |
| 2928 | } | 2923 | } |
| 2929 | 2924 | ||
| 2930 | ret = srpt_perform_rdmas(ch, ioctx); | 2925 | ret = srpt_perform_rdmas(ch, ioctx); |
| 2931 | if (ret) { | 2926 | if (ret) { |
| 2932 | if (ret == -EAGAIN || ret == -ENOMEM) | 2927 | if (ret == -EAGAIN || ret == -ENOMEM) |
| 2933 | printk(KERN_INFO "%s[%d] queue full -- ret=%d\n", | 2928 | pr_info("%s[%d] queue full -- ret=%d\n", |
| 2934 | __func__, __LINE__, ret); | 2929 | __func__, __LINE__, ret); |
| 2935 | else | 2930 | else |
| 2936 | printk(KERN_ERR "%s[%d] fatal error -- ret=%d\n", | 2931 | pr_err("%s[%d] fatal error -- ret=%d\n", |
| 2937 | __func__, __LINE__, ret); | 2932 | __func__, __LINE__, ret); |
| 2938 | goto out_unmap; | 2933 | goto out_unmap; |
| 2939 | } | 2934 | } |
| @@ -3058,7 +3053,7 @@ static void srpt_queue_response(struct se_cmd *cmd) | |||
| 3058 | !ioctx->queue_status_only) { | 3053 | !ioctx->queue_status_only) { |
| 3059 | ret = srpt_xfer_data(ch, ioctx); | 3054 | ret = srpt_xfer_data(ch, ioctx); |
| 3060 | if (ret) { | 3055 | if (ret) { |
| 3061 | printk(KERN_ERR "xfer_data failed for tag %llu\n", | 3056 | pr_err("xfer_data failed for tag %llu\n", |
| 3062 | ioctx->tag); | 3057 | ioctx->tag); |
| 3063 | return; | 3058 | return; |
| 3064 | } | 3059 | } |
| @@ -3075,7 +3070,7 @@ static void srpt_queue_response(struct se_cmd *cmd) | |||
| 3075 | } | 3070 | } |
| 3076 | ret = srpt_post_send(ch, ioctx, resp_len); | 3071 | ret = srpt_post_send(ch, ioctx, resp_len); |
| 3077 | if (ret) { | 3072 | if (ret) { |
| 3078 | printk(KERN_ERR "sending cmd response failed for tag %llu\n", | 3073 | pr_err("sending cmd response failed for tag %llu\n", |
| 3079 | ioctx->tag); | 3074 | ioctx->tag); |
| 3080 | srpt_unmap_sg_to_ib_sge(ch, ioctx); | 3075 | srpt_unmap_sg_to_ib_sge(ch, ioctx); |
| 3081 | srpt_set_cmd_state(ioctx, SRPT_STATE_DONE); | 3076 | srpt_set_cmd_state(ioctx, SRPT_STATE_DONE); |
| @@ -3154,7 +3149,7 @@ static int srpt_release_sdev(struct srpt_device *sdev) | |||
| 3154 | res = wait_event_interruptible(sdev->ch_releaseQ, | 3149 | res = wait_event_interruptible(sdev->ch_releaseQ, |
| 3155 | srpt_ch_list_empty(sdev)); | 3150 | srpt_ch_list_empty(sdev)); |
| 3156 | if (res) | 3151 | if (res) |
| 3157 | printk(KERN_ERR "%s: interrupted.\n", __func__); | 3152 | pr_err("%s: interrupted.\n", __func__); |
| 3158 | 3153 | ||
| 3159 | return 0; | 3154 | return 0; |
| 3160 | } | 3155 | } |
| @@ -3293,7 +3288,7 @@ static void srpt_add_one(struct ib_device *device) | |||
| 3293 | spin_lock_init(&sport->port_acl_lock); | 3288 | spin_lock_init(&sport->port_acl_lock); |
| 3294 | 3289 | ||
| 3295 | if (srpt_refresh_port(sport)) { | 3290 | if (srpt_refresh_port(sport)) { |
| 3296 | printk(KERN_ERR "MAD registration failed for %s-%d.\n", | 3291 | pr_err("MAD registration failed for %s-%d.\n", |
| 3297 | srpt_sdev_name(sdev), i); | 3292 | srpt_sdev_name(sdev), i); |
| 3298 | goto err_ring; | 3293 | goto err_ring; |
| 3299 | } | 3294 | } |
| @@ -3330,7 +3325,7 @@ free_dev: | |||
| 3330 | kfree(sdev); | 3325 | kfree(sdev); |
| 3331 | err: | 3326 | err: |
| 3332 | sdev = NULL; | 3327 | sdev = NULL; |
| 3333 | printk(KERN_INFO "%s(%s) failed.\n", __func__, device->name); | 3328 | pr_info("%s(%s) failed.\n", __func__, device->name); |
| 3334 | goto out; | 3329 | goto out; |
| 3335 | } | 3330 | } |
| 3336 | 3331 | ||
| @@ -3344,8 +3339,7 @@ static void srpt_remove_one(struct ib_device *device) | |||
| 3344 | 3339 | ||
| 3345 | sdev = ib_get_client_data(device, &srpt_client); | 3340 | sdev = ib_get_client_data(device, &srpt_client); |
| 3346 | if (!sdev) { | 3341 | if (!sdev) { |
| 3347 | printk(KERN_INFO "%s(%s): nothing to do.\n", __func__, | 3342 | pr_info("%s(%s): nothing to do.\n", __func__, device->name); |
| 3348 | device->name); | ||
| 3349 | return; | 3343 | return; |
| 3350 | } | 3344 | } |
| 3351 | 3345 | ||
| @@ -3464,7 +3458,7 @@ static struct se_node_acl *srpt_alloc_fabric_acl(struct se_portal_group *se_tpg) | |||
| 3464 | 3458 | ||
| 3465 | nacl = kzalloc(sizeof(struct srpt_node_acl), GFP_KERNEL); | 3459 | nacl = kzalloc(sizeof(struct srpt_node_acl), GFP_KERNEL); |
| 3466 | if (!nacl) { | 3460 | if (!nacl) { |
| 3467 | printk(KERN_ERR "Unable to allocate struct srpt_node_acl\n"); | 3461 | pr_err("Unable to allocate struct srpt_node_acl\n"); |
| 3468 | return NULL; | 3462 | return NULL; |
| 3469 | } | 3463 | } |
| 3470 | 3464 | ||
| @@ -3615,7 +3609,7 @@ static struct se_node_acl *srpt_make_nodeacl(struct se_portal_group *tpg, | |||
| 3615 | u8 i_port_id[16]; | 3609 | u8 i_port_id[16]; |
| 3616 | 3610 | ||
| 3617 | if (srpt_parse_i_port_id(i_port_id, name) < 0) { | 3611 | if (srpt_parse_i_port_id(i_port_id, name) < 0) { |
| 3618 | printk(KERN_ERR "invalid initiator port ID %s\n", name); | 3612 | pr_err("invalid initiator port ID %s\n", name); |
| 3619 | ret = -EINVAL; | 3613 | ret = -EINVAL; |
| 3620 | goto err; | 3614 | goto err; |
| 3621 | } | 3615 | } |
| @@ -3816,12 +3810,12 @@ static ssize_t srpt_tpg_store_enable( | |||
| 3816 | 3810 | ||
| 3817 | ret = kstrtoul(page, 0, &tmp); | 3811 | ret = kstrtoul(page, 0, &tmp); |
| 3818 | if (ret < 0) { | 3812 | if (ret < 0) { |
| 3819 | printk(KERN_ERR "Unable to extract srpt_tpg_store_enable\n"); | 3813 | pr_err("Unable to extract srpt_tpg_store_enable\n"); |
| 3820 | return -EINVAL; | 3814 | return -EINVAL; |
| 3821 | } | 3815 | } |
| 3822 | 3816 | ||
| 3823 | if ((tmp != 0) && (tmp != 1)) { | 3817 | if ((tmp != 0) && (tmp != 1)) { |
| 3824 | printk(KERN_ERR "Illegal value for srpt_tpg_store_enable: %lu\n", tmp); | 3818 | pr_err("Illegal value for srpt_tpg_store_enable: %lu\n", tmp); |
| 3825 | return -EINVAL; | 3819 | return -EINVAL; |
| 3826 | } | 3820 | } |
| 3827 | if (tmp == 1) | 3821 | if (tmp == 1) |
| @@ -3980,7 +3974,7 @@ static int __init srpt_init_module(void) | |||
| 3980 | 3974 | ||
| 3981 | ret = -EINVAL; | 3975 | ret = -EINVAL; |
| 3982 | if (srp_max_req_size < MIN_MAX_REQ_SIZE) { | 3976 | if (srp_max_req_size < MIN_MAX_REQ_SIZE) { |
| 3983 | printk(KERN_ERR "invalid value %d for kernel module parameter" | 3977 | pr_err("invalid value %d for kernel module parameter" |
| 3984 | " srp_max_req_size -- must be at least %d.\n", | 3978 | " srp_max_req_size -- must be at least %d.\n", |
| 3985 | srp_max_req_size, MIN_MAX_REQ_SIZE); | 3979 | srp_max_req_size, MIN_MAX_REQ_SIZE); |
| 3986 | goto out; | 3980 | goto out; |
| @@ -3988,7 +3982,7 @@ static int __init srpt_init_module(void) | |||
| 3988 | 3982 | ||
| 3989 | if (srpt_srq_size < MIN_SRPT_SRQ_SIZE | 3983 | if (srpt_srq_size < MIN_SRPT_SRQ_SIZE |
| 3990 | || srpt_srq_size > MAX_SRPT_SRQ_SIZE) { | 3984 | || srpt_srq_size > MAX_SRPT_SRQ_SIZE) { |
| 3991 | printk(KERN_ERR "invalid value %d for kernel module parameter" | 3985 | pr_err("invalid value %d for kernel module parameter" |
| 3992 | " srpt_srq_size -- must be in the range [%d..%d].\n", | 3986 | " srpt_srq_size -- must be in the range [%d..%d].\n", |
| 3993 | srpt_srq_size, MIN_SRPT_SRQ_SIZE, MAX_SRPT_SRQ_SIZE); | 3987 | srpt_srq_size, MIN_SRPT_SRQ_SIZE, MAX_SRPT_SRQ_SIZE); |
| 3994 | goto out; | 3988 | goto out; |
| @@ -3996,7 +3990,7 @@ static int __init srpt_init_module(void) | |||
| 3996 | 3990 | ||
| 3997 | srpt_target = target_fabric_configfs_init(THIS_MODULE, "srpt"); | 3991 | srpt_target = target_fabric_configfs_init(THIS_MODULE, "srpt"); |
| 3998 | if (IS_ERR(srpt_target)) { | 3992 | if (IS_ERR(srpt_target)) { |
| 3999 | printk(KERN_ERR "couldn't register\n"); | 3993 | pr_err("couldn't register\n"); |
| 4000 | ret = PTR_ERR(srpt_target); | 3994 | ret = PTR_ERR(srpt_target); |
| 4001 | goto out; | 3995 | goto out; |
| 4002 | } | 3996 | } |
| @@ -4018,13 +4012,13 @@ static int __init srpt_init_module(void) | |||
| 4018 | 4012 | ||
| 4019 | ret = target_fabric_configfs_register(srpt_target); | 4013 | ret = target_fabric_configfs_register(srpt_target); |
| 4020 | if (ret < 0) { | 4014 | if (ret < 0) { |
| 4021 | printk(KERN_ERR "couldn't register\n"); | 4015 | pr_err("couldn't register\n"); |
| 4022 | goto out_free_target; | 4016 | goto out_free_target; |
| 4023 | } | 4017 | } |
| 4024 | 4018 | ||
| 4025 | ret = ib_register_client(&srpt_client); | 4019 | ret = ib_register_client(&srpt_client); |
| 4026 | if (ret) { | 4020 | if (ret) { |
| 4027 | printk(KERN_ERR "couldn't register IB client\n"); | 4021 | pr_err("couldn't register IB client\n"); |
| 4028 | goto out_unregister_target; | 4022 | goto out_unregister_target; |
| 4029 | } | 4023 | } |
| 4030 | 4024 | ||
