Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751942AbaANK4x (ORCPT ); Tue, 14 Jan 2014 05:56:53 -0500 Received: from mail-ea0-f174.google.com ([209.85.215.174]:54652 "EHLO mail-ea0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751915AbaANK4h (ORCPT ); Tue, 14 Jan 2014 05:56:37 -0500 Message-ID: <52D517DE.50009@dev.mellanox.co.il> Date: Tue, 14 Jan 2014 12:56:30 +0200 From: Sagi Grimberg User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: "Nicholas A. Bellinger" CC: target-devel , linux-scsi , linux-kernel , "Martin K. Petersen" , Christoph Hellwig , Hannes Reinecke , Or Gerlitz Subject: Re: [PATCH 02/14] target: Add DIF CHECK_CONDITION ASC/ASCQ exception cases References: <1389212157-14540-1-git-send-email-nab@daterainc.com> <1389212157-14540-3-git-send-email-nab@daterainc.com> <52CE7D3F.7030308@mellanox.com> <1389336816.5567.404.camel@haakon3.risingtidesystems.com> <52D4EADC.60300@dev.mellanox.co.il> <1389689607.5567.525.camel@haakon3.risingtidesystems.com> In-Reply-To: <1389689607.5567.525.camel@haakon3.risingtidesystems.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/14/2014 10:53 AM, Nicholas A. Bellinger wrote: > On Tue, 2014-01-14 at 09:44 +0200, Sagi Grimberg wrote: >> On 1/10/2014 8:53 AM, Nicholas A. Bellinger wrote: >>> On Thu, 2014-01-09 at 12:43 +0200, Sagi Grimberg wrote: >>>> On 1/8/2014 10:36 PM, Nicholas A. Bellinger wrote: >>>>> From: Nicholas Bellinger >>>>> >>>>> This patch adds support for DIF related CHECK_CONDITION ASC/ASCQ >>>>> exception cases into transport_send_check_condition_and_sense(). >>>>> >>>>> This includes: >>>>> >>>>> LOGICAL BLOCK GUARD CHECK FAILED >>>>> LOGICAL BLOCK APPLICATION TAG CHECK FAILED >>>>> LOGICAL BLOCK REFERENCE TAG CHECK FAILED >>>>> >>>>> that used by DIF TYPE1 and TYPE3 failure cases. >>>>> >>>>> Cc: Martin K. Petersen >>>>> Cc: Christoph Hellwig >>>>> Cc: Hannes Reinecke >>>>> Cc: Sagi Grimberg >>>>> Cc: Or Gerlitz >>>>> Signed-off-by: Nicholas Bellinger >>>>> --- >>>>> drivers/target/target_core_transport.c | 30 ++++++++++++++++++++++++++++++ >>>>> include/target/target_core_base.h | 3 +++ >>>>> 2 files changed, 33 insertions(+) >>>>> >>>>> diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c >>>>> index 91953da..707ee17 100644 >>>>> --- a/drivers/target/target_core_transport.c >>>>> +++ b/drivers/target/target_core_transport.c >>>>> @@ -2648,6 +2648,36 @@ transport_send_check_condition_and_sense(struct se_cmd *cmd, >>>>> buffer[SPC_ASC_KEY_OFFSET] = 0x1d; >>>>> buffer[SPC_ASCQ_KEY_OFFSET] = 0x00; >>>>> break; >>>>> + case TCM_LOGICAL_BLOCK_GUARD_CHECK_FAILED: >>>>> + /* CURRENT ERROR */ >>>>> + buffer[0] = 0x70; >>>>> + buffer[SPC_ADD_SENSE_LEN_OFFSET] = 10; >>>>> + /* ILLEGAL REQUEST */ >>>>> + buffer[SPC_SENSE_KEY_OFFSET] = ILLEGAL_REQUEST; >>>>> + /* LOGICAL BLOCK GUARD CHECK FAILED */ >>>>> + buffer[SPC_ASC_KEY_OFFSET] = 0x10; >>>>> + buffer[SPC_ASCQ_KEY_OFFSET] = 0x01; >> Hey Nic, >> >> In my iSER patches I constructed the same sense buffer (call >> isert_pi_err_sense_buffer) and called isert_put_rsponse. So I should >> call this routine instead correct? > Yes, it should be OK to use this for generating CHECK_CONDITION from > fabric protection failures in isert_completion_rdma_write() code after > device->unreg_rdma_mem() has been called. > > --nab > Will do that. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/