All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 08/14] mpt3sas: Update hba_port objects after host reset
@ 2020-10-09 23:49 kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2020-10-09 23:49 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 7775 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20201009171440.4949-9-sreekanth.reddy@broadcom.com>
References: <20201009171440.4949-9-sreekanth.reddy@broadcom.com>
TO: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
TO: martin.petersen(a)oracle.com
CC: linux-scsi(a)vger.kernel.org
CC: sathya.prakash(a)broadcom.com
CC: suganath-prabu.subramani(a)broadcom.com
CC: Sreekanth Reddy <sreekanth.reddy@broadcom.com>

Hi Sreekanth,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.9-rc8 next-20201009]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Sreekanth-Reddy/mpt3sas-Add-support-for-multi-port-path-topology/20201010-011607
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
:::::: branch date: 7 hours ago
:::::: commit date: 7 hours ago
config: s390-randconfig-m031-20201009 (attached as .config)
compiler: s390-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/scsi/mpt3sas/mpt3sas_scsih.c:5940 _scsih_look_and_get_matched_port_entry() error: uninitialized symbol 'matched_code'.

Old smatch warnings:
drivers/scsi/mpt3sas/mpt3sas_scsih.c:5949 _scsih_look_and_get_matched_port_entry() error: uninitialized symbol 'matched_code'.
drivers/scsi/mpt3sas/mpt3sas_scsih.c:5961 _scsih_look_and_get_matched_port_entry() error: uninitialized symbol 'matched_code'.
drivers/scsi/mpt3sas/mpt3sas_scsih.c:6472 _scsih_expander_add() warn: returning -1 instead of -ENOMEM is sloppy
drivers/scsi/mpt3sas/mpt3sas_scsih.c:10234 _mpt3sas_fw_work() warn: inconsistent indenting

vim +/matched_code +5940 drivers/scsi/mpt3sas/mpt3sas_scsih.c

2756bd46f6fdde Sreekanth Reddy 2020-10-09  5897  
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5898  /**
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5899   * _scsih_look_and_get_matched_port_entry - Get matched hba port entry
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5900   *					from HBA port table
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5901   * @ioc: per adapter object
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5902   * @port_entry - hba port entry from temporary port table which needs to be
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5903   *		searched for matched entry in the HBA port table
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5904   * @matched_port_entry - save matched hba port entry here
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5905   * @count - count of matched entries
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5906   *
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5907   * return type of matched entry found.
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5908   */
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5909  static enum hba_port_matched_codes
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5910  _scsih_look_and_get_matched_port_entry(struct MPT3SAS_ADAPTER *ioc,
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5911  	struct hba_port *port_entry,
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5912  	struct hba_port **matched_port_entry, int *count)
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5913  {
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5914  	struct hba_port *port_table_entry, *matched_port = NULL;
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5915  	enum hba_port_matched_codes matched_code;
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5916  	int lcount = 0;
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5917  	*matched_port_entry = NULL;
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5918  
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5919  	list_for_each_entry(port_table_entry, &ioc->port_table_list, list) {
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5920  		if (!(port_table_entry->flags & HBA_PORT_FLAG_DIRTY_PORT))
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5921  			continue;
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5922  
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5923  		if ((port_table_entry->sas_address == port_entry->sas_address)
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5924  		    && (port_table_entry->phy_mask == port_entry->phy_mask)) {
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5925  			matched_code = MATCHED_WITH_ADDR_AND_PHYMASK;
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5926  			matched_port = port_table_entry;
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5927  			break;
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5928  		}
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5929  
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5930  		if ((port_table_entry->sas_address == port_entry->sas_address)
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5931  		    && (port_table_entry->phy_mask & port_entry->phy_mask)
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5932  		    && (port_table_entry->port_id == port_entry->port_id)) {
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5933  			matched_code = MATCHED_WITH_ADDR_SUBPHYMASK_AND_PORT;
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5934  			matched_port = port_table_entry;
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5935  			continue;
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5936  		}
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5937  
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5938  		if ((port_table_entry->sas_address == port_entry->sas_address)
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5939  		    && (port_table_entry->phy_mask & port_entry->phy_mask)) {
2756bd46f6fdde Sreekanth Reddy 2020-10-09 @5940  			if (matched_code ==
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5941  			    MATCHED_WITH_ADDR_SUBPHYMASK_AND_PORT)
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5942  				continue;
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5943  			matched_code = MATCHED_WITH_ADDR_AND_SUBPHYMASK;
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5944  			matched_port = port_table_entry;
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5945  			continue;
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5946  		}
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5947  
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5948  		if (port_table_entry->sas_address == port_entry->sas_address) {
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5949  			if (matched_code ==
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5950  			    MATCHED_WITH_ADDR_SUBPHYMASK_AND_PORT)
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5951  				continue;
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5952  			if (matched_code == MATCHED_WITH_ADDR_AND_SUBPHYMASK)
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5953  				continue;
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5954  			matched_code = MATCHED_WITH_ADDR;
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5955  			matched_port = port_table_entry;
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5956  			lcount++;
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5957  		}
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5958  	}
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5959  
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5960  	*matched_port_entry = matched_port;
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5961  	if (matched_code ==  MATCHED_WITH_ADDR)
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5962  		*count = lcount;
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5963  	return matched_code;
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5964  }
2756bd46f6fdde Sreekanth Reddy 2020-10-09  5965  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 29356 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH 00/14] mpt3sas: Add support for multi-port path topology
@ 2020-10-09 17:14 Sreekanth Reddy
  2020-10-09 17:14 ` [PATCH 08/14] mpt3sas: Update hba_port objects after host reset Sreekanth Reddy
  0 siblings, 1 reply; 5+ messages in thread
From: Sreekanth Reddy @ 2020-10-09 17:14 UTC (permalink / raw)
  To: martin.petersen
  Cc: linux-scsi, sathya.prakash, suganath-prabu.subramani, Sreekanth Reddy

[-- Attachment #1: Type: text/plain, Size: 4278 bytes --]

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(-)

-- 
2.18.4


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4175 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-10-12 12:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-09 23:49 [PATCH 08/14] mpt3sas: Update hba_port objects after host reset kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2020-10-09 17:14 [PATCH 00/14] mpt3sas: Add support for multi-port path topology Sreekanth Reddy
2020-10-09 17:14 ` [PATCH 08/14] mpt3sas: Update hba_port objects after host reset Sreekanth Reddy
2020-10-12 12:22   ` Dan Carpenter
2020-10-12 12:22     ` Dan Carpenter
2020-10-12 12:22     ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.