qla2xxx: Add EDIF support
Subsystems (2)
Nilesh Javali
maintainerPATCH 1/1 qla2xxx: Add EDIF support
From: Quinn Tran <[email protected]>
Add Encryption for Data In Flight (EDIF) support. This feature allows data of 2 end points to be encrypted. A user application is required to play the role of authentication for both sides. On completion of authentication, user app shall provide a set of Tx/Rx keys and spi's for HW to program into the session.
modprobe qla2xxx ql2xsecenable=1
--- drivers/scsi/qla2xxx/Makefile | 3 +- drivers/scsi/qla2xxx/qla_attr.c | 6 +- drivers/scsi/qla2xxx/qla_bsg.c | 95 +- drivers/scsi/qla2xxx/qla_bsg.h | 3 + drivers/scsi/qla2xxx/qla_dbg.h | 1 + drivers/scsi/qla2xxx/qla_def.h | 250 +- drivers/scsi/qla2xxx/qla_edif.c | 3638 +++++++++++++++++++++++++++ drivers/scsi/qla2xxx/qla_edif.h | 160 ++ drivers/scsi/qla2xxx/qla_edif_bsg.h | 225 ++ drivers/scsi/qla2xxx/qla_fw.h | 15 +- drivers/scsi/qla2xxx/qla_gbl.h | 64 +- drivers/scsi/qla2xxx/qla_gs.c | 4 + drivers/scsi/qla2xxx/qla_init.c | 183 +- drivers/scsi/qla2xxx/qla_iocb.c | 85 +- drivers/scsi/qla2xxx/qla_isr.c | 313 ++- drivers/scsi/qla2xxx/qla_mbx.c | 45 +- drivers/scsi/qla2xxx/qla_mid.c | 7 +- drivers/scsi/qla2xxx/qla_nvme.c | 4 + drivers/scsi/qla2xxx/qla_os.c | 123 +- drivers/scsi/qla2xxx/qla_target.c | 170 +- drivers/scsi/qla2xxx/qla_target.h | 22 +- 21 files changed, 5254 insertions(+), 162 deletions(-) create mode 100644 drivers/scsi/qla2xxx/qla_edif.c create mode 100644 drivers/scsi/qla2xxx/qla_edif.h create mode 100644 drivers/scsi/qla2xxx/qla_edif_bsg.h
drivers/scsi/qla2xxx/Makefile +2 -1
@@ -1,7 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 qla2xxx-y := qla_os.o qla_init.o qla_mbx.o qla_iocb.o qla_isr.o qla_gs.o \ qla_dbg.o qla_sup.o qla_attr.o qla_mid.o qla_dfs.o qla_bsg.o \ - qla_nx.o qla_mr.o qla_nx2.o qla_target.o qla_tmpl.o qla_nvme.o + qla_nx.o qla_mr.o qla_nx2.o qla_target.o qla_tmpl.o qla_nvme.o \ + qla_edif.o obj-$(CONFIG_SCSI_QLA_FC) += qla2xxx.o obj-$(CONFIG_TCM_QLA2XXX) += tcm_qla2xxx.o
drivers/scsi/qla2xxx/qla_attr.c +5 -1
@@ -2435,6 +2435,7 @@ static DEVICE_ATTR(port_speed, 0644, qla2x00_port_speed_show, qla2x00_port_speed_store); static DEVICE_ATTR(port_no, 0444, qla2x00_port_no_show, NULL); static DEVICE_ATTR(fw_attr, 0444, qla2x00_fw_attr_show, NULL); +static DEVICE_ATTR_RO (edif_doorbell);struct device_attribute *qla2x00_host_attrs[] = {
@@ -2480,6 +2481,7 @@ struct device_attribute *qla2x00_host_attrs[] = { &dev_attr_port_no, &dev_attr_fw_attr, &dev_attr_dport_diagnostics, + &dev_attr_edif_doorbell,NULL ,/* reserve for qlini_mode */ NULL ,/* reserve for ql2xiniexchg */ NULL, /* reserve for ql2xexchoffld */
@@ -3104,9 +3106,11 @@ qla24xx_vport_delete(struct fc_vport *fc_vport)qla24xx_disable_vp (vha); -qla2x00_wait_for_sess_deletion (vha);qla_nvme_delete (vha); +qla_enode_stop (vha); +qla_edb_stop (vha); + vha->flags.delete_progress =1 ;qlt_remove_target (ha, vha);
drivers/scsi/qla2xxx/qla_bsg.c +64 -31
188 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_bsg.h +3 -0
@@ -31,6 +31,7 @@#define QL_VND_DPORT_DIAGNOSTICS 0x19#define QL_VND_GET_PRIV_STATS_EX 0x1A#define QL_VND_SS_GET_FLASH_IMAGE_STATUS 0x1E +#define QL_VND_EDIF_MGMT 0X1F#define QL_VND_MANAGE_HOST_STATS 0x23#define QL_VND_GET_HOST_STATS 0x24#define QL_VND_GET_TGT_STATS 0x25
@@ -294,4 +295,6 @@ struct qla_active_regions { uint8_t reserved[32]; } __packed; +#include "qla_edif_bsg.h" +#endif
drivers/scsi/qla2xxx/qla_dbg.h +1 -0
@@ -367,6 +367,7 @@ ql_log_qp(uint32_t, struct qla_qpair *, int32_t, const char *fmt, ...);#define ql_dbg_tgt_mgt 0x00002000/* Target mode management */ #define ql_dbg_tgt_tmr 0x00001000/* Target mode task management */ #define ql_dbg_tgt_dif 0x00000800/* Target mode dif */ +#define ql_dbg_edif 0x00000400/* edif and purex debug */ extern int qla27xx_dump_mpi_ram (struct qla_hw_data *,uint32_t ,uint32_t *,uint32_t ,void **);
drivers/scsi/qla2xxx/qla_def.h +225 -25
435 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_edif.c new file +3638 -0
2,322 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_edif.h new file +160 -0
160 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_edif_bsg.h new file +225 -0
225 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_gbl.h +62 -2
64 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_init.c +154 -29
183 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_iocb.c +80 -5
85 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_isr.c +300 -13
313 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_mbx.c +37 -8
45 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_os.c +114 -9
123 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_target.c +137 -33
170 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.19.0.rc0
Part of the diff is not shown here. View the raw message.
kernel test robot
build botThank you for the patch! Perhaps something to improve:
Hi Nilesh,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20210507] [cannot apply to v5.12]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Nilesh-Javali/qla2xxx-Add-EDIF-support/20210507-212636 base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next config: xtensa-allyesconfig (attached as .config) compiler: xtensa-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/123765e7c3f96d59ba2239401abb1a3ed3adf910
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Nilesh-Javali/qla2xxx-Add-EDIF-support/20210507-212636 git checkout 123765e7c3f96d59ba2239401abb1a3ed3adf910
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=xtensa
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>):
drivers/scsi/qla2xxx/qla_edif.c: In function 'ql_print_bsg_sglist':
>> drivers/scsi/qla2xxx/qla_edif.c:2288:24: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 6 has type 'dma_addr_t' {aka 'unsigned int'} [-Wformat=]
2288 | "%x: dma(adr=%#llx len=%#x) off=%#x len=%#x\n",
| ~~~~^
| |
| long long unsigned int
| %#xvim +2288 drivers/scsi/qla2xxx/qla_edif.c
2275
2276 void
2277 ql_print_bsg_sglist(uint level, scsi_qla_host_t *vha, uint id, char *str,
2278 struct bsg_buffer *p)
2279 {
2280 struct scatterlist *sg;
2281 uint i;
2282
2283 ql_dbg(level, vha, id,
2284 "%s->(sg_cnt=%#x payload_len=%#x):\n",
2285 str, p->sg_cnt, p->payload_len);
2286 for_each_sg(p->sg_list, sg, p->sg_cnt, i) {
2287 ql_dbg(level, vha, id,
> 2288 "%x: dma(adr=%#llx len=%#x) off=%#x len=%#x\n",
2289 i, sg_dma_address(sg), sg_dma_len(sg), sg->offset,
2290 sg->length);
2291 }
2292 }
2293
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kernel test robot
build botThank you for the patch! Perhaps something to improve:
Hi Nilesh,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20210507] [cannot apply to v5.12]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Nilesh-Javali/qla2xxx-Add-EDIF-support/20210507-212636 base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next config: arm-randconfig-r033-20210507 (attached as .config) compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project a3a8a1a15b524d91b5308db68e9d293b34cd88dd)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/0day-ci/linux/commit/123765e7c3f96d59ba2239401abb1a3ed3adf910
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Nilesh-Javali/qla2xxx-Add-EDIF-support/20210507-212636 git checkout 123765e7c3f96d59ba2239401abb1a3ed3adf910
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>):
>> drivers/scsi/qla2xxx/qla_edif.c:2289:10: warning: format specifies type 'unsigned long long' but the argument has type 'dma_addr_t' (aka 'unsigned int') [-Wformat]
i, sg_dma_address(sg), sg_dma_len(sg), sg->offset,
^~~~~~~~~~~~~~~~~~
include/linux/scatterlist.h:28:28: note: expanded from macro 'sg_dma_address'
#define sg_dma_address(sg) ((sg)->dma_address)
^~~~~~~~~~~~~~~~~~~1 warning generated.
vim +2289 drivers/scsi/qla2xxx/qla_edif.c
2275
2276 void
2277 ql_print_bsg_sglist(uint level, scsi_qla_host_t *vha, uint id, char *str,
2278 struct bsg_buffer *p)
2279 {
2280 struct scatterlist *sg;
2281 uint i;
2282
2283 ql_dbg(level, vha, id,
2284 "%s->(sg_cnt=%#x payload_len=%#x):\n",
2285 str, p->sg_cnt, p->payload_len);
2286 for_each_sg(p->sg_list, sg, p->sg_cnt, i) {
2287 ql_dbg(level, vha, id,
2288 "%x: dma(adr=%#llx len=%#x) off=%#x len=%#x\n", > 2289 i, sg_dma_address(sg), sg_dma_len(sg), sg->offset, 2290 sg->length);
2291 }
2292 }
2293
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
Hi Nilesh,
Quoted 9 lines · Nilesh Javali
Add Encryption for Data In Flight (EDIF) support. This feature allows data of 2 end points to be encrypted. A user application is required to play the role of authentication for both sides. On completion of authentication, user app shall provide a set of Tx/Rx keys and spi's for HW to program into the session.
Quoted 7 lines
modprobe qla2xxx ql2xsecenable=1
Signed-off-by Larry Wisneski <[email protected]>Signed-off-by Duane Grigsby <[email protected]>Signed-off-by Rick Hicksted Jr <[email protected]>Signed-off-by Quinn Tran <[email protected]>Signed-off-by Nilesh Javali <[email protected]>
While you are fixing kernel test robot warnings, I’ll like to see this patch split into logical changes. It’s very hard to review 5K lines of changes into single patch. Also while you are at it, Please provide detail description of the feature and how user will use this feature.
--
Himanshu Madhani Oracle Linux Engineering