.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /******************************************************************************* |
---|
2 | 3 | * IBM Virtual SCSI Target Driver |
---|
3 | 4 | * Copyright (C) 2003-2005 Dave Boutcher (boutcher@us.ibm.com) IBM Corp. |
---|
.. | .. |
---|
9 | 10 | * |
---|
10 | 11 | * Authors: Bryant G. Ly <bryantly@linux.vnet.ibm.com> |
---|
11 | 12 | * Authors: Michael Cyr <mikecyr@linux.vnet.ibm.com> |
---|
12 | | - * |
---|
13 | | - * This program is free software; you can redistribute it and/or modify |
---|
14 | | - * it under the terms of the GNU General Public License as published by |
---|
15 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
16 | | - * (at your option) any later version. |
---|
17 | | - * |
---|
18 | | - * This program is distributed in the hope that it will be useful, |
---|
19 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
20 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
21 | | - * GNU General Public License for more details. |
---|
22 | 13 | * |
---|
23 | 14 | ****************************************************************************/ |
---|
24 | 15 | |
---|
.. | .. |
---|
44 | 35 | |
---|
45 | 36 | #define IBMVSCSIS_VERSION "v0.2" |
---|
46 | 37 | |
---|
47 | | -#define INITIAL_SRP_LIMIT 800 |
---|
| 38 | +#define INITIAL_SRP_LIMIT 1024 |
---|
48 | 39 | #define DEFAULT_MAX_SECTORS 256 |
---|
49 | 40 | #define MAX_TXU 1024 * 1024 |
---|
50 | 41 | |
---|
.. | .. |
---|
1590 | 1581 | case H_PERMISSION: |
---|
1591 | 1582 | if (connection_broken(vscsi)) |
---|
1592 | 1583 | flag_bits = (RESPONSE_Q_DOWN | CLIENT_FAILED); |
---|
| 1584 | + fallthrough; |
---|
1593 | 1585 | default: |
---|
1594 | 1586 | dev_err(&vscsi->dev, "adapter_info: h_copy_rdma to client failed, rc %ld\n", |
---|
1595 | 1587 | rc); |
---|
.. | .. |
---|
1885 | 1877 | */ |
---|
1886 | 1878 | struct viosrp_crq *crq = (struct viosrp_crq *)&msg_hi; |
---|
1887 | 1879 | struct ibmvscsis_cmd *cmd, *nxt; |
---|
1888 | | - struct iu_entry *iue; |
---|
1889 | 1880 | long rc = ADAPT_SUCCESS; |
---|
1890 | 1881 | bool retry = false; |
---|
1891 | 1882 | |
---|
.. | .. |
---|
1939 | 1930 | */ |
---|
1940 | 1931 | vscsi->credit += 1; |
---|
1941 | 1932 | } else { |
---|
1942 | | - iue = cmd->iue; |
---|
1943 | | - |
---|
1944 | 1933 | crq->valid = VALID_CMD_RESP_EL; |
---|
1945 | 1934 | crq->format = cmd->rsp.format; |
---|
1946 | 1935 | |
---|
.. | .. |
---|
2266 | 2255 | /* |
---|
2267 | 2256 | * Release the SCSI I_T Nexus to the emulated ibmvscsis Target Port |
---|
2268 | 2257 | */ |
---|
2269 | | - target_wait_for_sess_cmds(se_sess); |
---|
2270 | 2258 | target_remove_session(se_sess); |
---|
2271 | 2259 | tport->ibmv_nexus = NULL; |
---|
2272 | 2260 | kfree(nexus); |
---|
.. | .. |
---|
2363 | 2351 | { |
---|
2364 | 2352 | struct iu_entry *iue = cmd->iue; |
---|
2365 | 2353 | struct srp_i_logout *log_out = &vio_iu(iue)->srp.i_logout; |
---|
2366 | | - long rc = ADAPT_SUCCESS; |
---|
2367 | 2354 | |
---|
2368 | 2355 | if ((vscsi->debit > 0) || !list_empty(&vscsi->schedule_q) || |
---|
2369 | 2356 | !list_empty(&vscsi->waiting_rsp)) { |
---|
.. | .. |
---|
2379 | 2366 | ibmvscsis_post_disconnect(vscsi, WAIT_IDLE, 0); |
---|
2380 | 2367 | } |
---|
2381 | 2368 | |
---|
2382 | | - return rc; |
---|
| 2369 | + return ADAPT_SUCCESS; |
---|
2383 | 2370 | } |
---|
2384 | 2371 | |
---|
2385 | 2372 | /* Called with intr lock held */ |
---|
.. | .. |
---|
2502 | 2489 | break; |
---|
2503 | 2490 | case H_CLOSED: |
---|
2504 | 2491 | vscsi->flags |= CLIENT_FAILED; |
---|
| 2492 | + fallthrough; |
---|
2505 | 2493 | case H_DROPPED: |
---|
2506 | 2494 | vscsi->flags |= RESPONSE_Q_DOWN; |
---|
| 2495 | + fallthrough; |
---|
2507 | 2496 | case H_REMOTE_PARM: |
---|
2508 | 2497 | dev_err(&vscsi->dev, "ping_response: h_send_crq failed, rc %ld\n", |
---|
2509 | 2498 | rc); |
---|
.. | .. |
---|
3696 | 3685 | return 0; |
---|
3697 | 3686 | } |
---|
3698 | 3687 | |
---|
3699 | | -static char *ibmvscsis_get_fabric_name(void) |
---|
3700 | | -{ |
---|
3701 | | - return "ibmvscsis"; |
---|
3702 | | -} |
---|
3703 | | - |
---|
3704 | 3688 | static char *ibmvscsis_get_fabric_wwn(struct se_portal_group *se_tpg) |
---|
3705 | 3689 | { |
---|
3706 | 3690 | struct ibmvscsis_tport *tport = |
---|
.. | .. |
---|
3794 | 3778 | return 0; |
---|
3795 | 3779 | } |
---|
3796 | 3780 | |
---|
3797 | | -static int ibmvscsis_write_pending_status(struct se_cmd *se_cmd) |
---|
3798 | | -{ |
---|
3799 | | - return 0; |
---|
3800 | | -} |
---|
3801 | | - |
---|
3802 | 3781 | static void ibmvscsis_set_default_node_attrs(struct se_node_acl *nacl) |
---|
3803 | 3782 | { |
---|
3804 | 3783 | } |
---|
.. | .. |
---|
3814 | 3793 | se_cmd); |
---|
3815 | 3794 | struct iu_entry *iue = cmd->iue; |
---|
3816 | 3795 | struct scsi_info *vscsi = cmd->adapter; |
---|
3817 | | - char *sd; |
---|
3818 | 3796 | uint len = 0; |
---|
3819 | 3797 | int rc; |
---|
3820 | 3798 | |
---|
.. | .. |
---|
3822 | 3800 | 1); |
---|
3823 | 3801 | if (rc) { |
---|
3824 | 3802 | dev_err(&vscsi->dev, "srp_transfer_data failed: %d\n", rc); |
---|
3825 | | - sd = se_cmd->sense_buffer; |
---|
3826 | 3803 | se_cmd->scsi_sense_length = 18; |
---|
3827 | 3804 | memset(se_cmd->sense_buffer, 0, se_cmd->scsi_sense_length); |
---|
3828 | 3805 | /* Logical Unit Communication Time-out asc/ascq = 0x0801 */ |
---|
.. | .. |
---|
4045 | 4022 | |
---|
4046 | 4023 | static const struct target_core_fabric_ops ibmvscsis_ops = { |
---|
4047 | 4024 | .module = THIS_MODULE, |
---|
4048 | | - .name = "ibmvscsis", |
---|
| 4025 | + .fabric_name = "ibmvscsis", |
---|
4049 | 4026 | .max_data_sg_nents = MAX_TXU / PAGE_SIZE, |
---|
4050 | | - .get_fabric_name = ibmvscsis_get_fabric_name, |
---|
4051 | 4027 | .tpg_get_wwn = ibmvscsis_get_fabric_wwn, |
---|
4052 | 4028 | .tpg_get_tag = ibmvscsis_get_tag, |
---|
4053 | 4029 | .tpg_get_default_depth = ibmvscsis_get_default_depth, |
---|
.. | .. |
---|
4060 | 4036 | .release_cmd = ibmvscsis_release_cmd, |
---|
4061 | 4037 | .sess_get_index = ibmvscsis_sess_get_index, |
---|
4062 | 4038 | .write_pending = ibmvscsis_write_pending, |
---|
4063 | | - .write_pending_status = ibmvscsis_write_pending_status, |
---|
4064 | 4039 | .set_default_node_attributes = ibmvscsis_set_default_node_attrs, |
---|
4065 | 4040 | .get_cmd_state = ibmvscsis_get_cmd_state, |
---|
4066 | 4041 | .queue_data_in = ibmvscsis_queue_data_in, |
---|