From patchwork Fri Dec 18 13:26:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Saxena X-Patchwork-Id: 7883891 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 4150F9F32E for ; Fri, 18 Dec 2015 13:28:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4F41E204A2 for ; Fri, 18 Dec 2015 13:28:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 58508204A0 for ; Fri, 18 Dec 2015 13:28:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932302AbbLRN2U (ORCPT ); Fri, 18 Dec 2015 08:28:20 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:33522 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932251AbbLRN2O (ORCPT ); Fri, 18 Dec 2015 08:28:14 -0500 Received: by mail-pa0-f46.google.com with SMTP id ur14so60623303pab.0 for ; Fri, 18 Dec 2015 05:28:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=avagotech.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TDV9AfmKtB2PP5m7BGZfrqDPogha5Y01fYdLeYIQYEc=; b=feXU8xEs1CFI0LiCvrMHnlTJq3Z4Jba5a0usntDnDP5avfa4jgBv3IWoXI4vc7W/Xf mVs8khqLgNG08ewzszAYetjCVXhw2Q3mAn0eu0vaSPwvrzEz08Ug9MtuZ6y+xxUPBkrE WMq0WLgN3HYGmO3QKaEdsIo2B+dVDzMBe/Xr8= 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=TDV9AfmKtB2PP5m7BGZfrqDPogha5Y01fYdLeYIQYEc=; b=j8l/H0dTN7MXHiEwDNOb4Gme9z3o2Xifu0KJglegXimkXV5IId0MlSrvcd4uLR/3dk /LCYBFIB9mogls331WYU7YCL8o84SEU4KVOhPghOBkBCZ6KcuNFK25J9CAyg2EYxYxtS CbEQ7fbnmoiD1HHmGIh56uS9MYfpdQY3FOe86339hvIHalM2JVsfQ5ap0CxOuhMpO38t MA6Igq7abOsrj+JinAz1CufqrRTiSHGndE4PVv4E8ry89N0pgLyapICiLAkYcnumP2jd LLxi3g5Uj3Ov9NUAsrR6NNJ3yp6+xXS8nn5g6NBW2bGYP3BVGg00/3e7J62NrDbjyn+S 1lbQ== X-Gm-Message-State: ALoCoQm3Oj/FTldHl8zKeLVp4poe8dg0RKR3OTLa/Z5uhz0weS0s2PQYCTaUlSoa1SJuA+p4Xsbdb1CsFJjCT0vPjeFzO7Xm1w== X-Received: by 10.67.2.73 with SMTP id bm9mr5250039pad.94.1450445293339; Fri, 18 Dec 2015 05:28:13 -0800 (PST) Received: from host1.dhcp.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id 2sm18089348pfl.56.2015.12.18.05.28.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Dec 2015 05:28:12 -0800 (PST) From: Sumit Saxena X-Google-Original-From: Sumit Saxena To: jbottomley@parallels.com, hch@infradead.org, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, kashyap.desai@avagotech.com, sumit.saxena@avagotech.com Subject: [PATCH 06/15] megaraid_sas: Fastpath region lock bypass Date: Fri, 18 Dec 2015 18:56:59 +0530 Message-Id: <1450445228-26571-7-git-send-email-Sumit.Saxena@avagotech.com> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1450445228-26571-1-git-send-email-Sumit.Saxena@avagotech.com> References: <1450445228-26571-1-git-send-email-Sumit.Saxena@avagotech.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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,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 Firmware will fill per LD data to tell driver that particular LD supports Region lock bypass or not. If yes, then Driver will send non FP LDIO to region lock bypass FIFO. With this change in driver, firmware will optimize certain code to improve performance. Signed-off-by: Kashyap Desai Signed-off-by: Sumit Saxena Reviewed-by: Tomas Henzl --- drivers/scsi/megaraid/megaraid_sas.h | 8 ++++++-- drivers/scsi/megaraid/megaraid_sas_fp.c | 2 ++ drivers/scsi/megaraid/megaraid_sas_fusion.c | 6 ++++-- drivers/scsi/megaraid/megaraid_sas_fusion.h | 8 +++++--- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index 773fc54..01135be 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -1528,7 +1528,9 @@ union megasas_sgl_frame { typedef union _MFI_CAPABILITIES { struct { #if defined(__BIG_ENDIAN_BITFIELD) - u32 reserved:23; + u32 reserved:21; + u32 support_fp_rlbypass:1; + u32 support_vfid_in_ioframe:1; u32 support_ext_io_size:1; u32 support_ext_queue_depth:1; u32 security_protocol_cmds_fw:1; @@ -1548,7 +1550,9 @@ typedef union _MFI_CAPABILITIES { u32 security_protocol_cmds_fw:1; u32 support_ext_queue_depth:1; u32 support_ext_io_size:1; - u32 reserved:23; + u32 support_vfid_in_ioframe:1; + u32 support_fp_rlbypass:1; + u32 reserved:21; #endif } mfi_capabilities; __le32 reg; diff --git a/drivers/scsi/megaraid/megaraid_sas_fp.c b/drivers/scsi/megaraid/megaraid_sas_fp.c index 741509b..e413113 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fp.c +++ b/drivers/scsi/megaraid/megaraid_sas_fp.c @@ -1020,6 +1020,8 @@ MR_BuildRaidContext(struct megasas_instance *instance, /* assume this IO needs the full row - we'll adjust if not true */ regSize = stripSize; + io_info->do_fp_rlbypass = raid->capability.fpBypassRegionLock; + /* Check if we can send this I/O via FastPath */ if (raid->capability.fpCapable) { if (isRead) diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 0b31f5a..e8730ef 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -666,6 +666,8 @@ megasas_ioc_init_fusion(struct megasas_instance *instance) if (instance->max_chain_frame_sz > MEGASAS_CHAIN_FRAME_SZ_MIN) drv_ops->mfi_capabilities.support_ext_io_size = 1; + drv_ops->mfi_capabilities.support_fp_rlbypass = 1; + /* Convert capability to LE32 */ cpu_to_le32s((u32 *)&init_frame->driver_operations.mfi_capabilities); @@ -1710,8 +1712,8 @@ megasas_build_ldio_fusion(struct megasas_instance *instance, (MEGASAS_REQ_DESCRIPT_FLAGS_LD_IO << MEGASAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); if (fusion->adapter_type == INVADER_SERIES) { - if (io_request->RaidContext.regLockFlags == - REGION_TYPE_UNUSED) + if (io_info.do_fp_rlbypass || + (io_request->RaidContext.regLockFlags == REGION_TYPE_UNUSED)) cmd->request_desc->SCSIIO.RequestFlags = (MEGASAS_REQ_DESCRIPT_FLAGS_NO_LOCK << MEGASAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.h b/drivers/scsi/megaraid/megaraid_sas_fusion.h index a1f1c0b..db0978d 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.h +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.h @@ -643,7 +643,8 @@ struct MR_SPAN_BLOCK_INFO { struct MR_LD_RAID { struct { #if defined(__BIG_ENDIAN_BITFIELD) - u32 reserved4:6; + u32 reserved4:5; + u32 fpBypassRegionLock:1; u32 tmCapable:1; u32 fpNonRWCapable:1; u32 fpReadAcrossStripe:1; @@ -667,7 +668,8 @@ struct MR_LD_RAID { u32 fpReadAcrossStripe:1; u32 fpNonRWCapable:1; u32 tmCapable:1; - u32 reserved4:6; + u32 fpBypassRegionLock:1; + u32 reserved4:5; #endif } capability; __le32 reserved6; @@ -737,7 +739,7 @@ struct IO_REQUEST_INFO { u8 fpOkForIo; u8 IoforUnevenSpan; u8 start_span; - u8 reserved; + u8 do_fp_rlbypass; u64 start_row; u8 span_arm; /* span[7:5], arm[4:0] */ u8 pd_after_lb;