]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
8 years agoi40e: Changed version from 1.6.21 to 1.6.25
Bimmy Pujari [Tue, 8 Nov 2016 21:05:19 +0000 (13:05 -0800)]
i40e: Changed version from 1.6.21 to 1.6.25

Signed-off-by: Bimmy Pujari <bimmy.pujari@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Orabug: 26132523
(cherry picked from commit 360238693d2bc93fb6ff73146ed358e84fe67961)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Brian Maly <brian.maly@oracle.com>
8 years agords: tcp: fix memory leak in TIME_WAIT sockets
Sowmini Varadhan [Wed, 7 Jun 2017 21:09:38 +0000 (14:09 -0700)]
rds: tcp: fix memory leak in TIME_WAIT sockets

Due to a toxic cocktail of an endian-ness bug, plus some other changes
in mprds to make sure that the side with the numerically smaller address
must initiate the tcp connection, end result is an infinite connection
attempt and a memory leak in TIME_WAIT sockets.

Orabug: 26250066

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
8 years agords: tcp: canonical connection order for all paths with index > 0
Sowmini Varadhan [Wed, 31 May 2017 19:11:20 +0000 (12:11 -0700)]
rds: tcp: canonical connection order for all paths with index > 0

The rds_connect_worker() has a bug in the check that enforces the
canonical connection order described in the comments of
rds_tcp_state_change(). The intention is to make sure that all
the multipath connections are always initiated by the smaller IP
address via rds_start_mprds. To achieve this, rds_connection_worker
should check that cp_index > 0.

Orabug: 26241322

(Cherry-pick of upstream 087d975353d0cc9b7536d6ef46cd9303fceb2e17)

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agords: tcp: allow progress of rds_conn_shutdown if the rds_connection is marked ERROR...
Sowmini Varadhan [Wed, 31 May 2017 19:08:34 +0000 (12:08 -0700)]
rds: tcp: allow progress of rds_conn_shutdown if the rds_connection is marked ERROR by an intervening FIN

rds_conn_shutdown() runs in workq context, and marks the rds_connection
as DISCONNECTING before quiescing Tx/Rx paths. However, after all I/O
has quiesced, we may still find the rds_connection state to be
RDS_CONN_ERROR if an intervening FIN was processed in softirq context.

This is not a fatal error: rds_conn_shutdown() should continue the
shutdown, and there is no need to log noisy messages about this event.

Orabug: 26241322

(Cherry-pick of upstream e97656d03ca0cea888a0b9d382abce8233771f31)

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoBackport multipath RDS from upstream to UEK4
Sowmini Varadhan [Fri, 28 Apr 2017 00:50:42 +0000 (17:50 -0700)]
Backport multipath RDS from upstream to UEK4

This commit backports upstream Multipath RDS to UEK4.

Orabug: 26241322

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
8 years agoIB/cm: remove unnecessary ib_query_device in PSIF RNR WA
Wei Lin Guay [Wed, 7 Dec 2016 08:08:09 +0000 (09:08 +0100)]
IB/cm: remove unnecessary ib_query_device in PSIF RNR WA

The query device is performed in CM REQ/REP to retrieve the
vendorID of the sif device. This operation is illegal because
it is calling a sleeping function (ib_query_device) from
a non-sleepable context. Thus, this patch removes this illegal
call and reuses the cached vendorID/DeviceID in the pci_dev
data structure.

Orabug: 25892550

Signed-off-by: Wei Lin Guay <wei.lin.guay@oracle.com>
Reviewed-by: Håkon Bugge <haakon.bugge@oracle.com>
Reviewed-by: Francisco Triviño García <francisco.trivino@oracle.com>
Reviewed-by: Gerd Rausch <gerd.rausch@oracle.com>
8 years agoFix Express lane queue creation.
James Smart [Fri, 21 Apr 2017 23:05:05 +0000 (16:05 -0700)]
Fix Express lane queue creation.

The older sli4 adapters only supported the 64 byte WQE entry size.
The new adapter (fw) support both 64 and 128 byte WQE entry sizies.
The Express lane WQ was not being created with the 128 byte WQE sizes
when it was supported.

Not having the right WQE size created for the express lane work queue
caused the the firmware to overwrite the lun indentifier in the FCP header.

This patch correctly creates the express lane work queue with the
supported size.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
(cherry picked from commit 7e04e21afa82ef024416f5413b5bdb66e0505bcd)

Orabug: 26241598

Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoxfs: reset b_first_retry_time when clear the retry status of xfs_buf_t
Hou Tao [Fri, 3 Feb 2017 22:39:07 +0000 (14:39 -0800)]
xfs: reset b_first_retry_time when clear the retry status of xfs_buf_t

After successful IO or permanent error, b_first_retry_time also
needs to be cleared, else the invalid first retry time will be
used by the next retry check.

Signed-off-by: Hou Tao <houtao1@huawei.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
(cherry picked from commit 4dd2eb633598cb6a5a0be2fd9a2be0819f5eeb5f)

Orabug: 26130728

Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoxfs: fix max_retries _show and _store functions
Carlos Maiolino [Wed, 4 Jan 2017 04:34:17 +0000 (20:34 -0800)]
xfs: fix max_retries _show and _store functions

max_retries _show and _store functions should test against cfg->max_retries,
not cfg->retry_timeout

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
(cherry picked from commit ff97f2399edac1e0fb3fa7851d5fbcbdf04717cf)

Orabug: 26130728

Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoxfs: normalize "infinite" retries in error configs
Eric Sandeen [Tue, 13 Sep 2016 21:51:30 +0000 (07:51 +1000)]
xfs: normalize "infinite" retries in error configs

As it stands today, the "fail immediately" vs. "retry forever"
values for max_retries and retry_timeout_seconds in the xfs metadata
error configurations are not consistent.

A retry_timeout_seconds of 0 means "retry forever," but a
max_retries of 0 means "fail immediately."

retry_timeout_seconds < 0 is disallowed, while max_retries == -1
means "retry forever."

Make this consistent across the error configs, such that a value of
0 means "fail immediately" (i.e. wait 0 seconds, or retry 0 times),
and a value of -1 always means "retry forever."

This makes retry_timeout a signed long to accommodate the -1, even
though it stores jiffies.  Given our limit of a 1 day maximum
timeout, this should be sufficient even at much higher HZ values
than we have available today.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
(cherry picked from commit 77169812739dd800bc3620d781a77c50c75165cc)

Orabug: 26130728

Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoxfs: don't reset b_retries to 0 on every failure
Eric Sandeen [Wed, 20 Jul 2016 00:54:09 +0000 (10:54 +1000)]
xfs: don't reset b_retries to 0 on every failure

With the code as it stands today, b_retries never increments because
it gets reset to 0 in the error callback.

Remove that, and fix a similar problem where the first retry time
was constantly being overwritten, which defeated the timeout tunable
as well.  We now only set first retry time if a non-zero timeout is
set, to match the behavior of only incrementing retries if a retry
value is set.

This way max retries & timeouts consistently take effect after a
tunable is set, rather than acting retroactively on a buffer which
has failed at some point in the past and has accumulated state from
those prior failures.

Thanks to dchinner for talking through this with me.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
(cherry picked from commit 5539d36752eb789f4067a9f88e72177895d56317)

Orabug: 26130728

Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoxfs: fix xfs_error_get_cfg for negative errnos
Eric Sandeen [Wed, 20 Jul 2016 00:48:51 +0000 (10:48 +1000)]
xfs: fix xfs_error_get_cfg for negative errnos

xfs_error_get_cfg() is called with bp->b_error as an arg, which is
negative, so the switch statement won't ever find any matches.

This results in only the default error handler having any effect, as
EIO/ENOSPC/ENODEV get ignored due to the wrong sign.

It seems simplest to always flip the error sign to positive, so that
we can handle either negative errors in bp->b_error, or possibly a
positive errno via something like xfs_error_get_cfg(EIO) - this
future-proofs the function.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
(cherry picked from commit e97f6c545f963abd7de56a58a29ba73a9edee015)

Orabug: 26130728

Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoxfs: add "fail at unmount" error handling configuration
Carlos Maiolino [Wed, 18 May 2016 01:11:27 +0000 (11:11 +1000)]
xfs: add "fail at unmount" error handling configuration

If we take "retry forever" literally on metadata IO errors, we can
hang at unmount, once it retries those writes forever. This is the
default behavior, unfortunately.

Add an error configuration option for this behavior and default it
to "fail" so that an unmount will trigger actuall errors, a shutdown
and allow the unmount to succeed. It will be noisy, though, as it
will log the errors and shutdown that occurs.

To fix this, we need to mark the filesystem as being in the process
of unmounting. Do this with a mount flag that is added at the
appropriate time (i.e. before the blocking AIL sync). We also need
to add this flag if mount fails after the initial phase of log
recovery has been run.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
(cherry picked from commit e6b3bb78962e65c4ad125598755cfbf2a8779e86)

Orabug: 26130728

Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
 Conflicts:
fs/xfs/xfs_mount.c
fs/xfs/xfs_mount.h

8 years agoxfs: add configuration handlers for specific errors
Carlos Maiolino [Wed, 18 May 2016 01:09:28 +0000 (11:09 +1000)]
xfs: add configuration handlers for specific errors

now most of the infrastructure is in place, we can start adding
support for configuring specific errors such as ENODEV, ENOSPC, EIO,
etc. Add these error configurations and configure them all to have
appropriate behaviours. That is, all will be configured to retry
forever by default, except for ENODEV, which is an unrecoverable
error, so it will be configured to not retry on error

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
(cherry picked from commit e0a431b3a3cc3d0a4c38ccfca8c7320fde40efb6)

Orabug: 26130728

Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoxfs: add configuration of error failure speed
Carlos Maiolino [Wed, 18 May 2016 01:08:15 +0000 (11:08 +1000)]
xfs: add configuration of error failure speed

On reception of an error, we can fail immediately, perform some
bound amount of retries or retry indefinitely. The current behaviour
we have is to retry forever.

However, we'd like the ability to choose how long the filesystem
should try after an error, it can either fail immediately, retry a
few times, or retry forever. This is implemented by using
max_retries sysfs attribute, to hold the amount of times we allow
the filesystem to retry after an error. Being -1 a special case
where the filesystem will retry indefinitely.

Add both a maximum retry count and a retry timeout so that we can
bound by time and/or physical IO attempts.

Finally, plumb these into xfs_buf_iodone error processing so that
the error behaviour follows the selected configuration.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
(cherry picked from commit a5ea70d25d76950e11690110b526374307d05d81)

Orabug: 26130728

Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoxfs: introduce table-based init for error behaviors
Carlos Maiolino [Wed, 18 May 2016 01:06:44 +0000 (11:06 +1000)]
xfs: introduce table-based init for error behaviors

Before we start expanding the number of error classes and errors we
can configure behaviour for, we need a simple and clear way to
define the default behaviour that we initialized each mount with.
Introduce a table based method for keeping the initial configuration
in, and apply that to the existing initialization code.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
(cherry picked from commit ef6a50fbb1bba7951aa23adcfb40e99ca72dc51c)

Orabug: 26130728

Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoxfs: add configurable error support to metadata buffers
Carlos Maiolino [Wed, 18 May 2016 01:05:33 +0000 (11:05 +1000)]
xfs: add configurable error support to metadata buffers

With the error configuration handle for async metadata write errors
in place, we can now add initial support to the IO error processing
in xfs_buf_iodone_error().

Add an infrastructure function to look up the configuration handle,
and rearrange the error handling to prepare the way for different
error handling conigurations to be used.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
(cherry picked from commit df3093907ccc718459c54c99da29dd774af41186)

Orabug: 26130728

Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
 Conflicts:
fs/xfs/xfs_buf_item.c

8 years agoxfs: introduce metadata IO error class
Carlos Maiolino [Wed, 18 May 2016 01:01:00 +0000 (11:01 +1000)]
xfs: introduce metadata IO error class

Now we have the basic infrastructure, add the first error class so
we can build up the infrastructure in a meaningful way. Add the
metadata async write IO error class and sysfs entry, and introduce a
default configuration that matches the existing "retry forever"
behavior for async write metadata buffers.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
(cherry picked from commit ffd40ef697dfd3e06f44b1bb5fea93079de8c77d)

Orabug: 26130728

Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoxfs: configurable error behavior via sysfs
Carlos Maiolino [Wed, 18 May 2016 00:58:51 +0000 (10:58 +1000)]
xfs: configurable error behavior via sysfs

We need to be able to change the way XFS behaviours in error
conditions depending on the type of underlying storage. This is
necessary for handling non-traditional block devices with extended
error cases, such as thin provisioned devices that can return ENOSPC
as an IO error.

Introduce the basic sysfs infrastructure needed to define and
configure error behaviours. This is done to be generic enough to
extend to configuring behaviour in other error conditions, such as
ENOMEM, which also has different desired behaviours according to
machine configuration.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
(cherry picked from commit 192852be8b5fb14268c2133fe9ce5312e4745963)

Orabug: 26130728

Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
 Conflicts:
fs/xfs/xfs_sysfs.c

8 years agosparc64: mm: fix copy_tsb to correctly copy huge page TSBs
Mike Kravetz [Fri, 2 Jun 2017 21:51:12 +0000 (14:51 -0700)]
sparc64: mm: fix copy_tsb to correctly copy huge page TSBs

When a TSB grows beyond its current capacity, a new TSB is allocated
and copy_tsb is called to copy entries from the old TSB to the new.
A hash shift based on page size is used to calculate the index of an
entry in the TSB.  copy_tsb has hard coded PAGE_SHIFT in these
calculations.  However, for huge page TSBs the value REAL_HPAGE_SHIFT
should be used.  As a result, when copy_tsb is called for a huge page
TSB the entries are placed at the incorrect index in the newly
allocated TSB.  When doing hardware table walk, the MMU does not
match these entries and we end up in the TSB miss handling code.
This code will then create and write an entry to the correct index
in the TSB.  We take a performance hit for the table walk miss and
recreation of these entries.

Pass a new parameter to copy_tsb that is the page size shift to be
used when copying the TSB.

Orabug: 26100901

Suggested-by: Anthony Yznaga <anthony.yznaga@oracle.com>
Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from Linus repo on 7 July 2017
 commit 654f4807624a657f364417c2a7454f0df9961734)
Reviewed-by: Steve Sistare steven.sistare@oracle.com
Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
8 years agoIB/mlx4: Change flush logic so it adheres to the variable name
Håkon Bugge [Fri, 28 Apr 2017 11:06:53 +0000 (13:06 +0200)]
IB/mlx4: Change flush logic so it adheres to the variable name

Change and simplify the code to match the variable name. This commit
improves readability but makes no functional change to the code.

Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
Suggested-by: Wengang Wang <wen.gang.wang@oracle.com>
Reviewed-by: Wengang Wang <wen.gang.wang@oracle.com>
Reviewed-by: Knut Omang <knut.omang@oracle.com>
Acked-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
(cherry picked from commit 898782883501798284a10d1467b11dd2a48270cf)

Orabug: 26187991

Reviewed-by: Wei Lin Guay <wei.lin.guay@oracle.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
8 years agoIB/mlx4: Fix incorrect order of formal and actual parameters
Håkon Bugge [Fri, 28 Apr 2017 11:06:54 +0000 (13:06 +0200)]
IB/mlx4: Fix incorrect order of formal and actual parameters

The last two actual parameters when calling id_map_find_by_sl_id()
from id_map_get() are swapped. However, the same formal parameters to
id_map_get() have them swapped as well, inverting the effect of the
first error.

This commit improves readability, but makes no functional change to
the code.

Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
Reviewed-by: Wengang Wang <wen.gang.wang@oracle.com>
Reviewed-by: Knut Omang <knut.omang@oracle.com>
Acked-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
(cherry picked from commit b03ee4ca0cec348c84dccf08aaec2454c4d236c2)

Orabug: 26187991

Reviewed-by: Wei Lin Guay <wei.lin.guay@oracle.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
8 years agoBtrfs: show subvol= and subvolid= in /proc/mounts
Omar Sandoval [Mon, 18 May 2015 09:16:31 +0000 (02:16 -0700)]
Btrfs: show subvol= and subvolid= in /proc/mounts

Orabug: 26088734

Now that we're guaranteed to have a meaningful root dentry, we can just
export seq_dentry() and use it in btrfs_show_options(). The subvolume ID
is easy to get and can also be useful, so put that in there, too.

Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Omar Sandoval <osandov@osandov.com>
Signed-off-by: Chris Mason <clm@fb.com>
(cherry picked from commit c8d3fe028f64054d75c72566efb9ecf3c75ee161)
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
8 years agoxsigo: UEK4-master:poor performance discovering 256 FC LUNs w/4 paths per LUN
Pradeep Gopanapalli [Mon, 5 Jun 2017 23:29:03 +0000 (16:29 -0700)]
xsigo: UEK4-master:poor performance discovering 256 FC LUNs w/4 paths per LUN

Orabug: 26199177

Current sense_len checks for size of cp->sense_buffer which is of type
pointer. Passing truncated sense data(size of pointer) to upper scsi
layers(aula) is causing delay in discovering FC LUN's.
Fixed sense_len assignment to SCSI_SENSE_BUFFERSIZE, this resolved
delay in discovering FC LUN's.

Reviewed-by: sajid.zia@oracle.com
Signed-off-by: Pradeep Gopanapalli <pradeep.gopanapalli@oracle.com>
Signed-off-by: said.zia@oracle.com
8 years agouek-rpm: enable bnxt driver for sparc
Allen Pais [Tue, 11 Apr 2017 10:00:15 +0000 (15:30 +0530)]
uek-rpm: enable bnxt driver for sparc

Orabug:  26221767

Signed-off-by: Allen Pais <allen.pais@oracle.com>
8 years agouek-rpm: set CONFIG_FORCE_MAX_ZONEORDER to 16
Allen Pais [Wed, 19 Apr 2017 14:49:40 +0000 (20:19 +0530)]
uek-rpm: set CONFIG_FORCE_MAX_ZONEORDER to 16

Orabug: 26221819

Signed-off-by: Allen Pais <allen.pais@oracle.com>
8 years agoNVMe: During NVMe probe, get NVMe device information before mapping the device.
Ashok Vairavan [Mon, 5 Jun 2017 19:24:30 +0000 (12:24 -0700)]
NVMe: During NVMe probe, get NVMe device information before mapping the device.

Orabug: 26194850

As part of updating NVMe driver (Bug 25130845), the nvme device mapping was done
before getting the nvme device information. This change got introduced while
resolving a merge conflict. This caused the kernel panic during nvme probe.

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agosparc: Fix kernel BUG at arch/sparc/kernel/mdesc.c
Thomas Tai [Fri, 6 Jan 2017 14:18:38 +0000 (06:18 -0800)]
sparc: Fix kernel BUG at arch/sparc/kernel/mdesc.c

When running ldoms reboot test for long hours, ldom guest panic with
kernel BUG at arch/sparc/kernel/mdesc.c:176! It is because the mdesc
size has changed, mdesc_update should retry the operation by decrement
refcnt before mdesc_free.

orabug 25359044

Signed-off-by: Thomas Tai <thomas.tai@oracle.com>
Reviewed-By: Liam Merwick <Liam.Merwick@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>
8 years agosparc64: allocate sufficient space for machine description
Thomas Tai [Thu, 27 Oct 2016 19:48:50 +0000 (12:48 -0700)]
sparc64: allocate sufficient space for machine description

Machine description size can changed at runtime. If the
required MD size changes during allocating the space, retry
until the space is large enough.

Orabug: 23082240

Signed-off-by: Thomas Tai <thomas.tai@oracle.com>
Reviewed-by: Chris Hyser <chris.hyser@oracle.com>
Reviewed-by: Liam Merwick <liam.merwick@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>
8 years agosparc64/mlx4_core: relaxed order for mlx4_core dma mappings
Shamir Rabinovitch [Tue, 14 Mar 2017 16:35:27 +0000 (09:35 -0700)]
sparc64/mlx4_core: relaxed order for mlx4_core dma mappings

SPARC PCI require relaxed order PCI transactions from the HCA to the
host memory to enable maximum performance. CX3 is not capable of setting
the relaxed order for the PCI transactions. Only mlx4_core driver can set
relaxed order on the right DMA mappings. Fix it!

This is temporary fix only for UEK4. Upstream changed the way the IB
subsystem work with DMA and upstreaming of this fix requires first to
fix net-next tree panic when rdma service is started (Orabug 25760394)
and only then upstreaming the fix for the SPARC/CX3 performance issue.
This cannot be done in short time and require back-port of lots of
upstream code introduced with upstream commit: "Merge tag
'for-next-dma_ops' of
git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma".

The current decision is to limit the change to mlx4 drivers and the ULPs
that use it. This patch only override the mlx4 DMA functions as opposed
for doing this from ib_verbs DMA functions.

This patch is already used in UEK2/SPARC and was proven as working under
all the product testing and so it is ported as-is.

Orabug: 25723815

Cc: Yuval Shaia <yuval.shaia@oracle.com>
Cc: Govinda Tatti <govinda.tatti@oracle.com>
Cc: chris hyser <chris.hyser@oracle.com>
Reviewed-by: HÃ¥kon Bugge <haakon.bugge@oracle.com>
Signed-off-by: tndave <tushar.n.dave@oracle.com>
Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>
8 years agosparc64: Fix an error code returned by a DAX ioctl
Sanath Kumar [Tue, 23 May 2017 01:48:02 +0000 (20:48 -0500)]
sparc64: Fix an error code returned by a DAX ioctl

Orabug: 26132331

IOCTL for ccb submission failed due to get_user_pages error should
return EFAULT instead of EPERM. This was a regression introduced by a
prior patch that cleaned up a few functions in this code path.

Reviewed-by: Shannon Nelson <shannon.nelson@oracle.com>
Signed-off-by: Sanath Kumar <sanath.s.kumar@oracle.com>
8 years agosparc64: fix M8 ADI support
Anthony Yznaga [Wed, 31 May 2017 19:34:59 +0000 (12:34 -0700)]
sparc64: fix M8 ADI support

For platforms that support ADI two things must be done during boot.

First, etrap is patched to ensure that execution in the kernel runs with
PSTATE.mcde=1.  This ensures that version checking is enabled if the
kernel accesses ADI-enabled user memory through copy_{to/from}_user,
etc..

Second, the initialization of the common flags used in TTEs must be
adjusted to not set TTE.cv (cacheable-in-virtually-indexed-cache) which
has been replaced by TTE.mcd which enables MCD (aka ADI).

These steps are currently done for M7.  This patch adds support for M8
and does some minor cleanup to avoid M7-specific naming and reduce the
number of places chip type needs to be checked (and adjusted in the
future).

Orabug: 26096575
Signed-off-by: Anthony Yznaga <anthony.yznaga@oracle.com>
Reviewed-by: Steve Sistare <steven.sistare@oracle.com>
8 years agoAdded IB diag counters from UEK2 v4.1.12-102.0.20170601_1400
Chris Gray [Wed, 3 May 2017 00:46:34 +0000 (19:46 -0500)]
Added IB diag counters from UEK2

Orabug: 26088208
Signed-off-by: christopher.gray@oracle.com
8 years agoscsi: megaraid_sas: Driver version upgrade
Shivasharan S [Fri, 10 Mar 2017 11:22:15 +0000 (03:22 -0800)]
scsi: megaraid_sas: Driver version upgrade

Orabug: 26096381

Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 22487b66594f18f2a7c211f3ab8bb02dec74d37b)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: raid6 also require cpuSel check same as raid5
Shivasharan S [Fri, 10 Mar 2017 11:22:14 +0000 (03:22 -0800)]
scsi: megaraid_sas: raid6 also require cpuSel check same as raid5

Orabug: 26096381

Without this fix, raid6 performance will not be optimal.

Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 874d025da667d19b728141437ccbefe9dbaf9e7b)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: add correct return type check for ldio hint logic for raid1
Shivasharan S [Fri, 10 Mar 2017 11:22:13 +0000 (03:22 -0800)]
scsi: megaraid_sas: add correct return type check for ldio hint logic for raid1

Orabug: 26096381

Return value check of atomic_dec_if_positive is required as it returns
old value minus one.  Without this fix, driver will send small ios to
firmware path and that will be a performance issue.

Not critical, but good to have r1_ldio_hint as default value in sdev
private.

Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 49524b3c6e12375627ddd870613fcc6b24909898)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: array overflow in megasas_dump_frame()
Dan Carpenter [Tue, 14 Feb 2017 16:38:55 +0000 (19:38 +0300)]
scsi: megaraid_sas: array overflow in megasas_dump_frame()

Orabug: 26096381

The "sz" variable is in terms of bytes, but we're treating the buffer as
an array of __le32 so we have to divide by 4.

Fixes: def0eab3af86 ("scsi: megaraid_sas: enhance debug logs in OCR context")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Sumit Saxena <sumit.saxena@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 40a4c2c392593b57a2e6f6438794492596279838)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: driver version upgrade
Shivasharan S [Fri, 10 Feb 2017 08:59:39 +0000 (00:59 -0800)]
scsi: megaraid_sas: driver version upgrade

Orabug: 26096381

Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 156f8759bb708d7fd43cce9e2dc640b1ba01ecef)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: Change RAID_1_10_RMW_CMDS to RAID_1_PEER_CMDS and set value to 2
Shivasharan S [Fri, 10 Feb 2017 08:59:38 +0000 (00:59 -0800)]
scsi: megaraid_sas: Change RAID_1_10_RMW_CMDS to RAID_1_PEER_CMDS and set value to 2

Orabug: 26096381

For RAID1 FastPath writes, driver needs to allocate extra commands
internally to accommodate for the extra peer command being sent.
Currently driver is allocating 2 extra commands for each but only one
extra command is necessary.  Set RAID_1_10_RMW_CMDS to 2 and also change
macro name to RAID_1_PEER_CMDS.

Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit a73b0a4b5d17ee39b2cbac7638a97077189b80cc)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: Indentation and smatch warning fixes
Shivasharan S [Fri, 10 Feb 2017 08:59:37 +0000 (00:59 -0800)]
scsi: megaraid_sas: Indentation and smatch warning fixes

Orabug: 26096381

Fix indentation issues and smatch warning reported by Dan Carpenter
for previous series as discussed below.
http://www.spinics.net/lists/linux-scsi/msg103635.html
http://www.spinics.net/lists/linux-scsi/msg103603.html

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Sasikumar Chandrasekaran <sasikumar.pc@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 41064f1bf8886bc43afbd9aa23a698f97bc65664)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: Cleanup VD_EXT_DEBUG and SPAN_DEBUG related debug prints
Shivasharan S [Fri, 10 Feb 2017 08:59:36 +0000 (00:59 -0800)]
scsi: megaraid_sas: Cleanup VD_EXT_DEBUG and SPAN_DEBUG related debug prints

Orabug: 26096381

Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit e00731bc5abb8f00f64e74fc8deb3feca580f22d)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: Increase internal command pool
Shivasharan S [Fri, 10 Feb 2017 08:59:35 +0000 (00:59 -0800)]
scsi: megaraid_sas: Increase internal command pool

Orabug: 26096381

Fix - increase internal command pool to 8.

Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit ec77959515e584cd5cb2301531a3ed06c97eeacf)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: Bail out the driver load if ld_list_query fails
Shivasharan S [Fri, 10 Feb 2017 08:59:33 +0000 (00:59 -0800)]
scsi: megaraid_sas: Bail out the driver load if ld_list_query fails

Orabug: 26096381

Error handling: Bail out the driver load if key FW cmds (LD_LIST) are
not return successful.  Clean up error handling in megasas_init_fw.

Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 72bff2d1d0c9cb8923a2ffdeaafa40deaed0f671)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
Conflicts:
drivers/scsi/megaraid/megaraid_sas_base.c

8 years agoscsi: megaraid_sas: Change build_mpt_mfi_pass_thru to return void
Shivasharan S [Fri, 10 Feb 2017 08:59:32 +0000 (00:59 -0800)]
scsi: megaraid_sas: Change build_mpt_mfi_pass_thru to return void

Orabug: 26096381

Code refactoring to build_mpt_mfi_pass_thru to return void.

Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 7a7ae4f19280a4da2dfbdca3a414b0fd5fef2cb4)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: During OCR, if get_ctrl_info fails do not continue with OCR
Shivasharan S [Fri, 10 Feb 2017 08:59:31 +0000 (00:59 -0800)]
scsi: megaraid_sas: During OCR, if get_ctrl_info fails do not continue with OCR

Orabug: 26096381

Error handling: If controller reset is not able to recover, kill HBA and
quit immediately.

Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit a6821ca39e0cac24b4c366b28b07c1a37ce8915d)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: Do not set fp_possible if TM capable for non-RW syspdIO, change...
Shivasharan S [Fri, 10 Feb 2017 08:59:30 +0000 (00:59 -0800)]
scsi: megaraid_sas: Do not set fp_possible if TM capable for non-RW syspdIO, change fp_possible to bool

Orabug: 26096381

FIX - firmware wants non-RW SYS PD IOs to avoid FastPath for better
tracking and other functionalities if the device is task management
capable.

Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 1d6dbd1752fb4347a4a5db06c8f5cd35dd1919f4)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: Remove unused pd_index from megasas_build_ld_nonrw_fusion
Shivasharan S [Fri, 10 Feb 2017 08:59:29 +0000 (00:59 -0800)]
scsi: megaraid_sas: Remove unused pd_index from megasas_build_ld_nonrw_fusion

Orabug: 26096381

Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 25fb13dd2d6e9897c391315254d1b2f7c74e0482)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: megasas_return_cmd does not memset IO frame to zero
Shivasharan S [Fri, 10 Feb 2017 08:59:28 +0000 (00:59 -0800)]
scsi: megaraid_sas: megasas_return_cmd does not memset IO frame to zero

Orabug: 26096381

Memset the IO frame to zero after release.

Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 21c34006dce99949a83e9c46c543af28651db5db)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: max_fw_cmds are decremented twice, remove duplicate
Shivasharan S [Fri, 10 Feb 2017 08:59:27 +0000 (00:59 -0800)]
scsi: megaraid_sas: max_fw_cmds are decremented twice, remove duplicate

Orabug: 26096381

Fix to account for the reply_q_sz not exceeding the maximum commands
that the firmware can support, instance->max_fw_cmds is already
decremented in megasas_fusion_update_can_queue().  Remove the extra
decrement logic in code.

Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit cf4e55e7be0a4c009908803ff4c3140c9822c033)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: update can_queue only if the new value is less
Shivasharan S [Fri, 10 Feb 2017 08:59:26 +0000 (00:59 -0800)]
scsi: megaraid_sas: update can_queue only if the new value is less

Orabug: 26096381

Minor Optimization: No need to update HBA can_queue value if the current
max FW commands is equal to earlier value.

Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 013aec66afaa51581d4b41887fe418b94c54bc51)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: Change max_cmd from u32 to u16 in all functions
Shivasharan S [Fri, 10 Feb 2017 08:59:25 +0000 (00:59 -0800)]
scsi: megaraid_sas: Change max_cmd from u32 to u16 in all functions

Orabug: 26096381

Since maximum supported FW commands are all defined as u16, change
all local variables referring to max_cmd from u32 to u16.

Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 50b7f5a2d0126b893a4591336b1cdb4028a726b0)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: set pd_after_lb from MR_BuildRaidContext and initialize pDevHandl...
Shivasharan S [Fri, 10 Feb 2017 08:59:24 +0000 (00:59 -0800)]
scsi: megaraid_sas: set pd_after_lb from MR_BuildRaidContext and initialize pDevHandle to MR_DEVHANDLE_INVALID

Orabug: 26096381

Issue is limited for Syncro firmware where pd_after_lb is not set but is
accidentally used.  Not a functional issue, but results in low
performance due to improper load balancing between two LUNs.

Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit b41c0a4aa7c0fc1f98648c020358598498d48f06)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
Conflicts:
drivers/scsi/megaraid/megaraid_sas_fp.c

8 years agoscsi: megaraid_sas: latest controller OCR capability from FW before sending shutdown...
Shivasharan S [Fri, 10 Feb 2017 08:59:23 +0000 (00:59 -0800)]
scsi: megaraid_sas: latest controller OCR capability from FW before sending shutdown DCMD

Orabug: 26096381

Fetch the latest controller OCR capability from FW before sending
MR_DCMD_CTRL_SHUTDOWN When application sends a shutdown DCMD
(MR_DCMD_CTRL_SHUTDOWN), driver will fetch latest controller information
from firmware.  This is to ensure that driver always has latest OCR
capability of controller before sending the DCMD.

Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 95c060869e6872ea03a4a9d15236adcffb1d8b07)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: avoid unaligned access in ioctl path
Shivasharan S [Fri, 10 Feb 2017 08:59:22 +0000 (00:59 -0800)]
scsi: megaraid_sas: avoid unaligned access in ioctl path

Orabug: 26096381

Fix kernel warning for accessing unaligned memory access in driver.

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 318aaef88353c09a73d26d3b87a74fab67ff9282)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
Conflicts:
drivers/scsi/megaraid/megaraid_sas_base.c

8 years agoscsi: megaraid_sas: big endian support changes
Shivasharan S [Fri, 10 Feb 2017 08:59:21 +0000 (00:59 -0800)]
scsi: megaraid_sas: big endian support changes

Orabug: 26096381

Fix endiannes fixes for Ventura specific.

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit a174118b7a97c52c3c3a4f1b8eee594502a55381)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: Big endian RDPQ mode fix
Shivasharan S [Fri, 10 Feb 2017 08:59:20 +0000 (00:59 -0800)]
scsi: megaraid_sas: Big endian RDPQ mode fix

Orabug: 26096381

Fix if RDPQ mode enabled MR FW is deployed on big endian host machine,
driver does not setup reply address correctly.

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit ff96f9251768f3fe1b4cd6f48f4021b3a1be269b)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: MR_TargetIdToLdGet u8 to u16 and avoid invalid raid-map access
Shivasharan S [Fri, 10 Feb 2017 08:59:19 +0000 (00:59 -0800)]
scsi: megaraid_sas: MR_TargetIdToLdGet u8 to u16 and avoid invalid raid-map access

Orabug: 26096381

Change MR_TargetIdToLdGet return type from u8 to u16.

ld id range check is added at two places in this patch -
@megasas_build_ldio_fusion and @megasas_build_ld_nonrw_fusion.  Previous
driver code used different data type for lds TargetId returned from
MR_TargetIdToLdGet.  Prior to this change, above two functions was
safeguarded due to function always return u8 and maximum value of ld id
returned was 255.

In below check, fw_supported_vd_count as of today is 64 or 256 and valid
range to support is either 0-63 or 0-255. Ideally want to filter
accessing raid map for ld ids which are not valid. With the u16 change,
invalid ld id value is 0xFFFF and we will see kernel panic due to random
memory access in MR_LdRaidGet.  The changes will ensure we do not call
MR_LdRaidGet if ld id is beyond size of ldSpanMap array.

               if (ld < instance->fw_supported_vd_count)

>From firmware perspective,ld id 0xFF is invalid and even though current
driver code forward such command, firmware fails with target not
available.

ld target id issue occurs mainly whenever driver loops to populate raid
map (ea. MR_ValidateMapInfo).  These are the only two places where we
may see out of range target ids and wants to protect raid map access
based on range provided by Firmware API.

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit d2d0358bcd09139a8e71afbca35bcd6b219dd1bf)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: In validate raid map, raid capability is not converted to cpu...
Shivasharan S [Fri, 10 Feb 2017 08:59:18 +0000 (00:59 -0800)]
scsi: megaraid_sas: In validate raid map, raid capability is not converted to cpu format for all lds

Orabug: 26096381

On a host, if an ld is deleted there is a hole in the ld array returned
by the FW. But in MR_ValidateMapInfo we are not accounting for holes in
the ld array and traverse only upto index num_lds.  This patch takes
care of converting the capability field of all the valid lds in the ld
raid map.

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit a09454ce5dd11184c5040ed536d323e2a302a579)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: reduce size of fusion_context and use vmalloc if kmalloc fails
Shivasharan S [Fri, 10 Feb 2017 08:59:17 +0000 (00:59 -0800)]
scsi: megaraid_sas: reduce size of fusion_context and use vmalloc if kmalloc fails

Orabug: 26096381

Currently fusion context has fixed array load_balance_info. Use dynamic
allocation.  In few places, driver do not want physically contigious
memory.  Attempt to use vmalloc if physical contiguous memory is not
available.

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 5fc499b612c5401a7ae0674086befcdf8b148516)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
Conflicts:
drivers/scsi/megaraid/megaraid_sas.h

8 years agoscsi: megaraid_sas: add print in device removal path
Shivasharan S [Fri, 10 Feb 2017 08:59:16 +0000 (00:59 -0800)]
scsi: megaraid_sas: add print in device removal path

Orabug: 26096381

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit b4a42213a7eb8ec8556f27e6750bbc5c9193e86e)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: enhance debug logs in OCR context
Shivasharan S [Fri, 10 Feb 2017 08:59:15 +0000 (00:59 -0800)]
scsi: megaraid_sas: enhance debug logs in OCR context

Orabug: 26096381

Add additional logging from driver in OCR context.
Add debug logs for partial completion of IOs is iodone context.

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit def0eab3af8651e8951c5cf1b17ece0d26827636)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: set residual bytes count during IO completion
Shivasharan S [Fri, 10 Feb 2017 08:59:14 +0000 (00:59 -0800)]
scsi: megaraid_sas: set residual bytes count during IO completion

Orabug: 26096381

Fixing issue of not setting residual bytes correctly.

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 31d9a57b419d8ef8fa391009819f940778ce6245)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: raid 1 write performance for large io
Shivasharan S [Fri, 10 Feb 2017 08:59:13 +0000 (00:59 -0800)]
scsi: megaraid_sas: raid 1 write performance for large io

Orabug: 26096381

Avoid Host side PCI bandwidth bottleneck and hint FW to do Write
buffering using RaidFlag MR_RAID_FLAGS_IO_SUB_TYPE_LDIO_BW_LIMIT.  Once
IO is landed in FW with MR_RAID_FLAGS_IO_SUB_TYPE_LDIO_BW_LIMIT, it will
do single DMA from host and buffer the Write operation. On back end, FW
will DMA same buffer to the Mirror and Data Arm.  This will improve
large block IO performance which bottleneck due to Host side PCI
bandwidth limitation.

Consistent ~4000MB T.P for 256K Block size is expected performance
numbers.  IOPS for small Block size should be on par with Disk
performance.  (E.g 42 SAS Disk in JBOD mode gives 3700MB T.P.  Same
Drive used in R1 WT mode, should give ~1800MB T.P)

Using this patch 24 R1 VDs (HDD) gives below performance for Sequential
Write.  Without this patch, we cannot reach above 3200MB (Throughput is
in MB.)

Block Size    50% 256K and 50% 4K          100% 256K
4K                 3100                        2030
8K                 3140                        2740
16K                3140                        3140
32K                3400                        3240
64K                3500                        3700
128K               3870                        3870
256K               3920                        3920

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit a48ba0eca0456d45e920169930569caa3fc57124)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
Conflicts:
drivers/scsi/megaraid/megaraid_sas.h

8 years agoscsi: megaraid_sas: change issue_dcmd to return void from int
Shivasharan S [Fri, 10 Feb 2017 08:59:09 +0000 (00:59 -0800)]
scsi: megaraid_sas: change issue_dcmd to return void from int

Orabug: 26096381

With the changes to remove checks for a valid request descriptor,
issue_dcmd will now always return DCMD_SUCCESS. This patch changes
return type of issue_dcmd to void and change all callers appropriately.

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit f4fc209326c79b03fecd38a6709cf08da47f15f7)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: megasas_get_request_descriptor always return valid desc
Shivasharan S [Fri, 10 Feb 2017 08:59:08 +0000 (00:59 -0800)]
scsi: megaraid_sas: megasas_get_request_descriptor always return valid desc

Orabug: 26096381

No functional change. Code clean up. Removing error code which is not
valid scenario.  In megasas_get_request_descriptor we can remove the
error handling which is not required.  With fusion controllers, if there
is a valid message frame available, we are guaranteed to get a
corresponding request descriptor.

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 52205ac8940b43cca1711abfb43a05e7df08c09e)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: Use DID_REQUEUE
Shivasharan S [Fri, 10 Feb 2017 08:59:07 +0000 (00:59 -0800)]
scsi: megaraid_sas: Use DID_REQUEUE

Orabug: 26096381

Moving to use DID_REQUEUE return type for reliable unconditional
retries.  Driver wants unconditional re-queue, so replace DID_RESET with
DID_REQUEUE

Discussed below -
https://www.spinics.net/lists/linux-scsi/msg102848.html

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit f55cf47d925e48cddabafd3bc829f1ebc05c334d)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: RAID map is accessed for SYS PDs when use_seqnum_jbod_fp is not set
Shivasharan S [Fri, 10 Feb 2017 08:59:06 +0000 (00:59 -0800)]
scsi: megaraid_sas: RAID map is accessed for SYS PDs when use_seqnum_jbod_fp is not set

Orabug: 26096381

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit ed981b81fa6cb7ce191756822e3de24e51112cd3)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: Refactor MEGASAS_IS_LOGICAL macro using sdev
Shivasharan S [Fri, 10 Feb 2017 08:59:05 +0000 (00:59 -0800)]
scsi: megaraid_sas: Refactor MEGASAS_IS_LOGICAL macro using sdev

Orabug: 26096381

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 3cabd16256584581af2cc3d2cedabcfcf15021ad)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: 32 bit descriptor fire cmd optimization
Shivasharan S [Fri, 10 Feb 2017 08:59:04 +0000 (00:59 -0800)]
scsi: megaraid_sas: 32 bit descriptor fire cmd optimization

Orabug: 26096381

No functional change. Code refactor.

megasas_fire_cmd_fusion can always use 32 bit descriptor write for
ventura. No need to pass extra flag.  Only IOC INIT required 64 bit
Descriptor write.

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 45b8a35eed7b1d7e51a4dc04b5b694301a383afa)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: raid 1 fast path code optimize
Shivasharan S [Fri, 10 Feb 2017 08:59:03 +0000 (00:59 -0800)]
scsi: megaraid_sas: raid 1 fast path code optimize

Orabug: 26096381

No functional change. Code refactor.

Remove function megasas_fpio_to_ldio as we never require to convert fpio
to ldio because of frame unavailability.  Grab extra frame of raid 1
write fast path before it creates first frame as Fast Path.  Removed
is_raid_1_fp_write flag as raid 1 write fast path command is decided
using r1_alt_dev_handle only.  Move resetting megasas_cmd_fusion fields
at common function megasas_return_cmd_fusion.

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 8bf7c65d379a6d923dfebb50eb04c2407e4762ed)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: cpu select rework.
Shivasharan S [Fri, 10 Feb 2017 08:59:02 +0000 (00:59 -0800)]
scsi: megaraid_sas: cpu select rework.

Orabug: 26096381

No functional change. Code refactor.

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit f6c0d55c5b91c0d626d65aebee1a0d6b0a61851d)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoRevert "scsi: megaraid_sas: Enable or Disable Fast path based on the PCI Threshold...
Shivasharan S [Fri, 10 Feb 2017 08:59:01 +0000 (00:59 -0800)]
Revert "scsi: megaraid_sas: Enable or Disable Fast path based on the PCI Threshold Bandwidth"

Orabug: 26096381

This reverts commit "3e5eadb1a881" ("scsi: megaraid_sas: Enable or
Disable Fast path based on the PCI Threshold Bandwidth")

This patch was aimed to increase performance of R1 Write operation for
large IO size.  Since this method used timer approach, it turn on/off
fast path did not work as expected.  Patch 0013 describes new algorithm
and performance number.

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 18bbcabdc6cc6be8c7f6d80c85d314535d76188d)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: driver version upgrade
Sasikumar Chandrasekaran [Tue, 10 Jan 2017 23:20:53 +0000 (18:20 -0500)]
scsi: megaraid_sas: driver version upgrade

Orabug: 26096381

Upgrade driver version.

Signed-off-by: Sasikumar Chandrasekaran <sasikumar.pc@broadcom.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 223e4b93e61f7538681632bfb19edd4f27a0c319)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: Implement the PD Map support for SAS3.5 Generic Megaraid Controllers
Sasikumar Chandrasekaran [Tue, 10 Jan 2017 23:20:52 +0000 (18:20 -0500)]
scsi: megaraid_sas: Implement the PD Map support for SAS3.5 Generic Megaraid Controllers

Orabug: 26096381

Update Linux driver to use new pdTargetId field for JBOD target ID

Signed-off-by: Sasikumar Chandrasekaran <sasikumar.pc@broadcom.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit ede7c3ce82dc4001bbab33dddebab8c089f309e0)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: ldio_outstanding variable is not decremented in completion path
Sasikumar Chandrasekaran [Tue, 10 Jan 2017 23:20:51 +0000 (18:20 -0500)]
scsi: megaraid_sas: ldio_outstanding variable is not decremented in completion path

Orabug: 26096381

ldio outstanding variable needs to be decremented in io completion path for
iMR dual queue depth

Signed-off-by: Sasikumar Chandrasekaran <sasikumar.pc@broadcom.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit b71b49c209facf8fec3778142ae5e45bb6ca4afc)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: Enable or Disable Fast path based on the PCI Threshold Bandwidth
Sasikumar Chandrasekaran [Tue, 10 Jan 2017 23:20:50 +0000 (18:20 -0500)]
scsi: megaraid_sas: Enable or Disable Fast path based on the PCI Threshold Bandwidth

Orabug: 26096381

Large SEQ IO workload should sent as non fast path commands

Signed-off-by: Sasikumar Chandrasekaran <sasikumar.pc@broadcom.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 3e5eadb1a881bea2e3fa41f5ae7cdbfa36222d37)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: Add the Support for SAS3.5 Generic Megaraid Controllers Capabilities
Sasikumar Chandrasekaran [Tue, 10 Jan 2017 23:20:49 +0000 (18:20 -0500)]
scsi: megaraid_sas: Add the Support for SAS3.5 Generic Megaraid Controllers Capabilities

Orabug: 26096381

The Megaraid driver has to support the SAS3.5 Generic Megaraid Controllers Firmware functionality.

Signed-off-by: Sasikumar Chandrasekaran <sasikumar.pc@broadcom.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 9581ebebbe351d99579e8701e238c2771ccdae93)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: Dynamic Raid Map Changes for SAS3.5 Generic Megaraid Controllers
Sasikumar Chandrasekaran [Tue, 10 Jan 2017 23:20:48 +0000 (18:20 -0500)]
scsi: megaraid_sas: Dynamic Raid Map Changes for SAS3.5 Generic Megaraid Controllers

Orabug: 26096381

SAS3.5 Generic Megaraid Controllers FW will support new dynamic RaidMap to have different
sizes for different number of supported VDs.

Signed-off-by: Sasikumar Chandrasekaran <sasikumar.pc@broadcom.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit d889344e4e59eb962894ab3b64042dc37a2d8b39)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: SAS3.5 Generic Megaraid Controllers Fast Path for RAID 1/10 Writes
Sasikumar Chandrasekaran [Tue, 10 Jan 2017 23:20:47 +0000 (18:20 -0500)]
scsi: megaraid_sas: SAS3.5 Generic Megaraid Controllers Fast Path for RAID 1/10 Writes

Orabug: 26096381

To improve RAID 1/10 Write performance, OS drivers need to issue the
required Write IOs as Fast Path IOs (after the appropriate checks
allowing Fast Path to be used) to the appropriate physical drives
(translated from the OS logical IO) and wait for all Write IOs to complete.

Design: A write IO on RAID volume will be examined if it can be sent in
Fast Path based on IO size and starting LBA and ending LBA falling on to
a Physical Drive boundary. If the underlying RAID volume is a RAID 1/10,
driver issues two fast path write IOs one for each corresponding physical
drive after computing the corresponding start LBA for each physical drive.
Both write IOs will have the same payload and are posted to HW such that
replies land in the same reply queue.

If there are no resources available for sending two IOs, driver will send
the original IO from SCSI layer to RAID volume through the Firmware.

Based on PCI bandwidth and write payload, every second this feature is
enabled/disabled.

When both IOs are completed by HW, the resources will be released
and SCSI IO completion handler will be called.

Signed-off-by: Sasikumar Chandrasekaran <sasikumar.pc@broadcom.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 69c337c0f8d74d71e085efa8869be9fc51e5962b)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: SAS3.5 Generic Megaraid Controllers Stream Detection and IO Coale...
Sasikumar Chandrasekaran [Tue, 10 Jan 2017 23:20:46 +0000 (18:20 -0500)]
scsi: megaraid_sas: SAS3.5 Generic Megaraid Controllers Stream Detection and IO Coalescing

Orabug: 26096381

Detect sequential Write IOs and pass the hint that it is part of sequential
stream to help HBA Firmware do the Full Stripe Writes. For read IOs on
certain RAID volumes like Read Ahead volumes,this will help driver to
send it to Firmware even if the IOs can potentially be sent to
hardware directly (called fast path) bypassing firmware.

Design: 8 streams are maintained per RAID volume as per the combined
firmware/driver design. When there is no stream detected the LRU stream
is used for next potential stream and LRU/MRU map is updated to make this
as MRU stream. Every time a stream is detected the MRU map
is updated to make the current stream as MRU stream.

Signed-off-by: Sasikumar Chandrasekaran <sasikumar.pc@broadcom.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit fdd84e2514b0157219720cf8f3f55757938a39cd)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: EEDP Escape Mode Support for SAS3.5 Generic Megaraid Controllers
Sasikumar Chandrasekaran [Tue, 10 Jan 2017 23:20:45 +0000 (18:20 -0500)]
scsi: megaraid_sas: EEDP Escape Mode Support for SAS3.5 Generic Megaraid Controllers

Orabug: 26096381

An UNMAP command on a PI formatted device will leave the Logical Block Application
Tag and Logical Block Reference Tag as all F's (for those LBAs that are unmapped).
To avoid IO errors if those LBAs are subsequently read before they are written with
valid tag fields, the MPI SCSI IO requests need to set the EEDPFlags element EEDP
Escape Mode field, Bits [7:6] appropriately.  A value of 2 should be set to disable
all PI checks if the Logical Block Application Tag is 0xFFFF for PI types 1 and 2.
A value of 3 should be set to disable all PI checks if the Logical Block Application
Tag is 0xFFFF and the Logical Block Reference Tag is 0xFFFFFFFF for PI type 3.

Signed-off-by: Sasikumar Chandrasekaran <sasikumar.pc@broadcom.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 45d446038c7b93c40b2fe5ba0e95380f19e0493e)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: megaraid_sas: 128 MSIX Support
Sasikumar Chandrasekaran [Tue, 10 Jan 2017 23:20:44 +0000 (18:20 -0500)]
scsi: megaraid_sas: 128 MSIX Support

Orabug: 26096381

SAS3.5 Generic Megaraid based Controllers will have the support for 128 MSI-X vectors,
resulting in the need to support 128 reply queues

Signed-off-by: Sasikumar Chandrasekaran <sasikumar.pc@broadcom.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 2493c67e518c772a573c3b1ad02e7ced5b53f6ca)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
Conflicts:
drivers/scsi/megaraid/megaraid_sas_base.c

8 years agoscsi: megaraid_sas: Add new pci device Ids for SAS3.5 Generic Megaraid Controllers
Sasikumar Chandrasekaran [Tue, 10 Jan 2017 23:20:43 +0000 (18:20 -0500)]
scsi: megaraid_sas: Add new pci device Ids for SAS3.5 Generic Megaraid Controllers

Orabug: 26096381

This patch contains new pci device ids for SAS3.5 Generic Megaraid Controllers

Signed-off-by: Sasikumar Chandrasekaran <sasikumar.pc@broadcom.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 45f4f2eb3da3cbff02c3d77c784c81320c733056)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: sd: Check for unaligned partial completion
Damien Le Moal [Wed, 1 Mar 2017 08:27:00 +0000 (17:27 +0900)]
scsi: sd: Check for unaligned partial completion

Commit <f2e767bb5d6e> ("mpt3sas: Force request partial completion
alignment") was not considering the case of commands not operating on
logical block size units (e.g. REQ_OP_ZONE_REPORT and its 64B aligned
partial replies). In this case, forcing alignment of resid to the device
logical block size can break the command result, e.g. in the case of
REQ_OP_ZONE_REPORT, the exact number of zone reported by the device.

Move the partial completion alignement check of mpt3sas to a generic
implementation in sd_done(). The check is added within the default
section of the initial req_op() switch case so that the report and reset
zone commands are ignored. In addition, as sd_done() is not called for
passthrough requests, resid corrections are not done as intended by the
initial mpt3sas patch.

Fixes: f2e767bb5d6e ("mpt3sas: Force request partial completion alignment")
Cc: <stable@vger.kernel.org> # v4.10
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit c46f09175dabd5dd6a1507f36250bfa734a0156e
 change sd.c modification to avoid req_op conversion in current kernel)

Orabug: 26178369
Signed-off-by: shan.hai@oracle.com
8 years agoPCI/AER: include header file
Sudip Mukherjee [Wed, 23 Dec 2015 15:35:26 +0000 (21:05 +0530)]
PCI/AER: include header file

We are having build failure with sparc allmodconfig with the error:

drivers/nvme/host/pci.c:15:0:
include/linux/aer.h: In function 'pci_enable_pcie_error_reporting':
include/linux/aer.h:49:10: error: 'EINVAL' undeclared (first use in this function)

The file aer.h is using the error values but they are defined in
errno.h. Include errno.h so that we have the definitions of the error
codes.

Fixes: a0a3408ee614 ("NVMe: Add pci error handlers")
Cc: Keith Busch <keith.busch@intel.com>
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Jens Axboe <axboe@fb.com>
Orabug: 25130845

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agoNVMe: reverse IO direction for VUC command code F7
Ashok Vairavan [Mon, 13 Mar 2017 18:34:55 +0000 (11:34 -0700)]
NVMe: reverse IO direction for VUC command code F7

Orabug: 25258071

Samsung uses D2H command with Vendor Uniq Command (VUC) code F7
(the 0th bit of which is 1) for retrieving memory dump. In UEK4,
Bit 0 of the D2H command code has to be 0. Because of this voilation,
the nvmecli is unable to do crash and memory dumps in UEK4.

As the Samsung firmware can only understand VUC command code F7,
the IO direction is reversed for this vendor command code to
retrieve memory and crash dump.

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-By: Martin K. Petersen <martin.petersen@oracle.com>
8 years agonvme: factor out a add nvme_is_write helper
Christoph Hellwig [Mon, 6 Jun 2016 21:20:49 +0000 (23:20 +0200)]
nvme: factor out a add nvme_is_write helper

Centralize the check if a given NVMe command reads or writes data.

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Jay Freyensee <james.p.freyensee@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 7a5abb4b48570c3552e33ff4c72ae1e8dac3ba15)

Orabug: 25130845

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agonvme: allow for size limitations from transport drivers
Christoph Hellwig [Mon, 6 Jun 2016 21:20:48 +0000 (23:20 +0200)]
nvme: allow for size limitations from transport drivers

Some transport drivers may have a lower transfer size than
the controller. So allow the transport to set it in the
controller max_hw_sectors.

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit a229dbf61e03b70d98f5ed46f476d6369870a6ab)

Orabug: 25130845

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agonvme.h: add constants for PSDT and FUSE values
James Smart [Mon, 6 Jun 2016 21:20:47 +0000 (23:20 +0200)]
nvme.h: add constants for PSDT and FUSE values

Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 3972be23bd2d2bcfaa44595a260a371cd9218872)

Orabug: 25130845

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agonvme.h: add AER constants
Christoph Hellwig [Mon, 6 Jun 2016 21:20:46 +0000 (23:20 +0200)]
nvme.h: add AER constants

Reviewed-by: Jay Freyensee <james.p.freyensee@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Ming Lin <ming.l@ssi.samsung.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 79f370eac63796a8933b210bca02f006ba32d22e)

Orabug: 25130845

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agonvme.h: add NVM command set SQE/CQE size defines
Christoph Hellwig [Mon, 6 Jun 2016 21:20:45 +0000 (23:20 +0200)]
nvme.h: add NVM command set SQE/CQE size defines

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 69cd27e2511616f9b402d1bad4c49f91aa7411a3)

Orabug: 25130845

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agonvme.h: Add get_log_page command strucure
Armen Baloyan [Mon, 6 Jun 2016 21:20:44 +0000 (23:20 +0200)]
nvme.h: Add get_log_page command strucure

Add get_log_page command structure and a corresponding entry in
nvme_command union

Signed-off-by: Armen Baloyan <armenx.baloyan@intel.com>
Reviewed-by: Jay Freyensee <james.p.freyensee@intel.com>
Reviewed--by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 725b358836ed038d7d8eafef86330b3a0b3f9c2f)

Orabug: 25130845

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agonvme.h: add RTD3R, RTD3E and OAES fields
Christoph Hellwig [Mon, 6 Jun 2016 21:20:43 +0000 (23:20 +0200)]
nvme.h: add RTD3R, RTD3E and OAES fields

These have been added in NVMe 1.2 and we'll need at least oaes for the
NVMe target driver.

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Jay Freyensee <james.p.freyensee@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 14e974a84e831bf9a44495c7256a6846e7f77630)

Orabug: 25130845

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agoNVMe: Only release requested regions
Johannes Thumshirn [Tue, 10 May 2016 13:14:28 +0000 (15:14 +0200)]
NVMe: Only release requested regions

The NVMe driver only requests the PCIe device's memory regions but releases
all possible regions (including eventual I/O regions). This leads to a stale
warning entry in dmesg about freeing non existent resources.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit edb50a5403d2e2d2b2b63a8365c4378c9c300ed6)

Orabug: 25130845

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agoNVMe: Fix removal in case of active namespace list scanning method
Sunad Bhandary [Fri, 27 May 2016 10:29:43 +0000 (15:59 +0530)]
NVMe: Fix removal in case of active namespace list scanning method

In case of the active namespace list scanning method, a namespace that
is detached is not removed from the host if it was the last entry in
the list. Fix this by adding a scan to validate namespaces greater than
the value of prev.

This also handles the case of removing namespaces whose value exceed
the device's reported number of namespaces.

Signed-off-by: Sunad Bhandary S <sunad.s@samsung.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 47b0e50ac724d97c392f771bb46f11d9d1575242)

Orabug: 25130845

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agoNVMe: Implement namespace list scanning
Keith Busch [Thu, 22 Oct 2015 21:45:06 +0000 (15:45 -0600)]
NVMe: Implement namespace list scanning

The NVMe 1.1 specification provides an identify mode to return a
list of active namespaces. This is more efficient to discover which
namespace identifiers are active on a controller, providing potentially
significant improvement in scan time for controllers with sparesly
populated namespaces.

Signed-off-by: Keith Busch <keith.busch@intel.com>
[hch: add quirk for the broken Qemu Identify implementation.  To be relaxed
 later]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 540c801c65eb58e05e0ca38b6fd644a83d7e2b33)

Orabug: 25130845

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agoNVMe: Don't unmap controller registers on reset
Keith Busch [Mon, 13 Mar 2017 16:27:07 +0000 (09:27 -0700)]
NVMe: Don't unmap controller registers on reset

Unmapping the registers on reset or shutdown is not necessary. Keeping
the mapping simplifies reset handling.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit b00a726a9fd82ddd4c10344e46f0d371e1674303)

Orabug: 25130845

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agoNVMe: reduce admin queue depth as workaround for Samsung EPIC SQ errata
Ashok Vairavan [Thu, 8 Dec 2016 00:10:38 +0000 (16:10 -0800)]
NVMe: reduce admin queue depth as workaround for Samsung EPIC SQ errata

Orabug: 25186219

PCIe analyzer tracing by Oracle and Samsung revealed an errata in Samsung's
firmware for EPIC SSDs where the invalid completion entries in admin queue
and IO queue can occur  when the queues straddle an 8MB DMA address boundary.

This patch limits admin queue depth to 64 for EPIC SSDs.

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agonvme: Limit command retries
Keith Busch [Mon, 13 Mar 2017 16:06:05 +0000 (09:06 -0700)]
nvme: Limit command retries

Many controller implementations will return errors to commands that will
not succeed, but without the DNR bit set. The driver previously retried
these commands an unlimited number of times until the command timeout
has exceeded, which takes an unnecessarilly long period of time.

This patch limits the number of retries a command can have, defaulting
to 5, but is user tunable at load or runtime.

The struct request's 'retries' field is used to track the number of
retries attempted. This is in contrast with scsi's use of this field,
which indicates how many retries are allowed.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit f80ec966c19b78af4360e26e32e1ab775253105f)

Orabug: 25130845

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agoNVMe: reduce queue depth as workaround for Samsung EPIC SQ errata
Ashok Vairavan [Wed, 23 Nov 2016 22:31:21 +0000 (14:31 -0800)]
NVMe: reduce queue depth as workaround for Samsung EPIC SQ errata

Orabug: 25138123

Oracle discovered that the NVMe driver gets SQ completion errors eventually
leading to the device being reset, taken out of the PCI bus tree or kernel
panics when using the default SQ size of 1024 entries (64KB) for Samsung
EPIC NVMe SSDs.

PCIe analyzer tracing by Oracle and Samsung revealed an errata in Samsung's
firmware for EPIC SSDs where these invalid completion entries can occur
when the queues straddle an 8MB DMA address boundary.

This patch works around the errata by detecting these specific devices and
limiting their descriptor queue depth to 64.  This is only for the Samsung
NVMe controllers used in Oracle X-series servers.

There was no noticeable performance impact of reducing queue depths to 64
for these Samsung drives, Oracle X6-2 server, and Oracle VM Server 3.4.2.

Signed-off-by: Kyle Fortin <kyle.fortin@oracle.com>
Signed-off-by: Bhavesh Davda <bhavesh.davda@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>