hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*******************************************************************************
23 * IBM Virtual SCSI Target Driver
34 * Copyright (C) 2003-2005 Dave Boutcher (boutcher@us.ibm.com) IBM Corp.
....@@ -9,16 +10,6 @@
910 *
1011 * Authors: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
1112 * 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.
2213 *
2314 ****************************************************************************/
2415
....@@ -44,7 +35,7 @@
4435
4536 #define IBMVSCSIS_VERSION "v0.2"
4637
47
-#define INITIAL_SRP_LIMIT 800
38
+#define INITIAL_SRP_LIMIT 1024
4839 #define DEFAULT_MAX_SECTORS 256
4940 #define MAX_TXU 1024 * 1024
5041
....@@ -1590,6 +1581,7 @@
15901581 case H_PERMISSION:
15911582 if (connection_broken(vscsi))
15921583 flag_bits = (RESPONSE_Q_DOWN | CLIENT_FAILED);
1584
+ fallthrough;
15931585 default:
15941586 dev_err(&vscsi->dev, "adapter_info: h_copy_rdma to client failed, rc %ld\n",
15951587 rc);
....@@ -1885,7 +1877,6 @@
18851877 */
18861878 struct viosrp_crq *crq = (struct viosrp_crq *)&msg_hi;
18871879 struct ibmvscsis_cmd *cmd, *nxt;
1888
- struct iu_entry *iue;
18891880 long rc = ADAPT_SUCCESS;
18901881 bool retry = false;
18911882
....@@ -1939,8 +1930,6 @@
19391930 */
19401931 vscsi->credit += 1;
19411932 } else {
1942
- iue = cmd->iue;
1943
-
19441933 crq->valid = VALID_CMD_RESP_EL;
19451934 crq->format = cmd->rsp.format;
19461935
....@@ -2266,7 +2255,6 @@
22662255 /*
22672256 * Release the SCSI I_T Nexus to the emulated ibmvscsis Target Port
22682257 */
2269
- target_wait_for_sess_cmds(se_sess);
22702258 target_remove_session(se_sess);
22712259 tport->ibmv_nexus = NULL;
22722260 kfree(nexus);
....@@ -2363,7 +2351,6 @@
23632351 {
23642352 struct iu_entry *iue = cmd->iue;
23652353 struct srp_i_logout *log_out = &vio_iu(iue)->srp.i_logout;
2366
- long rc = ADAPT_SUCCESS;
23672354
23682355 if ((vscsi->debit > 0) || !list_empty(&vscsi->schedule_q) ||
23692356 !list_empty(&vscsi->waiting_rsp)) {
....@@ -2379,7 +2366,7 @@
23792366 ibmvscsis_post_disconnect(vscsi, WAIT_IDLE, 0);
23802367 }
23812368
2382
- return rc;
2369
+ return ADAPT_SUCCESS;
23832370 }
23842371
23852372 /* Called with intr lock held */
....@@ -2502,8 +2489,10 @@
25022489 break;
25032490 case H_CLOSED:
25042491 vscsi->flags |= CLIENT_FAILED;
2492
+ fallthrough;
25052493 case H_DROPPED:
25062494 vscsi->flags |= RESPONSE_Q_DOWN;
2495
+ fallthrough;
25072496 case H_REMOTE_PARM:
25082497 dev_err(&vscsi->dev, "ping_response: h_send_crq failed, rc %ld\n",
25092498 rc);
....@@ -3696,11 +3685,6 @@
36963685 return 0;
36973686 }
36983687
3699
-static char *ibmvscsis_get_fabric_name(void)
3700
-{
3701
- return "ibmvscsis";
3702
-}
3703
-
37043688 static char *ibmvscsis_get_fabric_wwn(struct se_portal_group *se_tpg)
37053689 {
37063690 struct ibmvscsis_tport *tport =
....@@ -3794,11 +3778,6 @@
37943778 return 0;
37953779 }
37963780
3797
-static int ibmvscsis_write_pending_status(struct se_cmd *se_cmd)
3798
-{
3799
- return 0;
3800
-}
3801
-
38023781 static void ibmvscsis_set_default_node_attrs(struct se_node_acl *nacl)
38033782 {
38043783 }
....@@ -3814,7 +3793,6 @@
38143793 se_cmd);
38153794 struct iu_entry *iue = cmd->iue;
38163795 struct scsi_info *vscsi = cmd->adapter;
3817
- char *sd;
38183796 uint len = 0;
38193797 int rc;
38203798
....@@ -3822,7 +3800,6 @@
38223800 1);
38233801 if (rc) {
38243802 dev_err(&vscsi->dev, "srp_transfer_data failed: %d\n", rc);
3825
- sd = se_cmd->sense_buffer;
38263803 se_cmd->scsi_sense_length = 18;
38273804 memset(se_cmd->sense_buffer, 0, se_cmd->scsi_sense_length);
38283805 /* Logical Unit Communication Time-out asc/ascq = 0x0801 */
....@@ -4045,9 +4022,8 @@
40454022
40464023 static const struct target_core_fabric_ops ibmvscsis_ops = {
40474024 .module = THIS_MODULE,
4048
- .name = "ibmvscsis",
4025
+ .fabric_name = "ibmvscsis",
40494026 .max_data_sg_nents = MAX_TXU / PAGE_SIZE,
4050
- .get_fabric_name = ibmvscsis_get_fabric_name,
40514027 .tpg_get_wwn = ibmvscsis_get_fabric_wwn,
40524028 .tpg_get_tag = ibmvscsis_get_tag,
40534029 .tpg_get_default_depth = ibmvscsis_get_default_depth,
....@@ -4060,7 +4036,6 @@
40604036 .release_cmd = ibmvscsis_release_cmd,
40614037 .sess_get_index = ibmvscsis_sess_get_index,
40624038 .write_pending = ibmvscsis_write_pending,
4063
- .write_pending_status = ibmvscsis_write_pending_status,
40644039 .set_default_node_attributes = ibmvscsis_set_default_node_attrs,
40654040 .get_cmd_state = ibmvscsis_get_cmd_state,
40664041 .queue_data_in = ibmvscsis_queue_data_in,