History log of /drivers/net/ethernet/intel/i40e/i40e.h
Revision Date Author Comments
a316f651c73f782ff7c6df623a69b67f8f464856 12-Jul-2014 Anjali Singhai Jain <anjali.singhai@intel.com> i40e: Fix an issue when PF reset fails

We shouldn't restart Admin queue subtask if PF reset fails since we do
not have the AQ setup at that point. This patch makes sure we disable AQ
clean subtask when PF reset fails.

This will resolve an occasional kernel panic when PF reset fails for
some reason.

Change-ID: I11a747773362a8c5c0ad7a10cd34be0bda8eb9e8
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
810b3ae42f5a6d1ddb17bb20eb69046de08ab1ef 10-Jul-2014 Anjali Singhai Jain <anjali.singhai@intel.com> i40e/i40evf: Ignore a driver perceived Tx hang if the number of desc pending < 4

We are seeing situations where the driver sees a hang with less than 4
desc pending, if the driver chooses to ignore it the queue progresses
forward and the stack never experiences a real hang.
With this patch we will log a stat when this situation happens
"tx_sluggish" will increment and we can see some more details
at a higher debug level. Other than that we will ignore this
particular case of Tx hang.

Change-ID: I7d1d1666d990e2b12f4f6bed0d17d22e1b6410d5
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
60793f4ab541f9c279f823e42dc8053341cc7547 09-Jul-2014 Anjali Singhai Jain <anjali.singhai@intel.com> i40e: Add a FD flush counter to ethtool

This helps know how many times the interface had to flush and replay FD
filter table, which gives an indication on how often we are getting FD
table full situation.

Also check on certain pf states before proceeding to add or delete
filters since we can't add or delete filters if we are in those states.

Change-ID: I97f5bbbea7146833ea61af0e08ea794fccba1780
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1e1be8f622ee3d01acdbf5f4e00fbdd53ff950c9 10-Jul-2014 Anjali Singhai Jain <anjali.singhai@intel.com> i40e: ATR policy change to flush the table to clean stale ATR rules

Instead of disabling ATR when we get a programming error, we now
will wait it out to see if some room gets created by ATR rule deletion.
If we still have too many errors and ATR filter count did not change
much, its time to flush and replay. We no more auto-disable ATR when
we have errors in programming.
The disabling of ATR when we get programming error was buggy and
was still adding new rules and causing continuous errors. With this
policy change we flush instead when we see too many errors.
ATR is still disabled if we add a SB rule for TCP/IPv4 flow type,
more logic is added to re-enable it once all SB TCP/IPv4 rules are gone.

Change-ID: I77edcbeab9500c72a7e0bd7b5c5b113ced133a9c
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
38e004388692f049908636a7944f6cd57d28bd77 01-Aug-2014 Vasu Dev <vasu.dev@intel.com> i40e: Adds FCoE related code to i40e core driver

Adds FCoE specific code to existing i40e core driver to:-

1. have separate FCoE VSI with additional FCoE queues pairs.
2. have FCoE related hash defines.
3. have additional FCoE related stats code.
4. export and then re-use existing functions required by FCoE build.

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Tested-by: Jack Morgan<jack.morgan@intel.com>
Signed-off-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9ce34f023d6025af89087472f0327e0a81073167 15-Mar-2014 Jakub Kicinski <kubakici@wp.pl> i40e: fix race conditions on queuing skb for HW time stamp

i40e has a single set of TX time stamping resources per NIC.
Use a simple bit lock to avoid race conditions and leaking skbs
when multiple TX rings try to claim time stamping.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Tested-By: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1f224ad2f760288dcc58b26546892a6b200b2af2 12-Feb-2014 Neerav Parikh <neerav.parikh@intel.com> i40e: Add ndo_get_phys_port_id() callback support

This patch adds a new API to get the port mac address from firmware.
It also adds support to the ndo_get_phys_port_id() callback to provide
port specific unique id to the netdev layer.
If the adapter has a valid per-port mac address then that
would be used for this purpose and is expected to be unique
on a per-port basis.

The information can be viewed by reading the phys_port_id
attribute in sysfs for each netdev or via IF netlink
interface.

Change-ID: I341fa6fff9c112f1f6d987189309e730e0b50e8b
Signed-off-by: Neerav Parikh <neerav.parikh@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
129573883c5b39d978c4a7fbe513f8e54898e27e 04-Jun-2014 Anjali Singhai Jain <anjali.singhai@intel.com> i40e: Fix the FD sideband logic to detect a FD table full condition

Hardware does not have a way of telling a PF how much of the global
shared FD table space is still available or is consumed.
Previously, every PF but PF0 would think there was still space available
when there wasn't. The PFs would continue to try to add filters and fail.
With this new logic if a filter programming error is detected we just
check if we are close to the guaranteed space full and that can be used
as a hint to say, there might not be space and we should turn off the
features. This way we can turn off the feature in SW for all PFs in
time.

Change-ID: I725cb2fab16c033f883056362b4542c1400503c5
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
6252c7e4ee48f016dd075168df9fabc7197f38e5 04-Jun-2014 Shannon Nelson <shannon.nelson@intel.com> i40e: reapply LAA after reset

The LAA is lost on a reset, so be sure to replay it when rebuilding
the switch after any reset.

Change-ID: I6e643f9a59dfd899b6cbdf84d93b4bc9c37bb949
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
5c2cebda438b888147f6dfd6d1423432d837c0ea 04-Jun-2014 Carolyn Wyborny <carolyn.wyborny@intel.com> i40e: Fix ethtool coalesce settings

This patch fixes the i40e_set_coalesce function to allow 0 as a disable
value. Also, added message to user about invalid value and provides valid
range.

Change-ID: I6c9ff11a9861f2045bd543745a3d132999ffbbd8
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
e157ea30606743f2bfa2ec445a0bb0839e17271b 04-Jun-2014 Carolyn Wyborny <carolyn.wyborny@intel.com> i40e/i40evf: Update RSS configuration

This patch changes the RSS configuration to set table size
and write to hardware to confirm RSS table size being used.

Change-ID: I455a4c09c9dd479f5791ee1f09fdc83ff9908df5
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
b5d06f058b0bb52c39e4f1a32584dda712e0398f 04-Jun-2014 Neerav Parikh <neerav.parikh@intel.com> i40e: Fix scheduling while atomic bug during NAPI

The bug is encountered when all the Tx hang recovery mechanisms have
failed and driver tries to bring down the interface in the interrupt context.
The patch defers this and schedules it for next cycle.

Change-ID: Id9cd1da15b0e5c018dce18da4d0eed5ef1e8a809
Signed-off-by: Neerav Parikh <neerav.parikh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
23527308d6519c551c8296146f3edf3ad1cd123a 04-Jun-2014 Neerav Parikh <neerav.parikh@intel.com> i40e: Helper routine for Rx/Tx queue enable/disable wait

Introduce helper routines that would wait for the Rx/Tx queue
to reach the enable or disable state as requested.

Change-ID: I518d9d0e2afef3f45107af3b46e9af402ff587c3
Signed-off-by: Neerav Parikh <neerav.parikh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
433c47de1368cf07a7cb8d9148a4d36d824b89f8 22-May-2014 Anjali Singhai Jain <anjali.singhai@intel.com> i40e/i40evf: Add Flow director stats to PF stats

Add members to stat struct to keep track of Flow director ATR and
SideBand filter packet matches.

Change-ID: Ibbb31a53c7adcc2bb96991dd80565442a2f2513c
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
4d9b604353e65824e49a01ecf2b3f3bf329e6048 22-May-2014 Neerav Parikh <neerav.parikh@intel.com> i40e: Separate out DCB capability and enabled flags

Currently if the firmware reports DCB capability the driver enables
I40E_FLAG_DCB_ENABLED flag. When this flag is enabled the driver
inserts a tag when transmitting a packet from the port even if there
are no DCB traffic classes configured at the port.

This patch adds a new flag I40E_FLAG_DCB_CAPABLE that will be set
when the DCB capability is present and the existing flag
I40E_FLAG_DCB_ENABLED will be set only if there are more than one
traffic classes configured at the port.

Change-ID: I24ccbf53ef293db2eba80c8a9772acf729795bd5
Signed-off-by: Neerav Parikh <neerav.parikh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
04b73bd7a46b0294456301e237041cca5adb33d7 22-May-2014 Anjali Singhai Jain <anjali.singhai@intel.com> i40e: Change the notion of src and dst for FD_SB in ethtool

In XL710 devices we program FD filter's fields from Tx perspective of the flow.
However the user interface exposed in ethtool should be compliant with the
previous generation of drivers where a filter src and dst field are from
the RX perspective. This patch changes the ethtool interface in this regard
to match the other drivers.

Change-ID: Iec6ccddd87357c4fb53ccf33aa0fae699faf70cf
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
3146ce3d4da6bd8f5541c551a84719069bc9166e 20-May-2014 Shannon Nelson <shannon.nelson@intel.com> i40e: remove unused variable and memory allocation

This was a vestige of early driver development that no longer
has any actual use.

Change-ID: I95b5b19c4bbfaff8759197af671ebaf716cb6ab5
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
505682cd7baba79b52f6c9df49224307fb6d34ef 20-May-2014 Mitch Williams <mitch.a.williams@intel.com> i40e: allow for more VSIs

The number of VSIs that the firmware reports to us is a guaranteed
minimum, not an absolute maximum. The hardware actually supports far
more than the reported value, which we often need.

To allow for this, we allocate space for a larger number of VSIs than is
guaranteed by the firmware, with the knowledge that we may fail to get
them all in the future.

Note that we are just allocating pointers here, the actual (much larger)
VSI structures are allocated on demand.

Change-ID: I6f4e535ce39d3bf417aef78306e04fbc7505140e
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
a5282f447d5e50cf285770226156a566e73687c2 10-May-2014 Akeem G Abodunrin <akeem.g.abodunrin@intel.com> i40e/i40evf: Clean up a few things

1. There is no ixgbe_watchdog_task function in the driver, so change
the comment to the correct function name, i40e_watchdog_subtask.
2. Remove num_msix_entries from interrupt set_up routine
because it is never used.
3. Remove some TBD comments that are not needed.

Change-ID: I37697a04007074b797f85fd83d626672e4df1ad1
Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
6374184672c8e405640ab57ea9ad1cb7ed4fa669 23-Apr-2014 Shannon Nelson <shannon.nelson@intel.com> i40e: remove irqs only when they are set up

Use an extra state variable to keep track of when the IRQs are fully
set up. This keeps us from trying to unhook IRQs that already were
left unhooked in a failed reset recovery, e.g. when firmware is broken.

Change-ID: I073eb081e4ef8aedcbdf1ee0717c0ed64fa172f2
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
082def103dd18350eb9a5c911465666606485404 09-Apr-2014 Anjali Singhai Jain <anjali.singhai@intel.com> i40e: Report cmd->data in ETHTOOL_GRXCLSRLCNT instead of ETHTOOL_GRXCLSRULE

Based on review feedback from upstream cmd->data is not
defined in ETHTOOL_GRXCLSRULE but needs to be reported in
ETHTOOL_GRXCLSRLCNT. Also use a helper function to calculate the total
filter count.

Change-ID: Iaacbf729527b73290c4fdad837b379b44fd7dd20
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1c112a6475c157d2f59cace533e3ce825ce49024 04-Apr-2014 Mitch Williams <mitch.a.williams@intel.com> i40e: add required include

On some architectures, this header must be explicitly included.

Change-ID: I4bc2eb0531956a7b676489f79d347d55cfe12421
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
0dd8357f8fab1d82aa8fc8267261203f393d5a1f 15-Jan-2014 Jacob Keller <jacob.e.keller@intel.com> i40e: remove ptp_tx_work timestamp work item

This patch removes the unnecessary ptp_tx_work item. It conflicts with
the interrupt-based handler, and will cause spurious warning messages to
be displayed in the kernel log. Since the hardware can properly trigger
an interrupt, we do not need to poll for an available timestamp in a
work queue any more.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
4eb3f7685fd6ffbe28a0a4ff10cced2acda5f7ec 06-Mar-2014 Shannon Nelson <shannon.nelson@intel.com> i40e: eeprom integrity check on load and empr

The driver needs to verify the eeprom checksum and firmware crc status bits,
and shutdown the driver if they fail. This code stops the processing of traffic,
but doesn't kill the PF netdev so that the NVMUpdate process should still have a
chance at fixing the image. The eeprom is checked on driver load and after an
EMP reset, the latter of which should be generated after an NVMUpdate.

Change-ID: I34deef21d2e16bf5a43c603cf8af27e6a29dc9d2
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
6c167f582ea93d0b66a187ec06a7c015fecd723a 15-Feb-2014 Elizabeth Kappler <elizabeth.m.kappler@intel.com> i40e: Refactor and cleanup i40e_open(), adding i40e_vsi_open()

This patch cleans up and moves a portion of i40e_open to i40e_vsi_open,
in order to have a shorter vsi_open function that does only that.

Change-ID: I1c418dda94dcfc0eb7d4386a70c330692ef5ecc9
Signed-off-by: Elizabeth Kappler <elizabeth.m.kappler@intel.com>
Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
7c3c288bcf95ebfc970c508821dd950876422280 14-Feb-2014 Anjali Singhai Jain <anjali.singhai@intel.com> i40e: Patch to enable Ethtool/netdev feature flag for NTUPLE control

This enables option '-k/-K' in ethtool for NTUPLE control.
NTUPLE control requires a reset, to take effect. When the feature is
turned off, the SW list of stored FD SB filters gets cleaned up.

Change-ID: I9d564b67a10d4afa11de3b320d601c3d2e6edc1f
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
55a5e60b9f583f64a6c95cfe869dd2d65ae53a95 12-Feb-2014 Anjali Singhai Jain <anjali.singhai@intel.com> i40e: Add code to handle FD table full condition

Add code to enforce the following policy:
- If the HW reports filter programming error, we check if it's due to a
full table.
- If so, we go ahead and turn off new rule addition for ATR and then SB
in that order.
- We monitor the programmed filter count, if enough room is created due
to filter deletion/reset, we then re-enable SB and ATR new rule addition.

Change-ID: I69d24b29e5c45bc4fa861258e11c2fa7b8868748
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
61dade7e9201162cba683cff103cebbdf06655d4 11-Feb-2014 Anjali Singhai Jain <anjali.singhai@intel.com> i40e: Define a new state variable to keep track of feature auto disable

This variable is a bit mask. It is needed to differentiate between
user enforced feature disables and auto disable of features due to
HW resource limitations.

Change-ID: Ib4b4f6ae1bb2668c12e482d2555100bc8ad713d5
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
ff80301efad4818938470326b9879bb960f5e66c 06-Feb-2014 Jesse Brandeburg <jesse.brandeburg@intel.com> i40e: fix nvm version and remove firmware report

The driver needs to use the format that the current NVM
uses when printing the version of the NVM. It should remain
this way from now on forward.

The driver was reporting when firmware was less than
an expected version number, but this is not a requirement
for the product and we print the firmware number at
init and in ethtool -i output. Just remove the print.

Change-ID: Ide0b856cd454ebf867610ef9a0d639bb358a4a60
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
17a73f6b14010d4516a05f52e3c87431e86edebb 12-Feb-2014 Joseph Gasparakis <joseph.gasparakis@intel.com> i40e: Flow Director sideband accounting

This patch completes implementation of the ethtool ntuple
rule management interface. It adds the get, update and delete
interface reset.

Change-ID: Ida7f481d9ee4e405ed91340b858eabb18a52fdb5
Signed-off-by: Joseph Gasparakis <joseph.gasparakis@intel.com>
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
4e3b35b044ea511184ad4c5eff32e05011310ec1 18-Jan-2014 Neerav Parikh <Neerav.Parikh@intel.com> i40e: add DCB and DCBNL support

This patch adds capability to configure DCB on i40e network
interfaces using Intel XL710 adapter firmware APIs.

By default all VSIs are only enabled for the default traffic
class enabled by firmware for any given PF. The driver would
query the firmware for the traffic classes that are enabled for
the port and reconfigure the LAN VSI to match to the port traffic
class settings. All other VSIs are only enabled for the default
traffic class settings for now.

The driver registers and listens to firmware events that may
require change in the DCB settings. It may reconfigure the VSI
settings based on these events.

This patch exposes IEEE DCBNL interfaces for the i40e driver to
allow any application to query the DCB settings on the adapter.

Signed-off-by: Neerav Parikh <Neerav.Parikh@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-By: Jack Morgan<jack.morgan@intel.com>
Signed-off-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
60ea5f83cddf538a4509f2214ffd50d8d69952a5 18-Jan-2014 Jesse Brandeburg <jesse.brandeburg@intel.com> i40e: rename defines

The FLAG_FDIR_* defines can be renamed to be more descriptive.
This patch is in preparation for the following where the fdir
code is refactored.

Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
d0b10249257f0f6932c2654b04db5c48376f0e7b 18-Jan-2014 Jesse Brandeburg <jesse.brandeburg@intel.com> i40e: Change firmware workaround

Remove a workaround that is no longer necessary and implement
a better understanding of what firmware is returning in the MSI-X
vector count. This makes it so that the driver ends up with the
right amount of queues when using all available MSI-X vectors.

Change-ID: I34e60cc71dcfb1b5412f37df956fedcc49ade187
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
a81ab36bf52d0ca3a32251a923be1dbced726141 08-Jan-2014 Paul Gortmaker <paul.gortmaker@windriver.com> drivers/net: delete non-required instances of include <linux/init.h>

None of these files are actually using any __init type directives
and hence don't need to include <linux/init.h>. Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.

This covers everything under drivers/net except for wireless, which
has been submitted separately.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6838b535e1c1e8f78847445d3dc804515cc0bdb5 14-Jan-2014 Jesse Brandeburg <jesse.brandeburg@intel.com> i40e: whitespace fixes

Fix some whitespace and comment issues.

Change-ID: I1587599e50ce66fd389965720e86f9e331d86643
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
beb0dff1251db5214889ea8a122049ec3ae25e41 11-Jan-2014 Jacob Keller <jacob.e.keller@intel.com> i40e: enable PTP

New feature: Enable PTP support in the i40e driver.

Change-ID: I6a8e799f582705191f9583afb1b9231a8db96cc8
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Matthew Vick <matthew.vick@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
4eb6f11d751f0ea5035a8136009189725aca66f9 18-Dec-2013 Anjali Singhai Jain <anjali.singhai@intel.com> i40e: Update the Current NVM version Low value

The current driver will warn the user if the NVM version
is out of date, this raises the bar to a newer version.

Change-ID: I5ec21d8efa4e7c3fdacb56f85d310bb2229b1483
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
dc641b7319f19a17639ed7d36aaddbf090206644 18-Dec-2013 Greg Rose <gregory.v.rose@intel.com> i40e: Fix GPL header

The GPL header included in each file in the i40e driver doesn't
need to include the "this program" text since this driver
is already part of the larger kernel.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
7b86228902a6a01b6a88ff6a418170a9c3196c02 28-Nov-2013 Anjali Singhai Jain <anjali.singhai@intel.com> i40e: Remove unnecessary prototypes

These functions don't need a prototype as they are defined
in the file before they are called.

Change-Id: Ie17ffad4a29a9c0df434c4ebc4681128a6095c65
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9f52987b0508c9162ef9861b2e82d7a82992162e 28-Nov-2013 Neerav Parikh <Neerav.Parikh@intel.com> i40e: I40E_FLAG_MQ_ENABLED is not used

Remove references to I40E_FLAG_MQ_ENABLED from the code
as it doesn't seem to be used anywhere.

Change-Id: I4c89fb65b2cdd26fbb0c58fccbbb4b03f0e5f1b3
Signed-off-by: Neerav Parikh <Neerav.Parikh@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
d739764406ee70e46e890db458fedd17708ee7bc 28-Nov-2013 Neerav Parikh <Neerav.Parikh@intel.com> i40e: Fix ring allocation

The allocation and clearing of rings for a VSI should be
using the alloc_queue_pairs and not num_queue_pairs.

The alloc_queue_pairs per VSI is a pre-allocated number
of queues assigned to a VSI; based on number of TCs enabled
only certain number of queues may be used from that. This
is mainly valid only for the LAN VSI case as that is the
only VSI that may be enabled with multiple traffic classes.
In the future the number of TCs may change based on DCBX
configuration.

The actual number of queues that are enabled/configured is
based on the number of TCs enabled for a given VSI and that
is stored in num_queue_pairs.

With this change num_[tr]x_queues is unused so remove them.

Change-Id: I9c2f84778bb25f7313c630e9b002a0caa883ce29
Signed-off-by: Neerav Parikh <Neerav.Parikh@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2ef28cfb098914f1b8e74807e0cbca2e89262d97 28-Nov-2013 Mitch Williams <mitch.a.williams@intel.com> i40e: use functions to enable and disable icr 0

Introduce i40e_irq_dynamic_disable_icr0 and use it and its previously-
extant counterpart when appropriate.

Change-Id: Ieb4037874fba2e96fc2354b34a97a3cb8f6490f3
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
a45e88c9db90c869365d8e258989639a09cf19dc 28-Nov-2013 Anjali Singhai Jain <anjali.singhai@intel.com> i40e: Dump the whole NVM, not half

Debugfs was reading exactly half the number of words, fix it.

Change-Id: Ieb217f3c6dca455d44e50a0dc61a6664c0cb2265
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
fc18eaa073e5a35aa21038c0c69a5a646195a58b 28-Nov-2013 Mitch Williams <mitch.a.williams@intel.com> i40e: refactor VF reset flow

Fix the VF reset flow so that it works on real hardware. After
discussions with the HW team, the reset flow has been changed
somewhat.

- Change the i40e_reset_vf function to a void type, and fix
up the callers to reflect this.
- Move the MSI-X disable code to i40e_free_vf_res since it must
be done every time the VF is freed, regardless of whether or
not it is reset.
- Ensure that the PCIe bus is quiet before polling the reset bit.
- Don't clear the VFGEN_RSTAT1 register at the beginning as it is
cleared by the reset.
- Poll longer for the reset to be done.
- Disable the queues using an existing function rather than
rolling our own.
- Free and reallocate the VSI after reset to avoid rx hang.

Change-Id: I11e2590431cb73e8663714d1cc5b23d59b809033
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8144f0f7e91ea9e2cbe11202a5ba14601b046d1d 28-Dec-2013 Joseph Gasparakis <joseph.gasparakis@intel.com> i40e: Rx checksum offload for VXLAN

This implements receive offload for VXLAN for i40e. The hardware
supports checksum offload/verification of the inner/outer header.

Change-Id: I450db300af6713f2044fef1191a0d1d294c13369
Signed-off-by: Joseph Gasparakis <joseph.gasparakis@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
a1c9a9d9984d9acf276089525b43a6528feab29b 28-Dec-2013 Jeff Kirsher <jeffrey.t.kirsher@intel.com> i40e: Implementation of VXLAN ndo's

This adds the implementation for the VXLAN ndo's. This allows the
hardware to do RX checksum offload for inner packets on the UDP ports
that VXLAN notifies us about.

Signed-off-by: Joseph Gasparakis <joseph.gasparakis@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8e2773ae3558d69ebba48df2c52111d975db6afa 28-Nov-2013 Shannon Nelson <shannon.nelson@intel.com> i40e: add wake-on-lan support

Wake on LAN is disabled by default and will remain that way for most
platforms, but there is an NVM setting that allows vendors to enable it
for a port if they think they've provided the right power environment
for the device. This patch adds code to check the NVM setting and enable
Magic Packet use if WoL is enabled for the port.

Since only Magic Packet is supported, there's not a lot of HW configuration
needed.

Change-Id: I44e904a7b15695e34683009f487064cd86ea59b0
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9007bccd306956280448fd16fc8e6c65ff4d5337 26-Nov-2013 Shannon Nelson <shannon.nelson@intel.com> i40e: support for suspend and resume

Add basic support for handling suspend and resume. We'll add
Wake-on-LAN support later.

Change-Id: Iea5e11c81bd9289a5bdbf086de8f626911a0b5ce
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
233261867fc62276d6a4099519f81dcd10bd7297 26-Nov-2013 Anjali Singhai Jain <anjali.singhai@intel.com> i40e: rtnl_lock in reset path fixes

Any user-initiated path which eventually calls reset needs
to hold the rtnl_lock, so add functionality to do that.

Be careful not to use the safe reset when cleaning up
from the diagnostic tests, which avoids rtnl_lock
recursion from ethtool.

Protect the reset_task with rtnl_lock, since it runs from a work item.

Change-Id: Ib6e7a3fb2966809db2daf35fd5a123ccdf6f6f0f
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
f8ff14640a72dd35da0fa5fb84b0ef61610f2c3a 26-Nov-2013 Anjali Singhai Jain <anjali.singhai@intel.com> i40e: function to reconfigure RSS queues and rebuild

This is the second of 3 patches that allows for changing
the number of queues in the driver on the fly.

This patch adds a function that calls the reinit flow for the
main VSI after making changes to the RSS queue count as requested
by the user.

Change-Id: I82dee91e9fe90eeb4e84a7369f4b8b342155dd85
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
93cd765bb27365e7be92c510c73b017426eb490d 20-Nov-2013 Anjali Singhai Jain <anjali.singhai@intel.com> i40e: Add a new variable to track number of pf instances

Track the number of physical functions (PFs) found, this is a global counter
on purpose so that each pf loaded has a unique ID.

Change-Id: I74d618520afbce4a774d0235449e3b5f97ff6d4a
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
7134f9cee04142715c586dd686537c9626f4e03f 26-Nov-2013 Jesse Brandeburg <jesse.brandeburg@intel.com> i40e: enable early hardware support

Enable a couple of workarounds based on revision ID that allow the
driver to work more fully on early hardware.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
7823fe341da4660c9aab9fec8fbff94e3070ceaf 16-Nov-2013 Shannon Nelson <shannon.nelson@intel.com> i40e: add support for triggering EMPR

Allow debugfs to trigger a reset called EMPR.

Change-Id: I2f6600a8242759ec60c8198d03f70c2b774e0740
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
cd92e72f2d0a5b576f025f693cfd306cebd8b84a 16-Nov-2013 Shannon Nelson <shannon.nelson@intel.com> i40e: add interrupt test

Add a quick ethtool test for interrupts using the SW interrupt.
Also, change the loopback test (for now) to not report failure.

Change-Id: Id8ef154b82475e3163087a8d1df01dfec4d529fc
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
fe31070444268e7b70279bd4a1403625820793b0 16-Nov-2013 Anjali Singhai jain <anjali.singhai@intel.com> i40e: firmware version fields offsets update

The version bits reported by the hardware changed, so fix
up the offsets to print the version correctly.

Change-Id: I8a8207b401ea88f6da024aebafe7d3826ee6512c
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
718bd4409e37cd74fd9a65b556999155120e6044 24-Sep-2013 Wei Yongjun <yongjun_wei@trendmicro.com.cn> i40e: remove unused including <linux/version.h>

Remove including <linux/version.h> that don't need it.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
116a57d4ae92729b343d6ebb4a1eec24672022ab 28-Sep-2013 Shannon Nelson <shannon.nelson@intel.com> i40e: tweaking icr0 handling for legacy irq

Fix the overactive irq issue seen in testing and allow use of
the legacy interrupt.

Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9f65e15b4f982391eef795a74adcc6580f0d7c53 28-Sep-2013 Alexander Duyck <alexander.h.duyck@intel.com> i40e: Move rings from pointer to array to array of pointers

Allocate the queue pairs individually instead of as a group. This
allows for much easier queue management as it is possible to dynamically
resize the queues without having to free and allocate the entire block.

Ease statistic collection by treating Tx/Rx queue pairs as a single
unit. Each pair is allocated together and starts with a Tx queue and
ends with an Rx queue. By ordering them this way it is possible to know
the Rx offset based on a pointer to the Tx queue.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
493fb30011b3ab5173cef96f1d1ce126da051792 28-Sep-2013 Alexander Duyck <alexander.h.duyck@intel.com> i40e: Move q_vectors from pointer to array to array of pointers

Allocate the q_vectors individually. The advantage to this is that it
allows for easier freeing and allocation. In addition it makes it so
that we could do node specific allocations at some point in the future.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
7daa6bf3294e518cf939830c1a8ec2a6a96204ac 11-Sep-2013 Jesse Brandeburg <jesse.brandeburg@intel.com> i40e: driver core headers

This patch contains the main driver header files, containing
structures and data types specific to the linux driver.

i40e_osdep.h contains some code that helps us adapt our OS agnostic code to
Linux.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
CC: PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com>
CC: e1000-devel@lists.sourceforge.net
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>