From: Sebastian Herbszt <herbszt@gmx.de>
To: linux-scsi@vger.kernel.org
Cc: qla2xxx-upstream@qlogic.com, Sebastian Herbszt <herbszt@gmx.de>
Subject: [PATCH] qla2xxx: use t10_pi_tuple
Date: Sun, 17 May 2015 23:35:06 +0200 [thread overview]
Message-ID: <20150517233506.00000268@localhost> (raw)
Drop unused scsi_dif_tuple and use t10_pi_tuple instead of own sd_dif_tuple copy.
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
diff -up linux/drivers/scsi/qla2xxx-orig/qla_def.h linux/drivers/scsi/qla2xxx/qla_def.h
--- linux/drivers/scsi/qla2xxx-orig/qla_def.h 2015-04-15 06:18:24.681045138 +0200
+++ linux/drivers/scsi/qla2xxx/qla_def.h 2015-05-17 20:17:20.308810956 +0200
@@ -25,6 +25,7 @@
#include <linux/firmware.h>
#include <linux/aer.h>
#include <linux/mutex.h>
+#include <linux/t10-pi.h>
#include <scsi/scsi.h>
#include <scsi/scsi_host.h>
@@ -276,16 +277,6 @@
struct req_que;
/*
- * (sd.h is not exported, hence local inclusion)
- * Data Integrity Field tuple.
- */
-struct sd_dif_tuple {
- __be16 guard_tag; /* Checksum */
- __be16 app_tag; /* Opaque storage */
- __be32 ref_tag; /* Target LBA or indirect LBA */
-};
-
-/*
* SCSI Request Block
*/
struct srb_cmd {
diff -up linux/drivers/scsi/qla2xxx-orig/qla_isr.c linux/drivers/scsi/qla2xxx/qla_isr.c
--- linux/drivers/scsi/qla2xxx-orig/qla_isr.c 2015-04-15 06:18:24.685045138 +0200
+++ linux/drivers/scsi/qla2xxx/qla_isr.c 2015-05-17 20:18:32.768814260 +0200
@@ -1711,12 +1711,6 @@ qla2x00_handle_sense(srb_t *sp, uint8_t
}
}
-struct scsi_dif_tuple {
- __be16 guard; /* Checksum */
- __be16 app_tag; /* APPL identifier */
- __be32 ref_tag; /* Target LBA or indirect LBA */
-};
-
/*
* Checks the guard or meta-data for the type of error
* detected by the HBA. In case of errors, we set the
@@ -1779,7 +1773,7 @@ qla2x00_handle_dif_error(srb_t *sp, stru
if (scsi_prot_sg_count(cmd)) {
uint32_t i, j = 0, k = 0, num_ent;
struct scatterlist *sg;
- struct sd_dif_tuple *spt;
+ struct t10_pi_tuple *pi;
/* Patch the corresponding protection tags */
scsi_for_each_prot_sg(cmd, sg,
@@ -1801,12 +1795,12 @@ qla2x00_handle_dif_error(srb_t *sp, stru
return 1;
}
- spt = page_address(sg_page(sg)) + sg->offset;
- spt += j;
+ pi = page_address(sg_page(sg)) + sg->offset;
+ pi += j;
- spt->app_tag = 0xffff;
+ pi->app_tag = 0xffff;
if (scsi_get_prot_type(cmd) == SCSI_PROT_DIF_TYPE3)
- spt->ref_tag = 0xffffffff;
+ pi->ref_tag = 0xffffffff;
}
return 0;
diff -up linux/drivers/scsi/qla2xxx-orig/qla_target.c linux/drivers/scsi/qla2xxx/qla_target.c
--- linux/drivers/scsi/qla2xxx-orig/qla_target.c 2015-04-24 22:55:32.801528872 +0200
+++ linux/drivers/scsi/qla2xxx/qla_target.c 2015-05-17 20:20:16.440818988 +0200
@@ -2591,17 +2591,17 @@ qlt_handle_dif_error(struct scsi_qla_hos
}
#if 0
- struct sd_dif_tuple *spt;
+ struct t10_pi_tuple *pi;
/* TODO:
* This section came from initiator. Is it valid here?
* should ulp be override with actual val???
*/
- spt = page_address(sg_page(sg)) + sg->offset;
- spt += j;
+ pi = page_address(sg_page(sg)) + sg->offset;
+ pi += j;
- spt->app_tag = 0xffff;
+ pi->app_tag = 0xffff;
if (cmd->se_cmd.prot_type == SCSI_PROT_DIF_TYPE3)
- spt->ref_tag = 0xffffffff;
+ pi->ref_tag = 0xffffffff;
#endif
}
reply other threads:[~2015-05-17 21:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150517233506.00000268@localhost \
--to=herbszt@gmx.de \
--cc=linux-scsi@vger.kernel.org \
--cc=qla2xxx-upstream@qlogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox