]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/log
mirror_ubuntu-artful-kernel.git
8 years agoUBUNTU: SAUCE: block_dev: Support checking inode permissions in lookup_bdev()
Seth Forshee [Fri, 31 Jul 2015 17:58:34 +0000 (12:58 -0500)]
UBUNTU: SAUCE: block_dev: Support checking inode permissions in lookup_bdev()

When looking up a block device by path no permission check is
done to verify that the user has access to the block device inode
at the specified path. In some cases it may be necessary to
check permissions towards the inode, such as allowing
unprivileged users to mount block devices in user namespaces.

Add an argument to lookup_bdev() to optionally perform this
permission check. A value of 0 skips the permission check and
behaves the same as before. A non-zero value specifies the mask
of access rights required towards the inode at the specified
path. The check is always skipped if the user has CAP_SYS_ADMIN.

All callers of lookup_bdev() currently pass a mask of 0, so this
patch results in no functional change. Subsequent patches will
add permission checks where appropriate.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: Smack: Add support for unprivileged mounts from user namespaces
Seth Forshee [Wed, 23 Sep 2015 20:16:06 +0000 (15:16 -0500)]
UBUNTU: SAUCE: Smack: Add support for unprivileged mounts from user namespaces

Security labels from unprivileged mounts cannot be trusted.
Ideally for these mounts we would assign the objects in the
filesystem the same label as the inode for the backing device
passed to mount. Unfortunately it's currently impossible to
determine which inode this is from the LSM mount hooks, so we
settle for the label of the process doing the mount.

This label is assigned to s_root, and also to smk_default to
ensure that new inodes receive this label. The transmute property
is also set on s_root to make this behavior more explicit, even
though it is technically not necessary.

If a filesystem has existing security labels, access to inodes is
permitted if the label is the same as smk_root, otherwise access
is denied. The SMACK64EXEC xattr is completely ignored.

Explicit setting of security labels continues to require
CAP_MAC_ADMIN in init_user_ns.

Altogether, this ensures that filesystem objects are not
accessible to subjects which cannot already access the backing
store, that MAC is not violated for any objects in the fileystem
which are already labeled, and that a user cannot use an
unprivileged mount to gain elevated MAC privileges.

sysfs, tmpfs, and ramfs are already mountable from user
namespaces and support security labels. We can't rule out the
possibility that these filesystems may already be used in mounts
from user namespaces with security lables set from the init
namespace, so failing to trust lables in these filesystems may
introduce regressions. It is safe to trust labels from these
filesystems, since the unprivileged user does not control the
backing store and thus cannot supply security labels, so an
explicit exception is made to trust labels from these
filesystems.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: fs: Limit file caps to the user namespace of the super block
Seth Forshee [Wed, 23 Sep 2015 20:16:04 +0000 (15:16 -0500)]
UBUNTU: SAUCE: fs: Limit file caps to the user namespace of the super block

Capability sets attached to files must be ignored except in the
user namespaces where the mounter is privileged, i.e. s_user_ns
and its descendants. Otherwise a vector exists for gaining
privileges in namespaces where a user is not already privileged.

Add a new helper function, in_user_ns(), to test whether a user
namespace is the same as or a descendant of another namespace.
Use this helper to determine whether a file's capability set
should be applied to the caps constructed during exec.

Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: fs: Add user namesapace member to struct super_block
Seth Forshee [Wed, 23 Sep 2015 20:16:01 +0000 (15:16 -0500)]
UBUNTU: SAUCE: fs: Add user namesapace member to struct super_block

Initially this will be used to eliminate the implicit MNT_NODEV
flag for mounts from user namespaces. In the future it will also
be used for translating ids and checking capabilities for
filesystems mounted from user namespaces.

s_user_ns is initialized in alloc_super() and is generally set to
current_user_ns(). To avoid security and corruption issues, two
additional mount checks are also added:

 - do_new_mount() gains a check that the user has CAP_SYS_ADMIN
   in current_user_ns().

 - sget() will fail with EBUSY when the filesystem it's looking
   for is already mounted from another user namespace.

proc requires some special handling. The user namespace of
current isn't appropriate when forking as a result of clone (2)
with CLONE_NEWPID|CLONE_NEWUSER, as it will set s_user_ns to the
namespace of the parent and make proc unmountable in the new user
namespace. Instead, the user namespace which owns the new pid
namespace is used. sget_userns() is allowed to allow passing in
a namespace other than that of current, and sget becomes a
wrapper around sget_userns() which passes current_user_ns().

Changes to original version of this patch
  * Documented @user_ns in sget_userns, alloc_super and fs.h
  * Kept an blank line in fs.h
  * Removed unncessary include of user_namespace.h from fs.h
  * Tweaked the location of get_user_ns and put_user_ns so
    the security modules can (if they wish) depend on it.
  -- EWB

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoNTB: Add support for AMD PCI-Express Non-Transparent Bridge
Xiangliang Yu [Thu, 21 Jan 2016 11:47:05 +0000 (19:47 +0800)]
NTB: Add support for AMD PCI-Express Non-Transparent Bridge

BugLink: http://bugs.launchpad.net/bugs/1542071
This adds support for AMD's PCI-Express Non-Transparent Bridge
(NTB) device on the Zeppelin platform. The driver connnects to the
standard NTB sub-system interface, with modification to add hooks
for power management in a separate patch. The AMD NTB device has 3
memory windows, 16 doorbell, 16 scratch-pad registers, and supports
up to 16 PCIe lanes running a Gen3 speeds.

Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Allen Hubbe <Allen.Hubbe@emc.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
(cherry picked from commit a1b3695820aa490e58915d720a1438069813008b)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: [Config] CONFIG_NTB_AMD=m
Tim Gardner [Tue, 16 Feb 2016 12:22:24 +0000 (04:22 -0800)]
UBUNTU: [Config] CONFIG_NTB_AMD=m

BugLink: http://bugs.launchpad.net/bugs/1542071
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: storvsc: use small sg_tablesize on x86
Joseph Salisbury [Thu, 15 Oct 2015 17:53:12 +0000 (13:53 -0400)]
UBUNTU: SAUCE: storvsc: use small sg_tablesize on x86

BugLink: http://bugs.launchpad.net/bugs/1495983
OriginalAuthor: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Brad Figg <brad.figg@canonical.com>
8 years agoUBUNTU: [Config] CONFIG_ARMV8_DEPRECATED=y
Tim Gardner [Tue, 16 Feb 2016 02:36:14 +0000 (19:36 -0700)]
UBUNTU: [Config] CONFIG_ARMV8_DEPRECATED=y

BugLink: http://bugs.launchpad.net/bugs/1545542
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoahci_xgene: Implement the workaround to fix the missing of the edge interrupt for...
Suman Tripathi [Sat, 6 Feb 2016 05:55:24 +0000 (11:25 +0530)]
ahci_xgene: Implement the workaround to fix the missing of the edge interrupt for the HOST_IRQ_STAT.

Due to H/W errata, the HOST_IRQ_STAT register misses the edge interrupt
when clearing the HOST_IRQ_STAT register and hardware reporting the
PORT_IRQ_STAT register happens to be at the same clock cycle.

Signed-off-by: Suman Tripathi <stripathi@apm.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
(cherry picked from linux-next commit 32aea2680de01f539d928112150279fdeeabca00)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoata: Remove the AHCI_HFLAG_EDGE_IRQ support from libahci.
Suman Tripathi [Sat, 6 Feb 2016 05:55:23 +0000 (11:25 +0530)]
ata: Remove the AHCI_HFLAG_EDGE_IRQ support from libahci.

The flexibility to override the irq handles in the LLD's are already
present, so controllers implementing a edge trigger latch can
implement their own interrupt handler inside the driver.  This patch
removes the AHCI_HFLAG_EDGE_IRQ support from libahci and moves edge
irq handling to ahci_xgene.

tj: Minor update to description.

Signed-off-by: Suman Tripathi <stripathi@apm.com>
Signed-off-by: Tejun Heo <tj@kenrel.org>
(cherry picked from linux-next commit d867b95f965457b9e85fb061ef8e3fdc029116ed)
[ dannf: offset adjustments ]
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agolibahci: Implement the capability to override the generic ahci interrupt handler.
Suman Tripathi [Sat, 6 Feb 2016 05:55:22 +0000 (11:25 +0530)]
libahci: Implement the capability to override the generic ahci interrupt handler.

This patch implements the capability to override the generic AHCI
interrupt handler so that specific ahci drivers can implement their
own custom interrupt handler routines.  It also exports
ahci_handle_port_intr so that custom irq_handler implementations can
use it.

tj: s/ahci_irq_handler/irq_handler/ and updated description.

Signed-off-by: Suman Tripathi <stripathi@apm.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
(cherry picked from linux-next commit f070d6715509dafc0af223577c896fe3d204ca88)
[ dannf: backported to v4.4 ]
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agomegaraid: Fix possible NULL pointer deference in mraid_mm_ioctl
Nicholas Krause [Tue, 5 Jan 2016 19:32:54 +0000 (14:32 -0500)]
megaraid: Fix possible NULL pointer deference in mraid_mm_ioctl

This adds the needed check after the call to the function
mraid_mm_alloc_kioc in order to make sure that this function has not
returned NULL and therefore makes sure we do not deference a NULL
pointer if one is returned by mraid_mm_alloc_kioc.  Further more add
needed comments explaining that this function call can return NULL if
the list head is empty for the pointer passed in order to allow furture
users to understand this required pointer check.

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
Acked-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 7296f62f0322d808362b21064deb34f20799c20d)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: Start new release
Tim Gardner [Fri, 12 Feb 2016 17:02:28 +0000 (10:02 -0700)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: Ubuntu-4.4.0-5.20
Tim Gardner [Thu, 11 Feb 2016 16:20:51 +0000 (08:20 -0800)]
UBUNTU: Ubuntu-4.4.0-5.20

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agos390/cio: update measurement characteristics
Sebastian Ott [Mon, 25 Jan 2016 09:32:51 +0000 (10:32 +0100)]
s390/cio: update measurement characteristics

BugLink: http://bugs.launchpad.net/bugs/1541534
Per channel path measurement characteristics are obtained during channel
path registration. However if some properties of a channel path change
we don't update the measurement characteristics.

Make sure to update the characteristics when we change the properties of
a channel path or receive a notification from FW about such a change.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(cherry picked from commit 9f3d6d7a40a178b8a5b5274f4e55fec8c30147c9)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agos390/cio: ensure consistent measurement state
Sebastian Ott [Mon, 25 Jan 2016 09:31:33 +0000 (10:31 +0100)]
s390/cio: ensure consistent measurement state

BugLink: http://bugs.launchpad.net/bugs/1541534
Make sure that in all cases where we could not obtain measurement
characteristics the associated fields are set to invalid values.

Note: without this change the "shared" capability of a channel path
for which we could not obtain the measurement characteristics was
incorrectly displayed as 0 (not shared). We will now correctly
report "unknown" in this case.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(cherry picked from commit 61f0bfcf8020f02eb09adaef96745d1c1d1b3623)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agos390/cio: fix measurement characteristics memleak
Sebastian Ott [Mon, 25 Jan 2016 09:30:27 +0000 (10:30 +0100)]
s390/cio: fix measurement characteristics memleak

BugLink: http://bugs.launchpad.net/bugs/1541534
Measurement characteristics are allocated during channel path
registration but not freed during deregistration. Fix this by
embedding these characteristics inside struct channel_path.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(cherry picked from commit 0d9bfe9123cfde59bf5c2e375b59d2a7d5061c4c)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoqeth: initialize net_device with carrier off
Ursula Braun [Fri, 11 Dec 2015 11:27:55 +0000 (12:27 +0100)]
qeth: initialize net_device with carrier off

BugLink: http://bugs.launchpad.net/bugs/1541907
/sys/class/net/<interface>/operstate for an active qeth network
interface offen shows "unknown", which translates to "state UNKNOWN
in output of "ip link show". It is caused by a missing initialization
of the __LINK_STATE_NOCARRIER bit in the net_device state field.
This patch adds a netif_carrier_off() invocation when creating the
net_device for a qeth device.

Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Acked-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Reference-ID: Bugzilla 133209
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e5ebe63214d44d4dcf43df02edf3613e04d671b9)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: (noup) Update spl to 0.6.5.4-0ubuntu2, zfs to 0.6.5.4-0ubuntu2
Tim Gardner [Wed, 10 Feb 2016 17:00:42 +0000 (10:00 -0700)]
UBUNTU: SAUCE: (noup) Update spl to 0.6.5.4-0ubuntu2, zfs to 0.6.5.4-0ubuntu2

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agomm: CONFIG_NR_ZONES_EXTENDED
Dan Williams [Tue, 9 Feb 2016 23:12:55 +0000 (10:12 +1100)]
mm: CONFIG_NR_ZONES_EXTENDED

BugLink: http://bugs.launchpad.net/bugs/1534647
ZONE_DEVICE (merged in 4.3) and ZONE_CMA (proposed) are examples of new mm
zones that are bumping up against the current maximum limit of 4 zones,
i.e.  2 bits in page->flags.  When adding a zone this equation still needs
to be satisified:

    SECTIONS_WIDTH + ZONES_WIDTH + NODES_SHIFT + LAST_CPUPID_SHIFT
  <= BITS_PER_LONG - NR_PAGEFLAGS

ZONE_DEVICE currently tries to satisfy this equation by requiring that
ZONE_DMA be disabled, but this is untenable given generic kernels want to
support ZONE_DEVICE and ZONE_DMA simultaneously.  ZONE_CMA would like to
increase the amount of memory covered per section, but that limits the
minimum granularity at which consecutive memory ranges can be added via
devm_memremap_pages().

The trade-off of what is acceptable to sacrifice depends heavily on the
platform.  For example, ZONE_CMA is targeted for 32-bit platforms where
page->flags is constrained, but those platforms likely do not care about
the minimum granularity of memory hotplug.  A big iron machine with 1024
numa nodes can likely sacrifice ZONE_DMA where a general purpose
distribution kernel can not.

CONFIG_NR_ZONES_EXTENDED is a configuration symbol that gets selected when
the number of configured zones exceeds 4.  It documents the configuration
symbols and definitions that get modified when ZONES_WIDTH is greater than
2.

For now, it steals a bit from NODES_SHIFT.  Later on it can be used to
document the definitions that get modified when a 32-bit configuration
wants more zone bits.

Note that GFP_ZONE_TABLE poses an interesting constraint since
include/linux/gfp.h gets included by the 32-bit portion of a 64-bit build.
We need to be careful to only build the table for zones that have a
corresponding gfp_t flag.  GFP_ZONES_SHIFT is introduced for this purpose.
This patch does not attempt to solve the problem of adding a new zone
that also has a corresponding GFP_ flag.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=110931
Fixes: 033fbae988fc ("mm: ZONE_DEVICE for "device memory"")
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Reported-by: Mark <markk@clara.co.uk>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Rik van Riel <riel@redhat.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from linux-next commit 27ffb3827ac71a46e8d52fc7ed7302d33a619d6c)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: [Config] CONFIG_ZONE_DMA=y
Tim Gardner [Wed, 10 Feb 2016 15:29:08 +0000 (08:29 -0700)]
UBUNTU: [Config] CONFIG_ZONE_DMA=y

BugLink: http://bugs.launchpad.net/bugs/1534647
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoperf kvm/powerpc: Add support for HCALL reasons
Hemant Kumar [Thu, 28 Jan 2016 06:33:07 +0000 (12:03 +0530)]
perf kvm/powerpc: Add support for HCALL reasons

BugLink: http://bugs.launchpad.net/bugs/1521678
Powerpc provides hcall events that also provides insights into guest
behaviour. Enhance perf kvm stat to record and analyze hcall events.

 - To trace hcall events :
  perf kvm stat record

 - To show the results :
  perf kvm stat report --event=hcall

The result shows the number of hypervisor calls from the guest grouped
by their respective reasons displayed with the frequency.

This patch makes use of two additional tracepoints
"kvm_hv:kvm_hcall_enter" and "kvm_hv:kvm_hcall_exit". To map the hcall
codes to their respective names, it needs a mapping. Such mapping is
added in this patch in book3s_hcalls.h.

 # pgrep qemu
A sample output :
19378
60515

2 VMs running.

 # perf kvm stat record -a
^C[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 4.153 MB perf.data.guest (39624
samples) ]

 # perf kvm stat report -p 60515 --event=hcall

Analyze events for all VMs, all VCPUs:

    HCALL-EVENT Samples Samples% Time% MinTime MaxTime  AvgTime

          H_IPI     822  66.08% 88.10% 0.63us  11.38us 2.05us (+- 1.42%)
     H_SEND_CRQ     144  11.58%  3.77% 0.41us   0.88us 0.50us (+- 1.47%)
   H_VIO_SIGNAL     118   9.49%  2.86% 0.37us   0.83us 0.47us (+- 1.43%)
H_PUT_TERM_CHAR      76   6.11%  2.07% 0.37us   0.90us 0.52us (+- 2.43%)
H_GET_TERM_CHAR      74   5.95%  2.23% 0.37us   1.70us 0.58us (+- 4.77%)
         H_RTAS       6   0.48%  0.85% 1.10us   9.25us 2.70us (+-48.57%)
      H_PERFMON       4   0.32%  0.12% 0.41us   0.96us 0.59us (+-20.92%)

Total Samples:1244, Total events handled time:1916.69us.

Signed-off-by: Hemant Kumar <hemant@linux.vnet.ibm.com>
Cc: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/1453962787-15376-4-git-send-email-hemant@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
(cherry picked from linux-next commit 78e6c39b231a8e31e193534fdbe29291b7fd8f37)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoperf kvm/powerpc: Port perf kvm stat to powerpc
Hemant Kumar [Thu, 28 Jan 2016 06:33:06 +0000 (12:03 +0530)]
perf kvm/powerpc: Port perf kvm stat to powerpc

BugLink: http://bugs.launchpad.net/bugs/1521678
perf kvm can be used to analyze guest exit reasons. This support already
exists in x86. Hence, porting it to powerpc.

 - To trace KVM events :
  perf kvm stat record
  If many guests are running, we can track for a specific guest by using
  --pid as in : perf kvm stat record --pid <pid>

 - To see the results :
  perf kvm stat report

The result shows the number of exits (from the guest context to
host/hypervisor context) grouped by their respective exit reasons with
their frequency.

Since, different powerpc machines have different KVM tracepoints, this
patch discovers the available tracepoints dynamically and accordingly
looks for them. If any single tracepoint is not present, this support
won't be enabled for reporting. To record, this will fail if any of the
events we are looking to record isn't available.  Right now, its only
supported on PowerPC Book3S_HV architectures.

To analyze the different exits, group them and present them (in a slight
descriptive way) to the user, we need a mapping between the "exit code"
(dumped in the kvm_guest_exit tracepoint data) and to its related
Interrupt vector description (exit reason). This patch adds this mapping
in book3s_hv_exits.h.

It records on two available KVM tracepoints for book3s_hv:

"kvm_hv:kvm_guest_exit" and "kvm_hv:kvm_guest_enter".

Here is a sample o/p:
 # pgrep qemu
19378
60515

2 Guests are running on the host.

 # perf kvm stat record -a
^C[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 4.153 MB perf.data.guest (39624
samples) ]

 # perf kvm stat report -p 60515

Analyze events for pid(s) 60515, all VCPUs:

     VM-EXIT Samples Samples% Time% MinTime    MaxTime  Avg time

       SYSCALL  9141  63.67%  7.49% 1.26us   5782.39us    9.87us (+- 6.46%)
H_DATA_STORAGE  4114  28.66%  5.07% 1.72us   4597.68us   14.84us (+-20.06%)
HV_DECREMENTER   418   2.91%  4.26% 0.70us  30002.22us  122.58us (+-70.29%)
      EXTERNAL   392   2.73%  0.06% 0.64us    104.10us    1.94us (+-18.83%)
RETURN_TO_HOST   287   2.00% 83.11% 1.53us 124240.15us 3486.52us (+-16.81%)
H_INST_STORAGE     5   0.03%  0.00% 1.88us      3.73us    2.39us (+-14.20%)

Total Samples:14357, Total events handled time:1203918.42us.

Signed-off-by: Hemant Kumar <hemant@linux.vnet.ibm.com>
Cc: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/1453962787-15376-3-git-send-email-hemant@linux.vnet.ibm.com
Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
(cherry picked from linux-next commit 066d3593e1b14690dc1131d50cacbb0b7eb3f160)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoperf kvm/{x86,s390}: Remove const from kvm_events_tp
Hemant Kumar [Thu, 28 Jan 2016 06:33:05 +0000 (12:03 +0530)]
perf kvm/{x86,s390}: Remove const from kvm_events_tp

BugLink: http://bugs.launchpad.net/bugs/1521678
This patch removes the "const" qualifier from kvm_events_tp declaration
to account for the fact that some architectures may need to update this
variable dynamically. For instance, powerpc will need to update this
variable dynamically depending on the machine type.

Signed-off-by: Hemant Kumar <hemant@linux.vnet.ibm.com>
Acked-by: David Ahern <dsahern@gmail.com>
Cc: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/1453962787-15376-2-git-send-email-hemant@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
(cherry picked from linux-next commit 48deaa74fcdad516a94fe38a4af706747d9e4745)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoperf kvm/{x86,s390}: Remove dependency on uapi/kvm_perf.h
Hemant Kumar [Thu, 28 Jan 2016 06:33:04 +0000 (12:03 +0530)]
perf kvm/{x86,s390}: Remove dependency on uapi/kvm_perf.h

BugLink: http://bugs.launchpad.net/bugs/1521678
Its better to remove the dependency on uapi/kvm_perf.h to allow dynamic
discovery of kvm events (if its needed). To do this, some extern
variables have been introduced with which we can keep the generic
functions generic.

Signed-off-by: Hemant Kumar <hemant@linux.vnet.ibm.com>
Acked-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Acked-by: David Ahern <dsahern@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/1453962787-15376-1-git-send-email-hemant@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
(cherry picked from linux-next commit 162607ea20fafb4a76234ebe4314cd733345482e)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: nbd: ratelimit error msgs after socket close
Dan Streetman [Mon, 8 Feb 2016 22:08:02 +0000 (17:08 -0500)]
UBUNTU: SAUCE: nbd: ratelimit error msgs after socket close

BugLink: http://bugs.launchpad.net/bugs/1505564
Make the "Attempted send on closed socket" error messages generated in
nbd_request_handler() ratelimited.

When the nbd socket is shutdown, the nbd_request_handler() function emits
an error message for every request remaining in its queue.  If the queue
is large, this will spam a large amount of messages to the log.  There's
no need for a separate error message for each request, so this patch
ratelimits it.

In the specific case this was found, the system was virtual and the error
messages were logged to the serial port, which overwhelmed it.

Fixes: 4d48a542b427 ("nbd: fix I/O hang on disconnected nbds")
Signed-off-by: Dan Streetman <dan.streetman@canonical.com>
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
(cherry-picked from commit da6ccaaa79caca4f38b540b651238f87215217a2 git://git.pengutronix.de/git/mpa/linux-nbd.git)
Acked-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
8 years agonet/mlx5e: Assign random MAC address if needed
Saeed Mahameed [Thu, 10 Dec 2015 15:12:38 +0000 (17:12 +0200)]
net/mlx5e: Assign random MAC address if needed

BugLink: http://bugs.launchpad.net/bugs/1540435
Under SRIOV there might be a case where VFs are loaded
without pre-assigned MAC address. In this case, the VF
will randomize its own MAC.  This will address the case
of administrator not assigning MAC to the VF through
the PF OS APIs and keep udev happy.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 108805fc196e001053e9e7c76f259977804dc0d6)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet/mlx5: Fix query E-Switch capabilities
Saeed Mahameed [Thu, 10 Dec 2015 15:12:37 +0000 (17:12 +0200)]
net/mlx5: Fix query E-Switch capabilities

BugLink: http://bugs.launchpad.net/bugs/1540435
E-Switch capabilities should be queried only if E-Switch flow table
is supported and not only when vport group manager.

Fixes: d6666753c6e8 ("net/mlx5: E-Switch, Introduce HCA cap and E-Switch vport context")
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 9bd0a185c2c48226a50e6e5b639edaa9e8ab6c51)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet/mlx5e: Add support for SR-IOV ndos
Saeed Mahameed [Tue, 1 Dec 2015 16:03:25 +0000 (18:03 +0200)]
net/mlx5e: Add support for SR-IOV ndos

BugLink: http://bugs.launchpad.net/bugs/1540435
Implement and enable SR-IOV ndos to manage SR-IOV configuration via
netdev netlink API.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 66e49dedada6e5badbb01e19e7ae511172c5ac7d)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet/mlx5: E-Switch, Introduce get vf statistics
Saeed Mahameed [Tue, 1 Dec 2015 16:03:24 +0000 (18:03 +0200)]
net/mlx5: E-Switch, Introduce get vf statistics

BugLink: http://bugs.launchpad.net/bugs/1540435
Add support to get VF statistics using query vport
counter command.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 3b751a2a418aa58c5bd3b23bf97d169cc4c63819)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet/mlx5: E-Switch, Introduce set vport vlan (VST mode)
Saeed Mahameed [Tue, 1 Dec 2015 16:03:23 +0000 (18:03 +0200)]
net/mlx5: E-Switch, Introduce set vport vlan (VST mode)

BugLink: http://bugs.launchpad.net/bugs/1540435
Add query and modify functions to control client vlan and qos
striping or insertion, in E-Switch vports contexts.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 9e7ea3524a3f819911ffa7f471b78223757e824e)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet/mlx5: E-Switch, Introduce HCA cap and E-Switch vport context
Saeed Mahameed [Tue, 1 Dec 2015 16:03:22 +0000 (18:03 +0200)]
net/mlx5: E-Switch, Introduce HCA cap and E-Switch vport context

BugLink: http://bugs.launchpad.net/bugs/1540435
E-Switch vport context is unlike NIC vport context, managed by the
E-Switch manager or vport_group_manager and not by the NIC(VF) driver.

The E-Switch manager can access (read/modify) any of its vports
E-Switch context.

Currently E-Switch vport context includes only clietnt and server
vlan insertion and striping data (for later support of VST mode).

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit d6666753c6e85834f1669c7b831cc2b7fc9e4390)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet/mlx5: E-Switch, Introduce Vport administration functions
Saeed Mahameed [Tue, 1 Dec 2015 16:03:21 +0000 (18:03 +0200)]
net/mlx5: E-Switch, Introduce Vport administration functions

BugLink: http://bugs.launchpad.net/bugs/1540435
Implement set VF mac/link state and query VF config
to be used later in nedev VF ndos or any other management API.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 77256579c6b43bb88da96b43637bafc0df20f8e8)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet/mlx5: E-Switch, Add SR-IOV (FDB) support
Saeed Mahameed [Tue, 1 Dec 2015 16:03:20 +0000 (18:03 +0200)]
net/mlx5: E-Switch, Add SR-IOV (FDB) support

BugLink: http://bugs.launchpad.net/bugs/1540435
Enabling E-Switch SRIOV for nvfs+1 vports.

Create E-Switch FDB for L2 UC/MC mac steering between VFs/PF and
external vport (Uplink).

FDB contains forwarding rules such as:
UC MAC0 -> vport0(PF).
UC MAC1 -> vport1.
UC MAC2 -> vport2.
MC MACX -> vport0, vport2, Uplink.
MC MACY -> vport1, Uplink.

For unmatched traffic FDB has the following default rules:
Unmached Traffic (src vport != Uplink) -> Uplink.
Unmached Traffic (src vport == Uplink) -> vport0(PF).

FDB rules population:
Each NIC vport (VF) will notify E-Switch manager of its UC/MC vport
context changes via modify vport context command, which will be
translated to an event that will be handled by E-Switch manager (PF)
which will update FDB table accordingly.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 81848731ff4070a3e4136efa6a99d507177a53fe)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet/mlx5: E-Switch, Introduce FDB hardware capabilities
Saeed Mahameed [Tue, 1 Dec 2015 16:03:19 +0000 (18:03 +0200)]
net/mlx5: E-Switch, Introduce FDB hardware capabilities

BugLink: http://bugs.launchpad.net/bugs/1540435
Define needed hardware structures and capabilities needed
for E-Switch FDB flow tables and read them on driver load.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 495716b191f607b2cb2175f7499966daef79f663)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet/mlx5: Introducing E-Switch and l2 table
Saeed Mahameed [Tue, 1 Dec 2015 16:03:18 +0000 (18:03 +0200)]
net/mlx5: Introducing E-Switch and l2 table

BugLink: http://bugs.launchpad.net/bugs/1540435
E-Switch is the software entity that represents and manages ConnectX4
inter-HCA ethernet l2 switching.

E-Switch has its own Virtual Ports, each Vport/vNIC/VF can be
connected to the device through a vport of an e-switch.

Each e-switch is managed by one vNIC identified by
HCA_CAP.vport_group_manager (usually it is the PF/vport[0]),
and its main responsibility is to forward each packet to the
right vport.

e-Switch needs to manage its own l2-table and FDB tables.

L2 table is a flow table that is managed by FW, it is needed for
Multi-host (Multi PF) configuration for inter HCA switching between
PFs.

FDB table is a flow table that is totally managed by e-Switch driver,
its main responsibility is to switch packets between e-Swtich internal
vports and uplink vport that belong to the same.

This patch introduces only e-Swtich l2 table management, FDB managemnt
will come later when ethernet SRIOV/VFs will be enabled.

preperation for ethernet sriov and l2 table management.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 073bb189a41d7bbad509b576a690611c46c4858f)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet/mlx5e: Write vlan list into vport context
Saeed Mahameed [Tue, 1 Dec 2015 16:03:17 +0000 (18:03 +0200)]
net/mlx5e: Write vlan list into vport context

BugLink: http://bugs.launchpad.net/bugs/1540435
Each Vport/vNIC must notify underlying e-Switch layer
for vlan table changes in-order to update SR-IOV FDB tables.

We do that at vlan_rx_add_vid and vlan_rx_kill_vid ndos.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit aad9e6e41e5e595528e316871bbc5be78a8a1eb4)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet/mlx5e: Write UC/MC list and promisc mode into vport context
Saeed Mahameed [Tue, 1 Dec 2015 16:03:16 +0000 (18:03 +0200)]
net/mlx5e: Write UC/MC list and promisc mode into vport context

BugLink: http://bugs.launchpad.net/bugs/1540435
Each Vport/vNIC must notify underlying e-Switch layer
for UC/MC list and promisc mode updates, in-order to update
l2 tables and SR-IOV FDB tables.

We do that at set_rx_mode ndo.

preperation for ethernet-SRIOV and l2 table management.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5e55da1d5a5f5ffd2038def3bfdcb2f8f3a0418a)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet/mlx5: Introduce access functions to modify/query vport vlans
Saeed Mahameed [Tue, 1 Dec 2015 16:03:15 +0000 (18:03 +0200)]
net/mlx5: Introduce access functions to modify/query vport vlans

BugLink: http://bugs.launchpad.net/bugs/1540435
Those functions are needed to notify the upcoming L2 table and SR-IOV
E-Switch(FDB) manager(PF), of the NIC vport (vf) vlan table changes.

preperation for ethernet sriov and l2 table management.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c0046cf7b81ac55b8bf056c71918ec04edd99379)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet/mlx5: Introduce access functions to modify/query vport promisc mode
Saeed Mahameed [Tue, 1 Dec 2015 16:03:14 +0000 (18:03 +0200)]
net/mlx5: Introduce access functions to modify/query vport promisc mode

BugLink: http://bugs.launchpad.net/bugs/1540435
Those functions are needed to notify the upcoming SR-IOV
E-Switch(FDB) manager(PF), of the NIC vport (vf) promisc mode changes.

Preperation for ethernet sriov and l2 table management.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit d82b73186dab70d6d332dd2afdb48608be2e5230)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet/mlx5: Introduce access functions to modify/query vport state
Saeed Mahameed [Tue, 1 Dec 2015 16:03:13 +0000 (18:03 +0200)]
net/mlx5: Introduce access functions to modify/query vport state

BugLink: http://bugs.launchpad.net/bugs/1540435
In preparation for SR-IOV we add here an API to enable each e-switch
manager (PF) to configure its VFs link states in e-switch

preparation for ethernet sriov.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e75465148b7df7f2796c75bf98bf33f171edeb2b)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet/mlx5: Introduce access functions to modify/query vport mac lists
Saeed Mahameed [Tue, 1 Dec 2015 16:03:12 +0000 (18:03 +0200)]
net/mlx5: Introduce access functions to modify/query vport mac lists

BugLink: http://bugs.launchpad.net/bugs/1540435
Those functions are needed to notify the upcoming L2 table and SR-IOV
E-Switch(FDB) manager(PF), of the NIC vport (vf) UC/MC mac lists
changes.

preperation for ethernet sriov and l2 table management.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e16aea2744abea612c27ee0eef606c6a6a8204de)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet/mlx5: Update access functions to Query/Modify vport MAC address
Saeed Mahameed [Tue, 1 Dec 2015 16:03:11 +0000 (18:03 +0200)]
net/mlx5: Update access functions to Query/Modify vport MAC address

BugLink: http://bugs.launchpad.net/bugs/1540435
In preparation for SR-IOV we add here an API to enable each e-switch
client (PF/VF) to configure its L2 MAC addresses and for the e-switch
manager (usually the PF) to access them in order to be able to
configure them into the e-switch.
Therefore we now pass vport num parameter to
mlx5_query_nic_vport_context, so PF can access other vports contexts.

preperation for ethernet sriov and l2 table management.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e1d7d349c69d12721c420f1fe673ce9aa462aadd)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet/mlx5: Add HW capabilities and structs for SR-IOV E-Switch
Saeed Mahameed [Tue, 1 Dec 2015 16:03:10 +0000 (18:03 +0200)]
net/mlx5: Add HW capabilities and structs for SR-IOV E-Switch

BugLink: http://bugs.launchpad.net/bugs/1540435
Update HCA capabilities and HW struct to include needed
capabilities for upcoming Ethernet Switch (SR-IOV E-Switch).

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 54f0a411ec72cb437d57d0c9654dcbd0f198ff3a)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet/mlx5_core: Add base sriov support
Eli Cohen [Tue, 1 Dec 2015 16:03:09 +0000 (18:03 +0200)]
net/mlx5_core: Add base sriov support

BugLink: http://bugs.launchpad.net/bugs/1540435
This patch adds SRIOV base support for mlx5 supported devices. The same
driver is used for both PFs and VFs; VFs are identified by the driver
through the flag MLX5_PCI_DEV_IS_VF added to the pci table entries.
Virtual functions are created as usual through writing a value to the
sriov_numvs sysfs file of the PF device. Upon instantiating VFs, they will
all be probed by the driver on the hypervisor. One can gracefully unbind
them through /sys/bus/pci/drivers/mlx5_core/unbind.

mlx5_wait_for_vf_pages() was added to ensure that when a VF dies without
executing proper teardown, the hypervisor driver waits till all of the
pages that were allocated at the hypervisor to maintain its operation
are returned.

In order for the VF to be operational, the PF needs to call enable_hca
for it. This can be done before the VFs are created through a call to
pci_enable_sriov.

If the there are VFs assigned to a VMs when the driver of the PF is
unloaded, all the VF will experience system error and PF driver unloads
cleanly; in this case pci_disable_sriov is not called and the devices
will show when running lspci. Once the PF driver is reloaded, it will
sync its data structures which maintain state on its VFs.

Signed-off-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit fc50db98ff872372f266695858f87a12eb1b4f05)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet/mlx5_core: Modify enable/disable hca functions
Eli Cohen [Tue, 1 Dec 2015 16:03:08 +0000 (18:03 +0200)]
net/mlx5_core: Modify enable/disable hca functions

BugLink: http://bugs.launchpad.net/bugs/1540435
Modify these functions to have func_id argument to state which device we
are referring to. This is done as a preparation for SRIOV support where
a PF driver needs to control its virtual functions.

Signed-off-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 0b10710603b27e86ddd89fb87742997594892e50)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoInput: wacom_w8001 - drop use of ABS_MT_TOOL_TYPE
Peter Hutterer [Sun, 7 Feb 2016 03:28:10 +0000 (21:28 -0600)]
Input: wacom_w8001 - drop use of ABS_MT_TOOL_TYPE

BugLink: http://bugs.launchpad.net/bugs/1542771
As of e0361b70175 ("Input: wacom_w8001 - split the touch and pen devices
into two devices") the touch events aren't multiplexed over the same device
anymore, the use of ABS_MT_TOOL_TYPE is superfluous. And even before then
it only ever sent MT_TOOL_TYPE_FINGER anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
(cherry picked from commit 5f7e5445a2de848c66d2d80ba5479197e8287c33)
Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoInput: wacom_w8001 - split the touch and pen devices into two devices
Peter Hutterer [Sun, 7 Feb 2016 03:28:09 +0000 (21:28 -0600)]
Input: wacom_w8001 - split the touch and pen devices into two devices

BugLink: http://bugs.launchpad.net/bugs/1542771
These devices have a pen device and a touch device through the same serial
protocol, split it up into two separate devices like we do for USB Wacom
tablets too.

Userspace already matches on the device name so we can't drop it
completely. Compose the same basename based on capabilities and append the
tool type, leading to a name like "Wacom Serial Penabled 2FG Touchscreen
Pen".

Note that this drops BTN_TOOL_FINGER, it is not needed once the tools
are split out (and a touch device with BTN_TOOL_FINGER is interpreted
as touchpad by most of userspace).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
(cherry picked from commit e0361b70175f0cd6199dd9ed6679632de73973d4)
Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoInput: wacom_w8001 - split pen and touch initialization up
Peter Hutterer [Sun, 7 Feb 2016 03:28:08 +0000 (21:28 -0600)]
Input: wacom_w8001 - split pen and touch initialization up

BugLink: http://bugs.launchpad.net/bugs/1542771
This is preparation work for splitting it up for two event nodes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
(cherry picked from commit 5d0a4fe2a9347b05bc5db2963cb7cd6cf014a9ed)
Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoInput: wacom_w8001 - handle touch error case correctly
Peter Hutterer [Sun, 7 Feb 2016 03:28:07 +0000 (21:28 -0600)]
Input: wacom_w8001 - handle touch error case correctly

BugLink: http://bugs.launchpad.net/bugs/1542771
If a device failed at the pen setup and gets a zero reply from the touch
device, we need to return an error. Otherwise we have a device with
nothing but a name and the EV_KEY and EV_ABS bits.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
(cherry picked from commit e171735410ae5a0ebf90d6bc6a8a97fc28bfc041)
Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoInput: wacom_w8001 - set BTN_TOOL_DOUBLETAP if we have 2fg support
Peter Hutterer [Sun, 7 Feb 2016 03:28:06 +0000 (21:28 -0600)]
Input: wacom_w8001 - set BTN_TOOL_DOUBLETAP if we have 2fg support

BugLink: http://bugs.launchpad.net/bugs/1542771
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
(cherry picked from commit ec9acda7360de7ee70cc0db36f41c1fd819a3310)
Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoInput: wacom_w8001 - use __set_bit for evbits
Peter Hutterer [Sun, 7 Feb 2016 03:28:05 +0000 (21:28 -0600)]
Input: wacom_w8001 - use __set_bit for evbits

BugLink: http://bugs.launchpad.net/bugs/1542771
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
(cherry picked from commit 86c03f46b9a40b251e4d97f461a13f8b1f18ae17)
Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: [Debian] git-ubuntu-log -- fix empty section formatting
Andy Whitcroft [Fri, 5 Feb 2016 17:39:13 +0000 (17:39 +0000)]
UBUNTU: [Debian] git-ubuntu-log -- fix empty section formatting

Signed-off-by: Andy Whitcroft <apw@canonical.com>
8 years agoUBUNTU: Start new release
Andy Whitcroft [Sat, 6 Feb 2016 22:51:27 +0000 (22:51 +0000)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Andy Whitcroft <apw@canonical.com>
8 years agoUBUNTU: ubuntu: vbox -- update to 5.0.14-dfsg-2
Andy Whitcroft [Sat, 6 Feb 2016 21:59:18 +0000 (21:59 +0000)]
UBUNTU: ubuntu: vbox -- update to 5.0.14-dfsg-2

BugLink: http://bugs.launchpad.net/bugs/1542728
Signed-off-by: Andy Whitcroft <apw@canonical.com>
8 years agoUBUNTU: [Debian] git-ubuntu-log -- switch to bug order
Andy Whitcroft [Fri, 5 Feb 2016 17:39:13 +0000 (17:39 +0000)]
UBUNTU: [Debian] git-ubuntu-log -- switch to bug order

Signed-off-by: Andy Whitcroft <apw@canonical.com>
8 years agoUBUNTU: Ubuntu-4.4.0-4.19
Andy Whitcroft [Fri, 5 Feb 2016 17:19:56 +0000 (17:19 +0000)]
UBUNTU: Ubuntu-4.4.0-4.19

Signed-off-by: Andy Whitcroft <apw@canonical.com>
8 years agoUBUNTU: [Config] reconstruct -- drop links for zfs userspace components -- restore...
Andy Whitcroft [Fri, 5 Feb 2016 17:18:35 +0000 (17:18 +0000)]
UBUNTU: [Config] reconstruct -- drop links for zfs userspace components -- restore spec links

These links are strictly wrong as they damage the tree, but without them
the build fails?

Signed-off-by: Andy Whitcroft <apw@canonical.com>
8 years agoUBUNTU: Ubuntu-4.4.0-4.18
Andy Whitcroft [Fri, 5 Feb 2016 14:59:18 +0000 (14:59 +0000)]
UBUNTU: Ubuntu-4.4.0-4.18

Signed-off-by: Andy Whitcroft <apw@canonical.com>
8 years agoUBUNTU: [Config] reconstruct -- drop links for zfs userspace components
Andy Whitcroft [Fri, 5 Feb 2016 14:41:01 +0000 (14:41 +0000)]
UBUNTU: [Config] reconstruct -- drop links for zfs userspace components

BugLink: http://bugs.launchpad.net/bugs/1542296
Signed-off-by: Andy Whitcroft <apw@canonical.com>
8 years agoRevert "af_unix: Revert 'lock_interruptible' in stream receive code"
Andy Whitcroft [Fri, 5 Feb 2016 13:20:56 +0000 (13:20 +0000)]
Revert "af_unix: Revert 'lock_interruptible' in stream receive code"

This reverts commit 3822b5c2fc62e3de8a0f33806ff279fb7df92432.

BugLink: http://bugs.launchpad.net/bugs/1540731
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
8 years agoUBUNTU: SAUCE: (noup) Update spl to 0.6.5.4-0ubuntu2, zfs to 0.6.5.4-0ubuntu1
Colin Ian King [Thu, 4 Feb 2016 15:57:21 +0000 (10:57 -0500)]
UBUNTU: SAUCE: (noup) Update spl to 0.6.5.4-0ubuntu2, zfs to 0.6.5.4-0ubuntu1

BugLink: http://bugs.launchpad.net/bugs/1542296
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: IB/IPoIB: Do not set skb truesize since using one linearskb
Carol L Soto [Wed, 3 Feb 2016 19:27:10 +0000 (14:27 -0500)]
UBUNTU: SAUCE: IB/IPoIB: Do not set skb truesize since using one linearskb

BugLink: http://bugs.launchpad.net/bugs/1541326
This patch is being upstreamed.

We are seeing this warning: at net/core/skbuff.c:4174
and before commit a44878d10063 ("IB/ipoib: Use one linear skb in RX flow")
skb truesize was not being set when ipoib was using just one skb.
Removing this line avoids the warning when running tcp tests like iperf.

Fixes: a44878d10063 ("IB/ipoib: Use one linear skb in RX flow")
Signed-off-by: Carol L Soto <clsoto@linux.vnet.ibm.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoHID: multitouch: enable palm rejection if device implements confidence usage
Allen Hung [Fri, 20 Nov 2015 10:21:06 +0000 (18:21 +0800)]
HID: multitouch: enable palm rejection if device implements confidence usage

BugLink: http://bugs.launchpad.net/bugs/1541671
The usage Confidence is mandary to Windows Precision Touchpad devices. The
appearance of this usage is checked in hidinput_connect but the quirk
MT_QUIRK_VALID_IS_CONFIDENCE is not applied to device accordingly.
Apply this quirk and also remove quirk MT_QUIRK_ALWAYS_VALID to enable palm
rejection for the WIN 8 touchpad devices which have implemented usage
Confidence in its input reports.

Tested on Dell XPS 13 laptop.

Signed-off-by: Allen Hung <allen_hung@dell.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
(cherry picked from commit 25a84db15b3f3a24d3ea7d2baf90693bcff34b0c)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoscsi: qla2xxxx: avoid type mismatch in comparison
Arnd Bergmann [Wed, 20 Jan 2016 10:47:14 +0000 (11:47 +0100)]
scsi: qla2xxxx: avoid type mismatch in comparison

BugLink: http://bugs.launchpad.net/bugs/1541456
A recent bug fix added code that does

        bool logged_out = (status & 0xFFFF);
        if (logged_out == CTIO_PORT_LOGGED_OUT)
...

This looks wrong because we are comparing a boolean with an
integer constant, ang gcc warns about it accordingly:

drivers/scsi/qla2xxx/qla_target.c: In function 'qlt_do_ctio_completion':
drivers/scsi/qla2xxx/qla_target.c:3587:20: warning: comparison of constant '41' with boolean expression is always false [-Wbool-compare]
        (logged_out == CTIO_PORT_LOGGED_OUT) ?

The correct fix is presumably to make that variable an 'int'.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 71cdc0796465 ("qla2xxx: Delete session if initiator is gone from FW")
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
(cherry picked from commit fab683eb12e71ac6057dc42dc7d1e5e71e5cba5e)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoqla2xxx: Check for online flag instead of active reset when transmitting responses
Dilip Kumar Uppugandla [Thu, 17 Dec 2015 19:57:11 +0000 (14:57 -0500)]
qla2xxx: Check for online flag instead of active reset when transmitting responses

BugLink: http://bugs.launchpad.net/bugs/1541456
Driver has following initialization sequence for Target mode

1. Driver initialization starts

2. ISP Abort is scheduled when the target is enabled.

qla2xxx [0000:04:00.0]-4807:25: ISP abort scheduled
qla2xxx [0000:04:00.0]-00af:25: Performing ISP error recovery - ha=ffff880caa9e0000.

3. DPC thread starts the ISP Abort

4. While DPC is resetting the chip and initializing the firmware, we get
   async events from the firmware about P2P mode, LOOP UP and PORT UPDATE.

5. PRLI from a initiator is delivered to us followed by a PLOGI and then a
   SCSI command which creates a session.

6. If the SCSI command is a WRITE in this case, we issue XFR RDY and it
   gets dropped as can be seen with messages RESET-XFR because ISP Abort
   is still active

qla2xxx [0000:04:00.0]-e902:25: RESET-XFR active/old-count/new-count = 1/1/1.

7. If the SCSI command is a READ, we issue RESPONSE and they get dropped
   as well because Abort is still active.

qla2xxx [0000:04:00.0]-e901:25: RESET-RSP active/old-count/new-count = 1/1/1

8. Now eventually, ISP Abort finishes clearing the DPC flags.

qla2xxx [0000:04:00.0]-8822:25: qla2x00_abort_isp succeeded.
qla2xxx [0000:04:00.0]-4808:25: ISP abort end.

9. Since we dropped SCSI commands silently (without any responses sent
   to the initiator) initiator waits for a SCSI timeout (which is 60
   seconds in our case), Sends an ABTS which fails since there
   no se_cmd found for the tag that ABTS is referencing as the
   commands were cleaned up in Step 6 and 7.

10. Initiator send an IO after the ABTS which succeed fine.

To fix the above case, the following changes have been made:
  - To prevent target from dropping commands silently, use the online flag
    instead to check for an active chip reset. Once the port is online during
    a chip reset phase, we are good to process the commands.
  - Clean up qla2x00_restart_isp to not set the online flag and process ATIO
    as it is unnecessary. During a chip reset, interrupts are enabled only
    after setting the online flag to 1, so ATIO's won't be missed and hence
    no need to process ATIO's after setting the online flag.

Signed-off-by: Dilip Kumar Uppugandla <dilip@purestorage.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
(cherry picked from commit 3bb67df5b5f880a1c9c1086308cf2b981d824da5)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoqla2xxx: Set all queues to 4k
Quinn Tran [Thu, 17 Dec 2015 19:57:09 +0000 (14:57 -0500)]
qla2xxx: Set all queues to 4k

BugLink: http://bugs.launchpad.net/bugs/1541456
set ATIO/Request/Response Queues and Default number
of outstanding command to 4k.

Signed-off-by: Quinn Tran <quinn.tran@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
(cherry picked from commit e7b42e335f129f0685ab94bcd34104163df38323)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoqla2xxx: Disable ZIO at start time.
Quinn Tran [Thu, 17 Dec 2015 19:57:08 +0000 (14:57 -0500)]
qla2xxx: Disable ZIO at start time.

BugLink: http://bugs.launchpad.net/bugs/1541456
Signed-off-by: Quinn Tran <quinn.tran@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
(cherry picked from commit 481ce73342b190987c2553e8df0075c3df23632e)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoqla2xxx: Move atioq to a different lock to reduce lock contention
Quinn Tran [Thu, 17 Dec 2015 19:57:07 +0000 (14:57 -0500)]
qla2xxx: Move atioq to a different lock to reduce lock contention

BugLink: http://bugs.launchpad.net/bugs/1541456
99% of the time the ATIOQ has SCSI command.  The other 1% of time
is something else.  Most of the time this interrupt does not need
to hold the hardware_lock.  We're moving the ATIO interrupt thread
to a different lock to reduce lock contention.

Signed-off-by: Quinn Tran <quinn.tran@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
(cherry picked from commit 2f424b9b36ad7062e9ade41a9fb034d21a9e4e4b)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoqla2xxx: Add selective command queuing
Quinn Tran [Thu, 17 Dec 2015 19:57:06 +0000 (14:57 -0500)]
qla2xxx: Add selective command queuing

BugLink: http://bugs.launchpad.net/bugs/1541456
queue work element to specific process lessen cache miss

Signed-off-by: Quinn Tran <quinn.tran@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
(cherry picked from commit fb3269baf4ecc2ce6d17d4eb537080035bdf6d5b)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoqla2xxx: Add irq affinity notification
Quinn Tran [Thu, 17 Dec 2015 19:57:05 +0000 (14:57 -0500)]
qla2xxx: Add irq affinity notification

BugLink: http://bugs.launchpad.net/bugs/1541456
Register to receive notification of when irq setting change
occured.

Signed-off-by: Quinn Tran <quinn.tran@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
(cherry picked from commit cdb898c52d1dfad4b4800b83a58b3fe5d352edde)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoqla2xxx: Remove dependency on hardware_lock to reduce lock contention.
Quinn Tran [Thu, 17 Dec 2015 19:57:04 +0000 (14:57 -0500)]
qla2xxx: Remove dependency on hardware_lock to reduce lock contention.

BugLink: http://bugs.launchpad.net/bugs/1541456
Sessions management (add, deleted, modify) currently are serialized
through the hardware_lock.  Hardware_lock is a high traffic lock.
This lock is accessed by both the transmit & receive sides.

Sessions management is now moved off to another lock call sess_lock.
This is done to reduce lock contention and increase traffic throughput.

Signed-off-by: Quinn Tran <quinn.tran@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
(cherry picked from commit 7560151b6b3c1f4432c1c5b5b6496070d1f38484)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoqla2xxx: Replace QLA_TGT_STATE_ABORTED with a bit.
Quinn Tran [Thu, 17 Dec 2015 19:57:03 +0000 (14:57 -0500)]
qla2xxx: Replace QLA_TGT_STATE_ABORTED with a bit.

BugLink: http://bugs.launchpad.net/bugs/1541456
Replace QLA_TGT_STATE_ABORTED state with a bit because
the current state of the command is lost when an abort
is requested by upper layer.

Signed-off-by: Quinn Tran <quinn.tran@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
(cherry picked from commit 193b50b9d54a4fcb723a8005b29d8dd5518e3ae2)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoqla2xxx: Wait for all conflicts before ack'ing PLOGI
Alexei Potashnik [Thu, 17 Dec 2015 19:57:02 +0000 (14:57 -0500)]
qla2xxx: Wait for all conflicts before ack'ing PLOGI

BugLink: http://bugs.launchpad.net/bugs/1541456
Until now ack'ing of a new PLOGI has only been delayed if there
was an existing session for the same WWN. Ack was released when
the session deletion completed.

If there was another WWN session with the same fc_id/loop_id pair
(aka "conflicting session"), PLOGI was still ack'ed immediately.
This potentially caused a problem when old session deletion logged
fc_id/loop_id out of FW after new session has been established.

Two work-arounds were attempted before:
1. Dropping PLOGIs until conflicting session goes away.
2. Detecting initiator being logged out of FW and issuing LOGO
to force re-login.

This patch introduces proper solution to the problem where PLOGI
is held until either existing session with same WWN or any
conflicting session goes away. Mechanism supports one session holding
two PLOGI acks as well as one PLOGI ack being held by many sessions.

Signed-off-by: Alexei Potashnik <alexei@purestorage.com>
Acked-by: Quinn Tran <quinn.tran@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
(cherry picked from commit b7bd104e6f1c3be2bf881dc1ca7db40da3ee65fd)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoqla2xxx: Delete session if initiator is gone from FW
Alexei Potashnik [Thu, 17 Dec 2015 19:57:01 +0000 (14:57 -0500)]
qla2xxx: Delete session if initiator is gone from FW

BugLink: http://bugs.launchpad.net/bugs/1541456
1. Initiator A is logged in with fc_id(1)/loop_id(1)
2. Initiator A re-logs in with fc_id(2)/loop_id(2)
3. Part of old session deletion async logoout for 1/1 is queued
4. Initiator B logs in with fc_id(1)/loop_id(1), starts
   passing data and creates session.
5. Async logo from 3 is processed by DPC and sent to FW

Now initiator B has the session but is logged out from FW.

This condition is detected first with CTIO error 29 at which
point we should delete current session. During session
deletion we will send LOGO to initiator to force re-login.

Under rare circumstances initiator might be logged out of FW,
not have driver session, but still think it's logged in.
E.g. the above sequence plus session deletion due to re-config.
Incoming commands will fail to create local session because
initiator is not found in FW. In this case we also issue LOGO
to initiator to force him re-login.

Finally this patch fixes exchange leak when commands where
received in logged out state. In this case loop_id must be
set to FFFF when corresponding exchange is terminated. The
patch modifies exchange termination to always use FFFF,
since in certain scenarios it's impossible to tell whether
command was received in logged in or logged out state.

Signed-off-by: Alexei Potashnik <alexei@purestorage.com>
Acked-by: Quinn Tran <quinn.tran@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
(cherry picked from commit 71cdc07964651db51ddeea05245ac899357f0e71)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoqla2xxx: Added interface to send explicit LOGO.
Himanshu Madhani [Thu, 17 Dec 2015 19:57:00 +0000 (14:57 -0500)]
qla2xxx: Added interface to send explicit LOGO.

BugLink: http://bugs.launchpad.net/bugs/1541456
This patch adds interface to send explicit LOGO
explicit LOGO using using ELS commands from driver.

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
(cherry picked from commit 6eb54715b54bb8324f3293e49635277652730e55)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoqla2xxx: Add FW resource count in DebugFS.
Quinn Tran [Thu, 17 Dec 2015 19:56:59 +0000 (14:56 -0500)]
qla2xxx: Add FW resource count in DebugFS.

BugLink: http://bugs.launchpad.net/bugs/1541456
DebugFS now will show fw_resource_count node.

FW Resource count

Original TGT exchg count[0]
current TGT exchg count[0]
original Initiator Exchange count[2048]
Current Initiator Exchange count[2048]
Original IOCB count[2078]
Current IOCB count[2067]
MAX VP count[254]
MAX FCF count[0]

Signed-off-by: Quinn Tran <quinn.tran@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
(cherry picked from commit 03e8c680d9b3b68ddae648a6e2c91c381e90066f)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoqla2xxx: Enable Target counters in DebugFS.
Himanshu Madhani [Thu, 17 Dec 2015 19:56:58 +0000 (14:56 -0500)]
qla2xxx: Enable Target counters in DebugFS.

BugLink: http://bugs.launchpad.net/bugs/1541456
Following counters are added in target mode to help debugging efforts.

Target Counters

qla_core_sbt_cmd = 0
qla_core_ret_sta_ctio = 0
qla_core_ret_ctio = 0
core_qla_que_buf = 0
core_qla_snd_status = 0
core_qla_free_cmd = 0
num alloc iocb failed = 0
num term exchange sent = 0
num Q full sent = 0

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
(cherry picked from commit ce1025cd4b8eb7afe07c3625f2ad080d8bee7cc4)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoqla2xxx: Enable Exchange offload support.
Himanshu Madhani [Thu, 17 Dec 2015 19:56:57 +0000 (14:56 -0500)]
qla2xxx: Enable Exchange offload support.

BugLink: http://bugs.launchpad.net/bugs/1541456
This patch enables Exchange offload support in Qlogic ISP.
To enable exchange offload with Qlogic ISP24XX/25XX/26XX,
set module parameter ql2xexchoffld to any non-zero number.
This will alow ISP firmware to store exchange data structures
used by firmware to host memory provided by driver. ISP firmware
can supports upto 32k total active exchanges.

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
(cherry picked from commit 2f56a7f1b5d8cf3d8bc84cc08dda09c991b698a7)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoqla2xxx: Enable Extended Logins support
Himanshu Madhani [Thu, 17 Dec 2015 19:56:56 +0000 (14:56 -0500)]
qla2xxx: Enable Extended Logins support

BugLink: http://bugs.launchpad.net/bugs/1541456
This patch enables Extended Logins support in Qlogic ISP.
To enable extended login with Qlogic ISP24XX/25XX/26XX,
set module parameter ql2xexlogins to any non-zero number.
This will alow ISP firmware to store port database structure
information of remote login sessions to host memory provided
by driver. ISP firmware supports upto 16k total logins.

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
(cherry picked from commit b0d6cabd355ae9c13c53680cfe8b5ae58a84d2c1)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoqla2xxx: Remove unavailable firmware files
Himanshu Madhani [Tue, 17 Nov 2015 20:44:48 +0000 (15:44 -0500)]
qla2xxx: Remove unavailable firmware files

BugLink: http://bugs.launchpad.net/bugs/1541456
Remove firmware binary names for the ISPs, which are not submitted to
linux-firmware.

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
Reviewed-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 940a7f09ad645b6be7ff85b034499fcffdfe0ebc)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agogenirq/msi: Export functions to allow MSI domains in modules
Jake Oshins [Thu, 10 Dec 2015 17:52:59 +0000 (17:52 +0000)]
genirq/msi: Export functions to allow MSI domains in modules

BugLink: http://bugs.launchpad.net/bugs/1541120
The Linux kernel already has the concept of IRQ domain, wherein a
component can expose a set of IRQs which are managed by a particular
interrupt controller chip or other subsystem. The PCI driver exposes
the notion of an IRQ domain for Message-Signaled Interrupts (MSI) from
PCI Express devices. This patch exposes the functions which are
necessary for creating a MSI IRQ domain within a module.

[ tglx: Split it into x86 and core irq parts ]

Signed-off-by: Jake Oshins <jakeo@microsoft.com>
Cc: gregkh@linuxfoundation.org
Cc: kys@microsoft.com
Cc: devel@linuxdriverproject.org
Cc: olaf@aepfle.de
Cc: apw@canonical.com
Cc: vkuznets@redhat.com
Cc: haiyangz@microsoft.com
Cc: marc.zyngier@arm.com
Cc: bhelgaas@google.com
Link: http://lkml.kernel.org/r/1449769983-12948-4-git-send-email-jakeo@microsoft.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
(cherry picked from commit a4289dc2ec3a5821076a78ee9678909b4eff297e)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agox86/irq: Export functions to allow MSI domains in modules
Jake Oshins [Thu, 10 Dec 2015 17:52:59 +0000 (17:52 +0000)]
x86/irq: Export functions to allow MSI domains in modules

BugLink: http://bugs.launchpad.net/bugs/1541120
The Linux kernel already has the concept of IRQ domain, wherein a
component can expose a set of IRQs which are managed by a particular
interrupt controller chip or other subsystem. The PCI driver exposes
the notion of an IRQ domain for Message-Signaled Interrupts (MSI) from
PCI Express devices. This patch exposes the functions which are
necessary for creating a MSI IRQ domain within a module.

[ tglx: Split it into x86 and core irq parts ]

Signed-off-by: Jake Oshins <jakeo@microsoft.com>
Cc: gregkh@linuxfoundation.org
Cc: kys@microsoft.com
Cc: devel@linuxdriverproject.org
Cc: olaf@aepfle.de
Cc: apw@canonical.com
Cc: vkuznets@redhat.com
Cc: haiyangz@microsoft.com
Cc: marc.zyngier@arm.com
Cc: bhelgaas@google.com
Link: http://lkml.kernel.org/r/1449769983-12948-4-git-send-email-jakeo@microsoft.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
(cherry picked from commit c8f3e518d3444ee9200a4987421fcee60f768f11)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agolpfc: Update version to 11.0.0.10 for upstream patch set
James Smart [Wed, 16 Dec 2015 23:12:08 +0000 (18:12 -0500)]
lpfc: Update version to 11.0.0.10 for upstream patch set

BugLink: http://bugs.launchpad.net/bugs/1541592
Update version to 11.0.0.10 for upstream patch set

Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit b034573c7eb39aa58cd4a08e487869fea6d4ad2d)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agolpfc: Use kzalloc instead of kmalloc
Punit Vara [Wed, 16 Dec 2015 23:12:07 +0000 (18:12 -0500)]
lpfc: Use kzalloc instead of kmalloc

BugLink: http://bugs.launchpad.net/bugs/1541592
This patch is to the lpfc_els.c which resolves following warning
reported by coccicheck:

WARNING: kzalloc should be used for rdp_context, instead of
kmalloc/memset

Signed-off-by: Punit Vara <punitvara@gmail.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Reviewed-by: Sebastian Herbszt <herbszt@gmx.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 699acd6220ea5b20b25d5eec0ab448827d745357)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agolpfc: Delete unnecessary checks before the function call "mempool_destroy"
Markus Elfring [Wed, 16 Dec 2015 23:12:06 +0000 (18:12 -0500)]
lpfc: Delete unnecessary checks before the function call "mempool_destroy"

BugLink: http://bugs.launchpad.net/bugs/1541592
The mempool_destroy() function tests whether its argument is NULL
and then returns immediately. Thus the test around the calls is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Reviewed-by: Sebastian Herbszt <herbszt@gmx.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 9be321819c43417432a8376428b90fe3fe3a3510)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agolpfc: Add logging for misconfigured optics.
James Smart [Wed, 16 Dec 2015 23:12:05 +0000 (18:12 -0500)]
lpfc: Add logging for misconfigured optics.

BugLink: http://bugs.launchpad.net/bugs/1541592
Add logging for misconfigured optics acqe reported by fw.

Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 448193b5b5e2471fc90ea11e78c39bcfd167efb6)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agolpfc: Fix external loopback failure.
James Smart [Wed, 16 Dec 2015 23:12:04 +0000 (18:12 -0500)]
lpfc: Fix external loopback failure.

BugLink: http://bugs.launchpad.net/bugs/1541592
Fix external loopback failure.

Rx sequence reassembly was incorrect.

Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 4360ca9c24388e44cb0e14861a62fff43cf225c0)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agolpfc: Fix mbox reuse in PLOGI completion
James Smart [Wed, 16 Dec 2015 23:12:03 +0000 (18:12 -0500)]
lpfc: Fix mbox reuse in PLOGI completion

BugLink: http://bugs.launchpad.net/bugs/1541592
Fix mbox reuse in PLOGI completion. Moved allocations so that buffer
properly init'd.

Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 01c73bbcd7cc4f31f45a1b0caeacdba46acd9c9c)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agolpfc: Use new FDMI speed definitions for 10G, 25G and 40G FCoE.
James Smart [Wed, 16 Dec 2015 23:12:02 +0000 (18:12 -0500)]
lpfc: Use new FDMI speed definitions for 10G, 25G and 40G FCoE.

BugLink: http://bugs.launchpad.net/bugs/1541592
Use new FDMI speed definitions for 10G, 25G and 40G FCoE.

Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit a085e87c814567c94e5d375e7362f9f25030aac1)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agolpfc: Make write check error processing more resilient
James Smart [Wed, 16 Dec 2015 23:12:01 +0000 (18:12 -0500)]
lpfc: Make write check error processing more resilient

BugLink: http://bugs.launchpad.net/bugs/1541592
Make write check error processing more resilient.

Checks to catch writes that fw reports weren't fully complete yet SCSI
status indicated fine needed correction.

Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 5afab6bbf3f026b7d50451acbfdc12300c5f4353)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agolpfc: Fix RDP ACC being too long.
James Smart [Wed, 16 Dec 2015 23:12:00 +0000 (18:12 -0500)]
lpfc: Fix RDP ACC being too long.

BugLink: http://bugs.launchpad.net/bugs/1541592
Fix RDP ACC being too long.

Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit eb8d68c9930f7f9c8f3f4a6059b051b32077a735)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agolpfc: Fix RDP Speed reporting.
James Smart [Wed, 16 Dec 2015 23:11:59 +0000 (18:11 -0500)]
lpfc: Fix RDP Speed reporting.

BugLink: http://bugs.launchpad.net/bugs/1541592
Fix RDP Speed reporting.

Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 81e7517723fc17396ba91f59312b3177266ddbda)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agolpfc: Modularize and cleanup FDMI code in driver
James Smart [Wed, 16 Dec 2015 23:11:58 +0000 (18:11 -0500)]
lpfc: Modularize and cleanup FDMI code in driver

BugLink: http://bugs.launchpad.net/bugs/1541592
Modularize, cleanup, add comments - for FDMI code in driver

Note: I don't like the comments with leading # - but as we have a lot if
present, I'm deferring to handle it in one big fix later.

Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 4258e98ee3862ca7036654b43c839ab7668043e0)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agolpfc: Fix crash in fcp command completion path.
James Smart [Wed, 16 Dec 2015 23:11:57 +0000 (18:11 -0500)]
lpfc: Fix crash in fcp command completion path.

BugLink: http://bugs.launchpad.net/bugs/1541592
Fix crash in fcp command completion path.

Missed null check.

Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit c90261dcd86e4eb5c9c1627fde037e902db8aefa)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agolpfc: Fix driver crash when module parameter lpfc_fcp_io_channel set to 16
James Smart [Wed, 16 Dec 2015 23:11:56 +0000 (18:11 -0500)]
lpfc: Fix driver crash when module parameter lpfc_fcp_io_channel set to 16

BugLink: http://bugs.launchpad.net/bugs/1541592
Fix driver crash when module parameter lpfc_fcp_io_channel set to 16

Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 6690e0d4fc5cccf74534abe0c9f9a69032bc02f0)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agolpfc: Fix RegLogin failed error seen on Lancer FC during port bounce
James Smart [Wed, 16 Dec 2015 23:11:55 +0000 (18:11 -0500)]
lpfc: Fix RegLogin failed error seen on Lancer FC during port bounce

BugLink: http://bugs.launchpad.net/bugs/1541592
Fix RegLogin failed error seen on Lancer FC during port bounce

Fix the statemachine and ref counting.

Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 4b7789b71c916f79a3366da080101014473234c3)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agolpfc: Fix the FLOGI discovery logic to comply with T11 standards
James Smart [Wed, 16 Dec 2015 23:11:53 +0000 (18:11 -0500)]
lpfc: Fix the FLOGI discovery logic to comply with T11 standards

BugLink: http://bugs.launchpad.net/bugs/1541592
Fix the FLOGI discovery logic to comply with T11 standards

We weren't properly setting fabric parameters, such as R_A_TOV and E_D_TOV,
when we registered the vfi object in default configs and pt2pt configs.
Revise to now pass service params with the values to the firmware and
ensure they are reset on link bounce. Required reworking the call sequence
in the discovery threads.

Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit d6de08cc46269899988b4f40acc7337279693d4b)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agolpfc: Fix FCF Infinite loop in lpfc_sli4_fcf_rr_next_index_get.
James Smart [Wed, 16 Dec 2015 23:11:52 +0000 (18:11 -0500)]
lpfc: Fix FCF Infinite loop in lpfc_sli4_fcf_rr_next_index_get.

BugLink: http://bugs.launchpad.net/bugs/1541592
Fix FCF Infinite loop in lpfc_sli4_fcf_rr_next_index_get.

Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit f5cb5304eb26d307c9b30269fb0e007e0b262b7d)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: [Config] update spl/zfs version
Tim Gardner [Thu, 4 Feb 2016 14:24:12 +0000 (07:24 -0700)]
UBUNTU: [Config] update spl/zfs version

BugLink: http://bugs.launchpad.net/bugs/1542296
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>