hv_netvsc: Add structs and handlers for VF messages
This patch adds data structures and handlers for messages related
to SRIOV Virtual Function.
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 71790a2792c8772e29bf5aa726215d9256ef93dc)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
KY Srinivasan [Wed, 22 Jul 2015 18:42:32 +0000 (11:42 -0700)]
hv_netvsc: Wait for sub-channels to be processed during probe
The current code returns from probe without waiting for the proper handling
of subchannels that may be requested. If the netvsc driver were to be rapidly
loaded/unloaded, we can trigger a panic as the unload will be tearing
down state that may not have been fully setup yet. We fix this issue by making
sure that we return from the probe call only after ensuring that the
sub-channel offers in flight are properly handled.
Reviewed-and-tested-by: Haiyang Zhang <haiyangz@microsoft.com Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b3e6b82a0099dfef038e40c630a554ed1e402504)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
hv_netvsc: Add close of RNDIS filter into change mtu call
The current change mtu call only stops tx before removing RNDIS filter.
In case ringbufer is not empty, the rndis_filter_device_remove() may
hang on removing the buffers.
This patch adds close of RNDIS filter before removing it, also a
gradual waiting loop until the ring is empty. The change_mtu hang
issue under heavy traffic is solved by this patch.
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 2de8530ba0c71a2fba02590681af0f3a2a187a9b)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
hv_netvsc: Add support to set MTU reservation from guest side
When packet encapsulation is in use, the MTU needs to be reduced for
headroom reservation.
The existing code takes the updated MTU value only from the host side.
But vSwitch extensions, such as Open vSwitch, require the flexibility
to change the MTU to different values from within a guest during the
lifecycle of a vNIC, when the encapsulation protocol is changed. The
patch supports this kind of MTU changes.
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f9cbce34c34bcc05ea0dd78c8999bfe88b5b6b86)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
storvsc: use shost_for_each_device() instead of open coding
Comment in struct Scsi_Host says that drivers are not supposed to access
__devices directly. storvsc_host_scan() doesn't happen in irq context
so we can just use shost_for_each_device().
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Reviewed-by: Long Li <longli@microsoft.com> Acked-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 8d6a9f5676f0e734967ac3739f5c6a28a0b047d9)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Vitaly Kuznetsov [Thu, 25 Jun 2015 16:12:11 +0000 (18:12 +0200)]
storvsc: be more picky about scmnd->sc_data_direction
Under the 'default' case in scmnd->sc_data_direction we have 3 options:
- DMA_NONE which we handle correctly.
- DMA_BIDIRECTIONAL which is never supposed to be set by SCSI stack.
- Garbage value.
Do WARN() and return -EINVAL in the last two cases. virtio_scsi does
BUG_ON() here but it looks like an overkill.
Reported-by: Radim Krčmář <rkrcmar@redhat.com> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Acked-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit cb1cf0804fe582f8a626c3cc591cb3127536137c)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
K. Y. Srinivasan [Mon, 1 Jun 2015 04:27:03 +0000 (21:27 -0700)]
Drivers: hv: vmbus: Allocate ring buffer memory in NUMA aware fashion
Allocate ring buffer memory from the NUMA node assigned to the channel.
Since this is a performance and not a correctness issue, if the node specific
allocation were to fail, fall back and allocate without specifying the node.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 294409d20572e9bcf857328286433f851168d54a)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
K. Y. Srinivasan [Sun, 31 May 2015 06:37:48 +0000 (23:37 -0700)]
Drivers: hv: vmbus: Implement NUMA aware CPU affinity for channels
Channels/sub-channels can be affinitized to VCPUs in the guest. Implement
this affinity in a way that is NUMA aware. The current protocol distributed
the primary channels uniformly across all available CPUs. The new protocol
is NUMA aware: primary channels are distributed across the available NUMA
nodes while the sub-channels within a primary channel are distributed amongst
CPUs within the NUMA node assigned to the primary channel.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 1f656ff3fdddc2f59649cc84b633b799908f1f7b)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
K. Y. Srinivasan [Sun, 31 May 2015 06:37:47 +0000 (23:37 -0700)]
Drivers: hv: vmbus: Use the vp_index map even for channels bound to CPU 0
Map target_cpu to target_vcpu using the mapping table.
We should use the mapping table to transform guest CPU ID to VP Index
as is done for the non-performance critical channels.
While the value CPU 0 is special and will
map to VP index 0, it is good to be consistent.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 9c6e64adf200d3bac0dd47d52cdbd3bd428384a5)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Vitaly Kuznetsov [Thu, 7 May 2015 00:47:46 +0000 (17:47 -0700)]
Drivers: hv: vmbus: distribute subchannels among all vcpus
Primary channels are distributed evenly across all vcpus we have. When the host
asks us to create subchannels it usually makes us num_cpus-1 offers and we are
supposed to distribute the work evenly among the channel itself and all its
subchannels. Make sure they are all assigned to different vcpus.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit ce59fec836a9b4dc51cbcf9cb245b59e0ef53bea)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Vitaly Kuznetsov [Fri, 29 May 2015 18:18:02 +0000 (11:18 -0700)]
Drivers: hv: balloon: check if ha_region_mutex was acquired in MEM_CANCEL_ONLINE case
Memory notifiers are being executed in a sequential order and when one of
them fails returning something different from NOTIFY_OK the remainder of
the notification chain is not being executed. When a memory block is being
onlined in online_pages() we do memory_notify(MEM_GOING_ONLINE, ) and if
one of the notifiers in the chain fails we end up doing
memory_notify(MEM_CANCEL_ONLINE, ) so it is possible for a notifier to see
MEM_CANCEL_ONLINE without seeing the corresponding MEM_GOING_ONLINE event.
E.g. when CONFIG_KASAN is enabled the kasan_mem_notifier() is being used
to prevent memory hotplug, it returns NOTIFY_BAD for all MEM_GOING_ONLINE
events. As kasan_mem_notifier() comes before the hv_memory_notifier() in
the notification chain we don't see the MEM_GOING_ONLINE event and we do
not take the ha_region_mutex. We, however, see the MEM_CANCEL_ONLINE event
and unconditionally try to release the lock, the following is observed:
[ 110.850927] =====================================
[ 110.850927] [ BUG: bad unlock balance detected! ]
[ 110.850927] 4.1.0-rc3_bugxxxxxxx_test_xxxx #595 Not tainted
[ 110.850927] -------------------------------------
[ 110.850927] systemd-udevd/920 is trying to release lock
(&dm_device.ha_region_mutex) at:
[ 110.850927] [<ffffffff81acda0e>] mutex_unlock+0xe/0x10
[ 110.850927] but there are no more locks to release!
At the same time we can have the ha_region_mutex taken when we get the
MEM_CANCEL_ONLINE event in case one of the memory notifiers after the
hv_memory_notifier() in the notification chain failed so we need to add
the mutex_is_locked() check. In case of MEM_ONLINE we are always supposed
to have the mutex locked.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 4e4bd36f97b1492f19b3329ac74ed313da13de34)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
K. Y. Srinivasan [Fri, 29 May 2015 00:08:07 +0000 (17:08 -0700)]
hv_netvsc: Allocate the sendbuf in a NUMA aware way
Allocate the send buffer in a NUMA aware way.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5defde5946676ee23cd6a9d0e1de899410f4a33f)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
K. Y. Srinivasan [Fri, 29 May 2015 00:08:06 +0000 (17:08 -0700)]
hv_netvsc: Allocate the receive buffer from the correct NUMA node
Allocate the receive bufer from the NUMA node assigned to the primary
channel.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 0a726c2b499e390b1c1fc3092bd789f2192a2d03)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
KY Srinivasan [Wed, 27 May 2015 20:16:57 +0000 (13:16 -0700)]
hv_netvsc: Properly size the vrss queues
The current algorithm for deciding on the number of VRSS channels is
not optimal since we open up the min of number of CPUs online and the
number of VRSS channels the host is offering. So on a 32 VCPU guest
we could potentially open 32 VRSS subchannels. Experimentation has
shown that it is best to limit the number of VRSS channels to the number
of CPUs within a NUMA node.
Here is the new algorithm for deciding on the number of sub-channels we
would open up:
1) Pick the minimum of what the host is offering and what the driver
in the guest is specifying as the default value.
2) Pick the minimum of (1) and the numbers of CPUs in the NUMA
node the primary channel is bound to.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e01ec2199ef22e2cabd7d6e68a192f3eb728029f)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Keith Mange [Tue, 26 May 2015 21:23:01 +0000 (14:23 -0700)]
Drivers: hv: vmbus:Update preferred vmbus protocol version to windows 10.
Add support for Windows 10.
Signed-off-by: Keith Mange <keith.mange@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 6c4e5f9c9ff41ea997fd0f345b3b2b88c113eb68)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
sixiao@microsoft.com [Thu, 14 May 2015 08:00:25 +0000 (01:00 -0700)]
hv_netvsc: use per_cpu stats to calculate TX/RX data
Current code does not lock anything when calculating the TX and RX stats.
As a result, the RX and TX data reported by ifconfig are not accuracy in a
system with high network throughput and multiple CPUs (in my test,
RX/TX = 83% between 2 HyperV VM nodes which have 8 vCPUs and 40G Ethernet).
This patch fixed the above issue by using per_cpu stats.
netvsc_get_stats64() summarizes TX and RX data by iterating over all CPUs
to get their respective stats.
This v2 patch addressed David's comments on the cleanup path when
netdev_alloc_pcpu_stats() failed.
Signed-off-by: Simon Xiao <sixiao@microsoft.com> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 7eafd9b4005643cfc24f1daf78f4dd56ff71f559)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
KY Srinivasan [Mon, 11 May 2015 22:39:46 +0000 (15:39 -0700)]
hv_netvsc: Use the xmit_more skb flag to optimize signaling the host
Based on the information given to this driver (via the xmit_more skb flag),
we can defer signaling the host if more packets are on the way. This will help
make the host more efficient since it can potentially process a larger batch of
packets. Implement this optimization.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 82fa3c776e5abba7ed6e4b4f4983d14731c37d6a)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Vitaly Kuznetsov [Thu, 7 May 2015 00:47:45 +0000 (17:47 -0700)]
Drivers: hv: vmbus: move init_vp_index() call to vmbus_process_offer()
We need to call init_vp_index() after we added the channel to the appropriate
list (global or subchannel) to be able to use this information when assigning
the channel to the particular vcpu. To do so we need to move a couple of
functions around. The only real change is the init_vp_index() call. This is a
small refactoring without a functional change.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit f38e7dd72337d83cced910cfbf6016475ef85bf7)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Vitaly Kuznetsov [Thu, 7 May 2015 00:47:40 +0000 (17:47 -0700)]
Drivers: hv: vmbus: do cleanup on all vmbus_open() failure paths
In case there was an error reported in the response to the CHANNELMSG_OPENCHANNEL
call we need to do the cleanup as a vmbus_open() user won't be doing it after
receiving an error. The cleanup should be done on all failure paths. We also need
to avoid returning open_info->response.open_result.status as the return value as
all other errors we return from vmbus_open() are -EXXX and vmbus_open() callers
are not supposed to analyze host error codes.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit ffc151f3c83c25ec06d5ad13a78d0fc066c7167e)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
K. Y. Srinivasan [Thu, 23 Apr 2015 04:31:31 +0000 (21:31 -0700)]
drivers: hv: vmbus: Get rid of some unused definitions
Get rid of some unused definitions.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit db9ba2088f6507fee370904f02db1eb9b49bd088)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Introduce FCOPY_VERSION_1 to support kernel replying to the negotiation
message with its own version.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Tested-by: Alex Ng <alexng@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit a4d1ee5b0255a135fead1d62a7fc7e6fe718b66e)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Tools: hv: vss: use misc char device to communicate with kernel
Use /dev/vmbus/hv_vss instead of netlink.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Tested-by: Alex Ng <alexng@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit f5722b9bd418e29b7429bd9a43bd100599b26d4f)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Tools: hv: kvp: use misc char device to communicate with kernel
Use /dev/vmbus/hv_kvp instead of netlink.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Tested-by: Alex Ng <alexng@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 8ddca8088586303cfe3db4209a4682f7a4cf7d2d)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Unify the code with the recently introduced hv_utils_transport. Netlink
communication is disabled for fcopy.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Tested-by: Alex Ng <alexng@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c7e490fc23eb44e6ae6ab41b9fd450e361f8a01f)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Drivers: hv: fcopy: set .owner reference for file operations
Get an additional reference otherwise a crash is observed when hv_utils module is being unloaded while
fcopy daemon is still running. .owner gives us an additional reference when
someone holds a descriptor for the device.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Tested-by: Alex Ng <alexng@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 3f0dccf86cab38d96b67efdfc944954f5490d057)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Drivers: hv: fcopy: switch to using the hvutil_device_state state machine
Switch to using the hvutil_device_state state machine from using 3 different state variables:
fcopy_transaction.active, opened, and in_hand_shake.
State transitions are:
-> HVUTIL_DEVICE_INIT when driver loads or on device release
-> HVUTIL_READY if the handshake was successful
-> HVUTIL_HOSTMSG_RECEIVED when there is a non-negotiation message from the host
-> HVUTIL_USERSPACE_REQ after userspace daemon read the message
-> HVUTIL_USERSPACE_RECV after/if userspace has replied
-> HVUTIL_READY after we respond to the host
-> HVUTIL_DEVICE_DYING on driver unload
In hv_fcopy_onchannelcallback() process ICMSGTYPE_NEGOTIATE messages even when
the userspace daemon is disconnected, otherwise we can make the host think
we don't support FCOPY and disable the service completely.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Tested-by: Alex Ng <alexng@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 4c93ccccf47e32d605b81207eb575cce3b12facc)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
'fcopy_work' (and fcopy_work_func) is a misnomer as it sounds like we expect
this useful work to happen and in reality it is just an emergency escape when
timeout happens.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Tested-by: Alex Ng <alexng@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 1d072339fa9e32365d282d8ade32822de7d21e5f)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Drivers: hv: fcopy: process deferred messages when we complete the transaction
In theory, the host is not supposed to issue any requests before be reply to
the previous one. In KVP we, however, support the following scenarios:
1) A message was received before userspace daemon registered;
2) A message was received while the previous one is still being processed.
In FCOPY we support only the former. Add support for the later, use
hv_poll_channel() to do the job.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Tested-by: Alex Ng <alexng@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 242f31221d48793d07e161bc668e1aabd502c18b)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Drivers: hv: kvp: switch to using the hvutil_device_state state machine
Switch to using the hvutil_device_state state machine from using 2 different state variables: kvp_transaction.active and
in_hand_shake.
State transitions are:
-> HVUTIL_DEVICE_INIT when driver loads or on device release
-> HVUTIL_READY if the handshake was successful
-> HVUTIL_HOSTMSG_RECEIVED when there is a non-negotiation message from the host
-> HVUTIL_USERSPACE_REQ after we sent the message to the userspace daemon
-> HVUTIL_USERSPACE_RECV after/if the userspace daemon has replied
-> HVUTIL_READY after we respond to the host
-> HVUTIL_DEVICE_DYING on driver unload
In hv_kvp_onchannelcallback() process ICMSGTYPE_NEGOTIATE messages even when
the userspace daemon is disconnected, otherwise we can make the host think
we don't support KVP and disable the service completely.
Unfortunately there is no good way we can figure out that the userspace daemon
has died (unless we start treating all timeouts as such). In case the daemon
restarts we skip the negotiation procedure (so the daemon is supposed to has
the same version). This behavior is unchanged from in_handshake approach.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Tested-by: Alex Ng <alexng@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 97bf16cd309805ebf82ffcc4063a65e06169651f)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
'kvp_work' (and kvp_work_func) is a misnomer as it sounds like we expect
this useful work to happen and in reality it is just an emergency escape when
timeout happens.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Tested-by: Alex Ng <alexng@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 68c8b39a0db71e0e76295bf277e8280ae36e7c10)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Drivers: hv: kvp: move poll_channel() to hyperv_vmbus.h
Move poll_channel() to hyperv_vmbus.h and make it inline and rename it to hv_poll_channel() so it can be reused
in other hv_util modules.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Tested-by: Alex Ng <alexng@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 8efe78fdb1490e271615fab32433ebc0f15fa822)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Drivers: hv: util: move kvp/vss function declarations to hyperv_vmbus.h
These declarations are internal to hv_util module and hv_fcopy_* declarations
already reside there.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Tested-by: Alex Ng <alexng@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 3647a83d9dcf00b8e17777ec8aa1e48f1ed4fe06)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
We set kvp_context when we want to postpone receiving a packet from vmbus due
to the previous transaction being unfinished. We, however, never reset this
state, all consequent kvp_respond_to_host() calls will result in poll_channel()
calling hv_kvp_onchannelcallback(). This doesn't cause real issues as:
1) Host is supposed to serialize transactions as well
2) If no message is pending vmbus_recvpacket() will return 0 recvlen.
This is just a cleanup.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Tested-by: Alex Ng <alexng@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 5fa97480b9b125bb9bdb446930289b3274ed7eb7)
Orabug: 21886720 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Maor Gottlieb [Mon, 27 Apr 2015 10:47:56 +0000 (13:47 +0300)]
net/mlx4_core: Fix FMR unmapping to allow remapping afterward
According to device spec we only need to set ownership bit to SW at FMR
unmap, all other stuff we did are redundant and not essential.
This fix is ported from Mellanox OFED 3.1.
It covers some of the same issues fixed in UEK2 with the
following UEK2 commits: bbdc2821db04 "mlx4_core: Avoid recycling old FMR R_Keys too soon" 5bddb281c0f1 "mlx4_ib: unmap FMR should update MPT status to 0xF"
Following comments from bbdc2821db04 patch by Olaf Kirch <okir@lst.de>
adds more useful information about impact of this change on RDS usage
in Oracle applications and copied here to retain useful context.
When a FMR is unmapped, mlx4 resets the map count to 0, and clears the
upper part of the R_Key which is used as the sequence counter.
This poses a problem for RDS, which uses ib_fmr_unmap as a fence
operation. RDS assumes that after issuing an unmap, the old R_Keys
will be invalid for a "reasonable" period of time. For instance,
Oracle processes uses shared memory buffers allocated from a pool of
buffers. When a process dies, we want to reclaim these buffers -- but
we must make sure there are no pending RDMA operations to/from those
buffers. The only way to achieve that is by using unmap and sync the
TPT.
However, when the sequence count is reset on unmap, there is a high
likelihood that a new mapping will be given the same R_Key that was
issued a few milliseconds ago.
To prevent this, don't reset the sequence count when unmapping a FMR.
In IPoIB code, parallel access of tx_outstanding (send path VS event
process path) needs to be serialized. We use priv->lock to protect it. We
also use that lock to make the stop/open tx queue to be atomic with the
changing on tx_outstanding to protect the race between the opening of tx
queue from completion hander and the closing from the send path.
This patch also make sure the increase of tx_outstanding prior to the
calling of post_send to avoid the possible decreasing before increasing in
case the running of increasing is scheduled later than the event handler.
Impact on Throuput is ~1.5% drop.
Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com> Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
See also patch "block: destroy bdi before blockdev is unregistered"
(commit ID 6cd18e711dd8).
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Cc: <stable@vger.kernel.org> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit bf2cf3baa20b0a6cd2d08707ef05dc0e992a8aa0)
Orabug: 22250360 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Conflicts:
drivers/scsi/scsi_sysfs.c
i40e: Fix for recursive RTNL lock during PROMISC change
The sync_vsi_filters function can be called directly under RTNL
or through the timer subtask without one. This was causing a deadlock.
If sync_vsi_filters is called from a thread which held the lock,
and in another thread the PROMISC setting got changed we would
be executing the PROMISC change in the thread which already held
the lock alongside the other filter update. The PROMISC change
requires a reset if we are on a VEB, which requires it to be called
under RTNL.
Earlier the driver would call reset for PROMISC change without
checking if we were already under RTNL and would try to grab it
causing a deadlock. This patch changes the flow to see if we are
already under RTNL before trying to grab it.
Ethan Zhao [Wed, 9 Dec 2015 10:50:41 +0000 (02:50 -0800)]
ixgbe: make a workaround to tx hang issue under dom
report 1 tx queue to net core to workaround the tx hang
issue reported in Xen environment.
The change is only limited to dom0 and baremetal is left unchanged.
Orabug: 22171500 Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com> Signed-off-by: Guru Anbalagane <guru.anbalagane@oracle.com>
Change I40E_FW_API_VERSION_MINOR to be consistent with 1.3.38
sourceforge driver. Currently i40e driver is reporting NVM
image is too old with the latest production image from 1.3.38.
The driver waits for command completion event while cleanup of task
within the frwd lock and back locks. The frwd lock was still held
which caused the call trace while issuing a device reset.
Release the frwd lock along with the back lock
to avoid waiting in the lock context.
Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 35843048e7e979df3b7b9f2ad49e21797a11386b)
Santosh Shilimkar [Wed, 21 Oct 2015 00:53:40 +0000 (17:53 -0700)]
Merge branch 'uek4-avago' of git://ca-git.us.oracle.com/linux-mkp-public into topic/uek-4.1/drivers
* 'uek4-avago' of git://ca-git.us.oracle.com/linux-mkp-public: (76 commits)
mpt3sas : Bump mpt3sas driver version to 9.100.00.00
mpt3sas: When device is blocked followed by unblock fails, unfreeze the I/Os
mpt3sas: Call dma_mapping_error() API after mapping an address with dma_map_single() API
mpt3sas: Use alloc_ordered_workqueue() API instead of create_singlethread_workqueue() API
mpt3sas: Added support for customer specific branding
mpt3sas: Return host busy error status to SML when DMA mapping of scatter gather list fails for a SCSI command
mpt3sas: Complete the SCSI command with DID_RESET status for log_info value 0x0x32010081
mpt3sas: MPI 2.5 Rev K (2.5.6) specifications
mpt3sas: Bump mpt3sas driver version to v6.100.00.00
mpt3sas: Add branding string support for OEM custom HBA
mpt3sas: Add branding string support for OEM's HBA
mpt3sas: MPI 2.5 Rev J (2.5.5) specification and 2.00.34 header files
mpt3sas: Update MPI2 strings to MPI2.5
mpt3sas: Bump mpt3sas Driver version to v5.100.00.00
mpt3sas: Provides the physical location of sas drives
mpt3sas: MPI 2.5 Rev I (2.5.4) specifications.
mpt3sas: Remove redundancy code while freeing the controller resources.
mpt3sas: Don't block the drive when drive addition under the control of SML
mpt3sas: Get IOC_FACTS information using handshake protocol only after HBA card gets into READY or Operational state.
mpt3sas: Added Combined Reply Queue feature to extend up-to 96 MSIX vector support
...
Sreekanth Reddy [Tue, 30 Jun 2015 06:55:06 +0000 (12:25 +0530)]
mpt3sas : Bump mpt3sas driver version to 9.100.00.00
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit c75683ca13d12a700531864bcd3118e94bc9eaa0) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:55:05 +0000 (12:25 +0530)]
mpt3sas: When device is blocked followed by unblock fails, unfreeze the I/Os
Issue: When the disks are getting discovered and assigned device
handles by the kernel, a device block followed by an unblock
(due to broadcast primitives) issued by the driver is
interspersed by the kernel changing the state of the device.
Therefore the unblock by the driver results in a no operation
within the kernel API.
To fix this one, the below patch checks the return of the unblock API
and performs a block followed by an unblock to unfreeze the block
layer's I/O queue. Sufficient checks and prints are also added in the
driver to identify this condition caused by the kernel.
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit df838f92f3f5240dca54e1629e8547818e8ea646) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:55:04 +0000 (12:25 +0530)]
mpt3sas: Call dma_mapping_error() API after mapping an address with dma_map_single() API
Added dma_mapping_error() API after mapping an address with dma_map_single()
API. Otherwise when CONFIG_DMA_API_DEBUG is enabled in the kernel, then it
complains about mpt3sas driver not calling dma_mapping_error after mapping an
address with dma_map_single
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 36814028ad720165a6febcf9ddd7de20833fd240) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:55:03 +0000 (12:25 +0530)]
mpt3sas: Use alloc_ordered_workqueue() API instead of create_singlethread_workqueue() API
Created a thread using alloc_ordered_workqueue() API in order to process
the works from firmware Work-queue sequentially instead of
create_singlethread_workqueue() API.
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Joe Lawrence <joe.lawrence@stratus.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit bdff785e4f593218816fa3677e043aae1481aa98) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:55:02 +0000 (12:25 +0530)]
mpt3sas: Added support for customer specific branding
"VendorID" "DeviceID" "SubsystemVendor ID" "SubsystemDevice ID" Cisco Branding String
0x1000 0x97 0x1137 0x154 Cisco 9300-8i 12Gbps SAS HBA
0x1000 0x97 0x1137 0x155 Cisco 12G Modular SAS Pass through Controller
0x1000 0x97 0x1137 0x156 UCS C3X60 12G SAS Pass through Controller
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit d8eb4a47c70b4bab34b938d2f682044687f53c64) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:55:01 +0000 (12:25 +0530)]
mpt3sas: Return host busy error status to SML when DMA mapping of scatter gather list fails for a SCSI command
scsi_dma_map API will return a negative value (i.e. -ENOMEM)
if DMA mapping of sg lists fails and zero if the sg list in the
SCSI cmd is NULL. But drivers doesn't handled sg list DMA mapping
failure case properly.
So, Updated the code to return host busy error status to SCSI MID Layer(SML),
when DMA mapping of scatter gather list fails for a SCSI command.
So that SML will retry this SCSI cmd after some time.
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 62f5c74c97037c7c00fdefb69dcfe39810c34a05) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:55:00 +0000 (12:25 +0530)]
mpt3sas: Complete the SCSI command with DID_RESET status for log_info value 0x0x32010081
For any SCSI command, if the driver receives
IOC status = SCSI_IOC_TERMINATED and log info = 0x32010081 then
that command will be completed with DID_RESET host status.
The definition of this log info value is
"Virtual IO has failed and has to be retried".
Firmware will provide this log info value with IOC Status
"SCSI_IOC_TERMINATED", whenever a drive (with is a part of a volume)
is pulled and pushed back within some minimal delay.
With this log info value, firmware informs the driver to retry the
failed IO command infinite times, so to provide some time for the
firmware to discover the reinserted drive successfully instated of
just retrying failed command for five times(doesn't giving enough
time for firmware to complete the drive discovery) and failing the
IO permanently even though drive came back successfully.
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 3898f08e8ccfc8b7b4c297960ecdde970869e950) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:54:59 +0000 (12:24 +0530)]
mpt3sas: MPI 2.5 Rev K (2.5.6) specifications
Below are the new changes to MPI 2.5 Rev K(2.5.6) specification and 2.00.35
header files
1) Added a minimum size requirement for target mode command buffers.
2) Added MinMSIxIndex and MaxMSIxIndex fields to CommandBufferPostBase
Request.
3) For BIOS Page 1, added SSUTimeout field, and added Product Name String
Format bits to the BiosOptions field
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit a6f84009b9d7ca97c400ca929f9d58f43b0ece9d) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:54:58 +0000 (12:24 +0530)]
mpt3sas: Bump mpt3sas driver version to v6.100.00.00
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 2b89669ae4addfa68a58e0fc16afdd24739720d8) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 38e4141ecb0e59c93d85ec5948f98d1f1e331a88) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit fb84dfc44718ef4099a827d147f738e428828d02) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 35c319b47884e49d9d0a84779097916ccb173947) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:54:54 +0000 (12:24 +0530)]
mpt3sas: Update MPI2 strings to MPI2.5
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 2e26c3853206ba166c3434e5f2ca4c82078ad84e) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:54:53 +0000 (12:24 +0530)]
mpt3sas: Bump mpt3sas Driver version to v5.100.00.00
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit f9d81cfc23151eb6e9e498663c9784c351646d0e) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:54:52 +0000 (12:24 +0530)]
mpt3sas: Provides the physical location of sas drives
This Patch will provide more details of the devices such as slot number,
enclosure logical id, enclosure level & connector name in the following
scenarios,
- When end device is added in the topology,
- When the end device is removed from the setup,
- When the SCSI mid layer issues TASK ABORT/ DEVICE RESET/ TARGET RESET during
error handling,
- When any command to the device fails with Sense key Hardware error or Medium
error or Unit Attention,
- When firmware returns device error or device not ready status for the end
device,
- When a Predicted fault is detected on an end device.
This information can be used by the user to identify the location of the
desired drive in the topology.
Driver will get these information by reading the sas device page0.
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit e6d45e3e7e6582fa206ef84631639ce70d50e5c5) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:54:51 +0000 (12:24 +0530)]
mpt3sas: MPI 2.5 Rev I (2.5.4) specifications.
Update MPI 2.5 Release: MPI 2.5 Rev I (2.5.4) specification and 2.00.33 header
files
Below is the change set from the MPI specification for I Rev
1) Added Base Enclosure Level bit to the Flags field of Manufacturing Page 7.
2) Updated description of the MaxTargetPortConnectTime field of SAS IO Unit
Page 1.
3) Added EnclosureLevel and ConnectorName fields to SAS Device Page 0. Also,
added EnclosureLevel and ConnectorName Valid bit to the Flags field.
4) Added EnclosureLevel field to SAS Enclosure Page 0. Also, added
EnclosureLevel Valid bit to the Flags field.
5) Added value for BIOS image to HashImageType.
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit a94bea343c2f747c62ef66b52d2430e6aeb75434) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:54:50 +0000 (12:24 +0530)]
mpt3sas: Remove redundancy code while freeing the controller resources.
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 580d4e3153f0d7a9a9235b675b0b7b13e2185a8b) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:54:49 +0000 (12:24 +0530)]
mpt3sas: Don't block the drive when drive addition under the control of SML
During hot-plugging of a disk(having a flaky link), the disk addition
stops and any further disk addition or removal doesn't happen on that
controller.
This is because, when driver receives DELAY_NOT_RESPONDING event for a disk
while it is undergoing addition at the SCSI Transport layer, the driver
would block the I/O to that disk resulting in a deadlock. i.e the disk
addition work couldn't be completed at the SCSI Transport Layer as it
can't send any I/Os (such as Inquiry, Report LUNs etc) to the disk as
I/Os are blocked to this drive. Also any subsequent device removal
(TARGET_NOT_RESPONDING) or link update(RC_PHY_CHANGED) event couldn't be
processed as they are in the queue to get processed after disk addition
event.
Description of Change:
Don't block the drive when drive addition is under the control of SML.
So that SML won't be blocked of issuing the device dicovery commands
(such as Inquiry, Report LUNs etc).
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit e4bc7f5c21a18cab9acd30940df0ee791fcd7b9e) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:54:48 +0000 (12:24 +0530)]
mpt3sas: Get IOC_FACTS information using handshake protocol only after HBA card gets into READY or Operational state.
Driver initialization fails if driver tries to send IOC facts request message
when the IOC is in reset or in a fault state.
This patch will make sure that
1.Driver to send IOC facts request message only if HBA is in operational or
ready state.
2.If IOC is in fault state, a diagnostic reset would be issued.
3.If IOC is in reset state then driver will wait for 10 seconds to exit out
of reset state. If the HBA continues to be in reset state, then the HBA
wouldn't be claimed by the driver.
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 4dc8c8087f0304ff8d06f862520406b11aac4a66) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:54:47 +0000 (12:24 +0530)]
mpt3sas: Added Combined Reply Queue feature to extend up-to 96 MSIX vector support
In this patch, increased the number of MSIX vector support for SAS3 C0 HBAs to
up-to 96.
Following are changes that are done in this patch
1. This feature is enabled only for SAS3 C0 and higher revision cards and also
only when reply post free queue count is greater than 8.
2. To support this feature 12 SupplementalReplyPostHostIndex system interfaces
are used. MSI-X index numbered from 0 to 7 use the first
SupplementalReplyPostHostIndex system interface to update its corresponding
ReplyPostHostIndex values, MSI-X index numbered from 8 to 15 will use the
second SupplementalReplyPostHostIndex system interface and so on. These 12
SuppementalReplyPostHostIndex system interfaces address are saved in the array
replyPostRegisterIndex[].
3. As each SupplementalReplyPostHostIndex register supports 8 MSI-X
vectors. So MSIxIndex field in these register must contain a value between 0
and 7.
4. After processing the reply descriptors from a reply post free queues then
update the new reply post host index value in ReplyPostHostIndex field and
(msix_index mod 8) value in MSIxIndex field of SupplementalReplyPostHostIndex
register. The Address of this SupplementalReplyPostHostIndex register is
retrived from (msix_index/8)th entry of replyPostRegisterIndex[] array.
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit fb77bb5376a55f4e6c8d9243249e82831a276ee5) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Calvin Owens [Fri, 14 Aug 2015 01:48:10 +0000 (18:48 -0700)]
mpt2sas: Refcount fw_events and fix unsafe list usage
The fw_event_work struct is concurrently referenced at shutdown, so
add a refcount to protect it, and refactor the code to use it.
Additionally, refactor _scsih_fw_event_cleanup_queue() such that it
no longer iterates over the list without holding the lock, since
_firmware_event_work() concurrently deletes items from the list.
Signed-off-by: Calvin Owens <calvinowens@fb.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Nicholas Bellinger <nab@linux-iscsi.org> Tested-by: Chaitra Basappa <chaitra.basappa@avagotech.com> Acked-by: Sreekanth Reddy <sreekanth.reddy@avagotech.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 008549f6e8a1dc4aeea4a8d64184909786b27713) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Calvin Owens [Fri, 14 Aug 2015 01:48:09 +0000 (18:48 -0700)]
mpt2sas: Refcount sas_device objects and fix unsafe list usage
These objects can be referenced concurrently throughout the driver, we
need a way to make sure threads can't delete them out from under each
other. This patch adds the refcount, and refactors the code to use it.
Additionally, we cannot iterate over the sas_device_list without
holding the lock, or we risk corrupting random memory if items are
added or deleted as we iterate. This patch refactors _scsih_probe_sas()
to use the sas_device_list in a safe way.
Signed-off-by: Calvin Owens <calvinowens@fb.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Nicholas Bellinger <nab@linux-iscsi.org> Tested-by: Chaitra Basappa <chaitra.basappa@avagotech.com> Acked-by: Sreekanth Reddy <sreekanth.reddy@avagotech.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit d224fe0d609734888af63656ddaf3a8352f0a7b5) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
mpt2sas, mpt3sas: Abort initialization if no memory I/O resources detected
Driver crashes if the BIOS do not set up at least one
memory I/O resource. This failure can happen if the device is too
slow to respond during POST and is missed by the BIOS, but Linux
then detects the device later in the boot process.
Based on a patch from Timothy Pearson <tpearson@raptorengineeringinc.com>
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 5aeeb78aeb4c8607cbda54a7b0dc7315171e214f) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
o While the driver is in the middle of a MB completion processing
and it receives a spurious MB interrupt, it is mistaken as a good MB
completion interrupt leading to premature completion of the next MB
request. Fix the driver to guard against this by checking the current
state of MB processing and ignore the spurious interrupt.
Also added a stats counter to record this condition.
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
Driver allocates a large chunk of temporary buffer using kzalloc
to copy FW image. As there is no real need of this memory to be
physically contiguous, use vzalloc instead.
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
In some cases it is required to capture minidump for iSCSI functions
as part of default minidump collection process. To enable this, firmware
exports it's capability and driver need to enable that capability
by issuing a mailbox command.
With this feature, firmware can provide additional iSCSI function's
minidump with smaller minidump capture mask (0x1f).
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
Use proper typecasting while performing byte-by-byte copy
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
Replace confusing QL_STATUS_INVALID_PARAM == -1 == -EPERM with -EINVAL
and QLC_STATUS_UNSUPPORTED_CMD == -2 == -ENOENT with -EOPNOTSUPP, the
latter error code is arguable, but it is already used in the driver,
so let it be here as well.
Also remove always false (!buf) check on read(), the driver should
not care if userspace gets its EFAULT or not.
Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Acked-by: Rajesh Borundia <rajesh.borundia@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
Santosh Shilimkar [Tue, 20 Oct 2015 01:20:23 +0000 (18:20 -0700)]
Merge branch 'topic/uek-4.1/rpm-build' of git://ca-git.us.oracle.com/linux-uek into uek/uek-4.1
* 'topic/uek-4.1/rpm-build' of git://ca-git.us.oracle.com/linux-uek:
uek-rpm: unset CONFIG_NFS_USE_LEGACY_DNS for OL7 debug kernel too
uek-rpm: build: Update the base release to 9 with stable v4.1.10
uek-rpm: configs: sparc: Enable VCC as a module
uek-rpm: configs: sparc64: enable i40e modules
uek-rpm: configs: sparc64: synced config files