hisi_sas: DIF support
Subsystems (2)
v5 cover hisi_sas: DIF support
This patchset introduces support to the driver for DIF/DIX.
We are making DIX support as RFC for now, based on issues discussed in the following:
https://marc.info/?l=linux-scsi&m=154357719329297&w=4 and
https://marc.info/?l=linux-scsi&m=154406987703456&w=2
We will only support PI in v3 hw at the moment, even though previous hw versions also support it.
Differences:v4->v5:
- Drop already accepted patches
- Fix comments according to Martin
- use t10_pi_ref_tag()
- stop using protection options in LLDD in favour of prot flags
- allow user to set prot mask
v3->v4:
- re-add DIX support as RFC - do not commit please!
- also DIX support is labelled experimental in the driver
v2->v3:
- fix sparse warnings
- drop DIX support
v1->v2:
- drop scsi_prot_op_normal()
Xiang Chen (2):
scsi: hisi_sas: Add support for DIF feature for v2 hw
scsi: hisi_sas: Add support for DIX feature for v3 hw as experimental
drivers/scsi/hisi_sas/hisi_sas.h | 28 +++++ drivers/scsi/hisi_sas/hisi_sas_main.c | 97 ++++++++++++++-- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 197 ++++++++++++++++++++++++++++++++- 3 files changed, 305 insertions(+), 17 deletions(-)
Signature · 1 line
1.9.1
PATCH v5 1/2 scsi: hisi_sas: Add support for DIF feature for v2 hw
From: Xiang Chen <[email protected]>
For v3 hw, we support DIF operation for SAS, but not SATA.
In addition, DIF CRC16 is supported.
This patchset adds the SW support for the described features. The main components are as follows:
- Get protection mask from module param
- Fill PI fields
- Fill related to DIF in DQ and protection iu memories
--- drivers/scsi/hisi_sas/hisi_sas.h | 8 ++ drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 132 ++++++++++++++++++++++++++++++++- 2 files changed, 137 insertions(+), 3 deletions(-)
drivers/scsi/hisi_sas/hisi_sas.h +8 -0
@@ -69,6 +69,12 @@#define HISI_SAS_SATA_PROTOCOL_FPDMA 0x8#define HISI_SAS_SATA_PROTOCOL_ATAPI 0x10 +#define HISI_SAS_DIF_PROT_MASK (SHOST_DIF_TYPE1_PROTECTION | \ + SHOST_DIF_TYPE2_PROTECTION | \ + SHOST_DIF_TYPE3_PROTECTION) + +#define HISI_SAS_PROT_MASK (HISI_SAS_DIF_PROT_MASK) +struct hisi_hba ;enum {
@@ -268,6 +274,8 @@ struct hisi_hba {struct pci_dev *pci_dev;struct device *dev; +int prot_mask; +void __iomem *regs;void __iomem *sgpio_regs;struct regmap *ctrl;
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +129 -3
197 lines not on this page · raw message
Signature · 1 line
1.9.1
Martin K. Petersen
AppliedRe: [PATCH v5 1/2] scsi: hisi_sas: Add support for DIF feature for v2 hw
John,
Quoted 11 lines
From: Xiang Chen <[email protected]>
For v3 hw, we support DIF operation for SAS, but not SATA.
In addition, DIF CRC16 is supported.
This patchset adds the SW support for the described features. The main components are as follows:
- Get protection mask from module param
- Fill PI fields
- Fill related to DIF in DQ and protection iu memories
Applied to 4.21/scsi-queue, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Re: [PATCH v5 1/2] scsi: hisi_sas: Add support for DIF feature for v2 hw
Quoted 9 lines · Martin K. Petersen
John,
Quoted 6 lines
From: Xiang Chen <[email protected]>
For v3 hw, we support DIF operation for SAS, but not SATA.
In addition, DIF CRC16 is supported.
Quoted 8 lines
Quoted 5 lines
This patchset adds the SW support for the described features. The main components are as follows:
- Get protection mask from module param
- Fill PI fields
- Fill related to DIF in DQ and protection iu memoriesApplied to 4.21/scsi-queue, thanks!
Thanks, and we're still looking at the DIX issue.
John
RFC PATCH v5 2/2 scsi: hisi_sas: Add support for DIX feature for v3 hw as experimental
In reply to John GarryFrom: Xiang Chen <[email protected]>
This patchset adds support for DIX to v3 hw driver.
As discussed in the following thread, DIX seems to be in conflict with SCSI MQ, so this is why we mark the support for this driver as experimental:
https://marc.info/?l=linux-scsi&m=154392687627603&w=2,
As for DIX support itself, we build upon support for DIF, most significantly is adding new DMA map and unmap paths.
--- drivers/scsi/hisi_sas/hisi_sas.h | 22 +++++++- drivers/scsi/hisi_sas/hisi_sas_main.c | 97 ++++++++++++++++++++++++++++++---- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 75 +++++++++++++++++++++++--- 3 files changed, 174 insertions(+), 20 deletions(-)
drivers/scsi/hisi_sas/hisi_sas.h +21 -1
@@ -55,6 +55,11 @@#define hisi_sas_sge_addr_mem (slot) hisi_sas_sge_addr(slot->buf)#define hisi_sas_sge_addr_dma (slot) hisi_sas_sge_addr(slot->buf_dma) +#define hisi_sas_sge_dif_addr (buf) \ + (buf + offsetof(struct hisi_sas_slot_dif_buf_table, sge_dif_page)) +#define hisi_sas_sge_dif_addr_mem (slot) hisi_sas_sge_dif_addr(slot->buf) +#define hisi_sas_sge_dif_addr_dma (slot) hisi_sas_sge_dif_addr(slot->buf_dma) +#define HISI_SAS_MAX_SSP_RESP_SZ (sizeof(struct ssp_frame_hdr) + 1024)#define HISI_SAS_MAX_SMP_RESP_SZ 1028#define HISI_SAS_MAX_STP_RESP_SZ 28
@@ -73,7 +78,11 @@ SHOST_DIF_TYPE2_PROTECTION | \ SHOST_DIF_TYPE3_PROTECTION) -#define HISI_SAS_PROT_MASK (HISI_SAS_DIF_PROT_MASK) +#define HISI_SAS_DIX_PROT_MASK (SHOST_DIX_TYPE1_PROTECTION | \ + SHOST_DIX_TYPE2_PROTECTION | \ + SHOST_DIX_TYPE3_PROTECTION) + +#define HISI_SAS_PROT_MASK (HISI_SAS_DIF_PROT_MASK | HISI_SAS_DIX_PROT_MASK)struct hisi_hba ;
@@ -203,6 +212,7 @@ struct hisi_sas_slot {struct sas_task *task;struct hisi_sas_port *port;u64 n_elem; +u64 n_elem_dif;int dlvry_queue;int dlvry_queue_slot;int cmplt_queue;
@@ -430,6 +440,11 @@ struct hisi_sas_sge_page {struct hisi_sas_sge sge[HISI_SAS_SGE_PAGE_CNT ]; }__aligned(16) ; +#define HISI_SAS_SGE_DIF_PAGE_CNT SG_CHUNK_SIZE +struct hisi_sas_sge_dif_page { +struct hisi_sas_sge sge[HISI_SAS_SGE_DIF_PAGE_CNT ]; +}__aligned(16) ; +struct hisi_sas_command_table_ssp {struct ssp_frame_hdr hdr;union {
@@ -460,6 +475,11 @@ struct hisi_sas_slot_buf_table {struct hisi_sas_sge_page sge_page; }; +struct hisi_sas_slot_dif_buf_table { +struct hisi_sas_slot_buf_table slot_buf; +struct hisi_sas_sge_dif_page sge_dif_page; +}; +extern struct scsi_transport_template *hisi_sas_stt;extern void hisi_sas_stop_phys (struct hisi_hba *hisi_hba);extern int hisi_sas_alloc (struct hisi_hba *hisi_hba,struct Scsi_Host *shost);
drivers/scsi/hisi_sas/hisi_sas_main.c +86 -11
165 lines not on this page · raw message
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +67 -8
132 lines not on this page · raw message
Signature · 1 line
1.9.1