Skip to content

Commit

Permalink
Merge pull request #31 from truenas/rebase_on_upstream_master
Browse files Browse the repository at this point in the history
Rebase on upstream master
  • Loading branch information
bmeagherix authored May 6, 2024
2 parents 9e79075 + ba0043f commit 0557e53
Show file tree
Hide file tree
Showing 20 changed files with 416 additions and 212 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/run_regression_tests.yaml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 6 additions & 17 deletions nightly/bin/nightly
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@

# Returns the revision number of the source files with date $1.
get_revision() {
if svn info . >/dev/null 2>&1; then
svn info -r "{$1}" "${scst_repo}" | sed -n 's/^Revision: //p'
else
git log --before="$1" | head -n 1 | cut -f2 -d ' '
fi
git log --before="$1" | head -n 1 | cut -f2 -d ' '
}

runcmd () {
Expand Down Expand Up @@ -54,11 +50,7 @@ usage () {
#----------------------------------------------------------------------------

scst_rootdir="$(dirname "$(dirname "$(cd "$(dirname "$0")" && echo "$PWD")")")"
if svn info . >/dev/null 2>&1; then
scst_repo="$(svn info "$scst_rootdir" | sed -n -e 's|\+ssh://[^@]*@|://|' -e 's/^URL: //p')"
else
scst_repo="$scst_rootdir"
fi
scst_repo="$scst_rootdir"
sendmail_opts=""
run_if_unchanged="false"

Expand Down Expand Up @@ -151,13 +143,10 @@ for logfile in old new ; do
# Check out and run the tests.
runcmd ${logfile} \
"Checking out SCST source tree" \
"if svn info . >/dev/null 2>&1; then \
svn co -q -r {${date}} ${scst_repo} ${ABT_TMPDIR}/scst; \
else \
( rmdir ${ABT_TMPDIR}/scst && \
git clone -q ${scst_repo} ${ABT_TMPDIR}/scst && \
cd ${ABT_TMPDIR}/scst && git reset --hard ${rev} ); \
fi" &&
"( rmdir ${ABT_TMPDIR}/scst && \
git clone -q ${scst_repo} ${ABT_TMPDIR}/scst && \
cd ${ABT_TMPDIR}/scst && git reset --hard ${rev} ); \
" &&
runcmd ${logfile} \
"Running regression tests" \
"cd ${ABT_TMPDIR}/scst && \
Expand Down
14 changes: 12 additions & 2 deletions qla2x00t-32gbit/qla_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion qla2x00t-32gbit/qla_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
59 changes: 7 additions & 52 deletions qla2x00t-32gbit/qla_dfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,51 +532,22 @@ qla_dfs_naqp_show(struct seq_file *s, void *unused)
*
* Example for creating "TEST" sysfs file:
* 1. struct qla_hw_data { ... struct dentry *dfs_TEST; }
* 2. QLA_DFS_SETUP_RD(TEST, scsi_qla_host_t);
* 2. QLA_DFS_SETUP_RD(TEST);
* 3. In qla2x00_dfs_setup():
* QLA_DFS_CREATE_FILE(ha, TEST, 0600, ha->dfs_dir, vha);
* 4. In qla2x00_dfs_remove():
* QLA_DFS_REMOVE_FILE(ha, TEST);
*/
#define QLA_DFS_SETUP_RD(_name, _ctx_struct) \
static int \
qla_dfs_##_name##_open(struct inode *inode, struct file *file) \
{ \
_ctx_struct *__ctx = inode->i_private; \
\
return single_open(file, qla_dfs_##_name##_show, __ctx); \
} \
\
static const struct file_operations qla_dfs_##_name##_ops = { \
.open = qla_dfs_##_name##_open, \
.read = seq_read, \
.llseek = seq_lseek, \
.release = single_release, \
};
#define QLA_DFS_SETUP_RD(_name) DEFINE_SHOW_ATTRIBUTE(qla_dfs_##_name)

#define QLA_DFS_SETUP_RW(_name, _ctx_struct) \
static int \
qla_dfs_##_name##_open(struct inode *inode, struct file *file) \
{ \
_ctx_struct *__ctx = inode->i_private; \
\
return single_open(file, qla_dfs_##_name##_show, __ctx); \
} \
\
static const struct file_operations qla_dfs_##_name##_ops = { \
.open = qla_dfs_##_name##_open, \
.read = seq_read, \
.llseek = seq_lseek, \
.release = single_release, \
.write = qla_dfs_##_name##_write, \
};
#define QLA_DFS_SETUP_RW(_name) DEFINE_SHOW_STORE_ATTRIBUTE(qla_dfs_##_name)

#define QLA_DFS_ROOT_CREATE_FILE(_name, _perm, _ctx) \
do { \
if (!qla_dfs_##_name) \
qla_dfs_##_name = debugfs_create_file(#_name, \
_perm, qla2x00_dfs_root, _ctx, \
&qla_dfs_##_name##_ops); \
&qla_dfs_##_name##_fops); \
} while (0)

#define QLA_DFS_ROOT_REMOVE_FILE(_name) \
Expand All @@ -591,7 +562,7 @@ static const struct file_operations qla_dfs_##_name##_ops = { \
do { \
(_struct)->dfs_##_name = debugfs_create_file(#_name, \
_perm, _parent, _ctx, \
&qla_dfs_##_name##_ops) \
&qla_dfs_##_name##_fops) \
} while (0)

#define QLA_DFS_REMOVE_FILE(_struct, _name) \
Expand All @@ -602,14 +573,6 @@ static const struct file_operations qla_dfs_##_name##_ops = { \
} \
} while (0)

static int
qla_dfs_naqp_open(struct inode *inode, struct file *file)
{
struct scsi_qla_host *vha = inode->i_private;

return single_open(file, qla_dfs_naqp_show, vha);
}

static ssize_t
qla_dfs_naqp_write(struct file *file, const char __user *buffer,
size_t count, loff_t *pos)
Expand Down Expand Up @@ -657,15 +620,7 @@ qla_dfs_naqp_write(struct file *file, const char __user *buffer,
kfree(buf);
return rc;
}

static const struct file_operations dfs_naqp_ops = {
.open = qla_dfs_naqp_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
.write = qla_dfs_naqp_write,
};

QLA_DFS_SETUP_RW(naqp);

int
qla2x00_dfs_setup(scsi_qla_host_t *vha)
Expand Down Expand Up @@ -711,7 +666,7 @@ qla2x00_dfs_setup(scsi_qla_host_t *vha)

if (IS_QLA27XX(ha) || IS_QLA83XX(ha) || IS_QLA28XX(ha)) {
ha->tgt.dfs_naqp = debugfs_create_file("naqp",
0400, ha->dfs_dir, vha, &dfs_naqp_ops);
0400, ha->dfs_dir, vha, &qla_dfs_naqp_fops);
if (IS_ERR(ha->tgt.dfs_naqp)) {
ql_log(ql_log_warn, vha, 0xd011,
"Unable to create debugFS naqp node.\n");
Expand Down
2 changes: 1 addition & 1 deletion qla2x00t-32gbit/qla_edif.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion qla2x00t-32gbit/qla_gbl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Loading

0 comments on commit 0557e53

Please sign in to comment.