Thierry Reding [Wed, 2 Dec 2015 16:50:03 +0000 (17:50 +0100)]
drm: Implement drm_modeset_lock_all_ctx()
BugLink: http://bugs.launchpad.net/bugs/1540390
This function is like drm_modeset_lock_all(), but it takes the lock
acquisition context as a parameter rather than storing it in the DRM
device's mode_config structure.
Implement drm_modeset_{,un}lock_all() in terms of the new function for
better code reuse, and add a note to the kerneldoc that new code should
use the new functions.
v2: improve kerneldoc
v4: rename drm_modeset_lock_all_crtcs() to drm_modeset_lock_all_ctx()
and take mode_config's .connection_mutex instead of .mutex lock to
avoid lock inversion (Daniel Vetter), use drm_modeset_drop_locks()
which is now the equivalent of drm_modeset_unlock_all_ctx()
v5: do not take the dev->mode_config.connection_mutex in
drm_atomic_legacy_backoff() since drm_modeset_lock_all_ctx()
already keeps it, enhance kerneldoc for drm_modeset_lock_all_ctx()
(Daniel Vetter)
Jani Nikula [Tue, 24 Nov 2015 19:21:55 +0000 (21:21 +0200)]
drm: fix potential dangling else problems in for_each_ macros
BugLink: http://bugs.launchpad.net/bugs/1540390
We have serious dangling else bugs waiting to happen in our for_each_
style macros with ifs. Consider, for example,
if (condition)
drm_for_each_plane_mask(plane, dev, plane_mask);
else
foo();
foo() will be called for each plane *not* in plane_mask, if condition
holds, and not at all if condition doesn't hold.
Fix this by reversing the conditions in the macros, and adding an else
branch for the "for each" block, so that other if/else blocks can't
interfere. Provide a "for_each_if" helper macro to make it easier to get
this right.
Chris Wilson [Fri, 4 Dec 2015 15:58:53 +0000 (15:58 +0000)]
mm: Export nr_swap_pages
BugLink: http://bugs.launchpad.net/bugs/1540390
Some modules, like i915.ko, use swappable objects and may try to swap
them out under memory pressure (via the shrinker). Before doing so, they
want to check using get_nr_swap_pages() to see if any swap space is
available as otherwise they will waste time purging the object from the
device without recovering any memory for the system. This requires the
nr_swap_pages counter to be exported to the modules.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: "Goel, Akash" <akash.goel@intel.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: linux-mm@kvack.org Link: http://patchwork.freedesktop.org/patch/msgid/1449244734-25733-1-git-send-email-chris@chris-wilson.co.uk Acked-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from drm-intel-next commit fb0fec501f08a0a83af7a2b25888ec8cebab53b0) Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com> Signed-off-by: Andy Whitcroft <apw@canonical.com>
Deepak S [Wed, 28 Oct 2015 19:19:51 +0000 (12:19 -0700)]
drm/i915/kbl: Add Kabylake PCI ID
BugLink: http://bugs.launchpad.net/bugs/1540390
v2: separate out device info into different GT (Damien)
v3: Add is_kabylake to the KBL gt3 structuer (Damien)
Sort the platforms in older -> newer order (Damien)
v4: Split platform definition since is_skylake=1 on
kabylake structure was Nacked. (Rodrigo)
v5: (Rodrigo) Rebase after commit 3cb27f38f
("drm/i915: remove an extra level of indirection in PCI ID list")
Cc: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Deepak S <deepak.s@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1446059991-17033-1-git-send-email-rodrigo.vivi@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
(cherry picked from commit d97044b661d0d56b2a2ae9b2b95ab0b359b417dc) Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com> Signed-off-by: Andy Whitcroft <apw@canonical.com>
Jani Nikula [Wed, 28 Oct 2015 17:33:09 +0000 (19:33 +0200)]
drm/i915: remove an extra level of indirection in PCI ID list
BugLink: http://bugs.launchpad.net/bugs/1540390
Add the PCI IDs directly in the pciidlist array instead of defining an
extra macro. The minor benefit from this is neater diffs when adding to
the end of the list.
Timo Aaltonen [Mon, 22 Feb 2016 16:35:37 +0000 (18:35 +0200)]
UBUNTU: SAUCE: i915_bpo: Rename the backport driver to i915_bpo
BugLink: http://bugs.launchpad.net/bugs/1540390 Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com> Signed-off-by: Andy Whitcroft <apw@canonical.com>
BugLink: http://bugs.launchpad.net/bugs/1540390 Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com> Signed-off-by: Andy Whitcroft <apw@canonical.com>
Timo Aaltonen [Mon, 22 Feb 2016 16:34:58 +0000 (18:34 +0200)]
UBUNTU: SAUCE: i915_bpo: Provide a backport driver for SKL, KBL & BXT graphics
BugLink: http://bugs.launchpad.net/bugs/1540390
Provide an updated i915 driver in the ubuntu directory. In subsequent
patches we'll rename this driver to be i915_bpo and strictly limit it's
support to only Skylake, Kabylake and Broxton. Keeping the initial sync
a separate stand alone patch will allow us to easily update this driver
again later.
The driver is based on drm-intel-next-2016-02-14 tag.
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com> Signed-off-by: Andy Whitcroft <apw@canonical.com>
Marc Zyngier [Fri, 15 Jan 2016 17:41:09 +0000 (17:41 +0000)]
hrtimer: Catch illegal clockids
It is way too easy to take any random clockid and feed it to
the hrtimer subsystem. At best, it gets mapped to a monotonic
base, but it would be better to just catch illegal values as
early as possible.
This patch does exactly that, mapping illegal clockids to an
illegal base index, and panicing when we detect the illegal
condition.
Marc Zyngier [Fri, 15 Jan 2016 17:41:08 +0000 (17:41 +0000)]
hrtimer: Add support for CLOCK_MONOTONIC_RAW
The KVM/ARM timer implementation arms a hrtimer when a vcpu is
blocked (usually because it is waiting for an interrupt)
while its timer is going to kick in the future.
It is essential that this timer doesn't get adjusted, or the
guest will end up being woken-up at the wrong time (NTP running
on the host seems to confuse the hell out of some guests).
In order to allow this, let's add CLOCK_MONOTONIC_RAW support
to hrtimer (it is so far only supported for posix timers). It also
has the (limited) benefit of fixing de0421d53bfb ("mac80211_hwsim:
shuffle code to prepare for dynamic radios"), which already uses
this functionnality without realizing wasn't implemented (just being
lucky...).
Paolo Pisati [Mon, 22 Feb 2016 15:02:00 +0000 (16:02 +0100)]
UBUNTU SAUCE: arm: mm: avoid calling apply_to_page_range on empty range
Calling apply_to_page_range with an empty range results in a BUG_ON
from the core code. This can be triggered by trying to load the st_drv
module with CONFIG_DEBUG_SET_MODULE_RONX enabled:
kernel BUG at mm/memory.c:1874!
Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
Modules linked in:
CPU: 3 PID: 1764 Comm: insmod Not tainted 4.5.0-rc1+ #2
Hardware name: ARM Juno development board (r0) (DT)
task: ffffffc9763b8000 ti: ffffffc975af8000 task.ti: ffffffc975af8000
PC is at apply_to_page_range+0x2cc/0x2d0
LR is at change_memory_common+0x80/0x108
This patch fixes the issue by making change_memory_common (called by the
set_memory_* functions) a NOP when numpages == 0, therefore avoiding the
erroneous call to apply_to_page_range and bringing us into line with x86
and s390.
Cc: <stable@vger.kernel.org> Reviewed-by: Laura Abbott <labbott@redhat.com> Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Mika Penttilä <mika.penttila@nextfour.com> BugLink: http://bugs.launchpad.net/bugs/1547718 Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com> Acked-by: Brad Figg <brad.figg@canonical.com> Acked-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Andy Whitcroft <apw@canonical.com>
Seth Forshee [Thu, 21 Jan 2016 21:37:53 +0000 (15:37 -0600)]
UBUNTU: SAUCE: overlayfs: Propogate nosuid from lower and upper mounts
An overlayfs mount using an upper or lower directory from a
nosuid filesystem bypasses this restriction. Change this so
that if any lower or upper directory is nosuid at mount time the
overlayfs superblock is marked nosuid. This requires some
additions at the vfs level since nosuid currently only applies to
mounts, so a SB_I_NOSUID flag is added along with a helper
function to check a path for nosuid in both the mount and the
superblock.
Seth Forshee [Thu, 21 Jan 2016 17:52:04 +0000 (11:52 -0600)]
UBUNTU: SAUCE: overlayfs: Be more careful about copying up sxid files
When an overlayfs filesystem's lowerdir is on a nosuid filesystem
but the upperdir is not, it's possible to copy up an sxid file or
stick directory into upperdir without changing the mode by
opening the file rw in the overlayfs mount without writing to it.
This makes it possible to bypass the nosuid restriction on the
lowerdir mount.
It's a bad idea in general to let the mounter copy up a sxid file
if the mounter wouldn't have had permission to create the sxid
file in the first place. Therefore change ovl_set_xattr to
exclude these bits when initially setting the mode, then set the
full mode after setting the user for the inode. This allows copy
up for non-sxid files to work as before but causes copy up to
fail for the cases where the user could not have created the sxid
inode in upperdir.
Seth Forshee [Tue, 19 Jan 2016 19:12:02 +0000 (13:12 -0600)]
UBUNTU: SAUCE: overlayfs: Skip permission checking for trusted.overlayfs.* xattrs
The original mounter had CAP_SYS_ADMIN in the user namespace
where the mount happened, and the vfs has validated that the user
has permission to do the requested operation. This is sufficient
for allowing the kernel to write these specific xattrs, so bypass
the permission checks for these xattrs.
Seth Forshee [Tue, 19 Jan 2016 16:25:24 +0000 (10:25 -0600)]
UBUNTU: SAUCE: overlayfs: Use mounter's credentials instead of selectively raising caps
When overlayfs needs to perform internal operations which require
privileges the current user may not have, it does so by
selectively raising the required capabilities in the current set
of credentials. If the current process is in a user namespace
this doesn't always work, as operations such as setting
privileged xattrs often requires privileges in init_user_ns.
These operations really ought to be permitted, based on a couple
of facts:
1. The vfs has already verified that the current process is
allowed to perform the requested operation on the overlayfs
super block, and overlayfs has verified that the operation is
permitted in upperdir.
2. The original mounter of the overlayfs super block was
privileged enough to perform the internal overlayfs
operations required to satisfy the user's request in
upperdir.
On the other hand, if the filesystem is mounted from a user
namespace and then accessed in init_user_ns the credentials taken
will exceed those of the mounter. This could result in performing
operations that the user could not do otherwise, such as creating
files which are sxid for another user or group. Both of these
issues can be prevented by using the mounter's credentials when
performing privileged overlayfs-internal operations.
Add a new internal interface, ovl_prepare_creds(), which returns
a new set of credentials for performing privileged internal
operations that is identical to the mounter's creds. Use this
internal interface instead of using prepare_creds() and
selectively raising the needed capabilities.
Seth Forshee [Tue, 19 Jan 2016 16:20:43 +0000 (10:20 -0600)]
UBUNTU: SAUCE: cred: Add clone_cred() interface
This interface returns a new set of credentials which is an exact
copy of another set. Also update prepare_kernel_cred() to use
this function instead of duplicating code.
Mitch Williams [Thu, 18 Feb 2016 00:12:23 +0000 (16:12 -0800)]
i40e: let go of the past
BugLink: http://bugs.launchpad.net/bugs/1547674
If we reset a VF, its VSI goes away, and it gets a new one. So don't
hang on to the now-stale local VSI pointer. It just leads to suffering
and kernel panics.
Change-ID: Ia8823b4e85893e95e963acee284968022b29177a 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 35f3472a750b3549f7f914ed96f41f0c2ca284f3) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
BugLink: http://bugs.launchpad.net/bugs/1547674
We need to suspend scheduling or any pending service task during driver
unload process, so that new task will not be scheduled. This patch sets
the suspend flag bit during reload which avoids service task execution.
Change-ID: I017c57b5d6656564556e3c5387da671369a572ac 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 a4618ec88de95a86f290d01c74c506552f1a5d95) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Shannon Nelson [Thu, 18 Feb 2016 00:12:21 +0000 (16:12 -0800)]
i40e: Use the new rx ctl register helpers. Don't use AQ calls from clear_hw.
BugLink: http://bugs.launchpad.net/bugs/1547674
Use the new AdminQ functions for safely accessing the Rx control
registers that may be affected by heavy small packet traffic.
We can't use AdminQ calls in i40e_clear_hw() because the HW is being
initialized and the AdminQ is not alive. We recently added an AQ
related replacement for reading PFLAN_QALLOC, and this patch puts
back the original register read.
Change-ID: Ib027168c954a5733299aa3a4ce5f8218c6bb5636 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 272cdaf2472ab7713deebe060bb90319b0382a94) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Shannon Nelson [Thu, 18 Feb 2016 00:12:20 +0000 (16:12 -0800)]
i40e: implement and use Rx CTL helper functions
BugLink: http://bugs.launchpad.net/bugs/1547674
Use the new AdminQ functions for safely accessing the Rx control
registers that may be affected by heavy small packet traffic.
Change-ID: Ibb00983e8dcba71f4b760222a609a5fcaa726f18 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 f658137cbb1fddbe40ec7f1a2cebaf9dc9484ea7) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Shannon Nelson [Thu, 18 Feb 2016 00:12:19 +0000 (16:12 -0800)]
i40e: add adminq commands for Rx CTL registers
BugLink: http://bugs.launchpad.net/bugs/1547674
Add the new opcodes and struct used for asking the firmware to update Rx
control registers that need extra care when being accessed while under
heavy traffic - e.g. sustained 64byte packets at line rate on all ports.
The firmware will take extra steps to be sure the register accesses
are successful.
Change-ID: I56c8144000da66ad99f68948d8a184b2ec2aeb3e 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 3336514381f9ef99c50e5337ae1bf36f8138679d) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
John Underwood [Thu, 18 Feb 2016 17:19:24 +0000 (09:19 -0800)]
i40e: add check for null VSI
BugLink: http://bugs.launchpad.net/bugs/1547674
Return from i40e_vsi_reinit_setup() if vsi param is NULL.
This makes this code consistent with all the other code that
checks for NULL before using one of the VSI pointers accessed
with an indexed variable. (Indexed VSI pointers are
intentionally set to NULL in i40e_vsi_clear() and
i40e_remove().
Change-ID: I3bc8b909c70fd2439334eeae994d151f61480985 Signed-off-by: John Underwood <johnx.underwood@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 f534039dd8ab39cb3259e5860d2be3b0e70aacbf) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
i40e: Expose some registers to program parser, FD and RSS logic
BugLink: http://bugs.launchpad.net/bugs/1547674
This patch adds 7 new register definitions for programming the
parser, flow director and RSS blocks in the HW.
Change-ID: I31e76673125275f3c69a14c646361919d04dc987 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 fe726082728da9f653d4e747baf0816d826fc626) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Carolyn Wyborny [Thu, 18 Feb 2016 00:12:16 +0000 (16:12 -0800)]
i40e: Fix for unexpected messaging
BugLink: http://bugs.launchpad.net/bugs/1547674
This fixes an issue where a previously removed message
has returned. Changing the message type to dev_dbg
leaves the info, if desired, but takes it out of normal
everyday usage. Also changed call to only provide port
data when its valid and not when its not (delete case).
Change-ID: Ief6f33b915f6364c24fa8e5789c2fc3168b5e2ed Signed-off-by: Carolyn Wyborny <carolyn.wyborny@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 730a8f8777e55912f445c2c29234d51cceb1dfc2) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Neerav Parikh [Thu, 18 Feb 2016 00:12:15 +0000 (16:12 -0800)]
i40e: Do not wait for Rx queue disable in DCB reconfig
BugLink: http://bugs.launchpad.net/bugs/1547674
Just like Tx queues don't wait for Rx queues to be disabled before
DCB has been reconfigured.
Check the queues are disabled only after the DCB configuration has
been applied to the VSI(s) managed by the PF driver.
In case of any timeout issue a PF reset to recover.
Change-ID: Ic51e94c25baf9a5480cee983f35d15575a88642c Signed-off-by: Neerav Parikh <neerav.parikh@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 3fe06f415b31ad06d2c2923216292057e899eb0d) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Kevin Scott [Thu, 18 Feb 2016 00:12:13 +0000 (16:12 -0800)]
i40e: Increase timeout when checking GLGEN_RSTAT_DEVSTATE bit
BugLink: http://bugs.launchpad.net/bugs/1547674
When linking with particular PHY types (ex: copper PHY), the amount of
time it takes for the GLGEN_RSTAT_DEVSTATE to be set increases greatly,
which can lead to a timeout and failure to load the driver.
Change-ID: If02be0dfcd7c57fdde2d5c81cd63651260cd2029 Signed-off-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 4d7cec078de864b7ba5459aa688278c4e6f3ad42) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Carolyn Wyborny [Thu, 18 Feb 2016 00:12:12 +0000 (16:12 -0800)]
i40e: Fix led blink capability for 10GBaseT PHY
BugLink: http://bugs.launchpad.net/bugs/1547674
This patch fixes a problem where the ethtool identify adapter
functionality did not work for some copper PHY's. Without this
patch, the blink led functionality fails on some parts. This
patch adds PHY write code to blink led's on parts where this
functionality is contained in the PHY rather than the MAC.
Change-ID: Iee7b3453f61d5ffd0b3d03f720ee4f17f919fcc2 Signed-off-by: Carolyn Wyborny <carolyn.wyborny@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 31b606d0c40a1435c54bff18e4d3d3c33af1c3cf) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Carolyn Wyborny [Thu, 18 Feb 2016 00:12:11 +0000 (16:12 -0800)]
i40e: Add functions to blink led on 10GBaseT PHY
BugLink: http://bugs.launchpad.net/bugs/1547674
This patch adds functions to blink led on devices using
10GBaseT PHY since MAC registers used in other designs
do not work in this device configuration.
Change-ID: Id4b88c93c649fd2b88073a00b42867a77c761ca3 Signed-off-by: Carolyn Wyborny <carolyn.wyborny@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 fd077cd3399b164548f538625f07f3e9f1d7ef00) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Alexander Duyck [Wed, 17 Feb 2016 19:02:56 +0000 (11:02 -0800)]
i40e/i40evf: Move Tx checksum closer to TSO
BugLink: http://bugs.launchpad.net/bugs/1547674
On all of the other Intel drivers we place checksum close to TSO as they
have a significant amount in common and it can help to reduce the decision
tree for how to handle the frame as the first check in TSO is to see if
checksumming is offloaded, and if it is not we can skip _BOTH_ TSO and Tx
checksum offload based on a single check.
Signed-off-by: Alexander Duyck <aduyck@mirantis.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 3bc67973e81d5104908a4ba7c2aab98a4f7bd64e) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Alexander Duyck [Wed, 17 Feb 2016 19:02:50 +0000 (11:02 -0800)]
i40e/i40evf: Rewrite logic for 8 descriptor per packet check
BugLink: http://bugs.launchpad.net/bugs/1547674
This patch is meant to rewrite the logic for how we determine if we can
transmit the frame or if it needs to be linearized.
The previous code for this function was using a mix of division and modulus
division as a part of computing if we need to take the slow path. Instead
I have replaced this by simply working with a sliding window which will
tell us if the frame would be capable of causing a single packet to span
several descriptors.
The logic for the scan is fairly simple. If any given group of 6 fragments
is less than gso_size - 1 then it is possible for us to have one byte
coming out of the first fragment, 6 fragments, and one or more bytes coming
out of the last fragment. This gives us a total of 8 fragments
which exceeds what we can allow so we send such frames to be linearized.
Arguably the use of modulus might be more exact as the approach I propose
may generate some false positives. However the likelihood of us taking much
of a hit for those false positives is fairly low, and I would rather not
add more overhead in the case where we are receiving a frame composed of 4K
pages.
Signed-off-by: Alexander Duyck <aduyck@mirantis.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 2d37490b82afe1d1b745811e6ce0a4d16bc5e996) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Alexander Duyck [Wed, 17 Feb 2016 19:02:43 +0000 (11:02 -0800)]
i40e/i40evf: Break up xmit_descriptor_count from maybe_stop_tx
BugLink: http://bugs.launchpad.net/bugs/1547674
In an upcoming patch I would like to have access to the descriptor count
used for the data portion of the frame. For this reason I am splitting up
the descriptor count function from the function that stops the ring.
Also in order to try and reduce unnecessary duplication of code I am moving
the slow-path portions of the code out of being inline calls so that we can
just jump to them and process them instead of having to build them into
each function that calls them.
Signed-off-by: Alexander Duyck <aduyck@mirantis.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 4ec441df25a686518fb369086e2b34a1cedaa6c9) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Alexander Duyck [Tue, 26 Jan 2016 03:32:54 +0000 (19:32 -0800)]
i40e: Add support for ATR w/ IPv6 extension headers
BugLink: http://bugs.launchpad.net/bugs/1547674
This patch updates the code for determining the L4 protocol and L3 header
length so that when IPv6 extension headers are being used we can determine
the offset and type of the L4 protocol.
Signed-off-by: Alexander Duyck <aduyck@mirantis.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 ffcc55c0c2a85835a4ac080bc1053c3a277b88e2) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Alexander Duyck [Mon, 25 Jan 2016 05:17:57 +0000 (21:17 -0800)]
i40evf: Update feature flags to reflect newly enabled features
BugLink: http://bugs.launchpad.net/bugs/1547674
Recent changes should have enabled support for IPv6 based tunnels and
support for TSO with outer UDP checksums. As such we can update the
feature flags to reflect that.
In addition we can clean-up the flags that aren't needed such as SCTP and
RXCSUM since having the bits there doesn't add any value.
I also found one spot where we were setting the same flag twice. It looks
like it was probably a git merge error that resulted in the line being
duplicated. As such I have dropped it in this patch.
Signed-off-by: Alexander Duyck <aduyck@mirantis.com> Acked-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 f608e6a60fc85e4f261daab5e7aac6225e2120d6) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Alexander Duyck [Mon, 25 Jan 2016 05:17:50 +0000 (21:17 -0800)]
i40e: Update feature flags to reflect newly enabled features
BugLink: http://bugs.launchpad.net/bugs/1547674
Recent changes should have enabled support for IPv6 based tunnels and
support for TSO with outer UDP checksums. As such we can update the
feature flags to reflect that.
In addition we can clean-up the flags that aren't needed such as SCTP and
RXCSUM since having the bits there doesn't add any value.
Signed-off-by: Alexander Duyck <aduyck@mirantis.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 bc5d252b363cca63b7ddc1e20dd8b8b242631006) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Alexander Duyck [Mon, 25 Jan 2016 05:17:43 +0000 (21:17 -0800)]
i40e: Do not drop support for IPv6 VXLAN or GENEVE tunnels
BugLink: http://bugs.launchpad.net/bugs/1547674
All of the documentation in the datasheets for the XL710 do not call out
any reason to exclude support for IPv6 based tunnels. As such I am
dropping the code that was excluding these tunnel types from having their
port numbers recognized. This way we can take advantage of things such as
checksum offload for inner headers over IPv6 based VXLAN or GENEVE
tunnels.
Signed-off-by: Alexander Duyck <aduyck@mirantis.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 84d5946d49cf9552d0f1740ad62d0f126cb3b6a9) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Alexander Duyck [Mon, 25 Jan 2016 05:17:36 +0000 (21:17 -0800)]
i40e: Fix ATR in relation to tunnels
BugLink: http://bugs.launchpad.net/bugs/1547674
This patch contains a number of fixes to make certain that we are using
the correct protocols when parsing both the inner and outer headers of a
frame that is mixed between IPv4 and IPv6 for inner and outer.
Signed-off-by: Alexander Duyck <aduyck@mirantis.com> Acked-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 6b037cd465ff6e5f6b96524658f47d59d1acc554) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Alexander Duyck [Mon, 25 Jan 2016 05:17:29 +0000 (21:17 -0800)]
i40e/i40evf: Enable support for SKB_GSO_UDP_TUNNEL_CSUM
BugLink: http://bugs.launchpad.net/bugs/1547674
The XL722 has support for providing the outer UDP tunnel checksum on
transmits. Make use of this feature to support segmenting UDP tunnels with
outer checksums enabled.
Signed-off-by: Alexander Duyck <aduyck@mirantis.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 5453205cd0975b845f6f8837f0c2b7c8cb80fcf8) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Alexander Duyck [Mon, 25 Jan 2016 05:17:22 +0000 (21:17 -0800)]
i40e/i40evf: Clean-up Rx packet checksum handling
BugLink: http://bugs.launchpad.net/bugs/1547674
This is mostly a minor clean-up for the Rx checksum path in order to avoid
some of the unnecessary conditional checks that were being applied.
Signed-off-by: Alexander Duyck <aduyck@mirantis.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 fad57330b6d0710fdf39dc1c2b28ccebb97ae8a1) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Alexander Duyck [Mon, 25 Jan 2016 05:17:10 +0000 (21:17 -0800)]
i40e/i40evf: Add exception handling for Tx checksum
BugLink: http://bugs.launchpad.net/bugs/1547674
Add exception handling to the Tx checksum path so that we can handle cases
of TSO where the frame is bad, or Tx checksum where we didn't recognize a
protocol
Drop I40E_TX_FLAGS_CSUM as it is unused, move the CHECKSUM_PARTIAL check
into the function itself so that we can decrease indent.
Signed-off-by: Alexander Duyck <aduyck@mirantis.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 529f1f652e3c3c6db6ab5a6e3a35469ddfd9575d) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Alexander Duyck [Mon, 25 Jan 2016 05:17:01 +0000 (21:17 -0800)]
i40e/i40evf: Do not write to descriptor unless we complete
BugLink: http://bugs.launchpad.net/bugs/1547674
This patch defers writing to the Tx descriptor bits until we know we have
successfully completed a given operation. So for example we defer updating
the tunnelling portion of the context descriptor until we have fully
identified the type.
The advantage to this approach is that we can assemble values as we go
instead of having to try and kludge everything together all at once. As a
result we can significantly clean up the tunneling configuration for
instance as we can just do a pointer walk and do the math for the distance
between each set of points.
Signed-off-by: Alexander Duyck <aduyck@mirantis.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 475b4205aa52c16feef08d55c8fd76e815b6bee7) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Alexander Duyck [Mon, 25 Jan 2016 05:16:54 +0000 (21:16 -0800)]
i40e/i40evf: Handle IPv6 extension headers in checksum offload
BugLink: http://bugs.launchpad.net/bugs/1547674
This patch adds support for IPv6 extension headers in setting up the Tx
checksum. Without this patch extension headers would cause IPv6 traffic to
fail as the transport protocol could not be identified.
Signed-off-by: Alexander Duyck <aduyck@mirantis.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 a3fd9d8876a589f05725237aced606b995956860) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Alexander Duyck [Mon, 25 Jan 2016 05:16:48 +0000 (21:16 -0800)]
i40e/i40evf: Add support for IPv4 encapsulated in IPv6
BugLink: http://bugs.launchpad.net/bugs/1547674
This patch fixes two issues. First was the fact that iphdr(skb)->protocl
was being used to test for the outer transport protocol. This completely
breaks IPv6 support. Second was the fact that we cleared the flag for v4
going to v6, but we didn't take care of txflags going the other way. As
such we would have the v6 flag still set even if the inner header was v4.
Signed-off-by: Alexander Duyck <aduyck@mirantis.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 a0064728f8a34f7a5afd9df86d9cdd8210977c8d) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Alexander Duyck [Mon, 25 Jan 2016 05:16:42 +0000 (21:16 -0800)]
i40e/i40evf: Replace header pointers with unions of pointers in Tx checksum path
BugLink: http://bugs.launchpad.net/bugs/1547674
The Tx checksum path was maintaining a set of 3 pointers and two lengths in
order to prepare the packet for being checksummed. The thing is we only
really needed 2 pointers, and the lengths that were being maintained can
easily be computed.
As such we can replace the IPv4 and IPv6 header pointers with one single
union that represents both, or a generic pointer to the start of the
network header. For the L4 headers we can do the same with TCP and a
generic pointer to the start of the transport header. The length of the
TCP header is obtained by simply multiplying doff by 4, and the network
header length can be obtained by subtracting the network header pointer
from the transport header pointer.
While I was at it I renamed l4_hdr to l4_proto to make it a bit more clear
and less likely to be confused with l4.hdr which is the transport header
pointer.
Signed-off-by: Alexander Duyck <aduyck@mirantis.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 b96b78f2b789ab8398e7ec0111bb8b4588ed42bf) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Alexander Duyck [Mon, 25 Jan 2016 05:16:35 +0000 (21:16 -0800)]
i40e/i40evf: Consolidate all header changes into TSO function
BugLink: http://bugs.launchpad.net/bugs/1547674
This patch goes through and pulls all of the spots where we were updating
either the TCP or IP checksums in the TSO and checksum path into the TSO
function. The general idea here is that we should only be updating the
header after we verify we have completed a skb_cow_head check to verify the
head is writable.
One other advantage to doing this is that it makes things much more
obvious. For example, in the case of IPv6 there was one spot where the
offset of the IPv4 header checksum was being updated which is obviously
incorrect.
Signed-off-by: Alexander Duyck <aduyck@mirantis.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 c777019af1dc7343be8dc44bb4d32f5e2ef072dd) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Alexander Duyck [Mon, 25 Jan 2016 05:16:28 +0000 (21:16 -0800)]
i40e/i40evf: Factor out L4 header and checksum from L3 bits in TSO path
BugLink: http://bugs.launchpad.net/bugs/1547674
This patch makes it so that the L4 header offsets and such can be ignored
when dealing with the L3 checksum and length update. This is done making
use of two things.
First we can just use the offset from the L4 header to the start of the
packet to determine the L4 offset, and from that we can then make use of
the data offset to determine the full length of the headers.
As far as adjusting the checksum to remove the length we can simply add the
inverse of the length instead of having to recompute the entire
pseudo-header without the length. In the case of an IPv6 header this
should be significantly cheaper since we can make use of a value we already
needed instead of having to read the source and destination address out of
the packet.
Signed-off-by: Alexander Duyck <aduyck@mirantis.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 c49a7bc3308099a8d5f9e2e38adfc5ab969804aa) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Alexander Duyck [Mon, 25 Jan 2016 05:16:20 +0000 (21:16 -0800)]
i40e/i40evf: Use u64 values instead of casting them in TSO function
BugLink: http://bugs.launchpad.net/bugs/1547674
Instead of casing u32 values to u64 it makes more sense to just start out
with u64 values in the first place. This way we don't need to create a
mess with all of the casts needed to populate a 64b value.
Signed-off-by: Alexander Duyck <aduyck@mirantis.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 03f9d6a59f94f70ae775ca2aae04f2accc01a973) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Alexander Duyck [Mon, 25 Jan 2016 05:16:13 +0000 (21:16 -0800)]
i40e/i40evf: Drop outer checksum offload that was not requested
BugLink: http://bugs.launchpad.net/bugs/1547674
The i40e and i40evf drivers contained code for inserting an outer checksum
on UDP tunnels. The issue however is that the upper levels of the stack
never requested such an offload and it results in possible errors.
In addition the same logic was being applied to the Rx side where it was
attempting to validate the outer checksum, but the logic there was
incorrect in that it was testing for the resultant sum to be equal to the
header checksum instead of being equal to 0.
Since this code is so massively flawed, and doing things that we didn't ask
for it to do I am just dropping it, and will bring it back later to use as
an offload for SKB_GSO_UDP_TUNNEL_CSUM which can make use of such a
feature.
As far as the Rx feature I am dropping it completely since it would need to
be massively expanded and applied to IPv4 and IPv6 checksums for all parts,
not just the one that supports Tx checksum offload for the outer.
Signed-off-by: Alexander Duyck <aduyck@mirantis.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 a9c9a81f5892eb984234223399ee624f7dbd15e8) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
i40e: When in promisc mode apply promisc mode to Tx Traffic as well
BugLink: http://bugs.launchpad.net/bugs/1547674
In MFP mode particularly when we were setting the PF VSI in limited
promiscuous, the HW switch was still mirroring the outgoing packets
from other VSIs (VF/VMdq) onto the PF VSI.
With this new bit set, the mirroring doesn't happen any more and so
we are in limited promiscuous on the PF VSI in MFP which is similar
to defport.
An API check is not required, since this bit is reserved for FW API
version < 1.5
Also update copyright year in file headers.
Change-ID: I9840cb95f11dde733d943cb03ce84f68b9611bc8 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 3b1200891b7f41e5725d8659b6f87e1d2060272c) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Shannon Nelson [Fri, 15 Jan 2016 22:33:20 +0000 (14:33 -0800)]
i40e: clean event descriptor before use
BugLink: http://bugs.launchpad.net/bugs/1547674
In one obscure corner case, it was possible to clear the NVM update wait
flag when no update_done message was actually received. This patch
cleans the event descriptor before use, and moves the opcode check to
where it won't get done if there was no event to clean.
Also update copyright year in file headers.
Change-ID: I68bbc41965e93f4adf07cbe98b9dfd63d41509a4 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 73b03f9848aa7556c8a10fd6ad4e64254e493445) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Mitch Williams [Fri, 15 Jan 2016 22:33:19 +0000 (14:33 -0800)]
i40evf: set adapter state on reset failure
BugLink: http://bugs.launchpad.net/bugs/1547674
If a reset fails to complete, the driver gets its affairs in order and
awaits the cold solace of rmmod. Unfortunately, it was not properly
setting the adapter state, which would cause a panic on rmmod, instead
of the desired surcease.
Set the adapter state to DOWN in this case, and avoid a panic.
Change-ID: I6fdd9906da52e023f8dc744f7da44b5d95278ca9 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 9b9344f7ce19c5c481f203a0af3e120b965afcd9) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Change-ID: I23f6c28a8d96d7aa171abcc265737cec7826c292 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 6e93d0c90fb2e20fc5b9dbdf28b45e91a16b4353) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Mitch Williams [Fri, 15 Jan 2016 22:33:17 +0000 (14:33 -0800)]
i40e: expand comment
BugLink: http://bugs.launchpad.net/bugs/1547674
Explain why we cannot remove this code, even though it works differently
than any of our other interrupt cause handling code.
Change-ID: Ie66203bd037a466066036611c31d44f759ec5176 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 0d79032781caf8573d141259bd5008516439d634) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
i40e: Do not disable queues in the Legacy/MSI Interrupt handler
BugLink: http://bugs.launchpad.net/bugs/1547674
The queues should never be enabled/disabled in the interrupt handler,
ICR0 interrupt enable should be the only thing that needs to be
dynamically changed in the handler.
This patch fixes that. Without this patch X722 platforms were
seeing weird ping timings when in Legacy mode since it takes
a whole lot of time for the HW/FW to re-enable queues.
Change-ID: If065afc45d81c5a19d4a94a00cd5b8f61cefc40c 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 a16ae2d59c290b0c545edb9bf41ac9cf88352ee0) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Mitch Williams [Fri, 15 Jan 2016 22:33:15 +0000 (14:33 -0800)]
i40e/i40evf: avoid atomics
BugLink: http://bugs.launchpad.net/bugs/1547674
In the case where we have a page fully used by receive data, we need to
release the page fully to the stack. Instead of calling get_page (which
increments the page count) followed by free_page (which decrements the
page count), just donate our reference to the stack. Although this
donation is not tax deductible, it does allow us to avoid two very
expensive atomic operations that reverse each other.
Change-ID: If70739792d5748995fc175ec92ac2171ed4ad8fc 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 16fd08b85962f6288fe1191856aa98cb0d40aa30) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Kiran Patil [Fri, 15 Jan 2016 22:33:14 +0000 (14:33 -0800)]
i40e: Removal of code which relies on BASE VEB SEID
BugLink: http://bugs.launchpad.net/bugs/1547674
Fixed mapping of SEID is removed from specification. Hence
this patch removes code which was using hard coded base VEB SEID.
Changed FCoE code to use "hw->pf_id" to obtain correct "idx"
and verified.
Removed defines for BASE VSI/VEB SEID and BASE_PF_SEID since it
is not used anymore.
Change-ID: Id507cf4b1fae1c0145e3f08ae9ea5846ea5840de 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 4147e2c5eec037dc51e4767b0ed42b32c6fecf9d) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
i40e: Fix PROMISC mode for Multi-function per port (MFP) devices
BugLink: http://bugs.launchpad.net/bugs/1547674
This patch falls back to enabling unicast, multicast and
broadcast promiscuous mode when the driver must disable it's use
of "default port" aka defport mode (which is normally used to
provide a promiscuous mode), due to internal incompatibility
with Multiple Function per Port (aka MFP).
The situation that requires this patch is when Physical
Function 0 is the device being used, and it can support SR-IOV
when MFP is enabled, via the driver creating a VEB on an MFP
enabled adapter.
Change-ID: Ie90b00d0d58782a5dfcf2c3c9725a2eb90bd63d8 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 6784ed5a7385f15bc34903abffaca3db0f4e0438) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
BugLink: http://bugs.launchpad.net/bugs/1547674
This patch adds a workaround for cases where we might have
interrupts that got lost but WB happened.
If that happens without this patch we will see a tx_timeout.
To work around it, this patch goes ahead and reschedules NAPI
in that situation, if NAPI is not already scheduled.
We also add a counter in ethtool to keep track of when
we detect a case of tx_lost_interrupt.
Note: napi_reschedule() can be safely called from process/service_task
context and is done in other drivers as well without an issue.
Change-ID: I00f98f1ce3774524d9421227652bef20fcbd0d20 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 dd353109e41c1e92e0cea9954404a6f5a7d46218) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Mitch Williams [Fri, 15 Jan 2016 22:33:10 +0000 (14:33 -0800)]
i40evf: support packet split receive
BugLink: http://bugs.launchpad.net/bugs/1547674
Support packet split receive on VFs. This is off by default but can be
enabled using ethtool private flags. Because we need to trigger a reset
from outside of i40evf_main.c, create a new function to do so, and
export it.
Also update copyright year in file headers.
Change-ID: I721aa5d70113d3d6d94102e5f31526f6fc57cbbb 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 00e5ec4bcc4aa3d4663502b5377e17ea43e058d6) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Change-ID: Ic0e3ea4f562e46de63b2a8de07f291ccc10205fd 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 d6b3bca11947888bc79e343be931b502040ab6a9) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
John Fastabend [Wed, 17 Feb 2016 22:35:23 +0000 (14:35 -0800)]
ixgbe: fix dates on header of ixgbe_model.h
BugLink: http://bugs.launchpad.net/bugs/1547674 Fixes: 9d35cf062e05 ("net: ixgbe: add minimal parser details for ixgbe") Reported-by: Mark Rustad <mark.d.rustad@intel.com> Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from net-next commit a92265ce1cea3832a47103ae16afa328a396e9af) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Fixes: 9d35cf062e05 ("net: ixgbe: add minimal parser details for ixgbe") Suggested-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from net-next commit fa477f4cb3de7bdd3899029803ebfcf269ba8c85) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Mitch Williams [Thu, 14 Jan 2016 00:51:51 +0000 (16:51 -0800)]
i40e: properly show packet split status in debugfs
BugLink: http://bugs.launchpad.net/bugs/1547674
Get rid of the unused hsplit field in the ring struct and use the
existing macro to detect packet split enablement. This allows debugfs
dumps of the VSI to properly show which Rx routine is in use.
Change-ID: Ic4e9589e6a788ab196ed0850703f704e30c03781 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 4668607aa30b3879312823a0ddbcd15077644f4e) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Mitch Williams [Thu, 14 Jan 2016 00:51:50 +0000 (16:51 -0800)]
i40e/i40evf: use logical operators, not bitwise
BugLink: http://bugs.launchpad.net/bugs/1547674
Mr. Spock would certainly raise an eyebrow to see us using bitwise
operators, when we should clearly be relying on logic. Fascinating.
Change-ID: Ie338010c016f93e9faa2002c07c90b15134b7477 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 1a36d7fadd1477761dc8b4fc8910d1defc31fad5) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Mitch Williams [Thu, 14 Jan 2016 00:51:49 +0000 (16:51 -0800)]
i40e/i40evf: use pages correctly in Rx
BugLink: http://bugs.launchpad.net/bugs/1547674
Refactor the packet split Rx code to properly use half-pages for
receives. The previous code was doing way more mapping and unmapping
than it needed to, and wasn't properly using half-pages.
Increment the page use count each time we give a half-page to an skb,
knowing that the stack will probably process and release the page before
we need it again. Only free and reallocate pages if the count shows that
both half-pages are in use. Add counters to track reallocations and page
reuse.
Change-ID: I534b299196036b64be82b4861a0a4036310a8f22 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 f16704e5e8aed1dfed4084c56dde17006c2e81f1) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Jesse Brandeburg [Thu, 14 Jan 2016 00:51:48 +0000 (16:51 -0800)]
i40e/i40evf: use __GFP_NOWARN
BugLink: http://bugs.launchpad.net/bugs/1547674
The i40e and i40evf drivers now cleanly handle allocation
failures and can avoid kernel log spew from the memory allocator
when allocations fail, so set __GFP_NOWARN on Rx buffer alloc.
Change-ID: Ic9e1b83c495e2a3ef6b069ba7fb6e52ce134cd23 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 dd1a5df872d7889b37b5ce3058a9f2e20d4d8b56) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Jesse Brandeburg [Thu, 14 Jan 2016 00:51:47 +0000 (16:51 -0800)]
i40e: dump descriptor indexes in hex
BugLink: http://bugs.launchpad.net/bugs/1547674
The debugging helpers for showing descriptor rings were
dumping the indexes in decimal and the offsets in hex.
Put everything in hex and at least be consistent.
Also update copyright year in file header.
Change-ID: Ia35a21411a2ddb713772dffb4e8718889fcfc895 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 13cb3e9d71d5823a3169b10b428ce717434c657e) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Jesse Brandeburg [Thu, 14 Jan 2016 00:51:46 +0000 (16:51 -0800)]
i40e/i40evf: try again after failure
BugLink: http://bugs.launchpad.net/bugs/1547674
This is the "Don't Give Up" patch. Previously the
driver could fail an allocation, and then possibly stall
a queue forever, by never coming back to continue receiving
or allocating buffers.
With this patch, the driver will keep polling trying to allocate
receive buffers until it succeeds. This should keep all receive
queues running even in the face of memory pressure.
Also update copyright year in file header.
Change-ID: I2b103d1ce95b9831288a7222c3343ffa1988b81b 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 c2e245ab1e9a61e66217aafea66c7dc6481f12f0) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Jesse Brandeburg [Thu, 14 Jan 2016 00:51:45 +0000 (16:51 -0800)]
i40e/i40evf: don't lose interrupts
BugLink: http://bugs.launchpad.net/bugs/1547674
While re-enabling interrupts the driver would clear all pending
causes. This meant that if an interrupt was generated while the driver
was cleaning or polling with interrupts disabled, then that interrupt
was lost. This could cause a queue to become dead, especially for
receive. Refactored the enable_icr0 function in order to allow
it to be decided by the caller whether the CLEARPBA (clear pending
events) bit will be set while re-enabling the interrupt.
Also update copyright year in file headers.
Change-ID: Ic1db100a05e13c98919057696db147a258ca365a 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 40d72a50986271e5c30f111e08ebd6d846708bbc) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
i40e: Refactor force_wb and WB_ON_ITR functionality code
BugLink: http://bugs.launchpad.net/bugs/1547674
Now that the Force-WriteBack functionality in X710/XL710 devices
has been moved out of the clean routine and into the service task,
we need to make sure WriteBack-On-ITR is separated out since it
is still called from clean.
In the X722 devices, Force-WriteBack implies WriteBack-On-ITR but
without the interrupt, which put the driver into a missed
interrupt scenario and a potential tx-timeout report.
With this patch, we break the two functions out, and call the
appropriate ones at the right place. This will avoid creating missed
interrupt like scenarios for X722 devices.
Also update copyright year in file headers.
Change-ID: Iacbde39f95f332f82be8736864675052c3583a40 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 ecc6a239e8dd233951bd3337f34d9ba4c46720c9) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Change-ID: Ie6e68c68e2d1d459e42168eda661051b56bf0a65 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 66fc360a0e9dd17e2c6ea02c15b02590b583abd1) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Shannon Nelson [Thu, 14 Jan 2016 00:51:41 +0000 (16:51 -0800)]
i40e: add VEB stat control and remove L2 cloud filter
BugLink: http://bugs.launchpad.net/bugs/1547674
With the latest firmware, statistics gathering can now be enabled and
disabled in the HW switch, so we need to add a parameter to allow the
driver to set it as desired. At the same time, the L2 cloud filtering
parameter has been removed as it was never used.
Older drivers working with the newer firmware and newer drivers working
with older firmware will not run into problems with these bits as the
defaults are reasonable and there is no overlap in the bit definitions.
Also, newer drivers will be forced to update because of the change in
function call parameters, a reminder that the functionality exists.
Also update copyright year.
Change-ID: I9acb9160b892ca3146f2f11a88fdcd86be3cadcc 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 8a187f448ede55147dfa2fdcacfacd795747972d) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Shannon Nelson [Thu, 14 Jan 2016 00:51:40 +0000 (16:51 -0800)]
i40e: set shared bit for multicast filters
BugLink: http://bugs.launchpad.net/bugs/1547674
Add the use of the new Shared MAC filter bit for multicast and broadcast
filters in order to make better use of the filters available from the
device. The FW folks have assured me that setting this bit on older FW
will have no affect, so we don't need a version check.
Also fixed a stray indent problem nearby.
Also update copyright year.
Change-ID: I4c5826a32594382a7937a592a24d228588cee7aa 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 67be6eb2473ac86e71f68c9470f8e00f39df7258) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Neerav Parikh [Thu, 14 Jan 2016 00:51:39 +0000 (16:51 -0800)]
i40e: Make the DCB firmware checks for X710/XL710 only
BugLink: http://bugs.launchpad.net/bugs/1547674
Make the DCB firmware version related checks specific to
X710 and XL710 only. These checks are not required for
X722 family of devices.
Introduced an inline routine to help determine if the
MAC type is X710/XL710 or not.
Moved the firmware version related checks in i40e_sw_init()
and defined flags for different cases
Fix the version check to allow using "Set LLDP MIB" AQ
for beyond FVL4 FW releases.
Change-ID: Ib78288343de983aa0354fc28aa36e99b073662c0 Signed-off-by: Neerav Parikh <neerav.parikh@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 f1bbad339cdd74cea945e33d758200d42310be17) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Jesse Brandeburg [Thu, 14 Jan 2016 00:51:38 +0000 (16:51 -0800)]
i40e: move sync_vsi_filters up in service_task
BugLink: http://bugs.launchpad.net/bugs/1547674
The sync_vsi_filters function is moved up in the service_task because
it may need to request a reset, and we don't want to wait another round
of service task time.
NOTE: Filters will be replayed by sync_vsi_filters including broadcast
and promiscuous settings.
Also, added some error handling in this space in case any of these
fail the driver will retry correctly.
Also update copyright year.
Change-ID: I23f3d552100baecea69466339f738f27614efd47 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 2818ccd95684d39cc3bdad579e02ae56c0d6de88) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Sowmini Varadhan [Wed, 13 Jan 2016 03:32:31 +0000 (19:32 -0800)]
i40e: use eth_platform_get_mac_address()
BugLink: http://bugs.launchpad.net/bugs/1547674
This commit converts commit b499ffb0a22c ("i40e: Look up MAC address in
Open Firmware or IDPROM") to use eth_platform_get_mac_address()
added by commit c7f5d105495a ("net: Add eth_platform_get_mac_address()
helper.")
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.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 ba94272d08a7e7e716f17e491dbc9068f88eb241) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
BugLink: http://bugs.launchpad.net/bugs/1547674
The X722 can support automatic rule eviction for automatically added
flow director rules. Feature is (should be) disabled by default.
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 72b748698076b4609186e9554a5a890cd435b172) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Anjali Singhai [Wed, 6 Jan 2016 19:49:28 +0000 (11:49 -0800)]
i40e: Enable Geneve offload for FW API ver > 1.4 for XL710/X710 devices
BugLink: http://bugs.launchpad.net/bugs/1547674
This patch makes sure we check the GENEVE offload capable flag before
we attempt offload.
It also enables the Capability for XL710/X710 devices with FW API
version higher than 1.4
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 a340c7895a83501df68eb403496cec74bc363157) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Jacob Keller [Mon, 4 Jan 2016 18:33:11 +0000 (10:33 -0800)]
i40e: avoid large memcpy by assigning struct
BugLink: http://bugs.launchpad.net/bugs/1547674
Assign the i40e_pf structure directly instead of using a large memcpy,
which avoids a sparse warning and lets the compiler optimize the copy
since it knows the size of the structure in advance.
Change-ID: I17604e23be2616521eb760290befcb767b52b3f7 Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Reviewed-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 45d043597d2d0e780e768866c6fbfe8dbee5f2cf) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
BugLink: http://bugs.launchpad.net/bugs/1547674
Driver already counted allocation errors, so print
them as part of the ethtool -S output. Useful for debugging
if your system is having trouble making memory available for
the driver.
Change-ID: I83839fa86e81e6d80f03b917c88dd3ef9a64dde0 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 c40918c3ad80e550ec68339d6816059e11648012) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Shannon Nelson [Mon, 4 Jan 2016 18:33:08 +0000 (10:33 -0800)]
i40e: negate PHY int mask bits
BugLink: http://bugs.launchpad.net/bugs/1547674
The PHY interrupt mask bits mask out the events we don't want,
so we need to negate the bitmask of events we want.
Change-ID: I273244da5a8d285b6abc84fd68a90f1e6fa0393e 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 2f0aff4151e13fff669b1fab4b93b7613b3b4be5) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Kiran Patil [Mon, 4 Jan 2016 18:33:07 +0000 (10:33 -0800)]
i40e: APIs to Add/remove port mirroring rules
BugLink: http://bugs.launchpad.net/bugs/1547674
This patch implements necessary functions related to port
mirroring features such as add/delete mirror rule, function
to set promiscuous VLAN mode for VSI if mirror rule_type is
"VLAN Mirroring".
Change-ID: Iaf513fd5f188f99dcb977b48f99e73185dfddc40 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 7bd6875bef7055170b2c871e6d44a0b5e826643f) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
BugLink: http://bugs.launchpad.net/bugs/1547674
The driver was being called by VLAN, bonding, teaming operations
that expected to be able to hold locks like rcu_read_lock().
This causes the driver to be held to the requirement to not sleep,
and was found by the kernel debug options for checking sleep
inside critical section, and the locking validator.
Change-ID: Ibc68c835f5ffa8ffe0638ffe910a66fc5649a7f7 Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Reviewed-by: Nelson, Shannon <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 c53934c6d1b11c676dafed04294cd906fc9ff5d3) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
BugLink: http://bugs.launchpad.net/bugs/1547674
The sync_vsi_filter function was allocating memory in such
a way that it could sleep (GFP_KERNEL) which was causing a problem
when called by the team driver under rcu_read_lock(), which cannot
be held while sleeping. Found with lockdep.
Change-ID: I4e59053cb5eedcf3d0ca151715be3dc42a94bdd5 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 38c3cec73c7be6789a3e3ed06ff74ce84f5b1528) Signed-off-by: Tim Gardner <tim.gardner@canonical.com>