hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/scsi/megaraid/megaraid_sas_fusion.h
....@@ -1,34 +1,20 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Linux MegaRAID driver for SAS based RAID controllers
34 *
45 * Copyright (c) 2009-2013 LSI Corporation
5
- * Copyright (c) 2013-2014 Avago Technologies
6
- *
7
- * This program is free software; you can redistribute it and/or
8
- * modify it under the terms of the GNU General Public License
9
- * as published by the Free Software Foundation; either version 2
10
- * of the License, or (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License
18
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
6
+ * Copyright (c) 2013-2016 Avago Technologies
7
+ * Copyright (c) 2016-2018 Broadcom Inc.
198 *
209 * FILE: megaraid_sas_fusion.h
2110 *
22
- * Authors: Avago Technologies
11
+ * Authors: Broadcom Inc.
2312 * Manoj Jose
2413 * Sumant Patro
25
- * Kashyap Desai <kashyap.desai@avagotech.com>
26
- * Sumit Saxena <sumit.saxena@avagotech.com>
14
+ * Kashyap Desai <kashyap.desai@broadcom.com>
15
+ * Sumit Saxena <sumit.saxena@broadcom.com>
2716 *
28
- * Send feedback to: megaraidlinux.pdl@avagotech.com
29
- *
30
- * Mail to: Avago Technologies, 350 West Trimble Road, Building 90,
31
- * San Jose, California 95131
17
+ * Send feedback to: megaraidlinux.pdl@broadcom.com
3218 */
3319
3420 #ifndef _MEGARAID_SAS_FUSION_H_
....@@ -89,7 +75,8 @@
8975 MR_RAID_FLAGS_IO_SUB_TYPE_RMW_P = 3,
9076 MR_RAID_FLAGS_IO_SUB_TYPE_RMW_Q = 4,
9177 MR_RAID_FLAGS_IO_SUB_TYPE_CACHE_BYPASS = 6,
92
- MR_RAID_FLAGS_IO_SUB_TYPE_LDIO_BW_LIMIT = 7
78
+ MR_RAID_FLAGS_IO_SUB_TYPE_LDIO_BW_LIMIT = 7,
79
+ MR_RAID_FLAGS_IO_SUB_TYPE_R56_DIV_OFFLOAD = 8
9380 };
9481
9582 /*
....@@ -103,7 +90,6 @@
10390 #define MEGASAS_FP_CMD_LEN 16
10491 #define MEGASAS_FUSION_IN_RESET 0
10592 #define MEGASAS_FUSION_OCR_NOT_POSSIBLE 1
106
-#define THRESHOLD_REPLY_COUNT 50
10793 #define RAID_1_PEER_CMDS 2
10894 #define JBOD_MAPS_COUNT 2
10995 #define MEGASAS_REDUCE_QD_COUNT 64
....@@ -155,12 +141,15 @@
155141 u16 timeout_value; /* 0x02 -0x03 */
156142 u16 routing_flags; // 0x04 -0x05 routing flags
157143 u16 virtual_disk_tgt_id; /* 0x06 -0x07 */
158
- u64 reg_lock_row_lba; /* 0x08 - 0x0F */
144
+ __le64 reg_lock_row_lba; /* 0x08 - 0x0F */
159145 u32 reg_lock_length; /* 0x10 - 0x13 */
160
- union {
161
- u16 next_lmid; /* 0x14 - 0x15 */
162
- u16 peer_smid; /* used for the raid 1/10 fp writes */
163
- } smid;
146
+ union { // flow specific
147
+ u16 rmw_op_index; /* 0x14 - 0x15, R5/6 RMW: rmw operation index*/
148
+ u16 peer_smid; /* 0x14 - 0x15, R1 Write: peer smid*/
149
+ u16 r56_arm_map; /* 0x14 - 0x15, Unused [15], LogArm[14:10], P-Arm[9:5], Q-Arm[4:0] */
150
+
151
+ } flow_specific;
152
+
164153 u8 ex_status; /* 0x16 : OUT */
165154 u8 status; /* 0x17 status */
166155 u8 raid_flags; /* 0x18 resvd[7:6], ioSubType[5:4],
....@@ -250,6 +239,13 @@
250239
251240 #define RAID_CTX_SPANARM_SPAN_SHIFT (5)
252241 #define RAID_CTX_SPANARM_SPAN_MASK (0xE0)
242
+
243
+/* LogArm[14:10], P-Arm[9:5], Q-Arm[4:0] */
244
+#define RAID_CTX_R56_Q_ARM_MASK (0x1F)
245
+#define RAID_CTX_R56_P_ARM_SHIFT (5)
246
+#define RAID_CTX_R56_P_ARM_MASK (0x3E0)
247
+#define RAID_CTX_R56_LOG_ARM_SHIFT (10)
248
+#define RAID_CTX_R56_LOG_ARM_MASK (0x7C00)
253249
254250 /* number of bits per index in U32 TrackStream */
255251 #define BITS_PER_INDEX_STREAM 4
....@@ -726,6 +722,8 @@
726722 #define MR_DCMD_CTRL_SHARED_HOST_MEM_ALLOC 0x010e8485 /* SR-IOV HB alloc*/
727723 #define MR_DCMD_LD_VF_MAP_GET_ALL_LDS_111 0x03200200
728724 #define MR_DCMD_LD_VF_MAP_GET_ALL_LDS 0x03150200
725
+#define MR_DCMD_CTRL_SNAPDUMP_GET_PROPERTIES 0x01200100
726
+#define MR_DCMD_CTRL_DEVICE_LIST_GET 0x01190600
729727
730728 struct MR_DEV_HANDLE_INFO {
731729 __le16 curDevHdl;
....@@ -776,7 +774,7 @@
776774 struct MR_CPU_AFFINITY_MASK {
777775 union {
778776 struct {
779
-#ifndef MFI_BIG_ENDIAN
777
+#ifndef __BIG_ENDIAN_BITFIELD
780778 u8 hw_path:1;
781779 u8 cpu0:1;
782780 u8 cpu1:1;
....@@ -867,9 +865,20 @@
867865 u8 regTypeReqOnRead;
868866 __le16 seqNum;
869867
870
- struct {
871
- u32 ldSyncRequired:1;
872
- u32 reserved:31;
868
+struct {
869
+#ifndef __BIG_ENDIAN_BITFIELD
870
+ u32 ldSyncRequired:1;
871
+ u32 regTypeReqOnReadIsValid:1;
872
+ u32 isEPD:1;
873
+ u32 enableSLDOnAllRWIOs:1;
874
+ u32 reserved:28;
875
+#else
876
+ u32 reserved:28;
877
+ u32 enableSLDOnAllRWIOs:1;
878
+ u32 isEPD:1;
879
+ u32 regTypeReqOnReadIsValid:1;
880
+ u32 ldSyncRequired:1;
881
+#endif
873882 } flags;
874883
875884 u8 LUN[8]; /* 0x24 8 byte LUN field used for SCSI IO's */
....@@ -880,7 +889,7 @@
880889 /* 0x30 - 0x33, Logical block size for the LD */
881890 u32 logical_block_length;
882891 struct {
883
-#ifndef MFI_BIG_ENDIAN
892
+#ifndef __BIG_ENDIAN_BITFIELD
884893 /* 0x34, P_I_EXPONENT from READ CAPACITY 16 */
885894 u32 ld_pi_exp:4;
886895 /* 0x34, LOGICAL BLOCKS PER PHYSICAL
....@@ -953,6 +962,7 @@
953962 u8 pd_after_lb;
954963 u16 r1_alt_dev_handle; /* raid 1/10 only */
955964 bool ra_capable;
965
+ u8 data_arms;
956966 };
957967
958968 struct MR_LD_TARGET_SYNC {
....@@ -1063,6 +1073,9 @@
10631073 #define MPI26_IEEE_SGE_FLAGS_NSF_MPI_IEEE (0x00)
10641074 #define MPI26_IEEE_SGE_FLAGS_NSF_NVME_PRP (0x08)
10651075 #define MPI26_IEEE_SGE_FLAGS_NSF_NVME_SGL (0x10)
1076
+
1077
+#define MEGASAS_DEFAULT_SNAP_DUMP_WAIT_TIME 15
1078
+#define MEGASAS_MAX_SNAP_DUMP_WAIT_TIME 60
10661079
10671080 struct megasas_register_set;
10681081 struct megasas_instance;
....@@ -1334,7 +1347,8 @@
13341347 dma_addr_t ioc_init_request_phys;
13351348 struct MPI2_IOC_INIT_REQUEST *ioc_init_request;
13361349 struct megasas_cmd *ioc_init_cmd;
1337
-
1350
+ bool pcie_bw_limitation;
1351
+ bool r56_div_offload;
13381352 };
13391353
13401354 union desc_value {
....@@ -1351,6 +1365,19 @@
13511365 RETURN_CMD = 3,
13521366 };
13531367
1368
+struct MR_SNAPDUMP_PROPERTIES {
1369
+ u8 offload_num;
1370
+ u8 max_num_supported;
1371
+ u8 cur_num_supported;
1372
+ u8 trigger_min_num_sec_before_ocr;
1373
+ u8 reserved[12];
1374
+};
1375
+
1376
+struct megasas_debugfs_buffer {
1377
+ void *buf;
1378
+ u32 len;
1379
+};
1380
+
13541381 void megasas_free_cmds_fusion(struct megasas_instance *instance);
13551382 int megasas_ioc_init_fusion(struct megasas_instance *instance);
13561383 u8 megasas_get_map_info(struct megasas_instance *instance);