From patchwork Fri Oct 9 17:14:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 11826897 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4C23D16C1 for ; Fri, 9 Oct 2020 17:14:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1585622265 for ; Fri, 9 Oct 2020 17:14:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="MfxqcBri" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390049AbgJIROZ (ORCPT ); Fri, 9 Oct 2020 13:14:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731521AbgJIRON (ORCPT ); Fri, 9 Oct 2020 13:14:13 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 326D6C0613D2 for ; Fri, 9 Oct 2020 10:14:13 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id g10so7393194pfc.8 for ; Fri, 09 Oct 2020 10:14:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:mime-version; bh=p5TDwZMK3aPJQRCrERPtqdSFeH5p465wGpx/OMeD4YY=; b=MfxqcBriiCxBANyq9pWTJxLY62B1YSj3YPiQOdyC1TvDEKgbXfzfD+AqZ4RDFWeWiu uyYxuG0+kAM1BwcEHCPJehoRRrZ/9oaw1Xs58kJ/ocCymXVw8JE9F2uw1vo7P/teZDQq z/Qxj0UfBKh6N4TwYeE3Gv18Q4CwlYjHX0Tiw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version; bh=p5TDwZMK3aPJQRCrERPtqdSFeH5p465wGpx/OMeD4YY=; b=r7Vf5+d4SFPb9H/8AfI/SRBpXAhhOB6IOxkgDq59J262JXQlvWttGAwNhwptJ7UQg6 zR8L2r7cNq3lWh1w/OeB2A7s0c7bPmVd0UDDzjCYn8SNe15GiCk2u1f2hR02J+0BoiWw OnQopMxU7Ts8/zDlwtREnpjshCNGUdGBNqP11KQC3td8r3I2p7L66dxPTjOyTo4A3bQj mCFsrn7lS5qlgadEP22emdfj5/1/jtQXqzBtv6tISCqbqOtfYL6El/khlyEmM2/A9/Rs 6qi5kaKQOcZ7gfakURo7zpGE3VOmvUgl3NqnoSfCWiv4VVMzZoTXDIUM0Mv7KuH7h9wL OTRg== X-Gm-Message-State: AOAM5339xzA4blMqtoqlxsByjB/LDtprm2UtG5BnUSOjlUrIim3LPftj OWm86BBe9kL18y3Ysn8Izsb10A== X-Google-Smtp-Source: ABdhPJxJ79/1SgZcNIO4M/EesYZ+JlIyhKyqDHwwus6koJk5eepA50ySzDq0n97KCyQalmF6nDxMPA== X-Received: by 2002:a63:a55c:: with SMTP id r28mr4007526pgu.177.1602263652347; Fri, 09 Oct 2020 10:14:12 -0700 (PDT) Received: from dhcp-10-123-20-36.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id fy24sm12299055pjb.35.2020.10.09.10.14.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Oct 2020 10:14:10 -0700 (PDT) From: Sreekanth Reddy To: martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, sathya.prakash@broadcom.com, suganath-prabu.subramani@broadcom.com, Sreekanth Reddy Subject: [PATCH 00/14] mpt3sas: Add support for multi-port path topology Date: Fri, 9 Oct 2020 22:44:26 +0530 Message-Id: <20201009171440.4949-1-sreekanth.reddy@broadcom.com> X-Mailer: git-send-email 2.18.4 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Multi-port path topology example: Zone 1 Zone 2 |-----------------| |----------------| | HD1 ..... HD25 | | HD26 ......HD50| | |==================================| | | | | | | | | | Expander | | | |==================================| | | | | | | | |-----------|-----| |----|-----------| x8| |x8 _______|______________|_______ | HBA | |____________________________| In this topology, zoning is enabled in such a way that drives from HD1 to HD25 are accessible only through zone1 and drives from HD26 to HD50 are accessible only through zone2. Here the first x8 connection bw HBA to Expander in zone1 will have one PortID and second x8 connection bw HBA to Expander in Zone2 will another PortID. Problem statement: When zoning is enabled in expander then we will have two expander instances (for a single real expander), one instance is accessible through the first x8 connection and second instance is accessible through second x8 connection from HBA. But for both the instances the SAS Address of the expander will be the same. But in current mpt3sas driver, driver add's only one expander instance, when second expander instance's 'add' event comes then driver ignores this event assumues that it is duplicate instance as it already has a sas_expander object in it's sas_expander_list list with the same SAS Address. So in this topology users will see only 25 drives instead of 50 drives. Current mpt3sas driver use ‘SAS Address’ as a key to uniquely identify the End devices or Expander devices, but on the multi-port path topologies (such as above topology) HBA firmware will provide multiple device entries with different Device handles for a single device. So here driver can't use ‘SAS Address’ as a key instead driver can use ‘SAS Address’ & ‘PhysicalPort (i.e. PortID)’ number as key to uniquely identify the device. where, PhysicalPort is a HBA port number through which the device is accessible. Solution: Now driver uses both 'SAS Address' & 'PhysicalPort' number as a key to uniquely identify the device object from the corresponding device list's. So, when 'add' event comes for second instance of expander, now driver can't find the sas_expander object with same 'SAS Address' & 'PhysicalPort' number (since for this second instance PhysicalPort number will be different from first instance's PhysicalPort number) from the sas_expander_list list. So the driver processes this event and will create a new sas_expander object for this expander instance and adds it sas_expander_list. With this solution, the driver will have two sas_expander objects, one object is for the first instance of the expander, another object is for second instance of the driver. Now users will access all 50 drives from above topology. Like device SAS Address, PhysicalPort number is readily available from below config pages, * SAS IO Unit Page 0, * SAS Device Page 0, * SAS Expander Page 0, * SAS Phy Page 0, etc Through this patch set, the driver now manages the sas_device & sas_expander objects using 'SAS Address' & 'PhysicalPort' number as key. Sreekanth Reddy (14): mpt3sas: Define hba_port structure mpt3sas: Allocate memory for hba_port objects mpt3sas: Rearrange _scsih_mark_responding_sas_device() mpt3sas: Update hba_port's sas_address & phy_mask mpt3sas: Get device objects using sas_address & portID mpt3sas: Rename transport_del_phy_from_an_existing_port mpt3sas: Get sas_device objects using device's rphy mpt3sas: Update hba_port objects after host reset mpt3sas: Set valid PhysicalPort in SMPPassThrough mpt3sas: Handling HBA vSES device mpt3sas: Add bypass_dirty_port_flag parameter mpt3sas: Handle vSES vphy object during HBA reset mpt3sas: add module parameter multipath_on_hba mpt3sas: Bump driver version to 35.101.00.00 drivers/scsi/mpt3sas/mpt3sas_base.h | 102 +- drivers/scsi/mpt3sas/mpt3sas_ctl.c | 6 +- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 1237 +++++++++++++++++++--- drivers/scsi/mpt3sas/mpt3sas_transport.c | 312 +++++- 4 files changed, 1455 insertions(+), 202 deletions(-)