]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
9 years agoi40e: Add RSS configuration to virtual channel
Mitch Williams [Fri, 1 Apr 2016 10:56:10 +0000 (03:56 -0700)]
i40e: Add RSS configuration to virtual channel

Orabug: 23176970

Add opcodes and structures to support RSS configuration by PF driver on
behalf of the VF drivers. This reduces complexity in the VF driver and
allows us to support future hardware designs without modifying the VF
driver.

Change-ID: I8c75765c630eacb71f95967f1109a198542593ac
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 commit 585954f8b808def857771037392c1621f167fa92)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Move NVM variable out of AQ struct
Shannon Nelson [Fri, 1 Apr 2016 10:56:09 +0000 (03:56 -0700)]
i40e: Move NVM variable out of AQ struct

Orabug: 23176970

The NVM update status info should stay collected together, not
spread across different structs.

Change-ID: Ic16f9e9fd79945d865bb7226184c889884585025
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 commit 437f82a2290ed94f0d6a86b749101f1ad5ed6231)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Restrict VF poll mode to only single function mode devices
Shannon Nelson [Fri, 1 Apr 2016 10:56:08 +0000 (03:56 -0700)]
i40e: Restrict VF poll mode to only single function mode devices

Orabug: 23176970

The VFs can request their queues to be set up into polling mode, rather
than interrupt mode, which works well for supporting things like DPDK,
but this should not be available when working in an multi-function
support device.

Change-ID: Id36792e4e7422db8f2033336507211f68f14ff6f
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 commit 14c5f5d264c3ee28e8ec9fd4dffb29f5d1ea1d02)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Faster RX via avoiding FCoE
Jesse Brandeburg [Fri, 1 Apr 2016 10:56:06 +0000 (03:56 -0700)]
i40e/i40evf: Faster RX via avoiding FCoE

Orabug: 23176970

As it turns out, calling into other files from hot path hurts
performance a lot.  In this case the majority of the time we
call "check FCoE" and the packet is *not* FCoE, but this call
was taking 5% of our total cycles spent on receive.

Change-ID: I080552c26e7060bc7b78504dc2763f6f0b3d8c76
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 commit 1f15d66712bb64e39fe2c23b1b32f68f9e1d4ee7)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Drop unused tx_ring argument
Jesse Brandeburg [Fri, 1 Apr 2016 10:56:05 +0000 (03:56 -0700)]
i40e/i40evf: Drop unused tx_ring argument

Orabug: 23176970

Some of the tx_ring arguments can be deleted since they are not used.

Change-ID: I99275b0f191d7f63ec2f05061919904940c36f31
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 commit 84b079928a10559ebc6679e1e973a3ee5b20ba83)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Move stack var deeper
Jesse Brandeburg [Fri, 1 Apr 2016 10:56:04 +0000 (03:56 -0700)]
i40e/i40evf: Move stack var deeper

Orabug: 23176970

A local variable could move down inside the context where it is used.

Change-ID: I9caba9e1eacf921037077f2665cbce83fd8e95d6
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 commit d1bd743b5b4d675e739b574284d1412ba996fe07)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Move HW flush
Akeem G Abodunrin [Fri, 1 Apr 2016 10:56:03 +0000 (03:56 -0700)]
i40e: Move HW flush

Orabug: 23176970

This patch moves the HW flush routine to the end of the reset flow,
after the completion of writing to the device VFLR registers- the
benefit is to avoid problems in the passthrough routines.

Change-ID: Ieb56866f21895e6c1fc514b7328c3df79807a57c
Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 30728c5bdf2ac6618eebf6949a2e59b3c4cf640f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Leave debug_mask cleared at init
Shannon Nelson [Fri, 1 Apr 2016 10:56:02 +0000 (03:56 -0700)]
i40e: Leave debug_mask cleared at init

Orabug: 23176970

Don't set our internal debug_mask at startup unless we get specific signal
to from the debug module parameter.

This should take care of the issue with all the device capabilities getting
printed even when we hadn't asked for the debug info.

Change-ID: I7fbc6bd8b11ed9b0631ec018ff36015a04100b6c
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 commit 89dd05512b79ee9ba0950f1ba1fb8077ec898ea2)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Inserting a HW capability display info
Deepthi Kavalur [Fri, 1 Apr 2016 10:56:01 +0000 (03:56 -0700)]
i40e: Inserting a HW capability display info

Orabug: 23176970

Display MSIx vector count for HW capabilities.

Change-ID: I4b41e9b50360cf660e7fbcb85b9390fedcf313b1
Signed-off-by: Deepthi Kavalur <deepthi.kavalur@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 453e16e8e8b96821111e8d90252f4df8ec418eea)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Fix TSO checksum pseudo-header adjustment
Alexander Duyck [Wed, 25 May 2016 17:00:36 +0000 (13:00 -0400)]
i40e/i40evf: Fix TSO checksum pseudo-header adjustment

Orabug: 23176970

With IPv4 and IPv6 now using the same format for checksums based on the
length of the frame we need to update the i40e and i40evf drivers so that
they correctly account for lengths greater than or equal to 64K.

With this patch the driver should now correctly update checksums for frames
up to 16776960 in length which should be more than large enough for all
possible TSO frames in the near future.

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 commit 24d41e5e2c9afe99b0584832206ba8779dfb783e)

Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Bump patch from 1.5.1 to 1.5.2
Avinash Dayanand [Fri, 18 Mar 2016 19:18:16 +0000 (12:18 -0700)]
i40e/i40evf: Bump patch from 1.5.1 to 1.5.2

Orabug: 23176970

Signed-off-by: Avinash Dayanand <avinash.dayanand@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 066439ce791b5d8533556a89836c0849589c2b41)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Request PHY media event at reset time
Shannon Nelson [Fri, 18 Mar 2016 19:18:15 +0000 (12:18 -0700)]
i40e: Request PHY media event at reset time

Orabug: 23176970

Add the Media Not Available flag to the link event mask.  It seems
that event comes first if you have a DA cable pulled out, but there's no
follow-up event for Link Down; if you're not looking for MEDIA_NA you will
get no event, even though there's now no Link.

Change-ID: cb3340a2849805bb881f64f6f2ae810eef46eba7
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 commit 867a79e37ed9a3a5a2051cc11df21a57a8a00bfe)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Lower some message levels
Mitch Williams [Fri, 18 Mar 2016 19:18:14 +0000 (12:18 -0700)]
i40e: Lower some message levels

Orabug: 23176970

These conditions can happen any time VFs are enabled or disabled and are
not really indicative of fatal problems unless they happen continuously.

Lower the log level so that people don't get scared.

Change-ID: I1ceb4adbd10d03cbeed54d1f5b7f20d60328351d
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 commit 18b7af57d9c1165c2b8f13ec4668d6d7f51708cf)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Fix for supported link modes in 10GBaseT PHY's
Avinash Dayanand [Fri, 18 Mar 2016 19:18:13 +0000 (12:18 -0700)]
i40e: Fix for supported link modes in 10GBaseT PHY's

Orabug: 23176970

100baseT/Full is now listed and supported link mode for 10GBaseT PHY.
This is a fix to list all the supported link modes of 10GBaseT PHY.

Change-ID: If2be3212ef0fef85fd5d6e4550c7783de2f915e9
Signed-off-by: Avinash Dayanand <avinash.dayanand@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 16badc34695ff489a39e450b4e4e5a241ac85a31)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: Fix get_rss_aq
Catherine Sullivan [Fri, 18 Mar 2016 19:18:12 +0000 (12:18 -0700)]
i40evf: Fix get_rss_aq

Orabug: 23176970

We were passing in the seed where we should just be passing false
because we want the VSI table not the pf table.

Change-ID: I9b633ab06eb59468087f0c0af8539857e99f9495
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 commit 539a379c50220d6ac19c7300671fe25819bd3f1b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Disable link polling
Shannon Nelson [Fri, 18 Mar 2016 19:18:11 +0000 (12:18 -0700)]
i40e: Disable link polling

Orabug: 23176970

Periodic link polling was added when the link events were found not to be
trustworthy.  This was the case early on, but was likely because the link
event mask was being used incorrectly.  As this has been fixed in recent
code, we can disable the link polling to lessen the AQ traffic.

Change-ID: Id890b5ee3c2d04381fc76ffa434777644f5d8eb0
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 commit 8c806b676d21a49628250731f4e30a8a071d080c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: Add longer wait after remove module
Mitch Williams [Fri, 18 Mar 2016 19:18:10 +0000 (12:18 -0700)]
i40evf: Add longer wait after remove module

Orabug: 23176970

Upon module remove, wait a little longer after requesting a reset before
checking to see if the firmware responded. This change prevents double
resets when the firmware is busy.

Change-ID: Ieedc988ee82fac1f32a074bf4d9e4dba426bfa58
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 commit 22ead37f8af83b4fa32c15cc21d3541e74661339)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Make VF resets more reliable
Mitch Williams [Fri, 18 Mar 2016 19:18:09 +0000 (12:18 -0700)]
i40e: Make VF resets more reliable

Orabug: 23176970

Clear the VFLR bit immediately after triggering a reset instead of
waiting until after cleanup is complete. Make sure to trigger a reset
every time, not just if the PF is up.

These changes fix a problem where VF resets would get lost by the PF,
preventing the VF driver from initializing.

Change-ID: I5945cf2884095b7b0554867c64df8617e71d9d29
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 commit 7369ca8745499d001663e1dccf15064a3eb34b4d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add new device ID for X722
Catherine Sullivan [Fri, 18 Mar 2016 19:18:08 +0000 (12:18 -0700)]
i40e: Add new device ID for X722

Orabug: 23176970

The new device ID is 0x37D3 and it should follow the same flows and
branding string as for 0x37D0.

Change-ID: Ia5ad4a1910268c4666a3fd46a7afffbec55b4fc2
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 commit d6bf58c2e88f9e0cfc029c158e1182eb1f07d7eb)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: Fix VLAN features
Mitch Williams [Fri, 18 Mar 2016 19:18:07 +0000 (12:18 -0700)]
i40evf: Fix VLAN features

Orabug: 23176970

Users of ethtool were being given the mistaken impression that this
driver was able to change its VLAN tagging features, and were
disappointed that this was not actually the case. Implement
ndo_fix_features method so that we can adjust these flags as needed to
avoid false impressions.

Change-ID: I08584f103a4fa73d6a4128d472e4ef44dcfda57f
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 commit c4445aedfe092907c2e792ff76ed4338d9a1cd52)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Remove unused variable
Mitch Williams [Fri, 18 Mar 2016 19:18:06 +0000 (12:18 -0700)]
i40e: Remove unused variable

Orabug: 23176970

This variable is vestigial, a remnant of the primordial code from which
this driver spawned. We can safely remove it.

Change-ID: I24e0fe338e7c7c50d27dc5515564f33caefbb93a
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 442b25e455f5e693c23f9d3a32b208ca9ab25cf0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Enable Geneve offload for FW API ver > 1.4 for XL710/X710 devices
Anjali Singhai Jain [Fri, 18 Mar 2016 19:18:05 +0000 (12:18 -0700)]
i40e: Enable Geneve offload for FW API ver > 1.4 for XL710/X710 devices

Orabug: 23176970

This patch enables the Capability for XL710/X710 devices with FW API
version higher than 1.4 to do geneve Rx offload.

Change-ID: I9a8f87772c48d7d67dc85e3701d2e0b845034c0b
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 3845ccea34df30680b5be7ec119f5c74ab57fdc0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: remove redundant check on vsi->active_vlans
Colin King [Sat, 13 Feb 2016 23:57:16 +0000 (23:57 +0000)]
i40e: remove redundant check on vsi->active_vlans

Orabug: 23176970

active_vlans is an unsigned long array, hence a null check on this
array is superfluous and can be removed.

Detected with static analysis by smatch:

drivers/net/ethernet/intel/i40e/i40e_debugfs.c:386
  i40e_dbg_dump_vsi_seid() warn: this array is probably
  non-NULL. 'vsi->active_vlans'

Signed-off-by: Colin Ian King <colin.king@canonical.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 commit afb8ece4326f2151771f4c40b8d9f799cee5ae6e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Bump patch from 1.4.25 to 1.5.1
Catherine Sullivan [Thu, 10 Mar 2016 22:59:51 +0000 (14:59 -0800)]
i40e/i40evf: Bump patch from 1.4.25 to 1.5.1

Orabug: 23176970

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 commit 50f26a507664499ccef017607a29cc1456695343)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Change comment to reflect correct function name
Mitch Williams [Thu, 10 Mar 2016 22:59:50 +0000 (14:59 -0800)]
i40e: Change comment to reflect correct function name

Orabug: 23176970

Minor correction in the comment to reflect the correct function name

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 commit 55f7d7233bd15c8a3fcf7051c681b05de5980a18)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: Add additional check for reset
Mitch Williams [Thu, 10 Mar 2016 22:59:49 +0000 (14:59 -0800)]
i40evf: Add additional check for reset

Orabug: 23176970

If the driver happens to read a register during the time in which the
device is undergoing reset, it will receive a value of 0xdeadbeef
instead of a valid value. Unfortunately, the driver may misinterpret
this as a valid value, especially if it's just looking for individual
bits.

Add an explicit check for this value when we are looking for admin queue
errors, and trigger reset recovery if we find it.

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 commit 19b73d8efaa459a66665b5e0a3e7acedd05f4901)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Change unknown event error msg to ignore message
Shannon Nelson [Thu, 10 Mar 2016 22:59:48 +0000 (14:59 -0800)]
i40e: Change unknown event error msg to ignore message

Orabug: 23176970

There's no real error in an unknown event from the Firmware, we're just
posting a useful FYI notice, so this patch simply removes the "Error" word.

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 commit 56e5ca688f3d334ddc2acab27cb7efa83b238557)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Added code to prevent double resets
Mitch Williams [Thu, 10 Mar 2016 22:59:47 +0000 (14:59 -0800)]
i40e: Added code to prevent double resets

Orabug: 23176970

Clear the VFLR bit after reset processing, instead of before. This
prevents double resets on VF init.

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 commit 7e5a313ed9b18ba9f35df2523eb9e386a195a2c4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Notify VFs of all resets
Mitch Williams [Thu, 10 Mar 2016 22:59:46 +0000 (14:59 -0800)]
i40e: Notify VFs of all resets

Orabug: 23176970

Notify VFs in the reset interrupt handler, instead of the actual
reset initiation code. This allows the VFs to get properly notified for
all resets, including resets initiated by different PFs on the same
physical device.

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 commit d3ce57344100023faa8f514eb66dfb110b53629c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Remove timer and task only if created
Shannon Nelson [Thu, 10 Mar 2016 22:59:45 +0000 (14:59 -0800)]
i40e: Remove timer and task only if created

Orabug: 23176970

In some error scenarios, we may find ourselves trying to remove a
non-existent timer or worktask.  This causes the kernel some bit
of consternation, so don't do it.

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 commit c99abb4cb8227bf8172c085213c91bf155c6618a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Assure that adminq is alive in debug mode
Shannon Nelson [Thu, 10 Mar 2016 22:59:44 +0000 (14:59 -0800)]
i40e: Assure that adminq is alive in debug mode

Orabug: 23176970

When dropping into debug mode in a failed probe, make sure that
the AdminQ is left alive for possible hand debug of driver and
firmware states.

Move the mutex_init calls earlier in probe so that if init fails,
the admin queue interface is still available for debugging purposes.

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 commit de03d2b0ef6520cf9da2e429cd7afb534782b737)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Remove MSIx only if created
Shannon Nelson [Thu, 10 Mar 2016 22:59:43 +0000 (14:59 -0800)]
i40e: Remove MSIx only if created

Orabug: 23176970

When cleaning up the interrupt handling, clean up the IRQs only if
we actually got them set up.  There are a couple of error recovery
paths that were violating this and causing the kernel a bit of
indigestion.

Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Reviewed-by: Williams, Mitch A <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 commit 692783980ad6163e8586baa36c066cd0d22fc7ce)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Fix up return code
Jesse Brandeburg [Thu, 10 Mar 2016 22:59:42 +0000 (14:59 -0800)]
i40e: Fix up return code

Orabug: 23176970

The i40e_common.c typically uses i40e_status as a return code,
but got missed this one case.

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 commit 618290262e960469758d4ab67457fcb2ea356d51)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Save off VSI resource count when updating VSI
Kevin Scott [Thu, 10 Mar 2016 22:59:41 +0000 (14:59 -0800)]
i40e: Save off VSI resource count when updating VSI

Orabug: 23176970

When updating a VSI, save off the number of allocated and unallocated
VSIs as we do when adding a VSI.

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 commit b6caccaccf749dddd296f3056111d6c4b94500c1)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Remove I40E_MAX_USER_PRIORITY define
Catherine Sullivan [Thu, 10 Mar 2016 22:59:40 +0000 (14:59 -0800)]
i40e/i40evf: Remove I40E_MAX_USER_PRIORITY define

Orabug: 23176970

This patch removes the duplicate definition of I40E_MAX_USER_PRIORITY
in i40e.h that is not needed.

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 commit b7c359376429953dc1672224dbc9845eadf2a29c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Fix casting in transmit code
Jesse Brandeburg [Thu, 10 Mar 2016 22:59:39 +0000 (14:59 -0800)]
i40e/i40evf: Fix casting in transmit code

Orabug: 23176970

Simple cast to fix a sparse warning.

Fixes: commit 5453205cd097 ("i40e/i40evf: Enable support for
SKB_GSO_UDP_TUNNEL_CSUM")

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 commit 4ea623922d1d73c162da53e02cce1d0d3fd55893)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Fix handling of boolean logic in polling routines
Alexander Duyck [Mon, 7 Mar 2016 17:29:57 +0000 (09:29 -0800)]
i40e/i40evf: Fix handling of boolean logic in polling routines

Orabug: 23176970

In the polling routines for i40e and i40evf we were using bitwise operators
to avoid the side effects of the logical operators, specifically the fact
that if the first case is true with "||" we skip the second case, or if it
is false with "&&" we skip the second case.  This fixes an earlier patch
that converted the bitwise operators over to the logical operators and
instead replaces the entire thing with just an if statement since it should
be more readable what we are trying to do this way.

Fixes: 1a36d7fadd14 ("i40e/i40evf: use logical operators, not bitwise")
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 commit f2edaaaa392bc21c24f532ea9bcc952a54a22367)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/i40evf/i40e_txrx.c

9 years agoi40evf: remove dead code
Alan Cox [Wed, 2 Mar 2016 00:02:15 +0000 (16:02 -0800)]
i40evf: remove dead code

Orabug: 23176970

The only error case is when the malloc fails, in which case the clean up
loop does nothing at all, so remove it

Signed-off-by: Alan Cox <alan@linux.intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 311f23e9a4314f62fed6c13e112c998b07e37e63)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Allow up to 12K bytes of data per Tx descriptor instead of 8K
Alexander Duyck [Fri, 19 Feb 2016 20:17:08 +0000 (12:17 -0800)]
i40e/i40evf: Allow up to 12K bytes of data per Tx descriptor instead of 8K

Orabug: 23176970

From what I can tell the practical limitation on the size of the Tx data
buffer is the fact that the Tx descriptor is limited to 14 bits.  As such
we cannot use 16K as is typically used on the other Intel drivers.  However
artificially limiting ourselves to 8K can be expensive as this means that
we will consume up to 10 descriptors (1 context, 1 for header, and 9 for
payload, non-8K aligned) in a single send.

I propose that we can reduce this by increasing the maximum data for a 4K
aligned block to 12K.  We can reduce the descriptors used for a 32K aligned
block by 1 by increasing the size like this.  In addition we still have the
4K - 1 of space that is still unused.  We can use this as a bit of extra
padding when dealing with data that is not aligned to 4K.

By aligning the descriptors after the first to 4K we can improve the
efficiency of PCIe accesses as we can avoid using byte enables and can fetch
full TLP transactions after the first fetch of the buffer.  This helps to
improve PCIe efficiency.  Below is the results of testing before and after
with this patch:

Recv   Send   Send                         Utilization      Service Demand
Socket Socket Message  Elapsed             Send     Recv    Send    Recv
Size   Size   Size     Time    Throughput  local    remote  local   remote
bytes  bytes  bytes    secs.   10^6bits/s  % S      % U     us/KB   us/KB
Before:
87380  16384  16384    10.00     33682.24  20.27    -1.00   0.592   -1.00
After:
87380  16384  16384    10.00     34204.08  20.54    -1.00   0.590   -1.00

So the net result of this patch is that we have a small gain in throughput
due to a reduction in overhead for putting together the frame.

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 commit 5c4654daf2e2f25dfbd7fa572c59937ea6d4198b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: call ndo_stop() instead of dev_close() when running offline selftest
Stefan Assmann [Wed, 3 Feb 2016 08:20:47 +0000 (09:20 +0100)]
i40e: call ndo_stop() instead of dev_close() when running offline selftest

Orabug: 23176970

Calling dev_close() causes IFF_UP to be cleared which will remove the
interfaces routes and some addresses. That's probably not what the user
intended when running the offline selftest. Besides this does not happen
if the interface is brought down before the test, so the current
behaviour is inconsistent.
Instead call the net_device_ops ndo_stop function directly and avoid
touching IFF_UP at all.

Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 08ca38742b63ae3825096e943de371a3b372c4a0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40e/i40e.h

9 years agoi40e/i40evf: Limit TSO to 7 descriptors for payload instead of 8 per packet
Alexander Duyck [Wed, 30 Mar 2016 23:15:37 +0000 (16:15 -0700)]
i40e/i40evf: Limit TSO to 7 descriptors for payload instead of 8 per packet

Orabug: 23176970

This patch addresses a bug introduced based on my interpretation of the
XL710 datasheet.  Specifically section 8.4.1 states that "A single transmit
packet may span up to 8 buffers (up to 8 data descriptors per packet
including both the header and payload buffers)."  It then later goes on to
say that each segment for a TSO obeys the previous rule, however it then
refers to TSO header and the segment payload buffers.

I believe the actual limit for fragments with TSO and a skbuff that has
payload data in the header portion of the buffer is actually only 7
fragments as the skb->data portion counts as 2 buffers, one for the TSO
header, and one for a segment payload buffer.

Fixes: 2d37490b82af ("i40e/i40evf: Rewrite logic for 8 descriptor per packet check")
Reported-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 3f3f7cb875c0f621485644d4fd7453b0d37f00e4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: fix errant PCIe bandwidth message
Jesse Brandeburg [Mon, 29 Feb 2016 19:00:24 +0000 (11:00 -0800)]
i40e: fix errant PCIe bandwidth message

Orabug: 23176970

There was an error introduced with commit 3fced535079a ("i40e: X722 is
on the IOSF bus and does not report the PCI bus info"), where code was
added but the enabling flag is never set.

CC: Anjali Singhai Jain <anjali.singhai@intel.com>
CC: Stefan Assman <sassman@redhat.com>
Fixes: 3fced535079a ("i40e: X722 is on the IOSF bus ...")
Reported-by: Steve Best <sbest@redhat.com>
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 commit 8e2cc0e67f4aa33931cd15a553938163a19dcab3)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add support for client interface for IWARP driver
Anjali Singhai Jain [Wed, 20 Jan 2016 19:40:01 +0000 (13:40 -0600)]
i40e: Add support for client interface for IWARP driver

Orabug: 23176970

This patch adds a Client interface for i40iw driver
support. Also expands the Virtchannel to support messages
from i40evf driver on behalf of i40iwvf driver.

This client API is used by the i40iw and i40iwvf driver
to access the core driver resources brokered by the i40e driver.

Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
(cherry picked from commit e3219ce6a775468368fb270fae3eb82a6787b436)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40e/i40e_main.c

9 years agoRevert "IPoIB: Protect tx_outstanding from parallel access"
Wengang Wang [Tue, 5 Jul 2016 20:48:43 +0000 (13:48 -0700)]
Revert "IPoIB: Protect tx_outstanding from parallel access"

This reverts commit 1cb6be04345014198fecaee2bc8edee8665b610e.

Orabug: 23480903 (uek4)
The above commit doesn't help fixing the issue, revert it.
tx_outstanding is protected by netif_tx_lock.

Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
9 years agoDriver: Vmxnet3: set CHECKSUM_UNNECESSARY for IPv6 packets
Shrikrishna Khare [Thu, 21 Apr 2016 01:12:29 +0000 (18:12 -0700)]
Driver: Vmxnet3: set CHECKSUM_UNNECESSARY for IPv6 packets

For IPv6, if the device indicates that the checksum is correct, set
CHECKSUM_UNNECESSARY.

Reported-by: Subbarao Narahari <snarahari@vmware.com>
Signed-off-by: Shrikrishna Khare <skhare@vmware.com>
Signed-off-by: Jin Heo <heoj@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23472394
(cherry picked from commit f0d437809d23999cb25207cfbe80c61e5703fdc1)
Signed-off-by: Dan Duval <dan.duval@oracle.com>
Conflict:

drivers/net/vmxnet3/vmxnet3_int.h

9 years agoppp: take reference on channels netns
Guillaume Nault [Wed, 23 Mar 2016 15:38:55 +0000 (16:38 +0100)]
ppp: take reference on channels netns

Let channels hold a reference on their network namespace.
Some channel types, like ppp_async and ppp_synctty, can have their
userspace controller running in a different namespace. Therefore they
can't rely on them to preclude their netns from being removed from
under them.

==================================================================
BUG: KASAN: use-after-free in ppp_unregister_channel+0x372/0x3a0 at
addr ffff880064e217e0
Read of size 8 by task syz-executor/11581
=============================================================================
BUG net_namespace (Not tainted): kasan: bad access detected
-----------------------------------------------------------------------------

Disabling lock debugging due to kernel taint
INFO: Allocated in copy_net_ns+0x6b/0x1a0 age=92569 cpu=3 pid=6906
[<      none      >] ___slab_alloc+0x4c7/0x500 kernel/mm/slub.c:2440
[<      none      >] __slab_alloc+0x4c/0x90 kernel/mm/slub.c:2469
[<     inline     >] slab_alloc_node kernel/mm/slub.c:2532
[<     inline     >] slab_alloc kernel/mm/slub.c:2574
[<      none      >] kmem_cache_alloc+0x23a/0x2b0 kernel/mm/slub.c:2579
[<     inline     >] kmem_cache_zalloc kernel/include/linux/slab.h:597
[<     inline     >] net_alloc kernel/net/core/net_namespace.c:325
[<      none      >] copy_net_ns+0x6b/0x1a0 kernel/net/core/net_namespace.c:360
[<      none      >] create_new_namespaces+0x2f6/0x610 kernel/kernel/nsproxy.c:95
[<      none      >] copy_namespaces+0x297/0x320 kernel/kernel/nsproxy.c:150
[<      none      >] copy_process.part.35+0x1bf4/0x5760 kernel/kernel/fork.c:1451
[<     inline     >] copy_process kernel/kernel/fork.c:1274
[<      none      >] _do_fork+0x1bc/0xcb0 kernel/kernel/fork.c:1723
[<     inline     >] SYSC_clone kernel/kernel/fork.c:1832
[<      none      >] SyS_clone+0x37/0x50 kernel/kernel/fork.c:1826
[<      none      >] entry_SYSCALL_64_fastpath+0x16/0x7a kernel/arch/x86/entry/entry_64.S:185

INFO: Freed in net_drop_ns+0x67/0x80 age=575 cpu=2 pid=2631
[<      none      >] __slab_free+0x1fc/0x320 kernel/mm/slub.c:2650
[<     inline     >] slab_free kernel/mm/slub.c:2805
[<      none      >] kmem_cache_free+0x2a0/0x330 kernel/mm/slub.c:2814
[<     inline     >] net_free kernel/net/core/net_namespace.c:341
[<      none      >] net_drop_ns+0x67/0x80 kernel/net/core/net_namespace.c:348
[<      none      >] cleanup_net+0x4e5/0x600 kernel/net/core/net_namespace.c:448
[<      none      >] process_one_work+0x794/0x1440 kernel/kernel/workqueue.c:2036
[<      none      >] worker_thread+0xdb/0xfc0 kernel/kernel/workqueue.c:2170
[<      none      >] kthread+0x23f/0x2d0 kernel/drivers/block/aoe/aoecmd.c:1303
[<      none      >] ret_from_fork+0x3f/0x70 kernel/arch/x86/entry/entry_64.S:468
INFO: Slab 0xffffea0001938800 objects=3 used=0 fp=0xffff880064e20000
flags=0x5fffc0000004080
INFO: Object 0xffff880064e20000 @offset=0 fp=0xffff880064e24200

CPU: 1 PID: 11581 Comm: syz-executor Tainted: G    B           4.4.0+
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.8.2-0-g33fbe13 by qemu-project.org 04/01/2014
 00000000ffffffff ffff8800662c7790 ffffffff8292049d ffff88003e36a300
 ffff880064e20000 ffff880064e20000 ffff8800662c77c0 ffffffff816f2054
 ffff88003e36a300 ffffea0001938800 ffff880064e20000 0000000000000000
Call Trace:
 [<     inline     >] __dump_stack kernel/lib/dump_stack.c:15
 [<ffffffff8292049d>] dump_stack+0x6f/0xa2 kernel/lib/dump_stack.c:50
 [<ffffffff816f2054>] print_trailer+0xf4/0x150 kernel/mm/slub.c:654
 [<ffffffff816f875f>] object_err+0x2f/0x40 kernel/mm/slub.c:661
 [<     inline     >] print_address_description kernel/mm/kasan/report.c:138
 [<ffffffff816fb0c5>] kasan_report_error+0x215/0x530 kernel/mm/kasan/report.c:236
 [<     inline     >] kasan_report kernel/mm/kasan/report.c:259
 [<ffffffff816fb4de>] __asan_report_load8_noabort+0x3e/0x40 kernel/mm/kasan/report.c:280
 [<     inline     >] ? ppp_pernet kernel/include/linux/compiler.h:218
 [<ffffffff83ad71b2>] ? ppp_unregister_channel+0x372/0x3a0 kernel/drivers/net/ppp/ppp_generic.c:2392
 [<     inline     >] ppp_pernet kernel/include/linux/compiler.h:218
 [<ffffffff83ad71b2>] ppp_unregister_channel+0x372/0x3a0 kernel/drivers/net/ppp/ppp_generic.c:2392
 [<     inline     >] ? ppp_pernet kernel/drivers/net/ppp/ppp_generic.c:293
 [<ffffffff83ad6f26>] ? ppp_unregister_channel+0xe6/0x3a0 kernel/drivers/net/ppp/ppp_generic.c:2392
 [<ffffffff83ae18f3>] ppp_asynctty_close+0xa3/0x130 kernel/drivers/net/ppp/ppp_async.c:241
 [<ffffffff83ae1850>] ? async_lcp_peek+0x5b0/0x5b0 kernel/drivers/net/ppp/ppp_async.c:1000
 [<ffffffff82c33239>] tty_ldisc_close.isra.1+0x99/0xe0 kernel/drivers/tty/tty_ldisc.c:478
 [<ffffffff82c332c0>] tty_ldisc_kill+0x40/0x170 kernel/drivers/tty/tty_ldisc.c:744
 [<ffffffff82c34943>] tty_ldisc_release+0x1b3/0x260 kernel/drivers/tty/tty_ldisc.c:772
 [<ffffffff82c1ef21>] tty_release+0xac1/0x13e0 kernel/drivers/tty/tty_io.c:1901
 [<ffffffff82c1e460>] ? release_tty+0x320/0x320 kernel/drivers/tty/tty_io.c:1688
 [<ffffffff8174de36>] __fput+0x236/0x780 kernel/fs/file_table.c:208
 [<ffffffff8174e405>] ____fput+0x15/0x20 kernel/fs/file_table.c:244
 [<ffffffff813595ab>] task_work_run+0x16b/0x200 kernel/kernel/task_work.c:115
 [<     inline     >] exit_task_work kernel/include/linux/task_work.h:21
 [<ffffffff81307105>] do_exit+0x8b5/0x2c60 kernel/kernel/exit.c:750
 [<ffffffff813fdd20>] ? debug_check_no_locks_freed+0x290/0x290 kernel/kernel/locking/lockdep.c:4123
 [<ffffffff81306850>] ? mm_update_next_owner+0x6f0/0x6f0 kernel/kernel/exit.c:357
 [<ffffffff813215e6>] ? __dequeue_signal+0x136/0x470 kernel/kernel/signal.c:550
 [<ffffffff8132067b>] ? recalc_sigpending_tsk+0x13b/0x180 kernel/kernel/signal.c:145
 [<ffffffff81309628>] do_group_exit+0x108/0x330 kernel/kernel/exit.c:880
 [<ffffffff8132b9d4>] get_signal+0x5e4/0x14f0 kernel/kernel/signal.c:2307
 [<     inline     >] ? kretprobe_table_lock kernel/kernel/kprobes.c:1113
 [<ffffffff8151d355>] ? kprobe_flush_task+0xb5/0x450 kernel/kernel/kprobes.c:1158
 [<ffffffff8115f7d3>] do_signal+0x83/0x1c90 kernel/arch/x86/kernel/signal.c:712
 [<ffffffff8151d2a0>] ? recycle_rp_inst+0x310/0x310 kernel/include/linux/list.h:655
 [<ffffffff8115f750>] ? setup_sigcontext+0x780/0x780 kernel/arch/x86/kernel/signal.c:165
 [<ffffffff81380864>] ? finish_task_switch+0x424/0x5f0 kernel/kernel/sched/core.c:2692
 [<     inline     >] ? finish_lock_switch kernel/kernel/sched/sched.h:1099
 [<ffffffff81380560>] ? finish_task_switch+0x120/0x5f0 kernel/kernel/sched/core.c:2678
 [<     inline     >] ? context_switch kernel/kernel/sched/core.c:2807
 [<ffffffff85d794e9>] ? __schedule+0x919/0x1bd0 kernel/kernel/sched/core.c:3283
 [<ffffffff81003901>] exit_to_usermode_loop+0xf1/0x1a0 kernel/arch/x86/entry/common.c:247
 [<     inline     >] prepare_exit_to_usermode kernel/arch/x86/entry/common.c:282
 [<ffffffff810062ef>] syscall_return_slowpath+0x19f/0x210 kernel/arch/x86/entry/common.c:344
 [<ffffffff85d88022>] int_ret_from_sys_call+0x25/0x9f kernel/arch/x86/entry/entry_64.S:281
Memory state around the buggy address:
 ffff880064e21680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff880064e21700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff880064e21780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                       ^
 ffff880064e21800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff880064e21880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Fixes: 273ec51dd7ce ("net: ppp_generic - introduce net-namespace functionality v2")
Reported-by: Baozeng Ding <sploving1@gmail.com>
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1f461dcdd296eecedaffffc6bae2bfa90bd7eb89)

Orabug: 23276689
CVE: CVE-2016-4805

Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnxt_en: Support new ETHTOOL_{G|S}LINKSETTINGS API.
Michael Chan [Wed, 22 Jun 2016 21:40:06 +0000 (17:40 -0400)]
bnxt_en: Support new ETHTOOL_{G|S}LINKSETTINGS API.

Orabug: 23221795

To fully support 25G and 50G link settings.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 00c04a928572991d30b2473a7e992c1be8e646f3)

Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Don't allow autoneg on cards that don't support it.
Michael Chan [Mon, 13 Jun 2016 06:25:37 +0000 (02:25 -0400)]
bnxt_en: Don't allow autoneg on cards that don't support it.

Orabug: 23221795

Some cards do not support autoneg.  The current code does not prevent the
user from enabling autoneg with ethtool on such cards, causing confusion.
Firmware provides the autoneg capability information and we just need to
store it in the support_auto_speeds field in bnxt_link_info struct.
The ethtool set_settings() call will check this field before proceeding
with autoneg.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 93ed8117336485af2cedb069d28f3d4270fb90a1)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Add BCM5731X and BCM5741X device IDs.
Michael Chan [Mon, 13 Jun 2016 06:25:36 +0000 (02:25 -0400)]
bnxt_en: Add BCM5731X and BCM5741X device IDs.

Orabug: 23221795

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b24eb6ae7058ca1a42b0532489e5f5796c107d65)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Add GRO logic for BCM5731X chips.
Michael Chan [Mon, 13 Jun 2016 06:25:35 +0000 (02:25 -0400)]
bnxt_en: Add GRO logic for BCM5731X chips.

Orabug: 23221795

Add bnxt_gro_func_5731x() to handle GRO packets for this chip.  The
completion structures used in the new chip have new data to help determine
the header offsets.  The offsets can be off by 4 if the packet is an
internal loopback packet (e.g. from one VF to another VF).  Some additional
logic is added to adjust the offsets if it is a loopback packet.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 94758f8de037cf5c62eb56287f5d5e937cda8c9b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Refactor bnxt_gro_skb().
Michael Chan [Mon, 13 Jun 2016 06:25:34 +0000 (02:25 -0400)]
bnxt_en: Refactor bnxt_gro_skb().

Orabug: 23221795

Newer chips require different logic to handle GRO packets.  So refactor
the code so that we can call different functions depending on the chip.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 309369c9b3f6a8665e581d9014f222b602f6845a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Define the supported chip numbers.
Michael Chan [Mon, 13 Jun 2016 06:25:33 +0000 (02:25 -0400)]
bnxt_en: Define the supported chip numbers.

Orabug: 23221795

Define all the supported chip numbers and chip categories.  Store the
chip_num returned by firmware.  If the call to get the version and chip
number fails, we should abort.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 659c805cc01b3c5a6d972db0408164371a2bab4b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Add PCI device ID for 57404 NPAR devices.
Michael Chan [Mon, 13 Jun 2016 06:25:32 +0000 (02:25 -0400)]
bnxt_en: Add PCI device ID for 57404 NPAR devices.

Orabug: 23221795

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit ebcd4eeb2a0b4859d7aaa3308b222a30d51a643f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Enable NPAR (NIC Partitioning) Support.
Satish Baddipadige [Mon, 13 Jun 2016 06:25:31 +0000 (02:25 -0400)]
bnxt_en: Enable NPAR (NIC Partitioning) Support.

Orabug: 23221795

NPAR type is read from bnxt_hwrm_func_qcfg.  Do not allow changing link
parameters if in NPAR mode sinc ethe port is shared among multiple
partitions.  The link parameters are set up by firmware.

Signed-off-by: Satish Baddipadige <sbaddipa@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 567b2abe68551781b725b3b739672da41cb92ef0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Handle VF_CFG_CHANGE event from firmware.
Michael Chan [Mon, 13 Jun 2016 06:25:30 +0000 (02:25 -0400)]
bnxt_en: Handle VF_CFG_CHANGE event from firmware.

Orabug: 23221795

When the VF driver gets this event, the VF configuration has changed (such
as default VLAN).  The VF driver will initiate a silent reset to pick up
the new configuration.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit fc0f19294d1ffaf9366b10d966f86e6cf13335a4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Add new function bnxt_reset().
Michael Chan [Mon, 13 Jun 2016 06:25:29 +0000 (02:25 -0400)]
bnxt_en: Add new function bnxt_reset().

Orabug: 23221795

When a default VLAN is added to the VF, the VF driver needs to reset to
pick up the default VLAN ID.  We can use the same tx timeout reset logic
to do that, without the debug output.  This new function, with the
silent parameter to suppress debug output will now serve both purposes.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6988bd920c6ea53497ed15db947408b7488c9e36)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Add function for VF driver to query default VLAN.
Michael Chan [Mon, 13 Jun 2016 06:25:28 +0000 (02:25 -0400)]
bnxt_en: Add function for VF driver to query default VLAN.

Orabug: 23221795

The PF can setup a default VLAN for a VF.  The default VLAN tag is
automatically inserted and stripped without the knowledge of the
stack running on the VF.  The VF driver needs to know that default
VLAN is enabled as VLAN acceleration on the RX side is no longer
supported.  Call netdev_update_features() to fix up the VLAN features
as necessary.  Also, VLAN strip mode must be enabled to strip out
the default VLAN tag.

Only allow VF default VLAN to be set if the firmware spec is >= 1.2.1.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit cf6645f8ebc69775a857b7c51928f3ad9e37aa66)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Simplify VLAN receive logic.
Michael Chan [Mon, 6 Jun 2016 06:37:16 +0000 (02:37 -0400)]
bnxt_en: Simplify VLAN receive logic.

Orabug: 23221795

Since both CTAG and STAG rx acceleration must be enabled together, we
only need to check one feature flag (NETIF_F_HW_VLAN_CTAG_RX) before
calling __vlan_hwaccel_put_tag().

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 8852ddb4dcdfe6f877a02f79bf2bca9ae63c039a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Enable and disable RX CTAG and RX STAG VLAN acceleration together.
Michael Chan [Mon, 6 Jun 2016 06:37:15 +0000 (02:37 -0400)]
bnxt_en: Enable and disable RX CTAG and RX STAG VLAN acceleration together.

Orabug: 23221795

The hardware can only be set to strip or not strip both the VLAN CTAG and
STAG.  It cannot strip one and not strip the other.  Add logic to
bnxt_fix_features() to toggle both feature flags when the user is toggling
one of them.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5a9f6b238e59bc05afb4cdeaf3672990bf2a5309)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Fix tx push race condition.
Michael Chan [Mon, 6 Jun 2016 06:37:14 +0000 (02:37 -0400)]
bnxt_en: Fix tx push race condition.

Orabug: 23221795

Set the is_push flag in the software BD before the tx data is pushed to
the chip.  It is possible to get the tx interrupt as soon as the tx data
is pushed.  The tx handler will not handle the event properly if the
is_push flag is not set and it will crash.

Signed-off-by: Michael Chan <michael.chan@broadocm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b9a8460a08a1e0150073cda3e7a0dd23cb888052)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Use dma_rmb() instead of rmb().
Michael Chan [Sun, 15 May 2016 07:04:51 +0000 (03:04 -0400)]
bnxt_en: Use dma_rmb() instead of rmb().

Orabug: 23221795

Use the weaker but more appropriate dma_rmb() to order the reading of
the completion ring.

Suggested-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b67daab033293b3882ba4dc926ffb084d70044e0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Add BCM57314 device ID.
Michael Chan [Sun, 15 May 2016 07:04:50 +0000 (03:04 -0400)]
bnxt_en: Add BCM57314 device ID.

Orabug: 23221795

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5049e33b559a44e9f216d86c58c7c7fce6f5df2f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Simplify and improve unsupported SFP+ module reporting.
Michael Chan [Sun, 15 May 2016 07:04:49 +0000 (03:04 -0400)]
bnxt_en: Simplify and improve unsupported SFP+ module reporting.

Orabug: 23221795

The current code is more complicated than necessary and can only report
unsupported SFP+ module if it is plugged in after the device is up.

Rename bnxt_port_module_event() to bnxt_get_port_module_status().  We
already have the current module_status in the link_info structure, so
just check that and report any unsupported SFP+ module status.  Delete
the unnecessary last_port_module_event.  Call this function at the
end of bnxt_open to report unsupported module already plugged in.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 10289bec0072b13f629a654d94faf1dadd44f335)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Fix length value in dmesg log firmware error message.
Michael Chan [Sun, 15 May 2016 07:04:48 +0000 (03:04 -0400)]
bnxt_en: Fix length value in dmesg log firmware error message.

Orabug: 23221795

The len value in the hwrm error message is wrong.  Use the properly adjusted
value in the variable len.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 8578d6c19a308dea3daf3d03acdf18724ec05590)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Improve the delay logic for firmware response.
Michael Chan [Sun, 15 May 2016 07:04:47 +0000 (03:04 -0400)]
bnxt_en: Improve the delay logic for firmware response.

Orabug: 23221795

The current code has 2 problems:

1. The maximum wait time is not long enough.  It is about 60% of the
duration specified by the firmware.  It is calling usleep_range(600, 800)
for every 1 msec we are supposed to wait.

2. The granularity of the delay is too coarse.  Many simple firmware
commands finish in 25 usec or less.

We fix these 2 issues by multiplying the original 1 msec loop counter by
40 and calling usleep_range(25, 40) for each iteration.

There is also a second delay loop to wait for the last DMA word to
complete.  This delay loop should be a very short 5 usec wait.

This change results in much faster bring-up/down time:

Before the patch:

time ip link set p4p1 up

real    0m0.120s
user    0m0.001s
sys     0m0.009s

After the patch:

time ip link set p4p1 up

real    0m0.030s
user    0m0.000s
sys     0m0.010s

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit a11fa2be6d1564375dc57530680268ad569c2632)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Reduce maximum ring pages if page size is 64K.
Michael Chan [Sun, 15 May 2016 07:04:46 +0000 (03:04 -0400)]
bnxt_en: Reduce maximum ring pages if page size is 64K.

Orabug: 23221795

The chip supports 4K/8K/64K page sizes for the rings and we try to
match it to the CPU PAGE_SIZE.  The current page size limits for the rings
are based on 4K/8K page size. If the page size is 64K, these limits are
too large.  Reduce them appropriately.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit d0a42d6fc8eaf1b64f62b0bbc3b829b756eacf57)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Report PCIe link speed and width during driver load
Ajit Khaparde [Sun, 15 May 2016 07:04:45 +0000 (03:04 -0400)]
bnxt_en: Report PCIe link speed and width during driver load

Orabug: 23221795

Add code to log a message during driver load indicating PCIe link
speed and width.

The log message will look like this:
bnxt_en 0000:86:00.0 eth0: PCIe: Speed 8.0GT/s Width x8

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 90c4f788f6c08aaa52edbb47a817403376523375)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Add Support for ETHTOOL_GMODULEINFO and ETHTOOL_GMODULEEEPRO
Ajit Khaparde [Sun, 15 May 2016 07:04:44 +0000 (03:04 -0400)]
bnxt_en: Add Support for ETHTOOL_GMODULEINFO and ETHTOOL_GMODULEEEPRO

Orabug: 23221795

Add support to fetch the SFP EEPROM settings from the firmware
and display it via the ethtool -m command.  We support SFP+ and QSFP
modules.

v2: Fixed a bug in bnxt_get_module_eeprom() found by Ben Hutchings.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 42ee18fe4ca2a12b8370bb1c53fa6b9f9300c70c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Fix invalid max channel parameter in ethtool -l.
Satish Baddipadige [Sun, 15 May 2016 07:04:43 +0000 (03:04 -0400)]
bnxt_en: Fix invalid max channel parameter in ethtool -l.

Orabug: 23221795

When there is only 1 MSI-X vector or in INTA mode, tx and rx pre-set
max channel parameters are shown incorrectly in ethtool -l.  With only 1
vector, bnxt_get_max_rings() will return -ENOMEM.  bnxt_get_channels
should check this return value, and set max_rx/max_tx to 0 if it is
non-zero.

Signed-off-by: Satish Baddipadige <sbaddipa@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 18d6e4e2d800cbd44a7d7d215a49f99c6508e4a5)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Add async event handling for speed config changes.
Michael Chan [Mon, 11 Apr 2016 08:11:14 +0000 (04:11 -0400)]
bnxt_en: Add async event handling for speed config changes.

Orabug: 23221795

On some dual port cards, link speeds on both ports have to be compatible.
Firmware will inform the driver when a certain speed is no longer
supported if the other port has linked up at a certain speed.  Add
logic to handle this event by logging a message and getting the
updated list of supported speeds.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 8cbde1175e3c8565edbb777cd09cbfdb93c78397)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Call firmware to approve VF MAC address change.
Michael Chan [Mon, 11 Apr 2016 08:11:13 +0000 (04:11 -0400)]
bnxt_en: Call firmware to approve VF MAC address change.

Orabug: 23221795

Some hypervisors (e.g. ESX) require the VF MAC address to be forwarded to
the PF for approval.  In Linux PF, the call is not forwarded and the
firmware will simply check and approve the MAC address if the PF has not
previously administered a valid MAC address for this VF.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 84c33dd342ad596a271a61da0119bf34e80bb1c5)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Shutdown link when device is closed.
Michael Chan [Mon, 11 Apr 2016 08:11:12 +0000 (04:11 -0400)]
bnxt_en: Shutdown link when device is closed.

Orabug: 23221795

Let firmware know that the driver is giving up control of the link so that
it can be shutdown if no management firmware is running.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 33f7d55f07ab964055d73d38774346f8d4821f00)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Disallow forced speed for 10GBaseT devices.
Michael Chan [Mon, 11 Apr 2016 08:11:11 +0000 (04:11 -0400)]
bnxt_en: Disallow forced speed for 10GBaseT devices.

Orabug: 23221795

10GBaseT devices must autonegotiate to determine master/slave clocking.
Disallow forced speed in ethtool .set_settings() for these devices.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 03efbec03198a0f505c2a6c93268c3c5df321c90)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Improve ethtool .get_settings().
Michael Chan [Tue, 5 Apr 2016 18:09:03 +0000 (14:09 -0400)]
bnxt_en: Improve ethtool .get_settings().

Orabug: 23221795

If autoneg is off, we should always report the speed and duplex settings
even if it is link down so the user knows the current settings.  The
unknown speed and duplex should only be used for autoneg when link is
down.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 29c262fed4067c52977ba279cf71520f9991a050)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Check for valid forced speed during ethtool -s.
Michael Chan [Tue, 5 Apr 2016 18:09:02 +0000 (14:09 -0400)]
bnxt_en: Check for valid forced speed during ethtool -s.

Orabug: 23221795

Check that the forced speed is a valid speed supported by firmware.
If not supported, return -EINVAL.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 9d9cee08fc9f5c4df84ef314158fd19c013bcec6)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Add unsupported SFP+ module warnings.
Michael Chan [Tue, 5 Apr 2016 18:09:01 +0000 (14:09 -0400)]
bnxt_en: Add unsupported SFP+ module warnings.

Orabug: 23221795

Add the PORT_CONN_NOT_ALLOWED async event handling logic.  The driver
will print an appropriate warning to reflect the SFP+ module enforcement
policy done in the firmware.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 4bb13abf208cb484a9b9d1af9233b0ef850c2fe7)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Set async event bits when registering with the firmware.
Michael Chan [Tue, 5 Apr 2016 18:09:00 +0000 (14:09 -0400)]
bnxt_en: Set async event bits when registering with the firmware.

Orabug: 23221795

Currently, the driver only sets bit 0 of the async_event_fwd fields.
To be compatible with the latest spec, we need to set the
appropriate event bits handled by the driver.  We should be handling
link change and PF driver unload events, so these 2 bits should be
set.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 25be862370031056989ee76e3c48c3ac8ff67fd4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Add get_eee() and set_eee() ethtool support.
Michael Chan [Tue, 5 Apr 2016 18:08:59 +0000 (14:08 -0400)]
bnxt_en: Add get_eee() and set_eee() ethtool support.

Orabug: 23221795

Allow users to get|set EEE parameters.

v2: Added comment for preserving the tx_lpi_timer value in get_eee.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 72b34f04e0b00956dd679ae18bf2163669df8b56)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Add EEE setup code.
Michael Chan [Tue, 5 Apr 2016 18:08:58 +0000 (14:08 -0400)]
bnxt_en: Add EEE setup code.

Orabug: 23221795

1. Add bnxt_hwrm_set_eee() function to setup EEE firmware parameters based
on the bp->eee settings.
2. The new function bnxt_eee_config_ok() will check if EEE parameters need
to be modified due to autoneg changes.
3. bnxt_hwrm_set_link() has added a new parameter to update EEE.  If the
parameter is set, it will call bnxt_hwrm_set_eee().

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 939f7f0ca442187db2a4ec7a40979c711b0c939e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Add basic EEE support.
Michael Chan [Tue, 5 Apr 2016 18:08:57 +0000 (14:08 -0400)]
bnxt_en: Add basic EEE support.

Orabug: 23221795

Get EEE capability and the initial EEE settings from firmware.
Add "EEE is active | not active" to link up dmesg.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 170ce01301a2a1a87808765531d938fa0b023641)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Improve flow control autoneg with Firmware 1.2.1 interface.
Michael Chan [Tue, 5 Apr 2016 18:08:56 +0000 (14:08 -0400)]
bnxt_en: Improve flow control autoneg with Firmware 1.2.1 interface.

Orabug: 23221795

Make use of the new AUTONEG_PAUSE bit in the new interface to better
control autoneg flow control settings, independent of RX and TX
advertisement settings.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c9ee9516c161da2d072e035907aa35a35dfa68a8)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Update to Firmware 1.2.2 spec.
Michael Chan [Tue, 5 Apr 2016 18:08:55 +0000 (14:08 -0400)]
bnxt_en: Update to Firmware 1.2.2 spec.

Orabug: 23221795

Use new field names in API structs and stop using deprecated fields
auto_link_speed and auto_duplex in phy_cfg/phy_qcfg structs.

Update copyright year to 2016.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 11f15ed394782dd018d60a0bb550616a8571b43c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Add workaround to detect bad opaque in rx completion (part 2)
Michael Chan [Tue, 10 May 2016 23:18:00 +0000 (19:18 -0400)]
bnxt_en: Add workaround to detect bad opaque in rx completion (part 2)

Orabug: 23221795

Add detection and recovery code when the hardware returned opaque value
does not match the expected consumer index.  Once the issue is detected,
we skip the processing of all RX and LRO/GRO packets.  These completion
entries are discarded without sending the SKB to the stack and without
producing new buffers.  The function will be reset from a workqueue.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit fa7e28127a5ad9fd55ac9c7707d8c8b835113a7c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Add workaround to detect bad opaque in rx completion (part 1)
Michael Chan [Tue, 10 May 2016 23:17:59 +0000 (19:17 -0400)]
bnxt_en: Add workaround to detect bad opaque in rx completion (part 1)

Orabug: 23221795

There is a rare hardware bug that can cause a bad opaque value in the RX
or TPA completion.  When this happens, the hardware may have used the
same buffer twice for 2 rx packets.  In addition, the driver will also
crash later using the bad opaque as the index into the ring.

The rx opaque value is predictable and is always monotonically increasing.
The workaround is to keep track of the expected next opaque value and
compare it with the one returned by hardware during RX and TPA start
completions.  If they miscompare, we will not process any more RX and
TPA completions and exit NAPI.  We will then schedule a workqueue to
reset the function.

This patch adds the logic to keep track of the next rx consumer index.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 376a5b8647d6c56cb8f104d7ad0390b4f4057e70)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Setup multicast properly after resetting device.
Michael Chan [Wed, 4 May 2016 20:56:44 +0000 (16:56 -0400)]
bnxt_en: Setup multicast properly after resetting device.

Orabug: 23221795

The multicast/all-multicast internal flags are not properly restored
after device reset.  This could lead to unreliable multicast operations
after an ethtool configuration change for example.

Call bnxt_mc_list_updated() and setup the vnic->mask in bnxt_init_chip()
to fix the issue.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 7d2837dd7a3239e8201d9bef75c1a708e451e123)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Need memory barrier when processing the completion ring.
Michael Chan [Wed, 4 May 2016 20:56:43 +0000 (16:56 -0400)]
bnxt_en: Need memory barrier when processing the completion ring.

Orabug: 23221795

The code determines if the next ring entry is valid before proceeding
further to read the rest of the entry.  The CPU can re-order and read
the rest of the entry first, possibly reading a stale entry, if DMA
of a new entry happens right after reading it.  This issue can be
readily seen on a ppc64 system, causing it to crash.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 67a95e2022c7f0405408fb1f910283785ece354a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Divide a page into 32K buffers for the aggregation ring if necessary.
Michael Chan [Mon, 25 Apr 2016 06:30:51 +0000 (02:30 -0400)]
bnxt_en: Divide a page into 32K buffers for the aggregation ring if necessary.

Orabug: 23221795

If PAGE_SIZE is bigger than BNXT_RX_PAGE_SIZE, that means the native CPU
page is bigger than the maximum length of the RX BD.  Divide the page
into multiple 32K buffers for the aggregation ring.

Add an offset field in the bnxt_sw_rx_agg_bd struct to keep track of the
page offset of each buffer.  Since each page can be referenced by multiple
buffer entries, call get_page() as needed to get the proper reference
count.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 89d0a06c516339c0a2b3d02677f5d6310b3319fb)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Limit RX BD pages to be no bigger than 32K.
Michael Chan [Mon, 25 Apr 2016 06:30:50 +0000 (02:30 -0400)]
bnxt_en: Limit RX BD pages to be no bigger than 32K.

Orabug: 23221795

The RX BD length field of this device is 16-bit, so the largest buffer
size is 65535.  For LRO and GRO, we allocate native CPU pages for the
aggregation ring buffers.  It won't work if the native CPU page size is
64K or bigger.

We fix this by defining BNXT_RX_PAGE_SIZE to be native CPU page size
up to 32K.  Replace PAGE_SIZE with BNXT_RX_PAGE_SIZE in all appropriate
places related to the rx aggregation ring logic.

The next patch will add additional logic to divide the page into 32K
chunks for aggrgation ring buffers if PAGE_SIZE is bigger than
BNXT_RX_PAGE_SIZE.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 2839f28bd5bf8fd2ab4a1ea3a5589c8f94364cbb)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Don't fallback to INTA on VF.
Michael Chan [Mon, 25 Apr 2016 06:30:49 +0000 (02:30 -0400)]
bnxt_en: Don't fallback to INTA on VF.

Orabug: 23221795

Only MSI-X can be used on a VF.  The driver should fail initialization
if it cannot successfully enable MSI-X.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1fa72e29e14d97fbda15437c648d7cc4eb00bff8)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Fix ethtool -a reporting.
Michael Chan [Mon, 28 Mar 2016 23:46:07 +0000 (19:46 -0400)]
bnxt_en: Fix ethtool -a reporting.

Orabug: 23221795

To report flow control tx/rx settings accurately regardless of autoneg
setting, we should use link_info->req_flow_ctrl.  Before this patch,
the reported settings were only correct when autoneg was on.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 3c02d1bb32347d0674714ee170772d771d513469)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Fix typo in bnxt_hwrm_set_pause_common().
Michael Chan [Mon, 28 Mar 2016 23:46:06 +0000 (19:46 -0400)]
bnxt_en: Fix typo in bnxt_hwrm_set_pause_common().

Orabug: 23221795

The typo caused the wrong flow control bit to be set.

Reported by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 49b5c7a125201bb42c25831fda3a50305c29ef50)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Implement proper firmware message padding.
Michael Chan [Mon, 28 Mar 2016 23:46:05 +0000 (19:46 -0400)]
bnxt_en: Implement proper firmware message padding.

Orabug: 23221795

The size of every padded firmware message is specified in the first
HWRM_VER_GET response message.  Use this value to pad every message
after that.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e6ef26991a46e20879bebb8298080eb7ceed4ae8)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Initialize CP doorbell value before ring allocation
Prashant Sreedharan [Mon, 28 Mar 2016 23:46:04 +0000 (19:46 -0400)]
bnxt_en: Initialize CP doorbell value before ring allocation

Orabug: 23221795

The existing code does the following:
    allocate completion ring
    initialize completion ring doorbell
    disable interrupts on this completion ring by writing to the doorbell

We can have a race where firmware sends an asynchronous event to the host
after completion ring allocation and before doorbell is initialized.
When this happens driver can crash while ringing the doorbell using
uninitialized value as part of handling the IRQ/napi request.

Signed-off-by: Prashant Sreedharan <prashant.sreedharan@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 33e52d888d0c84a0c66f13357a53113fd9710bd6)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Enable AER support.
Satish Baddipadige [Mon, 7 Mar 2016 20:38:48 +0000 (15:38 -0500)]
bnxt_en: Enable AER support.

Orabug: 23221795

Add pci_error_handler callbacks to support for pcie advanced error
recovery.

Signed-off-by: Satish Baddipadige <sbaddipa@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6316ea6db93d875df333e7ab205bf1aa3b3616d7)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Include hardware port statistics in ethtool -S.
Michael Chan [Mon, 7 Mar 2016 20:38:47 +0000 (15:38 -0500)]
bnxt_en: Include hardware port statistics in ethtool -S.

Orabug: 23221795

Include the more useful port statistics in ethtool -S for the PF device.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 8ddc9aaa725a9337fc7bbe95fe1d1499769fb9b2)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Include some hardware port statistics in ndo_get_stats64().
Michael Chan [Mon, 7 Mar 2016 20:38:46 +0000 (15:38 -0500)]
bnxt_en: Include some hardware port statistics in ndo_get_stats64().

Orabug: 23221795

Include some of the port error counters (e.g. crc) in ->ndo_get_stats64()
for the PF device.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 9947f83fb79ca501f5ab24c370211bfb78b6b364)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Add port statistics support.
Michael Chan [Mon, 7 Mar 2016 20:38:45 +0000 (15:38 -0500)]
bnxt_en: Add port statistics support.

Orabug: 23221795

Gather periodic port statistics if the device is PF and link is up.  This
is triggered in bnxt_timer() every one second to request firmware to DMA
the counters.

Signed-off-by: Michael Chan <michael.chan@broadocm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 3bdf56c47dfcd819ab1e73644c2eb9c72c08f29e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Extend autoneg to all speeds.
Michael Chan [Mon, 7 Mar 2016 20:38:44 +0000 (15:38 -0500)]
bnxt_en: Extend autoneg to all speeds.

Orabug: 23221795

Allow all autoneg speeds aupported by firmware to be advertised.  If
the advertising parameter is 0, then all supported speeds will be
advertised.

Remove BNXT_ALL_COPPER_ETHTOOL_SPEED which is no longer used as all
supported speeds can be advertised.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f1a082a6f79fd5f06b27ef05a5ba7ec8d6e83b4c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Use common function to get ethtool supported flags.
Michael Chan [Mon, 7 Mar 2016 20:38:43 +0000 (15:38 -0500)]
bnxt_en: Use common function to get ethtool supported flags.

Orabug: 23221795

The supported bits and advertising bits in ethtool have the same
definitions.  The same is true for the firmware bits.  So use the
common function to handle the conversion for both supported and
advertising bits.

v2: Don't use parentheses on function return.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 4b32cacca28fe8b29bf266feff19b6fc2180402e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Add reporting of link partner advertisement.
Michael Chan [Mon, 7 Mar 2016 20:38:42 +0000 (15:38 -0500)]
bnxt_en: Add reporting of link partner advertisement.

Orabug: 23221795

And report actual pause settings to ETHTOOL_GPAUSEPARAM to let ethtool
resolve the actual pause settings.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 3277360eb29c6e482391975717d983060ecbd28d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>