]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/log
mirror_ubuntu-zesty-kernel.git
8 years agoi40e: add a little more to an NVM update debug message
Shannon Nelson [Wed, 23 Dec 2015 20:05:51 +0000 (12:05 -0800)]
i40e: add a little more to an NVM update debug message

BugLink: http://bugs.launchpad.net/bugs/1547674
Add a little more detail to an NVM update debug message in order to
see the full ethtool request data.

Change-ID: Iab10437cb32d6fddc67ee347e7c0b42511e152cd
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: Kevin Scott <kevin.c.scott@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 1d73b2db4b9f4c12d42451efd09887ff7b37b02d)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: refactor DCB function
Jesse Brandeburg [Wed, 23 Dec 2015 20:05:50 +0000 (12:05 -0800)]
i40e: refactor DCB function

BugLink: http://bugs.launchpad.net/bugs/1547674
This is a simple refactor suggested by the community
to change a multi-level if statement into a switch.

Change-ID: I831cf3c40426022220aa9b43990022d22dfd50db
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit dd54a1ada9cea9275c53c89ad869214be6e9731a)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: add 20G speed for Tx bandwidth calculations
Mitch Williams [Wed, 23 Dec 2015 20:05:49 +0000 (12:05 -0800)]
i40e: add 20G speed for Tx bandwidth calculations

BugLink: http://bugs.launchpad.net/bugs/1547674
When calculating TX bandwidth for VFs, we need to know the link speed to
make sure we don't allocate more bandwidth than is available. Add 20G
link speed to the switch statement so we can support devices that link
at that speed.

Change-ID: I5409f6139d549e5832777db9c22ca0664e0c5f8b
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 07f169c3e9df898afe951d74734a0e54ac89ee9d)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: add counter for arq overflows
Mitch Williams [Wed, 23 Dec 2015 20:05:48 +0000 (12:05 -0800)]
i40e: add counter for arq overflows

BugLink: http://bugs.launchpad.net/bugs/1547674
Sometimes, ARQ overflows are a big deal and tell us that the
firmware/hardware/driver/something is having problems. But normally
they're no big deal. To assist in assessing this, add a counter to
our Ethtool stats. A handful of ARQ overflows during VF init is no
problem. A large, ever-growing number indicates that Something Bad is
happening.

Change-ID: Ie5348bfbc8a54a890559cb00279c28d976a55096
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 1d0a4ada8401c73b360fc8492064a1107fca019b)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: fix write-back-on-itr to work with legacy itr
Anjali Singhai Jain [Wed, 23 Dec 2015 20:05:47 +0000 (12:05 -0800)]
i40e: fix write-back-on-itr to work with legacy itr

BugLink: http://bugs.launchpad.net/bugs/1547674
We were not doing write-back on interrupt throttle for Legacy case in X722.
This patch fixes that, so we do WB_ON_ITR for Legacy as well. Plus the issue
that we should still be setting NO_ITR if we are touching the DYN_CTLN register
since we do not want to change ITR setting here.

Change-ID: I5db8491ee1544118a389db839cecc93e1bbc480e
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit a3d772a3925d85721ad8518db14603fb1cd99295)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: Store lan_vsi_idx and lan_vsi_id in the right size
Pandi Maharajan [Wed, 23 Dec 2015 20:05:46 +0000 (12:05 -0800)]
i40e: Store lan_vsi_idx and lan_vsi_id in the right size

BugLink: http://bugs.launchpad.net/bugs/1547674
lan_vsi_idx and lan_vsi_id are assigned to u16 data sized variables but
declared in u8. This patch fixes the width of the datatype.

Change-ID: If4bcbcc7d32f2b287c51cb33d17879691258dce2
Signed-off-by: Pandi Kumar Maharajan <pandi.maharajan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 071c859b878a05c3f603669bfda2e5b4332dd695)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: Bump AQ minor version to 1.5 for new FW features
Shannon Nelson [Wed, 23 Dec 2015 20:05:45 +0000 (12:05 -0800)]
i40e: Bump AQ minor version to 1.5 for new FW features

BugLink: http://bugs.launchpad.net/bugs/1547674
Bump AQ minor version to 1.5 for new FW features.

Change-ID: I5a790f7f519a2a8921aaa1c5663727dd1897ffec
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: Kevin Scott <kevin.c.scott@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 97b884fecd6186ac1bcc932c453dce305d81040b)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: AQ thermal sensor control struct
Shannon Nelson [Wed, 23 Dec 2015 20:05:44 +0000 (12:05 -0800)]
i40e: AQ thermal sensor control struct

BugLink: http://bugs.launchpad.net/bugs/1547674
Add the new AQ command and struct for managing a thermal sensor.

Change-ID: I6f5631839a0f3dca352a6c222f1269a960e2310a
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 6774faf96437e8192e4ee2d16f1399ec9f842b80)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: AQ Add VXLAN-GPE tunnel type
Shannon Nelson [Wed, 23 Dec 2015 20:05:43 +0000 (12:05 -0800)]
i40e: AQ Add VXLAN-GPE tunnel type

BugLink: http://bugs.launchpad.net/bugs/1547674
Add the new Cisco VXLAN-GPE cloud tunnel type for the Add Cloud Filter
and UDP tunnel AQ commands.

Change-ID: I2c093c7d79726c7fca08a36e5c63581a905da3d2
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: Kevin Scott <kevin.c.scott@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 2fcc1a401eb06ff41cd551672ea588c6efd8c4e6)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: AQ Add set_switch_config
Shannon Nelson [Wed, 23 Dec 2015 20:05:42 +0000 (12:05 -0800)]
i40e: AQ Add set_switch_config

BugLink: http://bugs.launchpad.net/bugs/1547674
Add the new Set Switch Config AdminQ command, and mark the L2 Filter
bit as deprecated in the Add VEB command.

Change-ID: I5b24790f14c56f0ddf3f70df1e486844146b039f
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: Kevin Scott <kevin.c.scott@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit fa5623a6e6807baa7f3b8e65896199e23e3f939e)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: AQ Shared resource flags
Shannon Nelson [Wed, 23 Dec 2015 20:05:41 +0000 (12:05 -0800)]
i40e: AQ Shared resource flags

BugLink: http://bugs.launchpad.net/bugs/1547674
Add flags to MAC allocation requests to signify that the MAC VLAN filters
should come from the shared resource pool rather than the dedicated PF
resource pools.

Change-ID: I4c2da64c01856edcb0982bc4aab75c5a91047a7a
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: Kevin Scott <kevin.c.scott@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 906807793092f7d659a8933ddd7b9fa97cd6cf39)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoigb: Add workaround for VLAN tag stripping on 82576
Alexander Duyck [Thu, 7 Jan 2016 07:11:43 +0000 (23:11 -0800)]
igb: Add workaround for VLAN tag stripping on 82576

BugLink: http://bugs.launchpad.net/bugs/1547674
There was a workaround partially implemented for the 82576 that is needed
in order for VLAN tag stripping to function correctly.  The original code
had side effects that would make it so the workaround was active on all
MACs.  I have updated the code so that the workaround is enabled, but
limited to the 82576, or activated if we exceed the available unicast
addresses.

The workaround has a side effect of mirroring all of the traffic outgoing
from the VFs back to the PF.  As such it is not recommended to use the
82576 in promiscuous mode as it will take a performance hit, though this is
now consistent with the performance as seen on the out-of-tree igb driver.

I also limited the scope of the UTA bits all being set to only when the
VMOLR register is enabled.  This should limit the effects of the UTA
register so that we don't pick up any excess traffic unless promiscuous
mode has been enabled on the PF, whereas before the PF would have ended up
in something equivalent to unicast promiscuous mode with VLAN filtering
otherwise.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit bf456abb9b82d5376e7189cca00b528dd86d1559)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoigb: Enable use of "bridge fdb add" to set unicast table entries
Alexander Duyck [Thu, 7 Jan 2016 07:11:34 +0000 (23:11 -0800)]
igb: Enable use of "bridge fdb add" to set unicast table entries

BugLink: http://bugs.launchpad.net/bugs/1547674
This change makes it so that we can use the bridge utility to add a FDB
entry for the PF to an igb port.  By doing this we can enable the VFs to
talk to virtual ports residing on top of the PF.

In addition this should also address issues with MACVLANs trying to reside
on top of the PF as well as they would have had similar issues when added
to the PF with SR-IOV enabled.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 268f9d33a9319bb2d4d999e264aef9c00081bba0)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoigb: Drop unnecessary checks in transmit path
Alexander Duyck [Thu, 7 Jan 2016 07:11:26 +0000 (23:11 -0800)]
igb: Drop unnecessary checks in transmit path

BugLink: http://bugs.launchpad.net/bugs/1547674
This patch drops several checks that we dropped from ixgbe some ago.  It
should not be possible for us to be called with either of the conditional
statements returning true so we can just drop them from the hot-path.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 9c2f186e45faa34d5f6ff52aa84c361d4be72288)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoigb: Add support for VLAN promiscuous with SR-IOV and NTUPLE
Alexander Duyck [Thu, 7 Jan 2016 07:11:18 +0000 (23:11 -0800)]
igb: Add support for VLAN promiscuous with SR-IOV and NTUPLE

BugLink: http://bugs.launchpad.net/bugs/1547674
This change fixes things so that we can fully support SR-IOV or the
recently added NTUPLE filtering while allowing support for VLAN promiscuous
mode.  By making this change we are able to support possible scenarios such
as SR-IOV with the PF connected to a Linux bridge hosting other VMs.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 16903caa339961b9f8a68b64f4f313789de48599)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoigb: Clean-up configuration of VF port VLANs
Alexander Duyck [Thu, 7 Jan 2016 07:11:11 +0000 (23:11 -0800)]
igb: Clean-up configuration of VF port VLANs

BugLink: http://bugs.launchpad.net/bugs/1547674
This patch is meant to clean-up the configuration of the VF port based VLAN
configuration.  The original logic was a bit muddled and had some
undesirable side effects such as VLANs being either completely stripped
from the port or VLANs being left when they shouldn't be.  The idea behind
this code is to avoid any events such as spurious spoof notifications when
we are removing one VLAN tag and replacing it with another.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit a15d92598a5a741037b873fd4a43595a63048bbd)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoigb: Merge VLVF configuration into igb_vfta_set
Alexander Duyck [Thu, 7 Jan 2016 07:11:04 +0000 (23:11 -0800)]
igb: Merge VLVF configuration into igb_vfta_set

BugLink: http://bugs.launchpad.net/bugs/1547674
This change makes it so that we can merge the configuration of the VLVF
registers into the setting of the VFTA register.  By doing this we simplify
the logic and make use of similar functionality that we have already added
for ixgbe making it easier to maintain both drivers.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 8b77c6b20f32511175dfd00322ae82fb31949d55)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoigb: Always enable VLAN 0 even if 8021q is not loaded
Alexander Duyck [Thu, 7 Jan 2016 07:10:54 +0000 (23:10 -0800)]
igb: Always enable VLAN 0 even if 8021q is not loaded

BugLink: http://bugs.launchpad.net/bugs/1547674
This patch makes it so that we always add VLAN 0.  This is important as we
need to guarantee the PF can receive untagged frames in the case of SR-IOV
being enabled but VLAN filtering not being enabled in the kernel.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 5982a5565a08abf3b9ff18941b3e3cc94f7c8286)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoigb: Do not factor VLANs into RLPML calculation
Alexander Duyck [Thu, 7 Jan 2016 07:10:47 +0000 (23:10 -0800)]
igb: Do not factor VLANs into RLPML calculation

BugLink: http://bugs.launchpad.net/bugs/1547674
The RLPML registers already take the size of VLAN headers into account when
determining the maximum packet length.  This is called out in EAS documents
for several parts including the 82576 and the i350.  As such we can drop
the addition of size to the value programmed into the RLPML registers.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit d3836f8e2517fb04328c673989fd780030926694)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoigb: Allow asymmetric configuration of MTU versus Rx frame size
Alexander Duyck [Thu, 7 Jan 2016 07:10:39 +0000 (23:10 -0800)]
igb: Allow asymmetric configuration of MTU versus Rx frame size

BugLink: http://bugs.launchpad.net/bugs/1547674
Since the igb driver is using page based receive there is no point in
limiting the Rx capabilities of the device.  The driver can receive 9K
jumbo frames at all times.  The only changes needed due to MTU changes are
updates for the FIFO sizes and flow-control watermarks.

Update the maximum frame size to reflect the 9.5K limitation of the
hardware, and replace all instances of max_frame_size with
MAX_JUMBO_FRAME_SIZE when referring to an Rx FIFO or frame.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 45693bcb00cbd379c373ab22ccd9a9d4755cc7ed)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoigb: Refactor VFTA configuration
Alexander Duyck [Thu, 7 Jan 2016 07:10:30 +0000 (23:10 -0800)]
igb: Refactor VFTA configuration

BugLink: http://bugs.launchpad.net/bugs/1547674
This patch starts the clean-up process on the VFTA configuration.
Specifically in this patch I attempt to address and simplify several items
while also updating the code to bring it more inline with what is already
in ixgbe.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 832e821c51e381966464c8a0f30f12eb1514eba0)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoigb: clean up code for setting MAC address
Alexander Duyck [Thu, 7 Jan 2016 07:10:23 +0000 (23:10 -0800)]
igb: clean up code for setting MAC address

BugLink: http://bugs.launchpad.net/bugs/1547674
Drop a bunch of hand written byte swapping code in favor of just doing the
byte swapping ourselves.  The registers are little endian registers storing
a big endian value so if we read the MAC address array as little endian
then we will get the CPU registers into the proper layout.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit c3278587e7d34cfbc1d38d3ae25923343af7752a)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoigb/igbvf: don't give up
Mitch Williams [Sat, 12 Dec 2015 00:45:38 +0000 (16:45 -0800)]
igb/igbvf: don't give up

BugLink: http://bugs.launchpad.net/bugs/1547674
The driver shouldn't just give up if it fails to get the hardware
mailbox lock. This can happen in a situation where the PF-VF
communication channel is heavily loaded and causes complete
communications failure between the PF and VF drivers.

Add a counter and a delay. The driver will now retry ten times, waiting
one millisecond between retries.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 9ce0e8d72678b5b60c99ce4c7af15ec127c761cb)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoigb: Unpair the queues when changing the number of queues
Shota Suzuki [Fri, 11 Dec 2015 09:44:00 +0000 (18:44 +0900)]
igb: Unpair the queues when changing the number of queues

BugLink: http://bugs.launchpad.net/bugs/1547674
By the commit 72ddef0506da ("igb: Fix oops caused by missing queue
pairing"), the IGB_FLAG_QUEUE_PAIRS flag can now be set when changing the
number of queues by "ethtool -L", but it is never cleared unless the igb
driver is reloaded.
This patch clears it if queue pairing becomes unnecessary as a result of
"ethtool -L".

Signed-off-by: Shota Suzuki <suzuki_shota_t3@lab.ntt.co.jp>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 37a5d163fb447b39f7960d0534de30e88ad395bb)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoigb: Remove unnecessary flag setting in igb_set_flag_queue_pairs()
Shota Suzuki [Fri, 11 Dec 2015 09:43:59 +0000 (18:43 +0900)]
igb: Remove unnecessary flag setting in igb_set_flag_queue_pairs()

BugLink: http://bugs.launchpad.net/bugs/1547674
If VFs are enabled (max_vfs >= 1), both max_rss_queues and
adapter->rss_queues are set to 2 in the case of e1000_82576.
In this case, IGB_FLAG_QUEUE_PAIRS is always set in the default block as a
result of fall-through, thus setting it in the e1000_82576 block is not
necessary.

Signed-off-by: Shota Suzuki <suzuki_shota_t3@lab.ntt.co.jp>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit ceb27759987ec10ba22332bd7fdf1cfb35b86991)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoixgbe: bulk free SKBs during TX completion cleanup cycle
Jesper Dangaard Brouer [Mon, 8 Feb 2016 12:15:09 +0000 (13:15 +0100)]
ixgbe: bulk free SKBs during TX completion cleanup cycle

BugLink: http://bugs.launchpad.net/bugs/1547674
There is an opportunity to bulk free SKBs during reclaiming of
resources after DMA transmit completes in ixgbe_clean_tx_irq.  Thus,
bulk freeing at this point does not introduce any added latency.

Simply use napi_consume_skb() which were recently introduced.  The
napi_budget parameter is needed by napi_consume_skb() to detect if it
is called from netpoll.

Benchmarking IPv4-forwarding, on CPU i7-4790K @4.2GHz (no turbo boost)
 Single CPU/flow numbers: before: 1982144 pps ->  after : 2064446 pps
 Improvement: +82302 pps, -20 nanosec, +4.1%
 (SLUB and GCC version 5.1.1 20150618 (Red Hat 5.1.1-4))

Joint work with Alexander Duyck.

Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from net-next commit a3a8749d34d8a5ac071c7ead792bd21ffe328aa0)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: add 100Mb ethtool reporting
Catherine Sullivan [Tue, 22 Dec 2015 22:25:14 +0000 (14:25 -0800)]
i40e: add 100Mb ethtool reporting

BugLink: http://bugs.launchpad.net/bugs/1547674
Add some missing reporting/advertisement of 100Mb capability
for adapters that support it.

Change-ID: I8b8523fbdc99517bec29d90c71b3744db11542ac
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit f8db54cc4df7b065b0028f8c919e2f47983f2043)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: AQ Add external power class to get link status
Shannon Nelson [Tue, 22 Dec 2015 22:25:13 +0000 (14:25 -0800)]
i40e: AQ Add external power class to get link status

BugLink: http://bugs.launchpad.net/bugs/1547674
Add the new External Device Power Ability field to the get_link_status data
structure, using space from the reserved field at the end of the struct.

Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: Kevin Scott <kevin.c.scott@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 5eb772f7ca86267565ef40c7b987c88405689b96)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: AQ Geneve cloud tunnel type
Shannon Nelson [Tue, 22 Dec 2015 22:25:12 +0000 (14:25 -0800)]
i40e: AQ Geneve cloud tunnel type

BugLink: http://bugs.launchpad.net/bugs/1547674
Fix the name of the new cloud tunnel type from the place-holder NGE
name to the official Geneve.  Also fix the spelling of the VXLAN type.

Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: Kevin Scott <kevin.c.scott@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
(cherry picked from net-next commit 5926425368ba8f1b186d45d96020c288e3bb9b8d)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: AQ Add Run PHY Activity struct
Shannon Nelson [Tue, 22 Dec 2015 22:25:11 +0000 (14:25 -0800)]
i40e: AQ Add Run PHY Activity struct

BugLink: http://bugs.launchpad.net/bugs/1547674
Add the AQ opcode and struct definitions for the Run PHY Activity command

Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: Kevin Scott <kevin.c.scott@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 5394f02f0c0553f97bb4c5596a34c9a7333c032b)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: Limit DCB FW version checks to X710/XL710 devices
Greg Bowers [Tue, 22 Dec 2015 22:25:10 +0000 (14:25 -0800)]
i40e: Limit DCB FW version checks to X710/XL710 devices

BugLink: http://bugs.launchpad.net/bugs/1547674
X710/XL710 devices require FW version checks to properly handle DCB
configurations from the FW.  Newer devices do not, so limit these checks
to X710/XL710.

Signed-off-by: Greg Bowers <gregory.j.bowers@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 6dfae3892473e91080accdb2da8476481393f769)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: add new proxy-wol bit for X722
Shannon Nelson [Tue, 22 Dec 2015 22:25:09 +0000 (14:25 -0800)]
i40e: add new proxy-wol bit for X722

BugLink: http://bugs.launchpad.net/bugs/1547674
Add the new proxy-wake-on-lan capability bit available with the
new X722 device.

Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 4ba40bcea7046a1fa9b57a8cb4bcb8776e86e7ed)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e/i40evf: Use private workqueue
Jesse Brandeburg [Tue, 22 Dec 2015 22:25:08 +0000 (14:25 -0800)]
i40e/i40evf: Use private workqueue

BugLink: http://bugs.launchpad.net/bugs/1547674
As done per ixgbe, use a private workqueue to avoid blocking the
system workqueue.  This avoids some strange side effects when
some other entity is depending on the system work queue.

Change-ID: Ic8ba08f5b03696cf638b21afd25fbae7738d55ee
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 2803b16c10ea7eec170c485388f5f26ae30e92fe)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40evf: add new write-back mode
Anjali Singhai Jain [Tue, 22 Dec 2015 22:25:07 +0000 (14:25 -0800)]
i40evf: add new write-back mode

BugLink: http://bugs.launchpad.net/bugs/1547674
Add write-back on interrupt throttle rate timer expiration support
for the i40evf driver, when running on X722 devices.

Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit f6d83d1376f496e6218080dd6eb663830672813f)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e/i40evf: Fix for UDP/TCP RSS for X722
Anjali Singhai Jain [Tue, 22 Dec 2015 22:25:05 +0000 (14:25 -0800)]
i40e/i40evf: Fix for UDP/TCP RSS for X722

BugLink: http://bugs.launchpad.net/bugs/1547674
The PCTYPES for the X710 and X722 families are different. This patch
makes adjustments for that.

Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 3d0da5b78262c1f86294419c7a70e4c837aca159)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: Extend ethtool RSS hooks for X722
Anjali Singhai Jain [Tue, 22 Dec 2015 22:25:04 +0000 (14:25 -0800)]
i40e: Extend ethtool RSS hooks for X722

BugLink: http://bugs.launchpad.net/bugs/1547674
This patch adds another way to access the RSS keys and lut using the AQ
for X722 devices.

Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 95a73780921aecc5e66022e000fcf8aeecfb53cf)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: add new device IDs for X722
Anjali Singhai Jain [Tue, 22 Dec 2015 22:25:03 +0000 (14:25 -0800)]
i40e: add new device IDs for X722

BugLink: http://bugs.launchpad.net/bugs/1547674
Add the KX and QSFP device IDs for X722.

Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 35dae51de3e99db10f355642f5fc67719b93f558)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: bump version to 1.4.10
Catherine Sullivan [Thu, 10 Dec 2015 19:38:51 +0000 (11:38 -0800)]
i40e: bump version to 1.4.10

BugLink: http://bugs.launchpad.net/bugs/1547674
Bump.

Change-ID: Ic9a495feb9ab0606f953c3848b0acf67169d3930
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 4f9e697ebbf40ba482ad0481da1e978440f2a53e)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: update features with right offload
Jesse Brandeburg [Thu, 10 Dec 2015 19:38:50 +0000 (11:38 -0800)]
i40e: update features with right offload

BugLink: http://bugs.launchpad.net/bugs/1547674
Synchronize code bases and add SCTP offload support.

Change-ID: I9f99071f7176225479026930c387bf681a47494e
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 5afdaaa0555257f3c42b141908567d40aca0e1d1)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: Cleanup the code with respect to restarting autoneg
Anjali Singhai Jain [Wed, 9 Dec 2015 23:50:31 +0000 (15:50 -0800)]
i40e: Cleanup the code with respect to restarting autoneg

BugLink: http://bugs.launchpad.net/bugs/1547674
The restart-autoneg work around does not apply to X722.
Added a flag to set it only for the right MAC and right FW version
where the work around should be applied.

Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Change-ID: I942c3ff40cccd1e56f424b1da776b020fe3c9d2a
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 8eed76fa4885f1ed9f19f4d3a16dd24cebf09c19)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40evf: null out ring pointers on free
Mitch Williams [Wed, 9 Dec 2015 23:50:30 +0000 (15:50 -0800)]
i40evf: null out ring pointers on free

BugLink: http://bugs.launchpad.net/bugs/1547674
Since we check these ring pointers to make sure we don't double-allocate
or double-free the rings, we had better null them out after we free
them. In very rare cases this can cause a panic if the driver is removed
during reset recovery.

Change-ID: Ib06eb4910a3058275c8f7ec5ef7f45baa4674f96
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 10311540fab76c7e5530bf5f0267a3d1b8d5818e)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: define function capabilities in only one place
Shannon Nelson [Thu, 10 Dec 2015 19:38:49 +0000 (11:38 -0800)]
i40e: define function capabilities in only one place

BugLink: http://bugs.launchpad.net/bugs/1547674
The device capabilities were defined in two places, and neither had all
the definitions.  It really belongs with the AQ API definition, so this
patch removes the other set of definitions and fills out the missing item.

Change-ID: I273ba7d79a476cd11d2e0ca5825fec1716740de2
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 406e734aa893fa5841e67de6d4f688ba70a82e4f)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40evf: allow channel bonding of VFs
Mitch Williams [Wed, 9 Dec 2015 23:50:27 +0000 (15:50 -0800)]
i40evf: allow channel bonding of VFs

BugLink: http://bugs.launchpad.net/bugs/1547674
In some modes, bonding would not enslave VF interfaces. This is due to
bonding calling change_mtu and the immediately calling open. Because of
the asynchronous nature of the admin queue mechanism, the VF returns
-EBUSY to the open call, because it knows the previous operation hasn't
finished yet. This causes bonding to fail with a less-than-useful error
message.

To fix this, remove the check for pending operations at the beginning of
open. But this introduces a new bug where the driver will panic on a
quick close/open cycle. To fix that, we add a new driver state,
__I40EVF_DOWN_PENDING, that the driver enters when down is called. The
driver finally transitions to a fully DOWN state when it receives
confirmation from the PF driver that all the queues are disabled. This
allows open to complete even if there is a pending mtu change, and
bonding is finally happy.

Change-ID: I06f4c7e435d5bacbfceaa7c3f209e0ff04be21cc
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 209dc4daf23f92b3e0bc6d602411506c4083e421)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: Replace X722 mac check in ethtool get_settings
Catherine Sullivan [Wed, 9 Dec 2015 23:50:25 +0000 (15:50 -0800)]
i40e: Replace X722 mac check in ethtool get_settings

BugLink: http://bugs.launchpad.net/bugs/1547674
100M SGMII is only supported on X722.  Replace the mac check with
a feature flag check that is only set for the X722 device.

Change-ID: I53452d9af6af8cd9dca8500215fbc6ce93418f52
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 48b1804ee3cdad7bf115666eb35edf12a734710f)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e/i40evf: Fix RSS rx-flow-hash configuration through ethtool
Anjali Singhai Jain [Wed, 9 Dec 2015 23:50:24 +0000 (15:50 -0800)]
i40e/i40evf: Fix RSS rx-flow-hash configuration through ethtool

BugLink: http://bugs.launchpad.net/bugs/1547674
This patch fixes the Hash PCTYPE enable for X722 since it supports
a broader selection of PCTYPES for TCP and UDP.

This patch also fixes a bug in XL710, X710, X722 support for RSS,
as of now we cannot reduce the (4)tuple for RSS for TCP/IPv4/IPV6 or
UDP/IPv4/IPv6 packets since this requires a product feature change
that comes in a later release.

A VF should never be allowed to change the tuples for RSS for any
PCTYPE since that's a global setting for the device in case of i40e
devices.

Change-ID: I0ee7203c9b24813260f58f3220798bc9d9ac4a12
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 6e35c04cf633e55648acb9ccabff42aa37bd4044)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoi40e: Add mac_filter_element at the end of the list instead of HEAD
Kiran Patil [Wed, 9 Dec 2015 23:50:23 +0000 (15:50 -0800)]
i40e: Add mac_filter_element at the end of the list instead of HEAD

BugLink: http://bugs.launchpad.net/bugs/1547674
Add MAC filter element to the end of the list in the given order,
just to be tidy, and just in case there are ever any ordering issues in
the future.

Change-ID: Idc15276147593ea9393ac72c861f9c7905a791b4
Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 04d5a21d62887b9bc5383fc68ab2756287da4532)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet: Add eth_platform_get_mac_address() helper.
David S. Miller [Thu, 5 Nov 2015 16:34:57 +0000 (11:34 -0500)]
net: Add eth_platform_get_mac_address() helper.

BugLink: http://bugs.launchpad.net/bugs/1547674
A repeating pattern in drivers has become to use OF node information
and, if not found, platform specific host information to extract the
ethernet address for a given device.

Currently this is done with a call to of_get_mac_address() and then
some ifdef'd stuff for SPARC.

Consolidate this into a portable routine, and provide the
arch_get_platform_mac_address() weak function hook for all
architectures to implement if they want.

Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from net-next commit c7f5d105495a38ed09e70d825f75d9d7d5407264)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet: bulk free infrastructure for NAPI context, use napi_consume_skb
Jesper Dangaard Brouer [Mon, 8 Feb 2016 12:14:59 +0000 (13:14 +0100)]
net: bulk free infrastructure for NAPI context, use napi_consume_skb

BugLink: http://bugs.launchpad.net/bugs/1547674
Discovered that network stack were hitting the kmem_cache/SLUB
slowpath when freeing SKBs.  Doing bulk free with kmem_cache_free_bulk
can speedup this slowpath.

NAPI context is a bit special, lets take advantage of that for bulk
free'ing SKBs.

In NAPI context we are running in softirq, which gives us certain
protection.  A softirq can run on several CPUs at once.  BUT the
important part is a softirq will never preempt another softirq running
on the same CPU.  This gives us the opportunity to access per-cpu
variables in softirq context.

Extend napi_alloc_cache (before only contained page_frag_cache) to be
a struct with a small array based stack for holding SKBs.  Introduce a
SKB defer and flush API for accessing this.

Introduce napi_consume_skb() as replacement for e.g. dev_consume_skb_any()
when running in NAPI context.  A small trick to handle/detect if we
are called from netpoll is to see if budget is 0.  In that case, we
need to invoke dev_consume_skb_irq().

Joint work with Alexander Duyck.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from net-next commit 795bb1c00dd338aa0d12f9a7f1f4776fb3160416)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agompt3sas: Remove cpumask_clear for zalloc_cpumask_var and don't free free_cpu_mask_var...
Suganath prabu Subramani [Thu, 11 Feb 2016 09:32:55 +0000 (15:02 +0530)]
mpt3sas: Remove cpumask_clear for zalloc_cpumask_var and don't free free_cpu_mask_var before reply_q

BugLink: http://bugs.launchpad.net/bugs/1512221
Removed cpumask_clear as it is not required for zalloc_cpumask_var and
free free_cpumask_var before freeing reply_q.

Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@broadcom.com>
Signed-off-by: Chaitra P B <chaitra.basappa@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 01b96358f594b38813f25d89da850e4bce337318)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agompt3sas: Updating mpt3sas driver version to 12.100.00.00
Suganath prabu Subramani [Thu, 28 Jan 2016 06:37:07 +0000 (12:07 +0530)]
mpt3sas: Updating mpt3sas driver version to 12.100.00.00

BugLink: http://bugs.launchpad.net/bugs/1512221
Bump mpt3sas driver version from 09.102.00.00 to 12.100.00.00

Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit f27b0bd7abe06288ba38125f144aa3d91fb315f4)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agompt3sas: Fix for Asynchronous completion of timedout IO and task abort of timedout IO.
Suganath prabu Subramani [Thu, 28 Jan 2016 06:37:06 +0000 (12:07 +0530)]
mpt3sas: Fix for Asynchronous completion of timedout IO and task abort of timedout IO.

BugLink: http://bugs.launchpad.net/bugs/1512221
Track msix of each IO and use the same msix for issuing abort to timed
out IO. With this driver will process IO's reply first followed by TM.

Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 06071c8bae271ea2f8af3951c40ffad340b2cbbd)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agompt3sas: Updated MPI Header to 2.00.42
Suganath prabu Subramani [Thu, 28 Jan 2016 06:37:05 +0000 (12:07 +0530)]
mpt3sas: Updated MPI Header to 2.00.42

BugLink: http://bugs.launchpad.net/bugs/1512221
Updated MPI version and MPI header files.

Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit ff711f645e0de9adec7fff52f2a5f0a1959d5be6)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agompt3sas: Add support for configurable Chain Frame Size
Suganath prabu Subramani [Thu, 28 Jan 2016 06:37:04 +0000 (12:07 +0530)]
mpt3sas: Add support for configurable Chain Frame Size

BugLink: http://bugs.launchpad.net/bugs/1512221
Added support for configurable Chain Frame Size. Calculate the
Chain Message Frame size from the IOCMaxChainSegementSize (iocfacts).
Applicable only for mpt3sas/SAS3.0 HBA's.

Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 84619ca86eb0797aad61f962dafa82788861c4e0)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agompt3sas: Added smp_affinity_enable module parameter.
Suganath Prabu Subramani [Mon, 8 Feb 2016 16:43:39 +0000 (22:13 +0530)]
mpt3sas: Added smp_affinity_enable module parameter.

BugLink: http://bugs.launchpad.net/bugs/1512221
Module parameter to enable/disable configuring affinity hint for msix
vector.  SMP affinity feature can be enabled/disabled by setting module
parameter "smp_affinity_enable" to 1/0.  By default this feature is
enabled. (smp_affinity_enable = 1 enabled).

Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit be65e666abdd21865b3ea2713257a66e624eeaec)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agompt3sas: Make use of additional HighPriority credit message frames for sending SCSI...
Suganath prabu Subramani [Thu, 28 Jan 2016 06:37:02 +0000 (12:07 +0530)]
mpt3sas: Make use of additional HighPriority credit message frames for sending SCSI IO's

BugLink: http://bugs.launchpad.net/bugs/1512221
Driver assumes HighPriority credit as part of Global credit. But,
Firmware treats HighPriority credit value and global cedits as two
different values. Changed host queue algorithm to treat global credits
and highPriority credits as two different values.

Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 3ffa7c60b71fcd1070a68a74c380c05c4c161710)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agompt3sas: Never block the Enclosure device
Suganath prabu Subramani [Thu, 28 Jan 2016 06:37:01 +0000 (12:07 +0530)]
mpt3sas: Never block the Enclosure device

BugLink: http://bugs.launchpad.net/bugs/1512221
Never block the SEP device (i.e. Never invoke the
scsi_internal_device_block() API for SEP device) even for the delay not
responding events. Blocking the SEP device will create a deadlock while
adding any device to the OS.

Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit b17d0b7ff0768070180e1021c0f32988445644d8)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agompt3sas: Fix static analyzer(coverity) tool identified defects
Suganath prabu Subramani [Thu, 28 Jan 2016 06:37:00 +0000 (12:07 +0530)]
mpt3sas: Fix static analyzer(coverity) tool identified defects

BugLink: http://bugs.launchpad.net/bugs/1512221
1.Wrong size of argument is being passed
 The size of struct being passed as an argument to memset func and area of
 memory being pointed by an instance of struct in memset func should be of
 same structure type.
2.Dereference null return value
3.Array compared against '0'
 Check whether value pointed by particular index of an array is null or not
 in "if" statement.

Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit dc2ed1660060a04ae9857047ace1169bddeb2ef6)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agompt3sas: Used IEEE SGL instead of MPI SGL while framing a SMP Passthrough request...
Suganath prabu Subramani [Thu, 28 Jan 2016 06:36:59 +0000 (12:06 +0530)]
mpt3sas: Used IEEE SGL instead of MPI SGL while framing a SMP Passthrough request message.

BugLink: http://bugs.launchpad.net/bugs/1512221
As driver was using MPI SGL while framing the SMP Passthrough request
message due to which firmware unable to post the Reply Data in the host
memory and timeout is observed for this SMP Passthrough request message
and so unable to perform phy disable operation.

Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 415f1c3fe636022dd2d91fc152c0665adf588e44)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agompt3sas: Added support for high port count HBA variants.
Suganath prabu Subramani [Thu, 28 Jan 2016 06:36:58 +0000 (12:06 +0530)]
mpt3sas: Added support for high port count HBA variants.

BugLink: http://bugs.launchpad.net/bugs/1512221
Updated hardware description headers with MPI v2.6 and
mpt3sas_pci_table[] with vendor_ids, device_ids of Cutlass and Intruder
HBA which have support for 4 ports.

Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 1abeff9c9ab2384a0da5019956d52944350301e6)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agompt3sas: A correction in unmap_resources
Tomas Henzl [Wed, 23 Dec 2015 13:21:47 +0000 (14:21 +0100)]
mpt3sas: A correction in unmap_resources

BugLink: http://bugs.launchpad.net/bugs/1512221
It might happen that we try to free an already freed pointer.

Reported-by: Maurizio Lombardi <mlombard@redhat.com>
Signed-off-by: Tomas Henzl <thenzl@redhat.com>
Acked-by: Chaitra P B <chaitra.basappa@avagotech.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 5f985d88bac34e7f3b4403118eab072902a0b392)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoibmvscsi: Add endian conversions to sysfs attribute show functions
Tyrel Datwyler [Thu, 11 Feb 2016 01:32:27 +0000 (19:32 -0600)]
ibmvscsi: Add endian conversions to sysfs attribute show functions

BugLink: http://bugs.launchpad.net/bugs/1547153
The values returned by the show functions for the host os_type,
mad_version, and partition_number attributes get their values directly
from the madapter_info struct whose associated fields are __be32
typed. Added endian conversion to ensure these values are sane on LE
platforms.

Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from linux-next commit f9e3de0d6053ae89828188291a405c64d8d95a0e)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: Start new release
Tim Gardner [Fri, 19 Feb 2016 12:29:38 +0000 (05:29 -0700)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: Ubuntu-4.4.0-7.22
Tim Gardner [Thu, 18 Feb 2016 20:33:53 +0000 (13:33 -0700)]
UBUNTU: Ubuntu-4.4.0-7.22

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoarm64: kernel: implement ACPI parking protocol
Lorenzo Pieralisi [Tue, 26 Jan 2016 11:10:38 +0000 (11:10 +0000)]
arm64: kernel: implement ACPI parking protocol

BugLink: http://bugs.launchpad.net/bugs/1547047
The SBBR and ACPI specifications allow ACPI based systems that do not
implement PSCI (eg systems with no EL3) to boot through the ACPI parking
protocol specification[1].

This patch implements the ACPI parking protocol CPU operations, and adds
code that eases parsing the parking protocol data structures to the
ARM64 SMP initializion carried out at the same time as cpus enumeration.

To wake-up the CPUs from the parked state, this patch implements a
wakeup IPI for ARM64 (ie arch_send_wakeup_ipi_mask()) that mirrors the
ARM one, so that a specific IPI is sent for wake-up purpose in order
to distinguish it from other IPI sources.

Given the current ACPI MADT parsing API, the patch implements a glue
layer that helps passing MADT GICC data structure from SMP initialization
code to the parking protocol implementation somewhat overriding the CPU
operations interfaces. This to avoid creating a completely trasparent
DT/ACPI CPU operations layer that would require creating opaque
structure handling for CPUs data (DT represents CPU through DT nodes, ACPI
through static MADT table entries), which seems overkill given that ACPI
on ARM64 mandates only two booting protocols (PSCI and parking protocol),
so there is no need for further protocol additions.

Based on the original work by Mark Salter <msalter@redhat.com>

[1] https://acpica.org/sites/acpica/files/MP%20Startup%20for%20ARM%20platforms.docx

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tested-by: Loc Ho <lho@apm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Hanjun Guo <hanjun.guo@linaro.org>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mark Salter <msalter@redhat.com>
Cc: Al Stone <ahs3@redhat.com>
[catalin.marinas@arm.com: Added WARN_ONCE(!acpi_parking_protocol_valid() on the IPI]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(backported from linux-next commit b518dc969cea61100ec7a7692716a0e82a189b2d)
Signed-off-by: Craig Magina <craig.magina@canonical.com>
8 years agoUBUNTU: [Config] Enabled ARM64_ACPI_PARKING_PROTOCOL
Craig Magina [Fri, 12 Feb 2016 18:07:55 +0000 (13:07 -0500)]
UBUNTU: [Config] Enabled ARM64_ACPI_PARKING_PROTOCOL

BugLink: http://bugs.launchpad.net/bugs/1547047
Signed-off-by: Craig Magina <craig.magina@canonical.com>
8 years agolivepatch: Cleanup module page permission changes
Josh Poimboeuf [Thu, 3 Dec 2015 22:33:26 +0000 (16:33 -0600)]
livepatch: Cleanup module page permission changes

Calling set_memory_rw() and set_memory_ro() for every iteration of the
loop in klp_write_object_relocations() is messy, inefficient, and
error-prone.

Change all the read-only pages to read-write before the loop and convert
them back to read-only again afterwards.

Suggested-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
(cherry picked from commit b56b36ee6751abe7fb3890681e86fc8de2122953)
Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agomodule: keep percpu symbols in module's symtab
Miroslav Benes [Thu, 26 Nov 2015 02:48:06 +0000 (13:18 +1030)]
module: keep percpu symbols in module's symtab

Currently, percpu symbols from .data..percpu ELF section of a module are
not copied over and stored in final symtab array of struct module.
Consequently such symbol cannot be returned via kallsyms API (for
example kallsyms_lookup_name). This can be especially confusing when the
percpu symbol is exported. Only its __ksymtab et al. are present in its
symtab.

The culprit is in layout_and_allocate() function where SHF_ALLOC flag is
dropped for .data..percpu section. There is in fact no need to copy the
section to final struct module, because kernel module loader allocates
extra percpu section by itself. Unfortunately only symbols from
SHF_ALLOC sections are copied due to a check in is_core_symbol().

The patch changes is_core_symbol() function to copy over also percpu
symbols (their st_shndx points to .data..percpu ELF section). We do it
only if CONFIG_KALLSYMS_ALL is set to be consistent with the rest of the
function (ELF section is SHF_ALLOC but !SHF_EXECINSTR). Finally
elf_type() returns type 'a' for a percpu symbol because its address is
absolute.

Signed-off-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
(cherry picked from commit e0224418516b4d8a6c2160574bac18447c354ef0)
Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agomodule: clean up RO/NX handling.
Rusty Russell [Wed, 25 Nov 2015 23:15:08 +0000 (09:45 +1030)]
module: clean up RO/NX handling.

Modules have three sections: text, rodata and writable data.  The code
handled the case where these overlapped, however they never can:
debug_align() ensures they are always page-aligned.

This is why we got away with manually traversing the pages in
set_all_modules_text_rw() without rounding.

We create three helper functions: frob_text(), frob_rodata() and
frob_writable_data().  We then call these explicitly at every point,
so it's clear what we're doing.

We also expose module_enable_ro() and module_disable_ro() for
livepatch to use.

Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
(cherry picked from commit 85c898db6327353d38f3dd428457384cf81f83f8)
Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agomodule: use a structure to encapsulate layout.
Rusty Russell [Wed, 25 Nov 2015 23:14:08 +0000 (09:44 +1030)]
module: use a structure to encapsulate layout.

Makes it easier to handle init vs core cleanly, though the change is
fairly invasive across random architectures.

It simplifies the rbtree code immediately, however, while keeping the
core data together in the same cachline (now iff the rbtree code is
enabled).

Acked-by: Peter Zijlstra <peterz@infradead.org>
Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
(cherry picked from commit 7523e4dc5057e157212b4741abd6256e03404cf1)
Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agogcov: use within_module() helper.
Rusty Russell [Wed, 25 Nov 2015 23:13:08 +0000 (09:43 +1030)]
gcov: use within_module() helper.

An exact mapping would be within_module_core(), but at this stage
(MODULE_STATE_GOING) the init section is empty, and this is clearer.

Reviewed-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
(cherry picked from commit c65abf358f211c3f88c8ed714dff25775ab49fc1)
Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agomodule: Use the same logic for setting and unsetting RO/NX
Josh Poimboeuf [Wed, 25 Nov 2015 23:12:08 +0000 (09:42 +1030)]
module: Use the same logic for setting and unsetting RO/NX

When setting a module's RO and NX permissions, set_section_ro_nx() is
used, but when clearing them, unset_module_{init,core}_ro_nx() are used.
The unset functions don't have the same checks the set function has for
partial page protections.  It's probably harmless, but it's still
confusingly asymmetrical.

Instead, use the same logic to do both.  Also add some new
set_module_{init,core}_ro_nx() helper functions for more symmetry with
the unset functions.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
(cherry picked from commit 20ef10c1b3068f105004e247d8e7dd8120fa4b9a)
Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agolivepatch: function,sympos scheme in livepatch sysfs directory
Chris J Arges [Wed, 2 Dec 2015 02:40:56 +0000 (20:40 -0600)]
livepatch: function,sympos scheme in livepatch sysfs directory

The following directory structure will allow for cases when the same
function name exists in a single object.
/sys/kernel/livepatch/<patch>/<object>/<function,sympos>

The sympos number corresponds to the nth occurrence of the symbol name in
kallsyms for the patched object.

An example of patching multiple symbols can be found here:
https://github.com/dynup/kpatch/issues/493

Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
(cherry picked from commit 444f9e99a840c4050c0530cfef81801a21a59f4c)
Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agolivepatch: add sympos as disambiguator field to klp_reloc
Chris J Arges [Wed, 2 Dec 2015 02:40:55 +0000 (20:40 -0600)]
livepatch: add sympos as disambiguator field to klp_reloc

In cases of duplicate symbols, sympos will be used to disambiguate instead
of val. By default sympos will be 0, and patching will only succeed if
the symbol is unique. Specifying a positive value will ensure that
occurrence of the symbol in kallsyms for the patched object will be used
for patching if it is valid. For external relocations sympos is not
supported.

Remove klp_verify_callback, klp_verify_args and klp_verify_vmlinux_symbol
as they are no longer used.

From the klp_reloc structure remove val, as it can be refactored as a
local variable in klp_write_object_relocations.

Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
(cherry picked from commit 064c89df6247cd829a7880cc8a87b7ed2cdfccd8)
Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agolivepatch: add old_sympos as disambiguator field to klp_func
Chris J Arges [Wed, 2 Dec 2015 02:40:54 +0000 (20:40 -0600)]
livepatch: add old_sympos as disambiguator field to klp_func

Currently, patching objects with duplicate symbol names fail because the
creation of the sysfs function directory collides with the previous
attempt. Appending old_addr to the function name is problematic as it
reveals the address of the function being patch to a normal user. Using
the symbol's occurrence in kallsyms to postfix the function name in the
sysfs directory solves the issue of having consistent unique names and
ensuring that the address is not exposed to a normal user.

In addition, using the symbol position as the user's method to disambiguate
symbols instead of addr allows for disambiguating symbols in modules as
well for both function addresses and for relocs. This also simplifies much
of the code. Special handling for kASLR is no longer needed and can be
removed. The klp_find_verify_func_addr function can be replaced by
klp_find_object_symbol, and klp_verify_vmlinux_symbol and its callback can
be removed completely.

In cases of duplicate symbols, old_sympos will be used to disambiguate
instead of old_addr. By default old_sympos will be 0, and patching will
only succeed if the symbol is unique. Specifying a positive value will
ensure that occurrence of the symbol in kallsyms for the patched object
will be used for patching if it is valid.

In addition, make old_addr an internal structure field not to be specified
by the user. Finally, remove klp_find_verify_func_addr as it can be
replaced by klp_find_object_symbol directly.

Support for symbol position disambiguation for relocations is added in the
next patch in this series.

Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
(cherry picked from commit b2b018ef48675a9a524fa9791ea7d67fdac405f7)
Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet: cavium: liquidio: fix check for in progress flag
Colin Ian King [Fri, 5 Feb 2016 16:30:39 +0000 (16:30 +0000)]
net: cavium: liquidio: fix check for in progress flag

smatch detected a suspicious looking bitop condition:

drivers/net/ethernet/cavium/liquidio/lio_main.c:2529
  handle_timestamp() warn: suspicious bitop condition

(skb_shinfo(skb)->tx_flags | SKBTX_IN_PROGRESS is always non-zero,
so the logic is definitely not correct.  Use & to mask the correct
bit.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from linux-next commit 19a6d156a7bd080f3a855a40a4a08ab475e34b4a)
Signed-off-by: Dann Frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet: cavium: liquidio: Return correct error code
Amitoj Kaur Chawla [Thu, 4 Feb 2016 13:55:13 +0000 (19:25 +0530)]
net: cavium: liquidio: Return correct error code

The return value of vmalloc on failure of allocation of memory should
be -ENOMEM and not -1.

Found using Coccinelle. A simplified version of the semantic patch
used is:

//<smpl>
@@
expression *e;
identifier l1;
position p,q;
@@

e@q = vmalloc(...);
if@p (e == NULL) {
...
goto l1;
}
l1:
...
return -1
+ -ENOMEM
;
//</smpl

The single call site of the containing function checks whether the
returned value is -1, so this check is changed as well. The single call
site of this call site, however, only checks whether the value is not 0,
so no further change was required.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from linux-next commit 08a965ec93ad0495802462c32b73241d658e189d)
Signed-off-by: Dann Frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet: thunderx: Alloc higher order pages when pagesize is small
Sunil Goutham [Thu, 11 Feb 2016 16:20:26 +0000 (21:50 +0530)]
net: thunderx: Alloc higher order pages when pagesize is small

Allocate higher order pages when pagesize is small, this will
reduce number of calls to page allocator and wastage of memory.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from linux-next commit 6e4be8d6717cb63c58f6b404e63a881c76d8878c)
Signed-off-by: Dann Frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet: thunderx: bgx: Add log message when setting mac address
Robert Richter [Thu, 11 Feb 2016 16:20:25 +0000 (21:50 +0530)]
net: thunderx: bgx: Add log message when setting mac address

Signed-off-by: Robert Richter <rrichter@cavium.com>
Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from linux-next commit 1d82efaca87ecf53e97c696f9d0a9adefea0c7b5)
Signed-off-by: Dann Frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet: thunderx: bgx: Use standard firmware node infrastructure.
David Daney [Thu, 11 Feb 2016 16:20:24 +0000 (21:50 +0530)]
net: thunderx: bgx: Use standard firmware node infrastructure.

In the case of OF device tree, the firmware information is attached to
the BGX device structure in the standard manner, so use the firmware
iterators and accessors where possible.

Signed-off-by: David Daney <david.daney@cavium.com>
Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from linux-next commit eee326fd83348ed39a06c0db999ed513d10d9c39)
Signed-off-by: Dann Frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet: thunderx: Assign affinity hints to vf's interrupts
Sunil Goutham [Thu, 11 Feb 2016 16:20:23 +0000 (21:50 +0530)]
net: thunderx: Assign affinity hints to vf's interrupts

This affinity hint can be used by user space irqbalance tool to set
preferred CPU mask for irqs registered by this VF. Irqbalance needs
to be in 'exact' mode to set irq affinity same as indicated by
affinity hint.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from linux-next commit fb4b7d98a0215fc3310c8415a86acfe726de395c)
Signed-off-by: Dann Frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet: thunderx: Use napi_schedule_irqoff()
Sunil Goutham [Thu, 11 Feb 2016 16:20:22 +0000 (21:50 +0530)]
net: thunderx: Use napi_schedule_irqoff()

napi_schedule is being called from hard irq context, hence
switch to napi_schedule_irqoff which avoids unneeded call
to local_irq_save and local_irq_restore.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from linux-next commit ef0a4d8601760b346d9d0893f2a554c338861c4f)
Signed-off-by: Dann Frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet, thunderx: Add TX timeout and RX buffer alloc failure stats.
Thanneeru Srinivasulu [Thu, 11 Feb 2016 16:20:21 +0000 (21:50 +0530)]
net, thunderx: Add TX timeout and RX buffer alloc failure stats.

When system is low on atomic memory, too many error messages are logged.
Since this is not a total failure but a simple switch to non-atomic allocation
better to have a stat.

Also add a stat for reset, kicked due to transmit watchdog timeout.

Signed-off-by: Thanneeru Srinivasulu <tsrinivasulu@caviumnetworks.com>
Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from linux-next commit a05d4845907a6f0296612d24956b189a51fb8df7)
Signed-off-by: Dann Frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoarm64: prefetch: add missing #include for spin_lock_prefetch
Will Deacon [Wed, 10 Feb 2016 10:07:30 +0000 (10:07 +0000)]
arm64: prefetch: add missing #include for spin_lock_prefetch

As of 52e662326e1e ("arm64: prefetch: don't provide spin_lock_prefetch
with LSE"), spin_lock_prefetch is patched at runtime when the LSE atomics
are in use. This relies on the ARM64_LSE_ATOMIC_INSN macro to drive
the alternatives framework, but that macro is only available via
asm/lse.h, which isn't explicitly included in processor.h. Consequently,
drivers can run into build failures such as:

   In file included from include/linux/prefetch.h:14:0,
                    from drivers/net/ethernet/intel/i40e/i40e_txrx.c:27:
   arch/arm64/include/asm/processor.h: In function 'spin_lock_prefetch':
   arch/arm64/include/asm/processor.h:183:15: error: expected string literal before 'ARM64_LSE_ATOMIC_INSN'
     asm volatile(ARM64_LSE_ATOMIC_INSN(

This patch add the missing include and gets things building again.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from linux-next commit afb83cc3f0e4f86ea0e1cc3db7a90f58f1abd4d5)
Signed-off-by: Dann Frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoarm64: lib: patch in prfm for copy_page if requested
Andrew Pinski [Tue, 2 Feb 2016 12:46:26 +0000 (12:46 +0000)]
arm64: lib: patch in prfm for copy_page if requested

On ThunderX T88 pass 1 and pass 2, there is no hardware prefetching so
we need to patch in explicit software prefetching instructions

Prefetching improves this code by 60% over the original code and 2x
over the code without prefetching for the affected hardware using the
benchmark code at https://github.com/apinski-cavium/copy_page_benchmark

Signed-off-by: Andrew Pinski <apinski@cavium.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Tested-by: Andrew Pinski <apinski@cavium.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from linux-next commit 60e0a09db24adc8809696307e5d97cc4ba7cb3e0)
Signed-off-by: Dann Frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoarm64: lib: improve copy_page to deal with 128 bytes at a time
Will Deacon [Tue, 2 Feb 2016 12:46:25 +0000 (12:46 +0000)]
arm64: lib: improve copy_page to deal with 128 bytes at a time

We want to avoid lots of different copy_page implementations, settling
for something that is "good enough" everywhere and hopefully easy to
understand and maintain whilst we're at it.

This patch reworks our copy_page implementation based on discussions
with Cavium on the list and benchmarking on Cortex-A processors so that:

  - The loop is unrolled to copy 128 bytes per iteration

  - The reads are offset so that we read from the next 128-byte block
    in the same iteration that we store the previous block

  - Explicit prefetch instructions are removed for now, since they hurt
    performance on CPUs with hardware prefetching

  - The loop exit condition is calculated at the start of the loop

Signed-off-by: Will Deacon <will.deacon@arm.com>
Tested-by: Andrew Pinski <apinski@cavium.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from linux-next commit 223e23e8aa26b0bb62c597637e77295e14f6a62c)
Signed-off-by: Dann Frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoarm64: prefetch: add alternative pattern for CPUs without a prefetcher
Will Deacon [Tue, 2 Feb 2016 12:46:24 +0000 (12:46 +0000)]
arm64: prefetch: add alternative pattern for CPUs without a prefetcher

Most CPUs have a hardware prefetcher which generally performs better
without explicit prefetch instructions issued by software, however
some CPUs (e.g. Cavium ThunderX) rely solely on explicit prefetch
instructions.

This patch adds an alternative pattern (ARM64_HAS_NO_HW_PREFETCH) to
allow our library code to make use of explicit prefetch instructions
during things like copy routines only when the CPU does not have the
capability to perform the prefetching itself.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Tested-by: Andrew Pinski <apinski@cavium.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from linux-next commit d5370f754875460662abe8561388e019d90dd0c4)
Signed-off-by: Dann Frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoarm64: prefetch: don't provide spin_lock_prefetch with LSE
Will Deacon [Tue, 2 Feb 2016 12:46:23 +0000 (12:46 +0000)]
arm64: prefetch: don't provide spin_lock_prefetch with LSE

The LSE atomics rely on us not dirtying data at L1 if we can avoid it,
otherwise many of the potential scalability benefits are lost.

This patch replaces spin_lock_prefetch with a nop when the LSE atomics
are in use, so that users don't shoot themselves in the foot by causing
needless coherence traffic at L1.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Tested-by: Andrew Pinski <apinski@cavium.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from linux-next commit cd5e10bdf3795d22f10787bb1991c43798c885d5)
Signed-off-by: Dann Frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoarm64: KVM: Configure TCR_EL2.PS at runtime
Tirumalesh Chalamarla [Wed, 10 Feb 2016 18:46:53 +0000 (10:46 -0800)]
arm64: KVM: Configure TCR_EL2.PS at runtime

Setting TCR_EL2.PS to 40 bits is wrong on systems with less that
less than 40 bits of physical addresses. and breaks KVM on systems
where the RAM is above 40 bits.

This patch uses ID_AA64MMFR0_EL1.PARange to set TCR_EL2.PS dynamically,
just like we already do for VTCR_EL2.PS.

[Marc: rewrote commit message, patch tidy up]

Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Tirumalesh Chalamarla <tchalamarla@caviumnetworks.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
(cherry picked from commit 3c5b1d92b3b02be07873d611a27950addff544d3)
[ dannf: backported to v4.4 ]
Signed-off-by: dann frazier <dann.frazier@canonical.com>
8 years agoirqchip/gic-v3: Make sure read from ICC_IAR1_EL1 is visible on redestributor
Tirumalesh Chalamarla [Thu, 4 Feb 2016 18:45:25 +0000 (10:45 -0800)]
irqchip/gic-v3: Make sure read from ICC_IAR1_EL1 is visible on redestributor

The ARM GICv3 specification mentions the need for dsb after a read
from the ICC_IAR1_EL1 register:

4.1.1 Physical CPU Interface:
The effects of reading ICC_IAR0_EL1 and ICC_IAR1_EL1
on the state of a returned INTID are not guaranteed
to be visible until after the execution of a DSB.

Not having this could result in missed interrupts, so let's add the
required barrier.

[Marc: fixed commit message]

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Tirumalesh Chalamarla <tchalamarla@caviumnetworks.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
(cherry picked from commit 1a1ebd5fb1e203ee8cc73508cc7a38ac4b804596)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet: cavium: liquidio: use helpers ns_to_timespec64()
Kefeng Wang [Wed, 27 Jan 2016 09:34:37 +0000 (17:34 +0800)]
net: cavium: liquidio: use helpers ns_to_timespec64()

Convert the driver to use ns_to_timespec64() to keep consistency
with timespec64_to_ns() instead of open coding the same logic.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 286af315d3f153595ce718fb1e442891f14ed5c0)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet: thunderx: Enable CQE count threshold interrupt
Sunil Goutham [Thu, 10 Dec 2015 07:55:20 +0000 (13:25 +0530)]
net: thunderx: Enable CQE count threshold interrupt

This feature is introduced in pass-2 chip and with this CQ interrupt
coalescing will work based on both timer and count.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b9687b48a63a12ea31442f64dc77d41e83d0e478)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet: thunderx: HW TSO support for pass-2 hardware
Sunil Goutham [Thu, 10 Dec 2015 07:55:19 +0000 (13:25 +0530)]
net: thunderx: HW TSO support for pass-2 hardware

This adds support for offloading TCP segmentation to HW in pass-2
revision of hardware. Both driver level SW TSO for pass1.x chips
and HW TSO for pass-2 chip will co-exist. Modified SQ descriptor
structures to reflect pass-2 hw implementation.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 40fb5f8a60f33133d36afde35a9ad865d35e4423)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet, thunderx: Remove unnecessary rcv buffer start address management
Sunil Goutham [Mon, 7 Dec 2015 05:00:33 +0000 (10:30 +0530)]
net, thunderx: Remove unnecessary rcv buffer start address management

Since we have moved on to using allocated pages to carve receive
buffers instead of netdev_alloc_skb() there is no need to store
any pointers for later retrieval. Earlier we had to store
skb and skb->data pointers which later are used to handover
received packet to network stack.

This will avoid an unnecessary cache miss as well.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 668dda06d48fc16a5b40e6a32057bd18589e3f95)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agonet: thunderx: nicvf_queues: nivc_*_intr: remove duplication
Yury Norov [Mon, 7 Dec 2015 05:00:32 +0000 (10:30 +0530)]
net: thunderx: nicvf_queues: nivc_*_intr: remove duplication

The same switch-case repeates for nivc_*_intr functions.
In this patch it is moved to a helper nicvf_int_type_to_mask().

By the way:
 - Unneeded write to NICVF register dropped if int_type is unknown.
 - netdev_dbg() is used instead of netdev_err().

Signed-off-by: Yury Norov <yury.norov@auriga.com>
Signed-off-by: Aleksey Makarov <aleksey.makarov@caviumnetworks.com>
Acked-by: Vadim Lomovtsev <Vadim.Lomovtsev@caiumnetworks.com>
Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b45ceb406e4fd3045180b8d70bff60b1d43c7ff4)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: rebase to v4.4.2
Tim Gardner [Wed, 17 Feb 2016 22:33:38 +0000 (15:33 -0700)]
UBUNTU: rebase to v4.4.2

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: (noup) cgroup: Add documentation for cgroup namespaces
Aditya Kali [Fri, 5 Dec 2014 01:03:47 +0000 (17:03 -0800)]
UBUNTU: SAUCE: (noup) cgroup: Add documentation for cgroup namespaces

BugLink: http://bugs.launchpad.net/bugs/1546775
Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: (noup) Add FS_USERNS_FLAG to cgroup fs
Serge Hallyn [Wed, 18 Nov 2015 16:56:45 +0000 (10:56 -0600)]
UBUNTU: SAUCE: (noup) Add FS_USERNS_FLAG to cgroup fs

BugLink: http://bugs.launchpad.net/bugs/1546775
allowing root in a non-init user namespace to mount it.  This should
now be safe, because

1. non-init-root cannot mount a previously unbound subsystem
2. the task doing the mount must be privileged with respect to the
   user namespace owning the cgroup namespace
3. the mounted subsystem will have its current cgroup as the root dentry.
   the permissions will be unchanged, so tasks will receive no new
   privilege over the cgroups which they did not have on the original
   mounts.

Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: (noup) cgroup: mount cgroupns-root when inside non-init cgroupns
Serge Hallyn [Tue, 8 Dec 2015 23:29:38 +0000 (17:29 -0600)]
UBUNTU: SAUCE: (noup) cgroup: mount cgroupns-root when inside non-init cgroupns

BugLink: http://bugs.launchpad.net/bugs/1546775
This patch enables cgroup mounting inside userns when a process
as appropriate privileges. The cgroup filesystem mounted is
rooted at the cgroupns-root. Thus, in a container-setup, only
the hierarchy under the cgroupns-root is exposed inside the container.
This allows container management tools to run inside the containers
without depending on any global state.

Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: (noup) kernfs: define kernfs_node_dentry
Aditya Kali [Mon, 13 Oct 2014 17:31:48 +0000 (10:31 -0700)]
UBUNTU: SAUCE: (noup) kernfs: define kernfs_node_dentry

BugLink: http://bugs.launchpad.net/bugs/1546775
Add a new kernfs api is added to lookup the dentry for a particular
kernfs path.

Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Serge E. Hallyn <serge.hallyn@canonical.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
8 years agoUBUNTU: SAUCE: (noup) cgroup: cgroup namespace setns support
Aditya Kali [Wed, 17 Sep 2014 22:16:31 +0000 (15:16 -0700)]
UBUNTU: SAUCE: (noup) cgroup: cgroup namespace setns support

BugLink: http://bugs.launchpad.net/bugs/1546775
setns on a cgroup namespace is allowed only if
task has CAP_SYS_ADMIN in its current user-namespace and
over the user-namespace associated with target cgroupns.
No implicit cgroup changes happen with attaching to another
cgroupns. It is expected that the somone moves the attaching
process under the target cgroupns-root.

Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Serge E. Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>