From patchwork Mon Mar 30 03:28:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nicholas A. Bellinger" X-Patchwork-Id: 6118311 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0626E9F6E1 for ; Mon, 30 Mar 2015 03:29:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 251172037F for ; Mon, 30 Mar 2015 03:29:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 33D872037D for ; Mon, 30 Mar 2015 03:29:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752800AbbC3D3f (ORCPT ); Sun, 29 Mar 2015 23:29:35 -0400 Received: from mail-ob0-f169.google.com ([209.85.214.169]:36841 "EHLO mail-ob0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752808AbbC3D3b (ORCPT ); Sun, 29 Mar 2015 23:29:31 -0400 Received: by obbld8 with SMTP id ld8so58173547obb.3 for ; Sun, 29 Mar 2015 20:29:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=eeplCdeo8zePidaQdGqUl4D/QW3SwwWgKdYisg7ZZ3U=; b=Mw2rH8n9+VeCM9ipnA7ml/WWHJIBuOrqDjPYSmSK6plbVaG1oPBVACEf7gzqsKnZ7w 3B6hux4nA7WuEfXmsadNL72y/GzRxlkUlIksmso8zx7RSJ7w6CMKuYxXXxPYS3RSchxw mPILmywQcoFmc4/Sa4F+nOnU2qcYrJevJBz71TxNUv3MaIK9qYHgLqX50hwTk2K160P8 ZSBRBmfugm1D+7ClYX0IZ4rtGxN8gs2o7Mrdlwb5X3xilZKcRBZ1m5YHdiSke5Hw+y8H rv1AP93zql+S6KyxOLTvMJktmz3VQbGo7M08SeR0rf/SSvjy3xKGxymYsvoFUde/pJgc gXdg== X-Gm-Message-State: ALoCoQlYiNJBJsFgVlLqIy6wVENILUNdIXz4hmX7MSMLXk26KAJwDe++nte8p4nDRND2Yi6ECnAQ X-Received: by 10.182.61.41 with SMTP id m9mr25212694obr.6.1427686170946; Sun, 29 Mar 2015 20:29:30 -0700 (PDT) Received: from localhost.localdomain (mail.linux-iscsi.org. [67.23.28.174]) by mx.google.com with ESMTPSA id wc6sm5439898obc.8.2015.03.29.20.29.30 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 29 Mar 2015 20:29:30 -0700 (PDT) From: "Nicholas A. Bellinger" To: target-devel Cc: linux-scsi , "Martin K. Petersen" , Sagi Grimberg , Quinn Tran , Nicholas Bellinger , Christoph Hellwig Subject: [PATCH-v2 07/15] target: Add internal READ_INSERT support Date: Mon, 30 Mar 2015 03:28:16 +0000 Message-Id: <1427686104-14231-8-git-send-email-nab@daterainc.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1427686104-14231-1-git-send-email-nab@daterainc.com> References: <1427686104-14231-1-git-send-email-nab@daterainc.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 From: Nicholas Bellinger This patch adds READ_INSERT support in target_check_read_prot() that invokes sbc_dif_generate() when LIO is responsible for generating the outgoing T10-PI. Required for supporting fabrics that exchange protection information, and would like to function with un-protected devices. Cc: Martin Petersen Cc: Sagi Grimberg Cc: Christoph Hellwig Signed-off-by: Nicholas Bellinger Reviewed-by: Martin K. Petersen --- drivers/target/target_core_transport.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index e603e34..12b13da 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1994,6 +1994,12 @@ static bool target_check_read_prot(struct se_cmd *cmd) } } break; + case TARGET_PROT_DIN_INSERT: + if (cmd->se_sess->sup_prot_ops & TARGET_PROT_DIN_INSERT) + break; + + sbc_dif_generate(cmd); + break; default: break; }