Commit graph

349255 commits

Author SHA1 Message Date
David S. Miller 6efecd8c51 Merge branch 'intel'
Jeff Kirsher says:

====================
This series contains updates to e1000e only.  All the updates come
from Bruce Allan and most of the patch fix or enable features on
i217/i218.  Most notably is patch 03 "e1000e: add support for IEEE-1588
PTP", which is v2 of the patch based on feedback from Stephen Hemminger.

Also patch 04 "e1000e: enable ECC on I217/I218 to catch packet buffer
memory errors" should be queued up for stable (as well as net) trees, but
the patch does not apply cleanly to either of those trees currently.
So I will work with Bruce to provide a version of the patch which will
apply cleanly to net (and stable) and we can queue it up at that point
for stable 3.5 tree.

The remaining patches are general cleanups of the code.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-27 19:06:42 -05:00
Bruce Allan 70806a7fd1 e1000e: cleanup: do not assign a variable a value when not necessary
Static analysis with cppcheck has shown a few instances of a variable
being reassigned a value before the old one has been used.  None of these
ever require the old value to be used so remove the old values.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-27 02:15:48 -08:00
Bruce Allan 7dbbe5d5a5 e1000e: do not ignore variables which get set a value
Static analysis with cppcheck has shown a few instances of a variable which
is assigned a value that is never used.  A number of these are the return
status of various driver function calls which should be passed back to the
caller of the current function.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-27 02:08:19 -08:00
Bruce Allan 1f96012d34 e1000e: cleanup: remove unnecessary function prototypes
...and cleanup some whitespace in other prototypes.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-27 02:01:47 -08:00
Bruce Allan 9d57088be9 e1000e: add comment to spinlock_t definition
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-27 01:54:42 -08:00
Bruce Allan d394998072 e1000e: remove definition of struct which is no longer used
The e1000e driver has been converted to use extended descriptors instead of
the older legacy descriptor type.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-27 01:47:40 -08:00
Bruce Allan 4e03510b47 e1000e: fix PHY init workarounds for i217/i218
Toggling the LANPHYPC Value bit cycles the power on the PHY and sets it
back to power-on defaults.  This includes setting it's MAC-PHY messaging
mode to use the PCIe-like interconnect, so the MAC must also be set back
from SMBus mode to PCIe mode otherwise the PHY can be inaccessible.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-27 01:40:38 -08:00
Bruce Allan ed1a42656a e1000e: correct maximum frame size on i217/i218
The largest jumbo frame supported by the i217 and i218 hardware is 9018.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-27 01:30:36 -08:00
Bruce Allan bf67044bf8 e1000e: update copyright date
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-27 01:22:53 -08:00
Bruce Allan fc915e9322 e1000e: remove prototype of non-existent function
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-27 01:15:28 -08:00
Bruce Allan 6e928b721c e1000e: prevent hardware from automatically configuring PHY on I217/I218
As done with the previous generation managed 82579, prevent the PHY from
being put into an unknown state by blocking the hardware from automatically
configuring the PHY as done with the previous generation managed 82579.
Instead, the driver should configure the PHY with contents of the EEPROM
image.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-27 01:07:35 -08:00
Bruce Allan 94fb848bf4 e1000e: enable ECC on I217/I218 to catch packet buffer memory errors
In rare instances, memory errors have been detected in the internal packet
buffer memory on I217/I218 when stressed under certain environmental
conditions.  Enable Error Correcting Code (ECC) in hardware to catch both
correctable and uncorrectable errors.  Correctable errors will be handled
by the hardware.  Uncorrectable errors in the packet buffer will cause the
packet to be received with an error indication in the buffer descriptor
causing the packet to be discarded.  If the uncorrectable error is in the
descriptor itself, the hardware will stop and interrupt the driver
indicating the error.  The driver will then reset the hardware in order to
clear the error and restart.

Both types of errors will be accounted for in statistics counters.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-27 00:49:42 -08:00
Bruce Allan d89777bf0e e1000e: add support for IEEE-1588 PTP
Add PTP IEEE-1588 support and make accesible via the PHC subsystem.

v2: make e1000e_ptp_clock_info a static const struct per Stephen Hemminger

Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Reviewed-by: Jacob Keller <Jacob.e.keller@intel.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-27 00:36:35 -08:00
Bruce Allan 347b5201cb e1000e: fix flow-control thresholds for jumbo frames on 82579/I217/I218
The previous static flow-control thresholds were causing unnecessary pause
packets to be transmitted when jumbo frames are configured reducing the
throughput.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-27 00:26:54 -08:00
Bruce Allan a8fc18910b e1000e: fix ethtool offline register test for I217
The SHRAH[9] register on I217 has a different R/W bit-mask than RAR and
SHRAL/H registers.  Set R/W bit-mask appropriately for SHRAH[9] when
testing the R/W ability of the register.  Also, fix the error message log
format so that it does not provide misleading information (i.e. the logged
register address could be incorrect).

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-27 00:19:19 -08:00
David S. Miller 031554eab0 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-27 01:26:27 -05:00
Tom Herbert 9c5e0c0bbc soreuseport: fix use of uid in tb->fastuid
Fix a reported compilation error where ia variable of type kuid_t
was being set to zero.

Eliminate two instances of setting tb->fastuid to zero.  tb->fastuid is
only used if tb->fastreuseport is set, so there should be no problem if
tb->fastuid is not initialized (when tb->fastreuesport is zero).

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-27 01:01:42 -05:00
Thomas Graf 5588d3742d Remove leftover #endif after introducing SO_REUSEPORT
Commit 055dc21a1d (soreuseport: infrastructure) removed the #if 0
around SO_REUSEPORT without removing the corresponding #endif
thus causing the header guard to close early.

Cc: Tom Herbert <therbert@google.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-27 01:01:41 -05:00
Jitendra Kalsaria 7a8feb4275 qlcnic: Bump up the version to 5.1.32
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-27 01:00:08 -05:00
Jitendra Kalsaria fe1adc6bf2 qlcnic: add support for FDB netdevice ops.
Providing communication channel between KVM and e-Switch so that it
can be informed when hypervisor configures a MAC address and VLAN.

qlcnic_mac_learn module param usage will be changed to:
	0 = MAC learning is disable
	1 = Driver learning is enable
	2 = FDB learning is enable

Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-27 01:00:08 -05:00
Jitendra Kalsaria 1d9219ddb9 qlcnic: sleeping function called from invalid context
device eth0 entered promiscuous mode
BUG: sleeping function called from invalid context at mm/slub.c:930
in_atomic(): 1, irqs_disabled(): 0, pid: 5911, name: brctl
INFO: lockdep is turned off.
Pid: 5911, comm: brctl Tainted: GF       W  O 3.6.0-0.rc7.git1.4.fc18.x86_64 #1
Call Trace:
[<ffffffff810a29ca>] __might_sleep+0x18a/0x240
[<ffffffff811b5d77>] __kmalloc+0x67/0x2d0
[<ffffffffa00a61a9>] ? qlcnic_alloc_lb_filters_mem+0x59/0xa0 [qlcnic]
[<ffffffffa00a61a9>] qlcnic_alloc_lb_filters_mem+0x59/0xa0 [qlcnic]
[<ffffffffa009e1c1>] qlcnic_set_multi+0x81/0x100 [qlcnic]
[<ffffffff8159cccf>] __dev_set_rx_mode+0x5f/0xb0
[<ffffffff8159cd4f>] dev_set_rx_mode+0x2f/0x50
[<ffffffff8159d00c>] dev_set_promiscuity+0x3c/0x50
[<ffffffffa05ed728>] br_add_if+0x1e8/0x400 [bridge]
[<ffffffffa05ee2df>] add_del_if+0x5f/0x90 [bridge]
[<ffffffffa05eee0b>] br_dev_ioctl+0x4b/0x90 [bridge]
[<ffffffff8159d613>] dev_ifsioc+0x373/0x3b0
[<ffffffff8159d78f>] dev_ioctl+0x13f/0x860
[<ffffffff812dd6e1>] ? avc_has_perm_flags+0x31/0x2c0
[<ffffffff8157c18d>] sock_do_ioctl+0x5d/0x70
[<ffffffff8157c21d>] sock_ioctl+0x7d/0x2c0
[<ffffffff812df922>] ? inode_has_perm.isra.48.constprop.61+0x62/0xa0
[<ffffffff811e4979>] do_vfs_ioctl+0x99/0x5a0
[<ffffffff812df9f7>] ? file_has_perm+0x97/0xb0
[<ffffffff810d716d>] ? trace_hardirqs_on+0xd/0x10
[<ffffffff811e4f19>] sys_ioctl+0x99/0xa0
[<ffffffff816e7369>] system_call_fastpath+0x16/0x1b
br0: port 1(eth0) entered forwarding state
br0: port 1(eth0) entered forwarding state

Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-27 01:00:08 -05:00
Himanshu Madhani dbab22c1f1 qlcnic: Fix LED/Beaconing tests to work on all ports of an adapter.
Provide port number in command payload for LED/Beaconing tests.

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-27 01:00:08 -05:00
Manish chopra 9a97e7053a qlcnic: avoid mixed mode interrupts for some adapter types
o Some adapter types do not support co-existence of Legacy Interrupt with
  MSI-x or MSI among multiple functions. For those adapters, prevent attaching
  to a function during normal load, if MSI-x or MSI vectors are not available.
o Using module parameters use_msi=0 and use_msi_x=0, driver can be loaded in
  legacy mode for all functions in the adapter.

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-27 01:00:08 -05:00
Shahed Shaikh efbcb1b20a qlcnic: enable RSS for TCP over IPv6
o This patch enables RSS for TYPE-C packets to enable RSS for TCP over IPv6

Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-27 01:00:08 -05:00
Shahed Shaikh 776e7bded9 qlcnic: enable LRO on IPv6 without dest ip check
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-27 01:00:08 -05:00
Sritej Velaga c84e340a95 qlcnic: set driver version in firmware
Signed-off-by: Sritej Velaga <sritej.velaga@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-27 01:00:07 -05:00
David S. Miller b640bee6d9 Merge branch 'master' of git://1984.lsi.us.es/nf-next
Pablo Neira Ayuso says:

====================
This batch contains netfilter updates for you net-next tree, they are:

* The new connlabel extension for x_tables, that allows us to attach
  labels to each conntrack flow. The kernel implementation uses a
  bitmask and there's a file in user-space that maps the bits with the
  corresponding string for each existing label. By now, you can attach
  up to 128 overlapping labels. From Florian Westphal.

* A new round of improvements for the netns support for conntrack.
  Gao feng has moved many of the initialization code of each module
  of the netns init path. He also made several code refactoring, that
  code looks cleaner to me now.

* Added documentation for all possible tweaks for nf_conntrack via
  sysctl, from Jiri Pirko.

* Cisco 7941/7945 IP phone support for our SIP conntrack helper,
  from Kevin Cernekee.

* Missing header file in the snmp helper, from Stephen Hemminger.

* Finally, a couple of fixes to resolve minor issues with these
  changes, from myself.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-27 00:56:10 -05:00
Greg Rose b876a744a2 ixgbevf: Fix link speed message to support 100Mbps
The X540 can link at 100Mbps - fix the link speed indicator message to
show that value.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:34:13 -08:00
Donald Dutile 43dc4e0158 ixgbe: Limit number of reported VFs to device specific value
ixgbe claims it supports 64 VFs in its SRIOV capability
structure, but the driver only supports 63.  Adjust it
so sysfs sriov configuration checking will check with
the proper totalvf value.

Signed-off-by: Donald Dutile <ddutile@redhat.com>
Acked-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:34:10 -08:00
Greg Rose da36b64736 ixgbe: Implement PCI SR-IOV sysfs callback operation
Implement callbacks in the driver for the new PCI bus driver
interface that allows the user to enable/disable SR-IOV VFs
in a device via the sysfs interface.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
CC: Don Dutile <ddutile@redhat.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:34:07 -08:00
Greg Rose 66dcfd7569 ixgbe: Modularize SR-IOV enablement code
In preparation for enable/disable of SR-IOV via the PCI sysfs interface
move some core SR-IOV enablement code that would be common to module
parameter usage or callback from the PCI bus driver to a separate
function so that it can be used by either method.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
CC: Don Dutile <ddutile@redhat.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Tested-by: Sibai Li <Sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:34:01 -08:00
Greg Rose 60a1a6800d ixgbe: Make mailbox ops initialization unconditional
There is no actual dependency on initialization of the mailbox ops on
whether SR-IOV is enabled or not and it doesn't hurt to go ahead and
initialize ops unconditionally.  Move the initialization into the device
probe so that the mailbox ops are initialized at the time we have the
board info necessary to do it.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
CC: Don Dutile <ddutile@redhat.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Tested-by: Sibai Li <Sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:33:53 -08:00
Jacob Keller b205c0de49 ixgbe: only compile ixgbe_debugfs.o when enabled
This patch modifies ixgbe_debugfs.c and the Makefile for the ixgbe
driver to only compile the file when the config is enabled. This means
we can remove the #ifdef inside the ixgbe_debugfs.c file.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:33:29 -08:00
Alexander Duyck 39dfb71bc0 ixgbe: Inline Rx PTP descriptor handling
This change is meant to inline the Rx PTP descriptor handling.  The main
motivation is to avoid unnecessary jumps into function calls that we then
immediately exit because we are not performing timestamps.

The net result of this change is that ixgbe_ptp_rx_tstamp drops from .5% CPU
utilization in my performance runs to 0%, and the only value tested is the Rx
descriptor which should already be warm in the cache if not stored in a
register.

Cc: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Acked-by: Jacob Keller <Jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:33:29 -08:00
Jacob Keller b1e50f7ac7 ixgbe: Fix overwriting of rx_mtrl in ixgbe_ptp_hwtstamp_ioctl
This patch corrects a bug introduced by commit f3444d8b. The rxmtrl value for
the UDP port to timestamp on was moved above the switch statement, but was
overwritten to 0 if the ioctl selected one of the V1 filters.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:33:28 -08:00
Jacob Keller 12ff3f3b6c ixgbe: add warning when scheduling reset
This patch adds warnings when a reset of the adapter is scheduled so that the
user can see log of why the reset occurred.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:33:28 -08:00
Jacob Keller 891dc0821d ixgbe: Add ptp work item to poll for the Tx timestamp
This patch copies the igb implementation of Tx timestamps, which uses a work
item to poll for the Tx timestamp. In addition it adds a timeout value of 15
seconds, after which it will stop polling.

This is necessary due to an issue with the descriptor being marked done before
the Tx timestamp event has occurred. These two events don't correlate, so using
the done bit on the descriptor as indication that the timestamp must already
have been taken leads to potentially dropped Tx timestamps (especially under
heavy packet load)

Reported-by: Matthew Vick <matthew.vick@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:33:28 -08:00
Jacob Keller 6cb562d668 ixgbe: Use watchdog check in favor of BPF for detecting latched timestamp
This patch removes ixgbe_ptp_match, and the corresponding packet filtering from
ixgbe driver. This code was previously causing some issues within the hotpath of
the driver. However the code also provided a check against possible frozen Rx
timestamp due to dropped packets when the Rx ring is full. This patch provides a
replacement solution based on the watchdog.

To this end, whenever a packet consumes the Rx timestamp it stores the jiffy
value in the rx_ring structure. Watchdog updates its own jiffy timer whenever
there is no valid timestamp in the registers.

If watchdog detects a valid timestamp in the registers, (meaning that no Rx
packet has consumed it yet) it will check which time is most recent, the last
time in the watchdog, or any time in the rx_rings. If the most recent "event"
was more than 5seconds ago, it will flush the Rx timestamp and print a warning
message to the syslog.

Reported-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:32:57 -08:00
Jacob Keller f2f33387f9 ixgbe: Update ptp_overflow check comment and jiffies
This patch fixes the comment on ptp_overflow_check to match up with what is
currently used as the parameters. Also change the jiffies check to use
time_is_after_jiffies macro.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:32:57 -08:00
Jacob Keller aeb8264847 ixgbe: add missing supported filters to get_ts_info
This patch updates the filters for ethtool's get_ts_info to return support for
all filters which can be supported by upscaling to ptp_v2_event. The intent
behind this change is due to reasoning that we do in fact support the
filters. (hwtstamp_ioctl returns success after setting the filter to the
upscaled version). In this way we can remain consistent over which filters are
supported via the get_ts_info ioctl and which filters are in practice actually
supported.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:32:57 -08:00
Jacob Keller dfcc4615f0 ixgbe: ethtool ixgbe_diag_test cleanup
This patch cleans up the ethtool diagnostics test by ensuring that the tests
work properly regardless of what state the adapter was in. The SRIOV VF check is
done at the beginning, forgoing the link test. The if_running -> dev_close is
moved before the link test, as well as a call to enable the Tx laser. This
ensures that the link test will return valid results even when adapter was
previously down. Also, a call to disable the Tx laser is added if the device
was down before the start. This ensures consistent behavior of the Tx laser
before and after the diagnostic checks. The end result is consistent behavior
regardless of device state.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:32:31 -08:00
David S. Miller 93b9c1ddd3 Merge branch 'testing' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next
Steffen Klassert says:

====================
1) Add a statistic counter for invalid output states and
   remove a superfluous state valid check, from Li RongQing.

2) Probe for asynchronous block ciphers instead of synchronous block
   ciphers to make the asynchronous variants available even if no
   synchronous block ciphers are found, from Jussi Kivilinna.

3) Make rfc3686 asynchronous block cipher and make use of
   the new asynchronous variant, from Jussi Kivilinna.

4) Replace some rwlocks by rcu, from Cong Wang.

5) Remove some unused defines.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 14:00:16 -05:00
Ariel Elior 4c133c39ae bnx2x: SR-IOV version compatibility bugfix
When posting a message on the bulletin board, the PF calculates crc
over the message and places the result in the message. When the VF
samples the Bulletin Board it copies the message aside and validates
this crc. The length of the message is crucial here and must be the
same in both parties. Since the PF is running in the Hypervisor and
the VF is running in a Vm, they can possibly be of different versions.
As the Bulletin Board is designed to grow forward in future versions,
in the VF the length must not be the size of the message structure
but instead it should be a field in the message itself.

Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:58:30 -05:00
Yuval Mintz ca9bdb9b27 bnx2x: Fix compilation with stop-on-error
Commit 823e1d9 caused bnx2x to fail once BNX2X_STOP_ON_ERROR is set.
Fixes compilation by moving function declarations between header files.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:58:29 -05:00
Michael Chan ad9b4359c7 cnic, bnx2x: Add CNIC_DRV_STATE_HANDLES_IRQ to ethdev->drv_state
In INTA mode, cnic and bnx2x share the same IRQ.  During chip reset,
for example, cnic will stop servicing IRQs after it has shutdown the
cnic hardware resources.  However, the shared IRQ is still active as
bnx2x needs to finish the reset.  There is a window when bnx2x does
not know that cnic is no longer handling IRQ and things don't always
work properly.

Add a flag to tell bnx2x that cnic is handling IRQ.  The flag is set
before the first cnic IRQ is expected and cleared when no more cnic
IRQs are expected, so there should be no race conditions.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:58:29 -05:00
Yuval Mintz 580d9d0813 bnx2x: correct memory release scheme
Fix an incorrect SR-IOV memory release which was committed in 1ab4434.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:58:29 -05:00
Yuval Mintz 86564c3f0f bnx2x: Remove many sparse warnings
Remove most of the sparse warnings in the bnx2x compilation
(i.e., thus resulting when compiling with `C=2 CF=-D__CHECK_ENDIAN__').

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:58:29 -05:00
Yuval Mintz 80bfe5cc1b bnx2x: Modify unload conditions
Don't unload the bnx2x driver if its in a recovery process, or if
the previous load have failed.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:58:29 -05:00
Dmitry Kravkov c3146eb676 bnx2x: Correct memory preparation and release
Since commit 15192a8cf there have been a memory leak upon rmmod
of the bnx2x driver.

This corrects the memory leak and corrects the zeroing of internal
memories upon driver load.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:58:28 -05:00
Yuval Mintz 6ab20355c0 bnx2x: Add missing VFs reference in macros
Add missing 57712_VF and 57800_VF to CHIP_IS_E2 and CHIP_IS_E3
macros (missing from commit 8395be5).

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:58:28 -05:00