You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(19) |
Nov
(18) |
Dec
(34) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(14) |
Feb
(14) |
Mar
(3) |
Apr
(10) |
May
(10) |
Jun
(17) |
Jul
(15) |
Aug
(24) |
Sep
(24) |
Oct
(11) |
Nov
(13) |
Dec
(15) |
2008 |
Jan
(10) |
Feb
(46) |
Mar
(20) |
Apr
(42) |
May
(44) |
Jun
(22) |
Jul
(59) |
Aug
(8) |
Sep
(15) |
Oct
(52) |
Nov
(30) |
Dec
(38) |
2009 |
Jan
(27) |
Feb
(27) |
Mar
(47) |
Apr
(85) |
May
(74) |
Jun
(41) |
Jul
(70) |
Aug
(64) |
Sep
(97) |
Oct
(147) |
Nov
(67) |
Dec
(48) |
2010 |
Jan
(68) |
Feb
(33) |
Mar
(53) |
Apr
(98) |
May
(55) |
Jun
(71) |
Jul
(99) |
Aug
(132) |
Sep
(291) |
Oct
(220) |
Nov
(344) |
Dec
(300) |
2011 |
Jan
(57) |
Feb
(25) |
Mar
(59) |
Apr
(104) |
May
(60) |
Jun
(155) |
Jul
(143) |
Aug
(43) |
Sep
(53) |
Oct
(20) |
Nov
(35) |
Dec
(103) |
2012 |
Jan
(62) |
Feb
(43) |
Mar
(29) |
Apr
(80) |
May
(75) |
Jun
(61) |
Jul
(52) |
Aug
(58) |
Sep
(33) |
Oct
(32) |
Nov
(69) |
Dec
(37) |
2013 |
Jan
(77) |
Feb
(28) |
Mar
(52) |
Apr
(18) |
May
(37) |
Jun
(21) |
Jul
(22) |
Aug
(55) |
Sep
(29) |
Oct
(74) |
Nov
(50) |
Dec
(44) |
2014 |
Jan
(77) |
Feb
(62) |
Mar
(81) |
Apr
(99) |
May
(59) |
Jun
(95) |
Jul
(55) |
Aug
(34) |
Sep
(78) |
Oct
(33) |
Nov
(48) |
Dec
(51) |
2015 |
Jan
(56) |
Feb
(120) |
Mar
(37) |
Apr
(15) |
May
(22) |
Jun
(196) |
Jul
(54) |
Aug
(33) |
Sep
(32) |
Oct
(42) |
Nov
(149) |
Dec
(61) |
2016 |
Jan
(15) |
Feb
(26) |
Mar
(37) |
Apr
(27) |
May
(14) |
Jun
(11) |
Jul
(13) |
Aug
(64) |
Sep
(2) |
Oct
(36) |
Nov
(18) |
Dec
(46) |
2017 |
Jan
(6) |
Feb
(1) |
Mar
(2) |
Apr
(50) |
May
(42) |
Jun
(11) |
Jul
(4) |
Aug
(12) |
Sep
(11) |
Oct
(21) |
Nov
(15) |
Dec
(42) |
2018 |
Jan
(33) |
Feb
(27) |
Mar
(20) |
Apr
(5) |
May
(4) |
Jun
(1) |
Jul
(42) |
Aug
(29) |
Sep
(11) |
Oct
(40) |
Nov
(312) |
Dec
(18) |
2019 |
Jan
(44) |
Feb
(98) |
Mar
(125) |
Apr
(160) |
May
(123) |
Jun
(33) |
Jul
(56) |
Aug
(81) |
Sep
(24) |
Oct
(23) |
Nov
(52) |
Dec
(86) |
2020 |
Jan
(6) |
Feb
(17) |
Mar
(62) |
Apr
(21) |
May
(118) |
Jun
(42) |
Jul
(52) |
Aug
(62) |
Sep
(20) |
Oct
(5) |
Nov
(23) |
Dec
(111) |
2021 |
Jan
(31) |
Feb
(8) |
Mar
(26) |
Apr
(13) |
May
(54) |
Jun
(31) |
Jul
(17) |
Aug
(10) |
Sep
(83) |
Oct
(8) |
Nov
(21) |
Dec
(33) |
2022 |
Jan
(67) |
Feb
(11) |
Mar
(4) |
Apr
(46) |
May
(12) |
Jun
(17) |
Jul
(19) |
Aug
(7) |
Sep
(53) |
Oct
(14) |
Nov
(29) |
Dec
(22) |
2023 |
Jan
(20) |
Feb
(4) |
Mar
(37) |
Apr
(25) |
May
(15) |
Jun
(20) |
Jul
(38) |
Aug
(1) |
Sep
(1) |
Oct
(34) |
Nov
|
Dec
(8) |
2024 |
Jan
(15) |
Feb
(10) |
Mar
|
Apr
(4) |
May
(23) |
Jun
|
Jul
(8) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Gleb C. <lna...@ya...> - 2024-08-19 14:13:26
|
Commit: aa086c9 GitHub URL: https://github.com/SCST-project/scst/commit/aa086c9fb39bc608bacec2d2b656e65713cdae85 Author: Brian M Date: 2024-08-19T17:13:00+03:00 Log Message: ----------- iscsi-scst: Add internal_portal parameter Add an internal_portal parameter to allow specified portals to bypass CHAP controls for both discovery and target login. If not populated, then the current behavior will be preserved. Modified Paths: -------------- iscsi-scst/README | 8 ++ iscsi-scst/usr/event.c | 65 +++++++++++++++ iscsi-scst/usr/iscsi_scstd.c | 3 + iscsi-scst/usr/iscsid.c | 30 ++++++- iscsi-scst/usr/iscsid.h | 1 + iscsi-scst/usr/param.h | 1 + 6 files changed, 107 insertions(+), 1 deletion(-) =================================================================== diff --git a/iscsi-scst/README b/iscsi-scst/README index 4a275b1..91ad191 100644 --- a/iscsi-scst/README +++ b/iscsi-scst/README @@ -200,6 +200,13 @@ is /sys/kernel/scst_tgt/targets/iscsi. It has the following entries: iSCSI-SCST attributes before it starts accepting new connections. 0 by default. + - internal_portal - May designate one or more existing portals as being + internal. This will eliminate the need to supply a CHAP user/secret + during discovery or target login to any targets configured on those + portals. This is particularly useful for internal targets used as + part of ALUA configuration. Multiple addresses may be supplied, + separated by space characters. Empty by default. + - link_local - if set, makes the response to an IPv6 SendTargets include any link local addresses. Default is set. @@ -552,6 +559,7 @@ both iSCSI-SCST targets will look like: | |-- IncomingUser | |-- OutgoingUser | |-- enabled +| |-- internal_portal | |-- iSNSServer | |-- iqn.2006-10.net.vlnb:tgt | | |-- DataDigest diff --git a/iscsi-scst/usr/event.c b/iscsi-scst/usr/event.c index a65a183..b2178ae 100644 --- a/iscsi-scst/usr/event.c +++ b/iscsi-scst/usr/event.c @@ -654,6 +654,18 @@ static int handle_e_get_attr_value(int fd, const struct iscsi_kern_event *event) snprintf(res_str, sizeof(res_str), "%d\n", send_targets_link_local); if (send_targets_link_local != DEFAULT_SEND_TARGETS_LINK_LOCAL) add_key_mark(res_str, sizeof(res_str), 0); + } else if (strcasecmp(ISCSI_INTERNAL_PORTAL_ATTR_NAME, pp) == 0) { + if (target != NULL) { + log_error("Not NULL target %s for global attribute %s", + target->name, pp); + res = -EINVAL; + goto out_free; + } + if (internal_portal) { + snprintf(res_str, sizeof(res_str), "%s\n", internal_portal); + add_key_mark(res_str, sizeof(res_str), 0); + } else + snprintf(res_str, sizeof(res_str), "\n"); } else { log_error("Unknown attribute %s", pp); res = -EINVAL; @@ -669,6 +681,14 @@ out: return res; } +static bool is_addr(char *addr) +{ + struct in_addr ia; + struct in6_addr ia6; + + return (inet_pton(AF_INET, addr, &ia) == 1) || inet_pton(AF_INET6, addr, &ia6); +} + static int handle_target_redirect(struct target *target, char *p) { int res = 0; @@ -1094,6 +1114,51 @@ static int handle_e_set_attr_value(int fd, const struct iscsi_kern_event *event) res = -EINVAL; goto out_free; } + } else if (strcasecmp(ISCSI_INTERNAL_PORTAL_ATTR_NAME, pp) == 0) { + if (target != NULL) { + log_error("Not NULL target %s for global attribute %s", + target->name, pp); + res = -EINVAL; + goto out_free; + } + p = config_strip_string(p); + if (!p || *p == '\0') { + free(internal_portal); + internal_portal = NULL; + } else { + /* We have been provided with a string, check the contents. */ + if (strchr(p, ' ')) { + char *portals = strdup(p); + char *portal; + + if (!portals) { + log_error("Memory error (internal_portal)"); + res = -ENOMEM; + goto out_free; + } + + portal = strtok(portals, " "); + while (portal != NULL) { + if (!is_addr(portal)) { + free(portals); + log_error("Invalid address supplied %s", portal); + res = -EINVAL; + goto out_free; + } + portal = strtok(NULL, " "); + } + free(portals); + } else { + /* No spaces */ + if (!is_addr(p)) { + log_error("Invalid address supplied %s", p); + res = -EINVAL; + goto out_free; + } + } + free(internal_portal); + internal_portal = strdup(p); + } } else { log_error("Unknown attribute %s", pp); res = -EINVAL; diff --git a/iscsi-scst/usr/iscsi_scstd.c b/iscsi-scst/usr/iscsi_scstd.c index 97b9143..60b8309 100644 --- a/iscsi-scst/usr/iscsi_scstd.c +++ b/iscsi-scst/usr/iscsi_scstd.c @@ -962,6 +962,9 @@ int main(int argc, char **argv) if (err != 0) exit(err); err = kernel_attr_add(NULL, ISCSI_LINK_LOCAL_ATTR_NAME, 0644, 0); + if (err != 0) + exit(err); + err = kernel_attr_add(NULL, ISCSI_INTERNAL_PORTAL_ATTR_NAME, 0644, 0); if (err != 0) exit(err); diff --git a/iscsi-scst/usr/iscsid.c b/iscsi-scst/usr/iscsid.c index 1ef94ce..d32b672 100644 --- a/iscsi-scst/usr/iscsid.c +++ b/iscsi-scst/usr/iscsid.c @@ -27,6 +27,7 @@ #include "iscsid.h" int iscsi_enabled; +char *internal_portal; static u32 ttt; @@ -1011,6 +1012,32 @@ static int cmnd_exec_auth(struct connection *conn) return res; } +static bool on_internal_portal(struct connection *conn) +{ + if (!internal_portal) + return false; + + if (strchr(internal_portal, ' ')) { + char *portals = strdup(internal_portal); + + if (portals) { + char *portal = strtok(portals, " "); + + while (portal != NULL) { + if (!strcmp(portal, conn->target_portal)) { + free(portals); + return true; + } + portal = strtok(NULL, " "); + } + free(portals); + } + return false; + } else { + return !strcmp(internal_portal, conn->target_portal); + } +} + static void cmnd_exec_login(struct connection *conn) { struct iscsi_login_req_hdr *req = (struct iscsi_login_req_hdr *)&conn->req.bhs; @@ -1083,7 +1110,8 @@ static void cmnd_exec_login(struct connection *conn) login_start(conn); if (rsp->status_class) return; - if (!accounts_empty(conn->tid, ISCSI_USER_DIR_INCOMING)) + if (!accounts_empty(conn->tid, ISCSI_USER_DIR_INCOMING) && + !on_internal_portal(conn)) goto auth_err; if (rsp->status_class) return; diff --git a/iscsi-scst/usr/iscsid.h b/iscsi-scst/usr/iscsid.h index e68f67d..b3beb3a 100644 --- a/iscsi-scst/usr/iscsid.h +++ b/iscsi-scst/usr/iscsid.h @@ -265,6 +265,7 @@ extern const char *get_error_str(int error); /* iscsid.c */ extern int iscsi_enabled; +extern char *internal_portal; extern int cmnd_execute(struct connection *conn); extern void cmnd_finish(struct connection *conn); diff --git a/iscsi-scst/usr/param.h b/iscsi-scst/usr/param.h index 9c9c62a..e936c25 100644 --- a/iscsi-scst/usr/param.h +++ b/iscsi-scst/usr/param.h @@ -21,6 +21,7 @@ #define ISCSI_ENABLED_ATTR_NAME "enabled" #define ISCSI_ISNS_ENTITY_ATTR_NAME "isns_entity_name" #define ISCSI_ALLOWED_PORTAL_ATTR_NAME "allowed_portal" +#define ISCSI_INTERNAL_PORTAL_ATTR_NAME "internal_portal" #define ISCSI_PER_PORTAL_ACL_ATTR_NAME "per_portal_acl" #define ISCSI_TARGET_REDIRECTION_ATTR_NAME "redirect" #define ISCSI_TARGET_REDIRECTION_VALUE_TEMP "temp" |
From: Gleb C. <lna...@ya...> - 2024-08-19 08:11:01
|
Commit: 0b00e0a GitHub URL: https://github.com/SCST-project/scst/commit/0b00e0af96674a9942021ebabfabadfc370b3e04 Author: Gleb Chesnokov Date: 2024-08-19T11:10:34+03:00 Log Message: ----------- scst_lib: Fix VPD inquiry handling on incorrect LUNs When SCST receives an INQUIRY request for an incorrect LUN, it calls scst_set_lun_not_supported_inquiry(), which returns an inquiry buffer with a peripheral qualifier of 011b and a peripheral device type of 1Fh. However, for a VPD inquiry, it is unable to populate the remaining fields. According to SPC-6, if the device server cannot return the requested data, it should terminate with CHECK CONDITION. Reported-by: Lev Vainblat <le...@za...> Modified Paths: -------------- scst/src/scst_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) =================================================================== diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index ba776be..c9d60c7 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -2094,7 +2094,7 @@ int scst_set_cmd_error(struct scst_cmd *cmd, int key, int asc, int ascq) if (cmd->cdb[0] == REQUEST_SENSE) res = scst_set_lun_not_supported_request_sense(cmd, key, asc, ascq); - else if (cmd->cdb[0] == INQUIRY) + else if (cmd->cdb[0] == INQUIRY && !(cmd->cdb[1] & 0x01/*EVPD*/)) res = scst_set_lun_not_supported_inquiry(cmd); else if (cmd->cdb[0] == REPORT_LUNS) res = scst_set_lun_not_supported_report_luns(cmd); |
From: Gleb C. <lna...@ya...> - 2024-07-15 12:20:45
|
Commit: 7117490 GitHub URL: https://github.com/SCST-project/scst/commit/71174909108626f248c9eda2cb2037e00fcc97ff Author: Gleb Chesnokov Date: 2024-07-15T15:18:16+03:00 Log Message: ----------- nightly build: Update kernel versions Another kernel versions update. Modified Paths: -------------- .github/workflows/run_regression_tests.yaml | 17 ++++++++------- nightly/conf/nightly.conf | 17 ++++++++------- 2 files changed, 18 insertions(+), 16 deletions(-) =================================================================== diff --git a/.github/workflows/run_regression_tests.yaml b/.github/workflows/run_regression_tests.yaml index b63b2ec..13ac3e2 100644 --- a/.github/workflows/run_regression_tests.yaml +++ b/.github/workflows/run_regression_tests.yaml @@ -14,15 +14,16 @@ jobs: fail-fast: false matrix: version: [ - '6.9', - '6.8.9', + '6.10', + '6.9.9', + '6.8.12', '6.7.12', - '6.6.30', - '6.1.90', - '5.15.158', - '5.10.216', - '5.4.275', - '4.19.313', + '6.6.40', + '6.1.99', + '5.15.162', + '5.10.221', + '5.4.279', + '4.19.317', '4.14.336', '4.9.337', '3.18.140', diff --git a/nightly/conf/nightly.conf b/nightly/conf/nightly.conf index e31dd09..9e9dce2 100644 --- a/nightly/conf/nightly.conf +++ b/nightly/conf/nightly.conf @@ -3,38 +3,39 @@ ABT_DETAILS="x86_64" ABT_JOBS=5 ABT_KERNELS=" \ -6.9 \ -6.8.9-nc \ +6.10 \ +6.9.9-nc \ +6.8.12-nc \ 6.7.12-nc \ -6.6.30-nc \ +6.6.40-nc \ 6.5.13-nc \ 6.4.16-nc \ 6.3.13-nc \ 6.2.16-nc \ -6.1.90-nc \ +6.1.99-nc \ 6.0.19-nc \ 5.19.17-nc \ 5.18.19-nc \ 5.17.15-nc \ 5.16.20-nc \ -5.15.158-nc \ +5.15.162-nc \ 5.14.21-nc \ 5.13.19-nc \ 5.12.19-nc \ 5.11.22-nc \ -5.10.216-nc \ +5.10.221-nc \ 5.9.16-nc \ 5.8.18-nc \ 5.7.19-nc \ 5.6.19-nc \ 5.5.19-nc \ -5.4.275-nc \ +5.4.279-nc \ 5.3.18-nc \ 5.2.21-nc \ 5.1.21-nc \ 5.0.21-nc \ 4.20.17-nc \ -4.19.313-nc \ +4.19.317-nc \ 4.18.20-nc \ 4.17.19-nc \ 4.16.18-nc \ |
From: Gleb C. <lna...@ya...> - 2024-07-15 12:18:46
|
Commit: faa8f46 GitHub URL: https://github.com/SCST-project/scst/commit/faa8f460d7b7b5206d2c34e5d901a378d73f689f Author: Gleb Chesnokov Date: 2024-07-15T15:18:16+03:00 Log Message: ----------- scst_local, qla2x00t-32gbit: Improve Linux kernel 6.10 porting Fix compilation warnings, errors. Modified Paths: -------------- qla2x00t-32gbit/include/trace/events/qla.h | 15 +++++++++++++++ scst_local/scst_local.c | 9 +++++---- 2 files changed, 20 insertions(+), 4 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/include/trace/events/qla.h b/qla2x00t-32gbit/include/trace/events/qla.h index e3b4700..8708519 100644 --- a/qla2x00t-32gbit/include/trace/events/qla.h +++ b/qla2x00t-32gbit/include/trace/events/qla.h @@ -2,6 +2,9 @@ #if !defined(_TRACE_QLA_H_) || defined(TRACE_HEADER_MULTI_READ) #define _TRACE_QLA_H_ +#ifndef INSIDE_KERNEL_TREE +#include <linux/version.h> +#endif #include <linux/tracepoint.h> #undef TRACE_SYSTEM @@ -22,11 +25,23 @@ DECLARE_EVENT_CLASS(qla_log_event, TP_STRUCT__entry( __string(buf, buf) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) __dynamic_array(char, msg, QLA_MSG_MAX) +#else + __vstring(msg, vaf->fmt, vaf->va) +#endif ), TP_fast_assign( +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) __assign_str(buf, buf); +#else + __assign_str(buf); +#endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) vsnprintf(__get_str(msg), QLA_MSG_MAX, vaf->fmt, *vaf->va); +#else + __assign_vstr(msg, vaf->fmt, vaf->va); +#endif ), TP_printk("%s %s", __get_str(buf), __get_str(msg)) diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index 6cd11f7..0e0efed 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1033,6 +1033,7 @@ out: #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) static int scst_local_slave_alloc(struct scsi_device *sdev) { struct request_queue *q = sdev->request_queue; @@ -1048,17 +1049,16 @@ static int scst_local_slave_alloc(struct scsi_device *sdev) #endif #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) /* * vdisk_blockio requires that data buffers have block_size alignment * and supports block sizes from 512 up to 4096. See also * https://github.com/sahlberg/libiscsi/issues/302. */ blk_queue_dma_alignment(q, (4096 - 1)); -#endif return 0; } +#endif static int scst_local_slave_configure(struct scsi_device *sdev) { @@ -1381,10 +1381,11 @@ static const struct scsi_host_template scst_lcl_ini_driver_template = { .name = SCST_LOCAL_NAME, .queuecommand = scst_local_queuecommand, .change_queue_depth = scst_local_change_queue_depth, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) + .slave_alloc = scst_local_slave_alloc, +#else .dma_alignment = (4096 - 1), #endif - .slave_alloc = scst_local_slave_alloc, .slave_configure = scst_local_slave_configure, .eh_abort_handler = scst_local_abort, .eh_device_reset_handler = scst_local_device_reset, |
From: Gleb C. <lna...@ya...> - 2024-07-15 08:59:52
|
Commit: 40675cf GitHub URL: https://github.com/SCST-project/scst/commit/40675cf67d5f322344855c5161950bf920e37841 Author: Gleb Chesnokov Date: 2024-07-15T11:54:23+03:00 Log Message: ----------- qla2x00t-32gbit: Fix debugfs output for fw_resource_count DebugFS output for fw_resource_count shows: estimate exchange used[0] high water limit [1945] n estimate iocb2 used [0] high water limit [5141] estimate exchange2 used[0] high water limit [1945] Which shows incorrect display due to missing newline in seq_print(). [mkp: fix checkpatch warning about space before newline] Fixes: 5f63a163ed2f ("scsi: qla2xxx: Fix exchange oversubscription for management commands") Signed-off-by: Himanshu Madhani <him...@or...> Link: https://lore.kernel.org/r/202...@or... Signed-off-by: Martin K. Petersen <mar...@or...> [ commit 998d09c5ef61 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_dfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_dfs.c b/qla2x00t-32gbit/qla_dfs.c index a4715de..51e1d14 100644 --- a/qla2x00t-32gbit/qla_dfs.c +++ b/qla2x00t-32gbit/qla_dfs.c @@ -278,7 +278,7 @@ qla_dfs_fw_resource_cnt_show(struct seq_file *s, void *unused) seq_printf(s, "Driver: estimate iocb used [%d] high water limit [%d]\n", iocbs_used, ha->base_qpair->fwres.iocbs_limit); - seq_printf(s, "estimate exchange used[%d] high water limit [%d] n", + seq_printf(s, "estimate exchange used[%d] high water limit [%d]\n", exch_used, ha->base_qpair->fwres.exch_limit); if (ql2xenforce_iocb_limit == 2) { |
From: Gleb C. <lna...@ya...> - 2024-07-15 08:59:27
|
Commit: ceba304 GitHub URL: https://github.com/SCST-project/scst/commit/ceba304d08ccf034b8198552bc85d2c636961951 Author: Gleb Chesnokov Date: 2024-07-15T11:54:23+03:00 Log Message: ----------- qla2x00t-32gbit: Avoid possible run-time warning with long model_num The prior strlcpy() replacement of strncpy() here (which was later replaced with strscpy()) expected pinfo->model_num (and pinfo->model_description) to be NUL-terminated, but it is possible it was not, as the code pattern here shows vha->hw->model_number (and vha->hw->model_desc) being exactly 1 character larger, and the replaced strncpy() was copying only up to the size of the source character array. Replace this with memtostr(), which is the unambiguous way to convert a maybe not-NUL-terminated character array into a NUL-terminated string. Fixes: 527e9b704c3d ("scsi: qla2xxx: Use memcpy() and strlcpy() instead of strcpy() and strncpy()") Reviewed-by: Martin K. Petersen <mar...@or...> Link: https://lore.kernel.org/r/202...@ch... Signed-off-by: Kees Cook <kee...@ch...> [ commit c3408c4ae041 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_mr.c | 6 ++--- scst/include/backport.h | 19 +++++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_mr.c b/qla2x00t-32gbit/qla_mr.c index ba12fdc..08c5fa6 100644 --- a/qla2x00t-32gbit/qla_mr.c +++ b/qla2x00t-32gbit/qla_mr.c @@ -1919,10 +1919,8 @@ qlafx00_fx_disc(scsi_qla_host_t *vha, fc_port_t *fcport, uint16_t fx_type) if (fx_type == FXDISC_GET_CONFIG_INFO) { struct config_info_data *pinfo = (struct config_info_data *) fdisc->u.fxiocb.rsp_addr; - strscpy(vha->hw->model_number, pinfo->model_num, - ARRAY_SIZE(vha->hw->model_number)); - strscpy(vha->hw->model_desc, pinfo->model_description, - ARRAY_SIZE(vha->hw->model_desc)); + memtostr(vha->hw->model_number, pinfo->model_num); + memtostr(vha->hw->model_desc, pinfo->model_description); memcpy(&vha->hw->mr.symbolic_name, pinfo->symbolic_name, sizeof(vha->hw->mr.symbolic_name)); memcpy(&vha->hw->mr.serial_num, pinfo->serial_num, diff --git a/scst/include/backport.h b/scst/include/backport.h index 7967508..7c53e9d 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -1510,6 +1510,25 @@ static inline ssize_t strscpy(char *dest, const char *src, size_t count) } #endif +#ifndef memtostr +/* + * See also commit 0efc5990bca5 ("string.h: Introduce memtostr() and memtostr_pad()") # v6.10. + */ +#define memtostr(dest, src) do { \ + const size_t _dest_len = __builtin_object_size(dest, 1); \ + const size_t _src_len = __builtin_object_size(src, 1); \ + const size_t _src_chars = strnlen(src, _src_len); \ + const size_t _copy_len = min(_dest_len - 1, _src_chars); \ + \ + BUILD_BUG_ON(!__builtin_constant_p(_dest_len) || \ + !__builtin_constant_p(_src_len) || \ + _dest_len == 0 || _dest_len == (size_t)-1 || \ + _src_len == 0 || _src_len == (size_t)-1); \ + memcpy(dest, src, _copy_len); \ + dest[_copy_len] = '\0'; \ +} while (0) +#endif + /* <linux/sysfs.h> */ #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0) && \ |
From: Gleb C. <lna...@ya...> - 2024-07-15 08:54:49
|
Commit: d776e70 GitHub URL: https://github.com/SCST-project/scst/commit/d776e70d5c0ba87ca955a00fc346e3c9bf8ec5b3 Author: Gleb Chesnokov Date: 2024-07-15T11:54:23+03:00 Log Message: ----------- qla2x00t-32gbit: Drop driver owner assignment PCI core in pci_register_driver() already sets the .owner, so driver does not need to. Signed-off-by: Krzysztof Kozlowski <krz...@li...> Link: https://lore.kernel.org/r/202...@li... Signed-off-by: Martin K. Petersen <mar...@or...> [ commit 4e64bbba5352 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_os.c | 3 --- 1 file changed, 3 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index d0d3bae..6c6ff1e 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -8309,9 +8309,6 @@ MODULE_DEVICE_TABLE(pci, qla2xxx_pci_tbl); static struct pci_driver qla2xxx_pci_driver = { .name = QLA2XXX_DRIVER_NAME, - .driver = { - .owner = THIS_MODULE, - }, .id_table = qla2xxx_pci_tbl, .probe = qla2x00_probe_one, .remove = qla2x00_remove_one, |
From: Gleb C. <lna...@ya...> - 2024-07-08 10:48:06
|
Commit: c3bd33a GitHub URL: https://github.com/SCST-project/scst/commit/c3bd33a34f88180af97069db496590760d8c5030 Author: Gleb Chesnokov Date: 2024-07-08T13:45:29+03:00 Log Message: ----------- qla2x00t-32gbit, scst_local: Port to Linux kernel v6.10 Support for the following scsi layer changes in the Linux kernel v6.10: - 5b7dfbeff92a ("scsi: core: Add a dma_alignment field to the host and host template") Modified Paths: -------------- qla2x00t-32gbit/qla_os.c | 7 +++++++ scst_local/scst_local.c | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index 20742d2..d0d3bae 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -2002,8 +2002,10 @@ qla2xxx_slave_configure(struct scsi_device *sdev) scsi_qla_host_t *vha = shost_priv(sdev->host); struct req_que *req = vha->req; +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) if (IS_T10_PI_CAPABLE(vha->hw)) blk_queue_update_dma_alignment(sdev->request_queue, 0x7); +#endif #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) scsi_adjust_queue_depth(sdev, 0, req->max_q_depth); @@ -3637,6 +3639,11 @@ skip_dpc: QLA_SG_ALL : 128; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0) + if (IS_T10_PI_CAPABLE(base_vha->hw)) + host->dma_alignment = 0x7; +#endif + ret = scsi_add_host(host, &pdev->dev); if (ret) goto probe_failed; diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index a8bf14b..6cd11f7 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1048,12 +1048,14 @@ static int scst_local_slave_alloc(struct scsi_device *sdev) #endif #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) /* * vdisk_blockio requires that data buffers have block_size alignment * and supports block sizes from 512 up to 4096. See also * https://github.com/sahlberg/libiscsi/issues/302. */ - blk_queue_dma_alignment(q, 4095); + blk_queue_dma_alignment(q, (4096 - 1)); +#endif return 0; } @@ -1379,6 +1381,9 @@ static const struct scsi_host_template scst_lcl_ini_driver_template = { .name = SCST_LOCAL_NAME, .queuecommand = scst_local_queuecommand, .change_queue_depth = scst_local_change_queue_depth, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0) + .dma_alignment = (4096 - 1), +#endif .slave_alloc = scst_local_slave_alloc, .slave_configure = scst_local_slave_configure, .eh_abort_handler = scst_local_abort, |
From: Gleb C. <lna...@ya...> - 2024-07-08 10:47:52
|
Commit: 5f4eee5 GitHub URL: https://github.com/SCST-project/scst/commit/5f4eee5fc938a655710c18a9997dc5d780e46673 Author: Gleb Chesnokov Date: 2024-07-08T13:45:29+03:00 Log Message: ----------- scst_lib: use bdev_nr_bytes(bdev) instead of i_size_read(bdev->bd_inode) Use the helper to query the size of a block device in bytes. Modified Paths: -------------- scst/include/backport.h | 12 ++++++++++++ scst/src/scst_lib.c | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) =================================================================== diff --git a/scst/include/backport.h b/scst/include/backport.h index c540277..7967508 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -329,6 +329,18 @@ static inline void bdev_release_backport(struct bdev_handle *handle) #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) +/* + * See also commit 6436bd90f76e ("block: add a bdev_nr_bytes helper") # v5.16. + */ +static inline loff_t bdev_nr_bytes_backport(struct block_device *bdev) +{ + return i_size_read(bdev->bd_inode); +} + +#define bdev_nr_bytes bdev_nr_bytes_backport +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 0) && \ (!defined(RHEL_RELEASE_CODE) || \ RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1)) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 8823921..ba776be 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -6178,7 +6178,7 @@ loff_t scst_bdev_size(const char *path) if (rc) return rc; - res = i_size_read(bdev_desc.bdev->bd_inode); + res = bdev_nr_bytes(bdev_desc.bdev); scst_release_bdev(&bdev_desc); return res; |
From: Gleb C. <lna...@ya...> - 2024-07-08 10:47:46
|
Commit: ad35eef GitHub URL: https://github.com/SCST-project/scst/commit/ad35eef335594695064d7c1ddcb53274c2690fff Author: Gleb Chesnokov Date: 2024-07-08T13:45:29+03:00 Log Message: ----------- scst/include/backport.h: Port to Linux kernel v6.10 Support for the following fs layer changes in the Linux kernel v6.10: - 7c98f7cb8fda ("remove call_{read,write}_iter() functions") Modified Paths: -------------- scst/include/backport.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) =================================================================== diff --git a/scst/include/backport.h b/scst/include/backport.h index 97e46c9..c540277 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -553,10 +553,12 @@ typedef unsigned int __poll_t; #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) && \ - LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) + (LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) || \ + LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0)) /* * See also commit bb7462b6fd64 ("vfs: use helpers for calling - * f_op->{read,write}_iter()"). + * f_op->{read,write}_iter()") # v4.11. + * See also commit 7c98f7cb8fda ("remove call_{read,write}_iter() functions") # v6.10. */ static inline ssize_t call_read_iter(struct file *file, struct kiocb *kio, struct iov_iter *iter) |
From: Gleb C. <lna...@ya...> - 2024-05-17 09:36:27
|
Commit: aa2c925 GitHub URL: https://github.com/SCST-project/scst/commit/aa2c92542998261dea74d0d714a627f3ecad473f Author: Gleb Chesnokov Date: 2024-05-17T12:36:01+03:00 Log Message: ----------- nightly build: Update kernel versions Another kernel versions update. Modified Paths: -------------- .github/workflows/run_regression_tests.yaml | 16 ++++++++------- nightly/conf/nightly.conf | 15 +++++++------- 2 files changed, 17 insertions(+), 14 deletions(-) =================================================================== diff --git a/.github/workflows/run_regression_tests.yaml b/.github/workflows/run_regression_tests.yaml index 60f2580..b63b2ec 100644 --- a/.github/workflows/run_regression_tests.yaml +++ b/.github/workflows/run_regression_tests.yaml @@ -4,6 +4,7 @@ on: push: branches: - master + - nightly/update jobs: regression_tests: @@ -13,14 +14,15 @@ jobs: fail-fast: false matrix: version: [ - '6.8.7', + '6.9', + '6.8.9', '6.7.12', - '6.6.28', - '6.1.87', - '5.15.156', - '5.10.215', - '5.4.274', - '4.19.312', + '6.6.30', + '6.1.90', + '5.15.158', + '5.10.216', + '5.4.275', + '4.19.313', '4.14.336', '4.9.337', '3.18.140', diff --git a/nightly/conf/nightly.conf b/nightly/conf/nightly.conf index 841cf72..e31dd09 100644 --- a/nightly/conf/nightly.conf +++ b/nightly/conf/nightly.conf @@ -3,37 +3,38 @@ ABT_DETAILS="x86_64" ABT_JOBS=5 ABT_KERNELS=" \ -6.8.7 \ +6.9 \ +6.8.9-nc \ 6.7.12-nc \ -6.6.28-nc \ +6.6.30-nc \ 6.5.13-nc \ 6.4.16-nc \ 6.3.13-nc \ 6.2.16-nc \ -6.1.87-nc \ +6.1.90-nc \ 6.0.19-nc \ 5.19.17-nc \ 5.18.19-nc \ 5.17.15-nc \ 5.16.20-nc \ -5.15.156-nc \ +5.15.158-nc \ 5.14.21-nc \ 5.13.19-nc \ 5.12.19-nc \ 5.11.22-nc \ -5.10.215-nc \ +5.10.216-nc \ 5.9.16-nc \ 5.8.18-nc \ 5.7.19-nc \ 5.6.19-nc \ 5.5.19-nc \ -5.4.274-nc \ +5.4.275-nc \ 5.3.18-nc \ 5.2.21-nc \ 5.1.21-nc \ 5.0.21-nc \ 4.20.17-nc \ -4.19.312-nc \ +4.19.313-nc \ 4.18.20-nc \ 4.17.19-nc \ 4.16.18-nc \ |
From: Gleb C. <lna...@ya...> - 2024-05-03 14:45:38
|
Commit: 7c4e074 GitHub URL: https://github.com/SCST-project/scst/commit/7c4e07414afb990e52cc4f6afade215a98ec657a Author: Gleb Chesnokov Date: 2024-05-03T17:45:14+03:00 Log Message: ----------- .github/workflows: Add a GitHub action to run regression tests upon push Introduce a new GitHub action that automatically runs the scripts/run_regression_tests script upon each push to the master branch. Modified Paths: -------------- .github/workflows/run_regression_tests.yaml | 66 +++++++++++++++ scripts/kernel-functions | 5 ++ scripts/run-regression-tests | 4 +- 3 files changed, 73 insertions(+), 2 deletions(-) =================================================================== diff --git a/.github/workflows/run_regression_tests.yaml b/.github/workflows/run_regression_tests.yaml new file mode 100644 index 0000000..60f2580 --- /dev/null +++ b/.github/workflows/run_regression_tests.yaml @@ -0,0 +1,66 @@ +name: Regression tests upon push + +on: + push: + branches: + - master + +jobs: + regression_tests: + name: ${{matrix.version}} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + version: [ + '6.8.7', + '6.7.12', + '6.6.28', + '6.1.87', + '5.15.156', + '5.10.215', + '5.4.274', + '4.19.312', + '4.14.336', + '4.9.337', + '3.18.140', + '3.10.108', + '5.14.0-284.30.1.el9_2^AlmaLinux^9.2', + '4.18.0-513.24.1.el8_9^AlmaLinux^8.9', + '4.18.0-477.13.1.el8_8^AlmaLinux^8.8', + '3.10.0-1160.108.1.el7^CentOS^7.9.2009', + '5.15.0-205.149.5.1.el9uek^UEK^9', + '5.4.17-2136.330.7.1.el8uek^UEK^8', + '5.4.17-2102.206.1.el7uek^UEK^7', + '4.1.12-124.48.6.el6uek^UEK^6' + ] + steps: + - name: Checkout code + uses: actions/checkout@main + + - name: Install libelf-dev + run: | + sudo apt-get install -y libelf-dev + + - name: Install sparse + run: | + sudo apt-get install sparse + + - name: Install smatch + run: | + git clone https://github.com/error27/smatch.git + cd smatch + make -j + sudo BINDIR=/bin SHAREDIR=/home/runner/share make install + + - name: Run regression tests + run: | + err=0 + + ./scripts/run-regression-tests -l -q -k -d /tmp/scst-${{matrix.version}} ${{matrix.version}}-nc-ns-nm | tee output.txt + + cat output.txt | grep -A1 "Compiling the patched kernel" | grep -e "FAILED" -e "[^0] errors" > /dev/null 2>&1 && err=1 + + rm -f output.txt + + exit $err diff --git a/scripts/kernel-functions b/scripts/kernel-functions index 336baf8..21d904e 100644 --- a/scripts/kernel-functions +++ b/scripts/kernel-functions @@ -60,7 +60,9 @@ function download_kernel { [12].*) series="${series:0:3}";; *) series="${series/.*/}.x";; esac + mkdir -p "${kernel_downloads}" || return $? + test -w "${kernel_downloads}" || return $? ( cd "${kernel_downloads}" || return $? @@ -826,6 +828,9 @@ function download_and_extract_distro_rpm { local kver=$1 local distro=$2 local release=$3 + + mkdir -p "${kernel_downloads}" || return $? + ( cd "${kernel_downloads}" || exit $? read -a urls -r <<<"$(get_srpm_urls "$distro" "$release" x86_64 | diff --git a/scripts/run-regression-tests b/scripts/run-regression-tests index 764e9d7..4d761f1 100755 --- a/scripts/run-regression-tests +++ b/scripts/run-regression-tests @@ -466,9 +466,9 @@ function run_smatch { then local errors warnings errors=$(grep -c ' error:' "${outputfile}") - warnings=$(grep -c ' warning:' "${outputfile}") + warnings=$(grep -c ' warn:' "${outputfile}") echo "${errors} errors / ${warnings} warnings." - grep -E ' info:| warning:| error:' < "${outputfile}" | + grep -E ' info:| warn:| error:' < "${outputfile}" | sed 's/^\([^:]*\):[0-9:]* /\1: /;s/\((see line \)[0-9]*\()\)/\1...\2/' | sort | uniq -c |
From: Gleb C. <lna...@ya...> - 2024-05-03 09:54:23
|
Commit: 3e0408f GitHub URL: https://github.com/SCST-project/scst/commit/3e0408fca6e91e6bc4867c9103c12642c2eaf4b6 Author: Gleb Chesnokov Date: 2024-05-03T12:50:49+03:00 Log Message: ----------- qla2x00t-32gbit: Fix off by one in qla_edif_app_getstats() The app_reply->elem[] array is allocated earlier in this function and it has app_req.num_ports elements. Thus this > comparison needs to be >= to prevent memory corruption. Fixes: 7878f22a2e03 ("scsi: qla2xxx: edif: Add getfcinfo and statistic bsgs") Signed-off-by: Dan Carpenter <dan...@li...> Link: https://lore.kernel.org/r/5c1...@mo...untain Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit 4406e4176f47 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_edif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_edif.c b/qla2x00t-32gbit/qla_edif.c index 96b45f6..1ce6c82 100644 --- a/qla2x00t-32gbit/qla_edif.c +++ b/qla2x00t-32gbit/qla_edif.c @@ -1101,7 +1101,7 @@ qla_edif_app_getstats(scsi_qla_host_t *vha, BSG_JOB_TYPE *bsg_job) list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) { if (fcport->edif.enable) { - if (pcnt > app_req.num_ports) + if (pcnt >= app_req.num_ports) break; app_reply->elem[pcnt].rekey_count = |
From: Gleb C. <lna...@ya...> - 2024-05-03 09:54:12
|
Commit: 6c6f675 GitHub URL: https://github.com/SCST-project/scst/commit/6c6f6759a6c4d0516231adc7ef965eb63405fb47 Author: Gleb Chesnokov Date: 2024-05-03T12:50:49+03:00 Log Message: ----------- qla2x00t-32gbit: Update version to 10.02.09.200-k Signed-off-by: Nilesh Javali <nj...@ma...> Link: https://lore.kernel.org/r/202...@ma... Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit b8260ca37930 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_version.h b/qla2x00t-32gbit/qla_version.h index d903563..7627fd8 100644 --- a/qla2x00t-32gbit/qla_version.h +++ b/qla2x00t-32gbit/qla_version.h @@ -6,9 +6,9 @@ /* * Driver version */ -#define QLA2XXX_VERSION "10.02.09.100-k" +#define QLA2XXX_VERSION "10.02.09.200-k" #define QLA_DRIVER_MAJOR_VER 10 #define QLA_DRIVER_MINOR_VER 2 #define QLA_DRIVER_PATCH_VER 9 -#define QLA_DRIVER_BETA_VER 100 +#define QLA_DRIVER_BETA_VER 200 |
From: Gleb C. <lna...@ya...> - 2024-05-03 09:53:57
|
Commit: f8f70db GitHub URL: https://github.com/SCST-project/scst/commit/f8f70db99be0698cd2e868caa3777291c54137f0 Author: Gleb Chesnokov Date: 2024-05-03T12:50:49+03:00 Log Message: ----------- qla2x00t-32gbit: Delay I/O Abort on PCI error Currently when PCI error is detected, I/O is aborted manually through the ABORT IOCB mechanism which is not guaranteed to succeed. Instead, wait for the OS or system to notify driver to wind down I/O through the pci_error_handlers api. Set eeh_busy flag to pause all traffic and wait for I/O to drain. Cc: st...@vg... Signed-off-by: Quinn Tran <qu...@ma...> Signed-off-by: Nilesh Javali <nj...@ma...> Link: https://lore.kernel.org/r/202...@ma... Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit 591c1fdf2016 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_attr.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_attr.c b/qla2x00t-32gbit/qla_attr.c index c35bddd..ed07226 100644 --- a/qla2x00t-32gbit/qla_attr.c +++ b/qla2x00t-32gbit/qla_attr.c @@ -2812,7 +2812,13 @@ qla2x00_dev_loss_tmo_callbk(struct fc_rport *rport) return; if (unlikely(pci_channel_offline(fcport->vha->hw->pdev))) { - qla2x00_abort_all_cmds(fcport->vha, DID_NO_CONNECT << 16); + /* Will wait for wind down of adapter */ + ql_dbg(ql_dbg_aer, fcport->vha, 0x900c, + "%s pci offline detected (id %06x)\n", __func__, + fcport->d_id.b24); + qla_pci_set_eeh_busy(fcport->vha); + qla2x00_eh_wait_for_pending_commands(fcport->vha, fcport->d_id.b24, + 0, WAIT_TARGET); return; } } @@ -2834,7 +2840,11 @@ qla2x00_terminate_rport_io(struct fc_rport *rport) vha = fcport->vha; if (unlikely(pci_channel_offline(fcport->vha->hw->pdev))) { - qla2x00_abort_all_cmds(fcport->vha, DID_NO_CONNECT << 16); + /* Will wait for wind down of adapter */ + ql_dbg(ql_dbg_aer, fcport->vha, 0x900b, + "%s pci offline detected (id %06x)\n", __func__, + fcport->d_id.b24); + qla_pci_set_eeh_busy(vha); qla2x00_eh_wait_for_pending_commands(fcport->vha, fcport->d_id.b24, 0, WAIT_TARGET); return; |
From: Gleb C. <lna...@ya...> - 2024-05-03 09:53:37
|
Commit: b7481e8 GitHub URL: https://github.com/SCST-project/scst/commit/b7481e82ef5b97c7418839338a1d210b577d212b Author: Gleb Chesnokov Date: 2024-05-03T12:50:49+03:00 Log Message: ----------- qla2x00t-32gbit: Change debug message during driver unload Upon driver unload, purge_mbox flag is set and the heartbeat monitor thread detects this flag and does not send the mailbox command down to FW with a debug message "Error detected: purge[1] eeh[0] cmd=0x0, Exiting". This being not a real error, change the debug message. Cc: st...@vg... Signed-off-by: Saurav Kashyap <ska...@ma...> Signed-off-by: Nilesh Javali <nj...@ma...> Link: https://lore.kernel.org/r/202...@ma... Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit b5a30840727a upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_mbx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_mbx.c b/qla2x00t-32gbit/qla_mbx.c index 21ec32b..0cd6f3e 100644 --- a/qla2x00t-32gbit/qla_mbx.c +++ b/qla2x00t-32gbit/qla_mbx.c @@ -194,7 +194,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) if (ha->flags.purge_mbox || chip_reset != ha->chip_reset || ha->flags.eeh_busy) { ql_log(ql_log_warn, vha, 0xd035, - "Error detected: purge[%d] eeh[%d] cmd=0x%x, Exiting.\n", + "Purge mbox: purge[%d] eeh[%d] cmd=0x%x, Exiting.\n", ha->flags.purge_mbox, ha->flags.eeh_busy, mcp->mb[0]); rval = QLA_ABORTED; goto premature_exit; |
From: Gleb C. <lna...@ya...> - 2024-05-03 09:53:23
|
Commit: f9329cc GitHub URL: https://github.com/SCST-project/scst/commit/f9329cc7e65423b6ffcc5b06629aaa057c7d3468 Author: Gleb Chesnokov Date: 2024-05-03T12:50:49+03:00 Log Message: ----------- qla2x00t-32gbit: Fix double free of fcport The server was crashing after LOGO because fcport was getting freed twice. -----------[ cut here ]----------- kernel BUG at mm/slub.c:371! invalid opcode: 0000 1 SMP PTI CPU: 35 PID: 4610 Comm: bash Kdump: loaded Tainted: G OE --------- - - 4.18.0-425.3.1.el8.x86_64 #1 Hardware name: HPE ProLiant DL360 Gen10/ProLiant DL360 Gen10, BIOS U32 09/03/2021 RIP: 0010:set_freepointer.part.57+0x0/0x10 RSP: 0018:ffffb07107027d90 EFLAGS: 00010246 RAX: ffff9cb7e3150000 RBX: ffff9cb7e332b9c0 RCX: ffff9cb7e3150400 RDX: 0000000000001f37 RSI: 0000000000000000 RDI: ffff9cb7c0005500 RBP: fffff693448c5400 R08: 0000000080000000 R09: 0000000000000009 R10: 0000000000000000 R11: 0000000000132af0 R12: ffff9cb7c0005500 R13: ffff9cb7e3150000 R14: ffffffffc06990e0 R15: ffff9cb7ea85ea58 FS: 00007ff6b79c2740(0000) GS:ffff9cb8f7ec0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055b426b7d700 CR3: 0000000169c18002 CR4: 00000000007706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: kfree+0x238/0x250 qla2x00_els_dcmd_sp_free+0x20/0x230 [qla2xxx] ? qla24xx_els_dcmd_iocb+0x607/0x690 [qla2xxx] qla2x00_issue_logo+0x28c/0x2a0 [qla2xxx] ? qla2x00_issue_logo+0x28c/0x2a0 [qla2xxx] ? kernfs_fop_write+0x11e/0x1a0 Remove one of the free calls and add check for valid fcport. Also use function qla2x00_free_fcport() instead of kfree(). Cc: st...@vg... Signed-off-by: Saurav Kashyap <ska...@ma...> Signed-off-by: Nilesh Javali <nj...@ma...> Link: https://lore.kernel.org/r/202...@ma... Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit 82f522ae0d97 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_iocb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_iocb.c b/qla2x00t-32gbit/qla_iocb.c index a67123b..85c3b9a 100644 --- a/qla2x00t-32gbit/qla_iocb.c +++ b/qla2x00t-32gbit/qla_iocb.c @@ -2653,7 +2653,8 @@ static void qla2x00_els_dcmd_sp_free(srb_t *sp) { struct srb_iocb *elsio = &sp->u.iocb_cmd; - kfree(sp->fcport); + if (sp->fcport) + qla2x00_free_fcport(sp->fcport); if (elsio->u.els_logo.els_logo_pyld) dma_free_coherent(&sp->vha->hw->pdev->dev, DMA_POOL_SIZE, @@ -2766,6 +2767,7 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *vha, int els_opcode, if (!elsio->u.els_logo.els_logo_pyld) { /* ref: INIT */ kref_put(&sp->cmd_kref, qla2x00_sp_release); + qla2x00_free_fcport(fcport); return QLA_FUNCTION_FAILED; } @@ -2800,7 +2802,6 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *vha, int els_opcode, fcport->d_id.b.area, fcport->d_id.b.al_pa); wait_for_completion(&elsio->u.els_logo.comp); - qla2x00_free_fcport(fcport); /* ref: INIT */ kref_put(&sp->cmd_kref, qla2x00_sp_release); |
From: Gleb C. <lna...@ya...> - 2024-05-03 09:53:09
|
Commit: b0dd719 GitHub URL: https://github.com/SCST-project/scst/commit/b0dd719ad27a4361b743de940ef599250b050f1d Author: Gleb Chesnokov Date: 2024-05-03T12:50:49+03:00 Log Message: ----------- qla2x00t-32gbit: Fix double free of the ha->vp_map pointer Coverity scan reported potential risk of double free of the pointer ha->vp_map. ha->vp_map was freed in qla2x00_mem_alloc(), and again freed in function qla2x00_mem_free(ha). Assign NULL to vp_map and kfree take care of NULL. Cc: st...@vg... Signed-off-by: Saurav Kashyap <ska...@ma...> Signed-off-by: Nilesh Javali <nj...@ma...> Link: https://lore.kernel.org/r/202...@ma... Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit e288285d4778 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_os.c | 1 + 1 file changed, 1 insertion(+) =================================================================== diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index fdc91e7..20742d2 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -4673,6 +4673,7 @@ fail_free_init_cb: ha->init_cb_dma = 0; fail_free_vp_map: kfree(ha->vp_map); + ha->vp_map = NULL; fail: ql_log(ql_log_fatal, NULL, 0x0030, "Memory allocation failure.\n"); |
From: Gleb C. <lna...@ya...> - 2024-05-03 09:53:02
|
Commit: 5a325ea GitHub URL: https://github.com/SCST-project/scst/commit/5a325ea4a7be5426faa5c8dbafef02b1e3a5269a Author: Gleb Chesnokov Date: 2024-05-03T12:50:49+03:00 Log Message: ----------- qla2x00t-32gbit: Fix command flush on cable pull System crash due to command failed to flush back to SCSI layer. BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 PGD 0 P4D 0 Oops: 0000 [#1] SMP NOPTI CPU: 27 PID: 793455 Comm: kworker/u130:6 Kdump: loaded Tainted: G OE --------- - - 4.18.0-372.9.1.el8.x86_64 #1 Hardware name: HPE ProLiant DL360 Gen10/ProLiant DL360 Gen10, BIOS U32 09/03/2021 Workqueue: nvme-wq nvme_fc_connect_ctrl_work [nvme_fc] RIP: 0010:__wake_up_common+0x4c/0x190 Code: 24 10 4d 85 c9 74 0a 41 f6 01 04 0f 85 9d 00 00 00 48 8b 43 08 48 83 c3 08 4c 8d 48 e8 49 8d 41 18 48 39 c3 0f 84 f0 00 00 00 <49> 8b 41 18 89 54 24 08 31 ed 4c 8d 70 e8 45 8b 29 41 f6 c5 04 75 RSP: 0018:ffff95f3e0cb7cd0 EFLAGS: 00010086 RAX: 0000000000000000 RBX: ffff8b08d3b26328 RCX: 0000000000000000 RDX: 0000000000000001 RSI: 0000000000000003 RDI: ffff8b08d3b26320 RBP: 0000000000000001 R08: 0000000000000000 R09: ffffffffffffffe8 R10: 0000000000000000 R11: ffff95f3e0cb7a60 R12: ffff95f3e0cb7d20 R13: 0000000000000003 R14: 0000000000000000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8b2fdf6c0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 0000002f1e410002 CR4: 00000000007706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: __wake_up_common_lock+0x7c/0xc0 qla_nvme_ls_req+0x355/0x4c0 [qla2xxx] qla2xxx [0000:12:00.1]-f084:3: qlt_free_session_done: se_sess 0000000000000000 / sess ffff8ae1407ca000 from port 21:32:00:02:ac:07:ee:b8 loop_id 0x02 s_id 01:02:00 logout 1 keep 0 els_logo 0 ? __nvme_fc_send_ls_req+0x260/0x380 [nvme_fc] qla2xxx [0000:12:00.1]-207d:3: FCPort 21:32:00:02:ac:07:ee:b8 state transitioned from ONLINE to LOST - portid=010200. ? nvme_fc_send_ls_req.constprop.42+0x1a/0x45 [nvme_fc] qla2xxx [0000:12:00.1]-2109:3: qla2x00_schedule_rport_del 21320002ac07eeb8. rport ffff8ae598122000 roles 1 ? nvme_fc_connect_ctrl_work.cold.63+0x1e3/0xa7d [nvme_fc] qla2xxx [0000:12:00.1]-f084:3: qlt_free_session_done: se_sess 0000000000000000 / sess ffff8ae14801e000 from port 21:32:01:02:ad:f7:ee:b8 loop_id 0x04 s_id 01:02:01 logout 1 keep 0 els_logo 0 ? __switch_to+0x10c/0x450 ? process_one_work+0x1a7/0x360 qla2xxx [0000:12:00.1]-207d:3: FCPort 21:32:01:02:ad:f7:ee:b8 state transitioned from ONLINE to LOST - portid=010201. ? worker_thread+0x1ce/0x390 ? create_worker+0x1a0/0x1a0 qla2xxx [0000:12:00.1]-2109:3: qla2x00_schedule_rport_del 21320102adf7eeb8. rport ffff8ae3b2312800 roles 70 ? kthread+0x10a/0x120 qla2xxx [0000:12:00.1]-2112:3: qla_nvme_unregister_remote_port: unregister remoteport on ffff8ae14801e000 21320102adf7eeb8 ? set_kthread_struct+0x40/0x40 qla2xxx [0000:12:00.1]-2110:3: remoteport_delete of ffff8ae14801e000 21320102adf7eeb8 completed. ? ret_from_fork+0x1f/0x40 qla2xxx [0000:12:00.1]-f086:3: qlt_free_session_done: waiting for sess ffff8ae14801e000 logout The system was under memory stress where driver was not able to allocate an SRB to carry out error recovery of cable pull. The failure to flush causes upper layer to start modifying scsi_cmnd. When the system frees up some memory, the subsequent cable pull trigger another command flush. At this point the driver access a null pointer when attempting to DMA unmap the SGL. Add a check to make sure commands are flush back on session tear down to prevent the null pointer access. Cc: st...@vg... Signed-off-by: Quinn Tran <qu...@ma...> Signed-off-by: Nilesh Javali <nj...@ma...> Link: https://lore.kernel.org/r/202...@ma... Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit a27d4d0e7de3 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_target.c | 10 ++++++++++ 1 file changed, 10 insertions(+) =================================================================== diff --git a/qla2x00t-32gbit/qla_target.c b/qla2x00t-32gbit/qla_target.c index 6ef76bd..48c4f86 100644 --- a/qla2x00t-32gbit/qla_target.c +++ b/qla2x00t-32gbit/qla_target.c @@ -1077,6 +1077,16 @@ void qlt_free_session_done(struct work_struct *work) "%s: sess %p logout completed\n", __func__, sess); } + /* check for any straggling io left behind */ + if (!(sess->flags & FCF_FCP2_DEVICE) && + qla2x00_eh_wait_for_pending_commands(sess->vha, sess->d_id.b24, 0, WAIT_TARGET)) { + ql_log(ql_log_warn, vha, 0x3027, + "IO not return. Resetting.\n"); + set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); + qla2xxx_wake_dpc(vha); + qla2x00_wait_for_chip_reset(vha); + } + if (sess->logo_ack_needed) { sess->logo_ack_needed = 0; qla24xx_async_notify_ack(vha, sess, |
From: Gleb C. <lna...@ya...> - 2024-05-03 09:52:56
|
Commit: 3fba8e4 GitHub URL: https://github.com/SCST-project/scst/commit/3fba8e48e1e76047b0d02ed3d74f8a83f5124c3b Author: Brian Meagher Date: 2024-05-03T12:52:30+03:00 Log Message: ----------- scst_lib: Allow REPORT LUNS to operate on an unsupported LUN Initiators will attempt to send LUN 0 INQUIRY and REPORT LUNS commands when connecting to a target. Add scst_set_lun_not_supported_report_luns to handle the case when REPORT LUNs is sent to an unsupported LUN. Also, in scst_set_lun_not_supported_inquiry report a valid vendor identification string to promote better initiator behavior. Modified Paths: -------------- scst/src/scst_lib.c | 143 +++++++++++++++ 1 file changed, 143 insertions(+) =================================================================== diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index bbb4c61..8823921 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -57,6 +57,9 @@ #include "scst_mem.h" #include "scst_pres.h" +/* 8 byte ASCII Vendor */ +#define SCST_NOLUN_VENDOR "SCST " + /* * List and IRQ lock to globally serialize all STPG commands. Needed to * prevent deadlock, if (1) a device group contains multiple devices and @@ -1919,6 +1922,10 @@ go: buf[2] = 6; /* Device complies to SPC-4 */ buf[4] = len - 4; + /* Set T10 Vendor identification */ + if (len >= 16) + memcpy(&(buf[8]), SCST_NOLUN_VENDOR, 8); + TRACE_BUFFER("INQUIRY for not supported LUN set", buf, len); cmd->data_direction = SCST_DATA_READ; @@ -1933,6 +1940,140 @@ out: return res; } +static int scst_set_lun_not_supported_report_luns(struct scst_cmd *cmd) +{ + uint8_t *buf; + int dev_cnt = 0; + struct scatterlist *sg; + struct scst_tgt_dev *tgt_dev = NULL; + int i, len; + int res = 0; + int offs, overflow = 0; + + TRACE_ENTRY(); + + if (cmd->status != 0) { + TRACE_MGMT_DBG("cmd %p already has status %x set", + cmd, cmd->status); + res = -EEXIST; + goto out; + } + + if ((cmd->cdb[2] != 0) && (cmd->cdb[2] != 2)) { + TRACE(TRACE_MINOR, + "Unsupported SELECT REPORT value %#x in REPORT LUNS command", + cmd->cdb[2]); + scst_set_invalid_field_in_cdb(cmd, 2, 0); + goto out; + } + + if (cmd->sg == NULL) { + if (cmd->bufflen == 0) { + int bufflen = get_unaligned_be32(&cmd->cdb[6]); + + cmd->bufflen = bufflen ? max_t(int, 8, bufflen) : 8; + } + + /* + * If target driver preparing data buffer using tgt_alloc_data_buf() + * callback, it is responsible to copy the sense to its buffer + * in xmit_response(). + */ + if (cmd->tgt_i_data_buf_alloced && (cmd->tgt_i_sg != NULL)) { + cmd->sg = cmd->tgt_i_sg; + cmd->sg_cnt = cmd->tgt_i_sg_cnt; + TRACE_MEM("Tgt used for REPORTS LUNS (not supported LUN): cmd %p", + cmd); + goto go; + } + + cmd->sg = scst_alloc_sg(cmd->bufflen, GFP_ATOMIC, &cmd->sg_cnt); + if (cmd->sg == NULL) { + PRINT_ERROR("Unable to alloc sg for REPORTS LUNS (not supported LUN)"); + res = 1; + goto out; + } + + TRACE_MEM( + "sg %p (cnt %d, len %d) allocated for REPORTS LUNS (not supported LUN): cmd %p", + cmd->sg, cmd->sg_cnt, cmd->bufflen, cmd); + } + +go: + sg = cmd->sg; + len = sg->length; + + TRACE_MEM("sg %p (len %d) for REPORTS LUNS for cmd %p", sg, len, cmd); + + buf = sg_virt(sg); + len = max_t(int, 8, len); + + memset(buf, 0, len); + offs = 8; + + rcu_read_lock(); + for (i = 0; i < SESS_TGT_DEV_LIST_HASH_SIZE; i++) { + struct list_head *head = &cmd->sess->sess_tgt_dev_list[i]; + + list_for_each_entry_rcu(tgt_dev, head, + sess_tgt_dev_list_entry) { + struct scst_tgt_dev_UA *ua; + + if (!overflow) { + if ((len - offs) < 8) { + overflow = 1; + goto inc_dev_cnt; + } + *(__force __be64 *)&buf[offs] + = scst_pack_lun(tgt_dev->lun, + cmd->sess->acg->addr_method); + offs += 8; + } +inc_dev_cnt: + dev_cnt++; + + /* Clear sense_reported_luns_data_changed UA. */ + spin_lock_bh(&tgt_dev->tgt_dev_lock); + list_for_each_entry(ua, &tgt_dev->UA_list, + UA_list_entry) { + if (scst_analyze_sense(ua->UA_sense_buffer, + ua->UA_valid_sense_len, + SCST_SENSE_ALL_VALID, + SCST_LOAD_SENSE(scst_sense_reported_luns_data_changed))) { + TRACE_DBG( + "Freeing not needed REPORTED LUNS DATA CHANGED UA %p", + ua); + scst_tgt_dev_del_free_UA(tgt_dev, ua); + break; + } + } + spin_unlock_bh(&tgt_dev->tgt_dev_lock); + } + } + rcu_read_unlock(); + + /* Set the response header */ + dev_cnt *= 8; + put_unaligned_be32(dev_cnt, buf); + + dev_cnt += 8; + if (dev_cnt < len) + len = dev_cnt; + + TRACE_BUFFER("REPORTS LUNS for not supported LUN set", buf, len); + + cmd->data_direction = SCST_DATA_READ; + scst_set_resp_data_len(cmd, len); + + cmd->completed = 1; + cmd->resid_possible = 1; + +out: + TRACE_EXIT_RES(res); + + return res; +} + /* * scst_set_cmd_error() - set error in the command and fill the sense buffer. * @@ -1955,6 +2096,8 @@ int scst_set_cmd_error(struct scst_cmd *cmd, int key, int asc, int ascq) key, asc, ascq); else if (cmd->cdb[0] == INQUIRY) res = scst_set_lun_not_supported_inquiry(cmd); + else if (cmd->cdb[0] == REPORT_LUNS) + res = scst_set_lun_not_supported_report_luns(cmd); else goto do_sense; |
From: Gleb C. <lna...@ya...> - 2024-05-03 09:52:47
|
Commit: 0929d81 GitHub URL: https://github.com/SCST-project/scst/commit/0929d8125f8d7f5656b7dca3acd02e3742de3e69 Author: Gleb Chesnokov Date: 2024-05-03T12:50:49+03:00 Log Message: ----------- qla2x00t-32gbit: NVME|FCP prefer flag not being honored Changing of [FCP|NVME] prefer flag in flash has no effect on driver. For device that supports both FCP + NVMe over the same connection, driver continues to connect to this device using the previous successful login mode. On completion of flash update, adapter will be reset. Driver will reset the prefer flag based on setting from flash. Cc: st...@vg... Signed-off-by: Quinn Tran <qu...@ma...> Signed-off-by: Nilesh Javali <nj...@ma...> Link: https://lore.kernel.org/r/202...@ma... Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit 69aecdd41010 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_init.c | 18 +++++++++++++++ 1 file changed, 18 insertions(+) =================================================================== diff --git a/qla2x00t-32gbit/qla_init.c b/qla2x00t-32gbit/qla_init.c index 0a15109..6a1af56 100644 --- a/qla2x00t-32gbit/qla_init.c +++ b/qla2x00t-32gbit/qla_init.c @@ -7504,6 +7504,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) struct scsi_qla_host *vp, *tvp; struct req_que *req = ha->req_q_map[0]; unsigned long flags; + fc_port_t *fcport; if (vha->flags.online) { qla2x00_abort_isp_cleanup(vha); @@ -7572,6 +7573,15 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) "ISP Abort - ISP reg disconnect post nvmram config, exiting.\n"); return status; } + + /* User may have updated [fcp|nvme] prefer in flash */ + list_for_each_entry(fcport, &vha->vp_fcports, list) { + if (NVME_PRIORITY(ha, fcport)) + fcport->do_prli_nvme = 1; + else + fcport->do_prli_nvme = 0; + } + if (!qla2x00_restart_isp(vha)) { clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); @@ -7642,6 +7652,14 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) atomic_inc(&vp->vref_count); spin_unlock_irqrestore(&ha->vport_slock, flags); + /* User may have updated [fcp|nvme] prefer in flash */ + list_for_each_entry(fcport, &vp->vp_fcports, list) { + if (NVME_PRIORITY(ha, fcport)) + fcport->do_prli_nvme = 1; + else + fcport->do_prli_nvme = 0; + } + qla2x00_vp_abort_isp(vp); spin_lock_irqsave(&ha->vport_slock, flags); |
From: Gleb C. <lna...@ya...> - 2024-05-03 09:52:25
|
Commit: 10c4006 GitHub URL: https://github.com/SCST-project/scst/commit/10c4006caacbbec0d70297cbb9302a6b6a72bf12 Author: Gleb Chesnokov Date: 2024-05-03T12:50:49+03:00 Log Message: ----------- qla2x00t-32gbit: Update manufacturer detail Update manufacturer detail from "Marvell Semiconductor, Inc." to "Marvell". Cc: st...@vg... Signed-off-by: Bikash Hazarika <bha...@ma...> Signed-off-by: Nilesh Javali <nj...@ma...> Link: https://lore.kernel.org/r/202...@ma... Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit 688fa069fda6 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_def.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_def.h b/qla2x00t-32gbit/qla_def.h index f009d2c..a777885 100644 --- a/qla2x00t-32gbit/qla_def.h +++ b/qla2x00t-32gbit/qla_def.h @@ -125,7 +125,7 @@ typedef union { #include "qla_nvme.h" #define QLA2XXX_DRIVER_NAME "qla2xxx" #define QLA2XXX_APIDEV "ql2xapidev" -#define QLA2XXX_MANUFACTURER "Marvell Semiconductor, Inc." +#define QLA2XXX_MANUFACTURER "Marvell" /* * We have MAILBOX_REGISTER_COUNT sized arrays in a few places, |
From: Gleb C. <lna...@ya...> - 2024-05-03 09:52:12
|
Commit: 869135e GitHub URL: https://github.com/SCST-project/scst/commit/869135ef83b30bdb8ed41c80ca3fa388f7ab43c1 Author: Gleb Chesnokov Date: 2024-05-03T12:50:49+03:00 Log Message: ----------- qla2x00t-32gbit: Split FCE|EFT trace control Current code combines the allocation of FCE|EFT trace buffers and enables the features all in 1 step. Split this step into separate steps in preparation for follow-on patch to allow user to have a choice to enable / disable FCE trace feature. Cc: st...@vg... Reported-by: kernel test robot <lk...@in...> Signed-off-by: Quinn Tran <qu...@ma...> Signed-off-by: Nilesh Javali <nj...@ma...> Link: https://lore.kernel.org/r/202...@ma... Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit 76a192e1a566 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_init.c | 102 ++++++--------- 1 file changed, 41 insertions(+), 61 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_init.c b/qla2x00t-32gbit/qla_init.c index d44fa5d..0a15109 100644 --- a/qla2x00t-32gbit/qla_init.c +++ b/qla2x00t-32gbit/qla_init.c @@ -2669,6 +2669,40 @@ exit: return rval; } +static void qla_enable_fce_trace(scsi_qla_host_t *vha) +{ + int rval; + struct qla_hw_data *ha = vha->hw; + + if (ha->fce) { + ha->flags.fce_enabled = 1; + memset(ha->fce, 0, fce_calc_size(ha->fce_bufs)); + rval = qla2x00_enable_fce_trace(vha, + ha->fce_dma, ha->fce_bufs, ha->fce_mb, &ha->fce_bufs); + + if (rval) { + ql_log(ql_log_warn, vha, 0x8033, + "Unable to reinitialize FCE (%d).\n", rval); + ha->flags.fce_enabled = 0; + } + } +} + +static void qla_enable_eft_trace(scsi_qla_host_t *vha) +{ + int rval; + struct qla_hw_data *ha = vha->hw; + + if (ha->eft) { + memset(ha->eft, 0, EFT_SIZE); + rval = qla2x00_enable_eft_trace(vha, ha->eft_dma, EFT_NUM_BUFFERS); + + if (rval) { + ql_log(ql_log_warn, vha, 0x8034, + "Unable to reinitialize EFT (%d).\n", rval); + } + } +} /* * qla2x00_initialize_adapter * Initialize board. @@ -3675,9 +3709,8 @@ qla24xx_chip_diag(scsi_qla_host_t *vha) } static void -qla2x00_init_fce_trace(scsi_qla_host_t *vha) +qla2x00_alloc_fce_trace(scsi_qla_host_t *vha) { - int rval; dma_addr_t tc_dma; void *tc; struct qla_hw_data *ha = vha->hw; @@ -3706,27 +3739,17 @@ qla2x00_init_fce_trace(scsi_qla_host_t *vha) return; } - rval = qla2x00_enable_fce_trace(vha, tc_dma, FCE_NUM_BUFFERS, - ha->fce_mb, &ha->fce_bufs); - if (rval) { - ql_log(ql_log_warn, vha, 0x00bf, - "Unable to initialize FCE (%d).\n", rval); - dma_free_coherent(&ha->pdev->dev, FCE_SIZE, tc, tc_dma); - return; - } - ql_dbg(ql_dbg_init, vha, 0x00c0, "Allocated (%d KB) for FCE...\n", FCE_SIZE / 1024); - ha->flags.fce_enabled = 1; ha->fce_dma = tc_dma; ha->fce = tc; + ha->fce_bufs = FCE_NUM_BUFFERS; } static void -qla2x00_init_eft_trace(scsi_qla_host_t *vha) +qla2x00_alloc_eft_trace(scsi_qla_host_t *vha) { - int rval; dma_addr_t tc_dma; void *tc; struct qla_hw_data *ha = vha->hw; @@ -3751,14 +3774,6 @@ qla2x00_init_eft_trace(scsi_qla_host_t *vha) return; } - rval = qla2x00_enable_eft_trace(vha, tc_dma, EFT_NUM_BUFFERS); - if (rval) { - ql_log(ql_log_warn, vha, 0x00c2, - "Unable to initialize EFT (%d).\n", rval); - dma_free_coherent(&ha->pdev->dev, EFT_SIZE, tc, tc_dma); - return; - } - ql_dbg(ql_dbg_init, vha, 0x00c3, "Allocated (%d KB) EFT ...\n", EFT_SIZE / 1024); @@ -3766,13 +3781,6 @@ qla2x00_init_eft_trace(scsi_qla_host_t *vha) ha->eft = tc; } -static void -qla2x00_alloc_offload_mem(scsi_qla_host_t *vha) -{ - qla2x00_init_fce_trace(vha); - qla2x00_init_eft_trace(vha); -} - void qla2x00_alloc_fw_dump(scsi_qla_host_t *vha) { @@ -3827,10 +3835,10 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha) if (ha->tgt.atio_ring) mq_size += ha->tgt.atio_q_length * sizeof(request_t); - qla2x00_init_fce_trace(vha); + qla2x00_alloc_fce_trace(vha); if (ha->fce) fce_size = sizeof(struct qla2xxx_fce_chain) + FCE_SIZE; - qla2x00_init_eft_trace(vha); + qla2x00_alloc_eft_trace(vha); if (ha->eft) eft_size = EFT_SIZE; } @@ -4260,7 +4268,6 @@ qla2x00_setup_chip(scsi_qla_host_t *vha) struct qla_hw_data *ha = vha->hw; struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; unsigned long flags; - uint16_t fw_major_version; int done_once = 0; if (IS_P3P_TYPE(ha)) { @@ -4327,7 +4334,6 @@ execute_fw_with_lr: goto failed; enable_82xx_npiv: - fw_major_version = ha->fw_major_version; if (IS_P3P_TYPE(ha)) qla82xx_check_md_needed(vha); else @@ -4356,12 +4362,11 @@ enable_82xx_npiv: if (rval != QLA_SUCCESS) goto failed; - if (!fw_major_version && !(IS_P3P_TYPE(ha))) - qla2x00_alloc_offload_mem(vha); - if (ql2xallocfwdump && !(IS_P3P_TYPE(ha))) qla2x00_alloc_fw_dump(vha); + qla_enable_fce_trace(vha); + qla_enable_eft_trace(vha); } else { goto failed; } @@ -7494,7 +7499,6 @@ qla2x00_abort_isp_cleanup(scsi_qla_host_t *vha) int qla2x00_abort_isp(scsi_qla_host_t *vha) { - int rval; uint8_t status = 0; struct qla_hw_data *ha = vha->hw; struct scsi_qla_host *vp, *tvp; @@ -7588,31 +7592,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) if (IS_QLA81XX(ha) || IS_QLA8031(ha)) qla2x00_get_fw_version(vha); - if (ha->fce) { - ha->flags.fce_enabled = 1; - memset(ha->fce, 0, - fce_calc_size(ha->fce_bufs)); - rval = qla2x00_enable_fce_trace(vha, - ha->fce_dma, ha->fce_bufs, ha->fce_mb, - &ha->fce_bufs); - if (rval) { - ql_log(ql_log_warn, vha, 0x8033, - "Unable to reinitialize FCE " - "(%d).\n", rval); - ha->flags.fce_enabled = 0; - } - } - if (ha->eft) { - memset(ha->eft, 0, EFT_SIZE); - rval = qla2x00_enable_eft_trace(vha, - ha->eft_dma, EFT_NUM_BUFFERS); - if (rval) { - ql_log(ql_log_warn, vha, 0x8034, - "Unable to reinitialize EFT " - "(%d).\n", rval); - } - } } else { /* failed the ISP abort */ vha->flags.online = 1; if (test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) { |
From: Gleb C. <lna...@ya...> - 2024-05-03 09:51:56
|
Commit: f91f314 GitHub URL: https://github.com/SCST-project/scst/commit/f91f314b3a5ce1699776ccdd247dd068add5fb65 Author: Gleb Chesnokov Date: 2024-05-03T12:50:49+03:00 Log Message: ----------- qla2x00t-32gbit: Fix N2N stuck connection Disk failed to rediscover after chip reset error injection. The chip reset happens at the time when a PLOGI is being sent. This causes a flag to be left on which blocks the retry. Clear the blocking flag. Cc: st...@vg... Signed-off-by: Quinn Tran <qu...@ma...> Signed-off-by: Nilesh Javali <nj...@ma...> Link: https://lore.kernel.org/r/202...@ma... Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit 881eb861ca38 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_gbl.h | 2 +- qla2x00t-32gbit/qla_iocb.c | 32 +++++---------- qla2x00t-32gbit/qla_os.c | 2 +- 3 files changed, 13 insertions(+), 23 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_gbl.h b/qla2x00t-32gbit/qla_gbl.h index ea684de..355c64a 100644 --- a/qla2x00t-32gbit/qla_gbl.h +++ b/qla2x00t-32gbit/qla_gbl.h @@ -44,7 +44,7 @@ extern int qla2x00_fabric_login(scsi_qla_host_t *, fc_port_t *, uint16_t *); extern int qla2x00_local_device_login(scsi_qla_host_t *, fc_port_t *); extern int qla24xx_els_dcmd_iocb(scsi_qla_host_t *, int, port_id_t); -extern int qla24xx_els_dcmd2_iocb(scsi_qla_host_t *, int, fc_port_t *, bool); +extern int qla24xx_els_dcmd2_iocb(scsi_qla_host_t *, int, fc_port_t *); extern void qla2x00_els_dcmd2_free(scsi_qla_host_t *vha, struct els_plogi *els_plogi); diff --git a/qla2x00t-32gbit/qla_iocb.c b/qla2x00t-32gbit/qla_iocb.c index 45ba8d5..a67123b 100644 --- a/qla2x00t-32gbit/qla_iocb.c +++ b/qla2x00t-32gbit/qla_iocb.c @@ -3057,7 +3057,7 @@ static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res) int qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, - fc_port_t *fcport, bool wait) + fc_port_t *fcport) { srb_t *sp; struct srb_iocb *elsio = NULL; @@ -3072,8 +3072,7 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, if (!sp) { ql_log(ql_log_info, vha, 0x70e6, "SRB allocation failed\n"); - fcport->flags &= ~FCF_ASYNC_ACTIVE; - return -ENOMEM; + goto done; } fcport->flags |= FCF_ASYNC_SENT; @@ -3082,9 +3081,6 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, ql_dbg(ql_dbg_io, vha, 0x3073, "%s Enter: PLOGI portid=%06x\n", __func__, fcport->d_id.b24); - if (wait) - sp->flags = SRB_WAKEUP_ON_COMP; - sp->type = SRB_ELS_DCMD; sp->name = "ELS_DCMD"; sp->fcport = fcport; @@ -3100,7 +3096,7 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, if (!elsio->u.els_plogi.els_plogi_pyld) { rval = QLA_FUNCTION_FAILED; - goto out; + goto done_free_sp; } resp_ptr = elsio->u.els_plogi.els_resp_pyld = @@ -3109,7 +3105,7 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, if (!elsio->u.els_plogi.els_resp_pyld) { rval = QLA_FUNCTION_FAILED; - goto out; + goto done_free_sp; } ql_dbg(ql_dbg_io, vha, 0x3073, "PLOGI %p %p\n", ptr, resp_ptr); @@ -3125,7 +3121,6 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, if (els_opcode == ELS_DCMD_PLOGI && DBELL_ACTIVE(vha)) { struct fc_els_flogi *p = ptr; - p->fl_csp.sp_features |= cpu_to_be16(FC_SP_FT_SEC); } @@ -3134,10 +3129,11 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, (uint8_t *)elsio->u.els_plogi.els_plogi_pyld, sizeof(*elsio->u.els_plogi.els_plogi_pyld)); - init_completion(&elsio->u.els_plogi.comp); rval = qla2x00_start_sp(sp); if (rval != QLA_SUCCESS) { - rval = QLA_FUNCTION_FAILED; + fcport->flags |= FCF_LOGIN_NEEDED; + set_bit(RELOGIN_NEEDED, &vha->dpc_flags); + goto done_free_sp; } else { ql_dbg(ql_dbg_disc, vha, 0x3074, "%s PLOGI sent, hdl=%x, loopid=%x, to port_id %06x from port_id %06x\n", @@ -3145,21 +3141,15 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, fcport->d_id.b24, vha->d_id.b24); } - if (wait) { - wait_for_completion(&elsio->u.els_plogi.comp); - - if (elsio->u.els_plogi.comp_status != CS_COMPLETE) - rval = QLA_FUNCTION_FAILED; - } else { - goto done; - } + return rval; -out: - fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE); +done_free_sp: qla2x00_els_dcmd2_free(vha, &elsio->u.els_plogi); /* ref: INIT */ kref_put(&sp->cmd_kref, qla2x00_sp_release); done: + fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE); + qla2x00_set_fcport_disc_state(fcport, DSC_DELETED); return rval; } diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index 52e8018..fdc91e7 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -5656,7 +5656,7 @@ qla2x00_do_work(struct scsi_qla_host *vha) break; case QLA_EVT_ELS_PLOGI: qla24xx_els_dcmd2_iocb(vha, ELS_DCMD_PLOGI, - e->u.fcport.fcport, false); + e->u.fcport.fcport); break; case QLA_EVT_SA_REPLACE: rc = qla24xx_issue_sa_replace_iocb(vha, e); |
From: Gleb C. <lna...@ya...> - 2024-05-03 09:51:44
|
Commit: aabf1ce GitHub URL: https://github.com/SCST-project/scst/commit/aabf1cedc3618ef12e7fd5e71063ceba1c9e6c91 Author: Gleb Chesnokov Date: 2024-05-03T12:50:49+03:00 Log Message: ----------- qla2x00t-32gbit: Prevent command send on chip reset Currently IOCBs are allowed to push through while chip reset could be in progress. During chip reset the outstanding_cmds array is cleared twice. Once when any command on this array is returned as failed and secondly when the array is initialize to zero. If a command is inserted on to the array between these intervals, then the command will be lost. Check for chip reset before sending IOCB. Cc: st...@vg... Signed-off-by: Quinn Tran <qu...@ma...> Signed-off-by: Nilesh Javali <nj...@ma...> Link: https://lore.kernel.org/r/202...@ma... Reviewed-by: Himanshu Madhani <him...@or...> Signed-off-by: Martin K. Petersen <mar...@or...> [ commit 4895009c4bb7 upstream ] Modified Paths: -------------- qla2x00t-32gbit/qla_init.c | 8 +++- qla2x00t-32gbit/qla_iocb.c | 33 ++++++++++++++- 2 files changed, 37 insertions(+), 4 deletions(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_init.c b/qla2x00t-32gbit/qla_init.c index 68d9d22..d44fa5d 100644 --- a/qla2x00t-32gbit/qla_init.c +++ b/qla2x00t-32gbit/qla_init.c @@ -1193,8 +1193,12 @@ int qla24xx_async_gnl(struct scsi_qla_host *vha, fc_port_t *fcport) return rval; done_free_sp: - /* ref: INIT */ - kref_put(&sp->cmd_kref, qla2x00_sp_release); + /* + * use qla24xx_async_gnl_sp_done to purge all pending gnl request. + * kref_put is call behind the scene. + */ + sp->u.iocb_cmd.u.mbx.in_mb[0] = MBS_COMMAND_ERROR; + qla24xx_async_gnl_sp_done(sp, QLA_COMMAND_ERROR); fcport->flags &= ~(FCF_ASYNC_SENT); done: fcport->flags &= ~(FCF_ASYNC_ACTIVE); diff --git a/qla2x00t-32gbit/qla_iocb.c b/qla2x00t-32gbit/qla_iocb.c index e045f39..45ba8d5 100644 --- a/qla2x00t-32gbit/qla_iocb.c +++ b/qla2x00t-32gbit/qla_iocb.c @@ -2603,6 +2603,33 @@ void qla2x00_sp_release(struct kref *kref) { struct srb *sp = container_of(kref, struct srb, cmd_kref); + struct scsi_qla_host *vha = sp->vha; + + switch (sp->type) { + case SRB_CT_PTHRU_CMD: + /* GPSC & GFPNID use fcport->ct_desc.ct_sns for both req & rsp */ + if (sp->u.iocb_cmd.u.ctarg.req && + (!sp->fcport || + sp->u.iocb_cmd.u.ctarg.req != sp->fcport->ct_desc.ct_sns)) { + dma_free_coherent(&vha->hw->pdev->dev, + sp->u.iocb_cmd.u.ctarg.req_allocated_size, + sp->u.iocb_cmd.u.ctarg.req, + sp->u.iocb_cmd.u.ctarg.req_dma); + sp->u.iocb_cmd.u.ctarg.req = NULL; + } + if (sp->u.iocb_cmd.u.ctarg.rsp && + (!sp->fcport || + sp->u.iocb_cmd.u.ctarg.rsp != sp->fcport->ct_desc.ct_sns)) { + dma_free_coherent(&vha->hw->pdev->dev, + sp->u.iocb_cmd.u.ctarg.rsp_allocated_size, + sp->u.iocb_cmd.u.ctarg.rsp, + sp->u.iocb_cmd.u.ctarg.rsp_dma); + sp->u.iocb_cmd.u.ctarg.rsp = NULL; + } + break; + default: + break; + } sp->free(sp); } @@ -2708,7 +2735,7 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *vha, int els_opcode, */ sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); if (!sp) { - kfree(fcport); + qla2x00_free_fcport(fcport); ql_log(ql_log_info, vha, 0x70e6, "SRB allocation failed\n"); return -ENOMEM; @@ -2763,6 +2790,7 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *vha, int els_opcode, if (rval != QLA_SUCCESS) { /* ref: INIT */ kref_put(&sp->cmd_kref, qla2x00_sp_release); + qla2x00_free_fcport(fcport); return QLA_FUNCTION_FAILED; } @@ -2772,6 +2800,7 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *vha, int els_opcode, fcport->d_id.b.area, fcport->d_id.b.al_pa); wait_for_completion(&elsio->u.els_logo.comp); + qla2x00_free_fcport(fcport); /* ref: INIT */ kref_put(&sp->cmd_kref, qla2x00_sp_release); @@ -3935,7 +3964,7 @@ qla2x00_start_sp(srb_t *sp) return -EAGAIN; } - pkt = __qla2x00_alloc_iocbs(sp->qpair, sp); + pkt = qla2x00_alloc_iocbs_ready(sp->qpair, sp); if (!pkt) { rval = -EAGAIN; ql_log(ql_log_warn, vha, 0x700c, |