Print this page
3862 stmf + kstat = kernel panic
3863 stmf_itl_task_start() must check for ilu->ilu_kstat_io is non-null
3864 memory leak in the iSCSI code
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Jeremy Jones <jeremy@delphix.com>
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed by: Dan McDonald <danmcd@nexenta.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Reviewed by: Richard Elling <richard.elling@gmail.com>
Approved by: Gordon Ross <gwr@nexenta.com>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/sys/lpif.h
+++ new/usr/src/uts/common/sys/lpif.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
|
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
23 + * Copyright (c) 2013 by Delphix. All rights reserved.
23 24 */
24 25 #ifndef _LPIF_H
25 26 #define _LPIF_H
26 27
27 28 /*
28 29 * Definitions for stmf LUs and lu providers.
29 30 */
30 31
31 32 #include <sys/stmf_defines.h>
32 33 #include <sys/stmf.h>
33 34
34 35 #ifdef __cplusplus
35 36 extern "C" {
36 37 #endif
37 38
38 39 #define LPIF_REV_1 0x00010000
39 40 #define LPIF_REV_2 0x00020000
40 41
41 42 typedef struct stmf_lu {
42 43 void *lu_stmf_private;
43 44 void *lu_provider_private;
44 45
45 46 struct scsi_devid_desc *lu_id;
46 47 char *lu_alias; /* optional */
47 48 struct stmf_lu_provider *lu_lp;
48 49 uint32_t lu_abort_timeout; /* In seconds */
49 50
50 51 /* SAM Device Server Class */
51 52 stmf_status_t (*lu_task_alloc)(struct scsi_task *task);
52 53 void (*lu_new_task)(struct scsi_task *task,
53 54 struct stmf_data_buf *initial_dbuf);
54 55 void (*lu_dbuf_xfer_done)(struct scsi_task *task,
55 56 struct stmf_data_buf *dbuf);
56 57 /*
57 58 * If completion confirmation is not requested, status xfer done
58 59 * is called after the transport has confirmed that status has been
59 60 * sent. If completion confirmation is requested then the HBA will
60 61 * request a completion confirmation from the host and upon receiving
61 62 * the same, this entry point will be called.
62 63 */
63 64 void (*lu_send_status_done)(struct scsi_task *task);
64 65 void (*lu_task_free)(struct scsi_task *task);
65 66 stmf_status_t (*lu_abort)(struct stmf_lu *lu,
66 67 int abort_cmd, void *arg, uint32_t flags);
67 68 void (*lu_task_poll)(struct scsi_task *task);
68 69 void (*lu_ctl)(struct stmf_lu *lu, int cmd,
69 70 void *arg);
70 71 stmf_status_t (*lu_info)(uint32_t cmd, struct stmf_lu *lu,
71 72 void *arg, uint8_t *buf, uint32_t *bufsizep);
72 73 void (*lu_event_handler)(struct stmf_lu *lu,
73 74 int eventid, void *arg, uint32_t flags);
74 75 void *lu_proxy_reg_arg;
75 76 uint32_t lu_proxy_reg_arg_len;
76 77 void (*lu_dbuf_free)(struct scsi_task *task,
77 78 struct stmf_data_buf *dbuf);
78 79 } stmf_lu_t;
79 80
80 81 /*
81 82 * Abort cmd
82 83 */
83 84 #define STMF_LU_ABORT_TASK 1
84 85 #define STMF_LU_RESET_STATE 2
85 86 #define STMF_LU_ITL_HANDLE_REMOVED 3
86 87
87 88 /*
88 89 * Asymmetric access state
89 90 */
90 91 #define STMF_LU_ACTIVE 0
91 92 #define STMF_LU_STANDBY 1
92 93
93 94 /*
94 95 * proxy register msg types
95 96 */
96 97 #define STMF_MSG_LU_REGISTER 0
97 98 #define STMF_MSG_LU_ACTIVE 1
98 99 #define STMF_MSG_LU_DEREGISTER 2
99 100
100 101
101 102 #define STMF_PROXY_READ 1
102 103 #define STMF_PROXY_WRITE 2
103 104
104 105 /*
105 106 * Reasons for itl handle removal. Passed in flags.
106 107 */
107 108 #define STMF_ITL_REASON_MASK 0x0f
108 109 #define STMF_ITL_REASON_UNKNOWN 0x0
109 110 #define STMF_ITL_REASON_DEREG_REQUEST 0x1
110 111 #define STMF_ITL_REASON_USER_REQUEST 0x2
111 112 #define STMF_ITL_REASON_IT_NEXUS_LOSS 0x3
112 113
113 114 typedef struct stmf_lu_provider {
114 115 void *lp_stmf_private;
115 116 void *lp_private;
116 117
117 118 uint32_t lp_lpif_rev; /* Currently LPIF_REV_2 */
118 119 int lp_instance;
119 120 char *lp_name;
120 121 void (*lp_cb)(struct stmf_lu_provider *lp,
121 122 int cmd, void *arg, uint32_t flags);
122 123 uint8_t lp_alua_support;
123 124 stmf_status_t (*lp_proxy_msg)(uint8_t *luid,
|
↓ open down ↓ |
91 lines elided |
↑ open up ↑ |
124 125 void *proxy_reg_arg, uint32_t proxy_reg_arg_len, uint32_t type);
125 126 } stmf_lu_provider_t;
126 127
127 128 stmf_status_t stmf_deregister_lu_provider(stmf_lu_provider_t *lp);
128 129 stmf_status_t stmf_register_lu_provider(stmf_lu_provider_t *lp);
129 130 stmf_status_t stmf_register_lu(stmf_lu_t *lup);
130 131 stmf_status_t stmf_deregister_lu(stmf_lu_t *lup);
131 132 stmf_status_t stmf_set_lu_access(stmf_lu_t *lup, uint8_t access_state);
132 133 stmf_status_t stmf_proxy_scsi_cmd(scsi_task_t *, stmf_data_buf_t *dbuf);
133 134 int stmf_is_standby_port(scsi_task_t *);
134 -void stmf_lu_xfer_start(struct scsi_task *task);
135 -void stmf_lu_xfer_done(struct scsi_task *task, boolean_t read,
136 - uint64_t xfer_bytes, hrtime_t elapsed_time);
137 135
138 136 #ifdef __cplusplus
139 137 }
140 138 #endif
141 139
142 140 #endif /* _LPIF_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX