From patchwork Tue Oct 27 13:08:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 11860339 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 2B024139F for ; Tue, 27 Oct 2020 13:08:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3759221F8 for ; Tue, 27 Oct 2020 13:08:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="FhDpt5xo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751838AbgJ0NIV (ORCPT ); Tue, 27 Oct 2020 09:08:21 -0400 Received: from mail-pj1-f49.google.com ([209.85.216.49]:33796 "EHLO mail-pj1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751683AbgJ0NIV (ORCPT ); Tue, 27 Oct 2020 09:08:21 -0400 Received: by mail-pj1-f49.google.com with SMTP id b6so731956pju.1 for ; Tue, 27 Oct 2020 06:08:20 -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=TDTXYv3Z4Lh2a1Rt9HGlXkTS8UDvlOWdufaKS2J45qw=; b=FhDpt5xoHJjKi6NAXnfVY3QvOy2g6eekj/z6uuUBaLExeAGwMfaxkRbylt2IUO6MKL Zt1NfrBEWvuxlAfEwbXRsVnIfK0tgxeNuSSQxN66h0MLUuQ9Aspg+bJyTGX1oVq//6v+ Qoisplr6uBIRX1aYTf+QM8QJ/JPOzW8Ln/Chw= 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=TDTXYv3Z4Lh2a1Rt9HGlXkTS8UDvlOWdufaKS2J45qw=; b=oAuJgfBLWZK6SgEDNB3oPvCdkt67kjmDPoPBgoffM5YvDUd/YTemg+OtYsrIu8ExBJ EOhBD5+uis3lKvKgkGxIPUZOQBOhRG2vsCUhkqg1jtb0vdX90+GYDG8TGB1teERCkpoX B/66rGvGxX7JTjp+TkJcTud/GGW+GkaEaHaleVcXGMfF8WTI6Va2z+BrmmwmgGVkw0h5 gt9wYJI6GKmrFFfYx7h4ptMseDUclv5t8KbEIc7HAOsSd8qfC9Ius0XO19D9N3SblluX AaYalMriZLDhhrVs9nExmfQs1eL9Nfu3oWQLeY4/1ZgiHCogXWiLqu12jvRJ7mPdqHwm qfdw== X-Gm-Message-State: AOAM530WDZrKTJ0OTLOua14Ta2IqZEJhGDnMfSl8LRXMbe3vZuWUOFyL QrhsG4W9HutvDqQRH8FCZcxcvPtsGwlQYQ== X-Google-Smtp-Source: ABdhPJzVPSnNbeTLtXstnOaUAuCYmfIteHhc+rQA08OKM79h+ZDXRgUBRsyi0wID7ZzX5MNcYRQNQA== X-Received: by 2002:a17:90a:6f05:: with SMTP id d5mr2020061pjk.162.1603804099598; Tue, 27 Oct 2020 06:08:19 -0700 (PDT) Received: from dhcp-10-123-20-36.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id b24sm2009319pge.59.2020.10.27.06.08.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 06:08:18 -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 v1 00/14] mpt3sas: Add support for multi-port path topology Date: Tue, 27 Oct 2020 18:38:33 +0530 Message-Id: <20201027130847.9962-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. v1: Fix compilation warning reported by kernel test robot. 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 | 1238 +++++++++++++++++++--- drivers/scsi/mpt3sas/mpt3sas_transport.c | 312 +++++- 4 files changed, 1456 insertions(+), 202 deletions(-)