From patchwork Sun Jul 12 14:06:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Herbszt X-Patchwork-Id: 6772331 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2E7B6C05AC for ; Sun, 12 Jul 2015 14:06:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 35F2720666 for ; Sun, 12 Jul 2015 14:06:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 427D62065E for ; Sun, 12 Jul 2015 14:06:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751186AbbGLOGm (ORCPT ); Sun, 12 Jul 2015 10:06:42 -0400 Received: from mout.gmx.net ([212.227.15.15]:57627 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750732AbbGLOGm (ORCPT ); Sun, 12 Jul 2015 10:06:42 -0400 Received: from localhost ([88.65.167.230]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MhRI2-1ZZeVZ2ETa-00MbCP; Sun, 12 Jul 2015 16:06:39 +0200 Date: Sun, 12 Jul 2015 16:06:31 +0200 From: Sebastian Herbszt To: linux-scsi@vger.kernel.org Cc: qla2xxx-upstream@qlogic.com, Sebastian Herbszt Subject: [RESEND][PATCH] qla2xxx: use t10_pi_tuple Message-ID: <20150712160631.000059ca@localhost> X-Mailer: Claws Mail 3.9.2-55-g74b05b (GTK+ 2.16.6; i586-pc-mingw32msvc) MIME-Version: 1.0 X-Provags-ID: V03:K0:GbRZtl8iI+Rp0p8C7JahgPuz3icEfXFrXcoWIcCJ2aQy3Tl29WV 6E9tBJpKzGm7hwRdlf3N71o5z23Dz71d3kPTOsWNNtz9/WO4QIRtu8XVnIJJRn2h8Or6tCL k4pRSZ28mtHfXggMhZl1l7AXi1L6gXC19GbOBv35bGn2gfRAx2VDfnKB1fPtYXGQQ4oQtby taA8GU73vR8x11i8X+nbA== X-UI-Out-Filterresults: notjunk:1; V01:K0:LJBlei+/FPE=:puMVnUGKQ2jPs/J8UfJhBb USGSs+vlu0dviePnTCOpot5wDQP3aBM2y3UCdXXj/6VZIjEGcsV70NR0GY6shRBqwTSKZ3s9f Dbbtt+AKsFx+al0L5YL8+zF0m8eTCwGAFvThOdwD/LUZCHWryWTj40Itaay0dCSFY68kz6vOl zTcb94rOqeQmPhH0vYAmXgvKbrPsrlzzE/v9wJ858Anhdc9MTHjrzNyDiB1UEQkiotsLNqvIE HBo3pBMozvMSKLErxs4oLSH95svJb5cDAp2W1uIr/YYEe/sD8Ah9azdKgArhNavgo2bpeMxJn kZ7i05wyCCXMMc1UMlqX8FUFDYo/3mJR5vZX4SWJ2Xepq2W3mAG+xXxlf+g3Cv6Eg/zD2DIKf mOF8HKCkFScGETPBiWWQyqyQn888AEisGBRnkwsER/CHXHAbM7AlpcPyTDB673MsPFs4150gp VaENgCuS76D4l7i/+/s/G32RZa4pf3UZP3xk0gQcIcBX+mq03jas+2vdyMvqANHDOHQRuxF2v 1YbQvHY/K14+neAaBNOZAdgie8r4HXk1iE6eYLHoKCBYi89Zs4ig7tOufVxhhq2WNZdCAqzE+ +QFSNQPGYHAN200K8zVs+fhWNHE4ZuIgrShA5sAa/jjcC15HLyJFthzy8Zz4tYtmmi1vYKvyO YVOO1AydS5HjmydklLoJQTRW+T7VpFt18SS6K9jzcwcaKQkVigzCT92EYYldLCnLP4zM= Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Drop unused scsi_dif_tuple and use t10_pi_tuple instead of own sd_dif_tuple copy. Signed-off-by: Sebastian Herbszt --- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -urp 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-07-09 09:45:44.285703687 +0200 @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -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 -urp linux/drivers/scsi/qla2xxx-orig/qla_isr.c linux/drivers/scsi/qla2xxx/qla_isr.c --- linux/drivers/scsi/qla2xxx-orig/qla_isr.c 2015-07-05 22:18:44.157739160 +0200 +++ linux/drivers/scsi/qla2xxx/qla_isr.c 2015-07-09 09:45:44.289703687 +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 -urp linux/drivers/scsi/qla2xxx-orig/qla_target.c linux/drivers/scsi/qla2xxx/qla_target.c --- linux/drivers/scsi/qla2xxx-orig/qla_target.c 2015-07-05 22:18:44.177739161 +0200 +++ linux/drivers/scsi/qla2xxx/qla_target.c 2015-07-09 09:45:44.293703687 +0200 @@ -2589,17 +2589,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 }