====================
Intel Wired LAN Driver Updates
This series contains updates to igb, ixgbe, ixgbevf, i40e and i40evf.
Anjali provides a i40e/i40evf patch to add Energy Efficient Ethernet
Low Power Idle stats and a fix for i40e to change the string
"Side Band" to "Sideband" for consistency.
Mitch provides 2 patches for i40evf to fix if the driver encounters
an error while communicating with the PF driver, do not shut down the
admin queue unconditionally. Add an error message when the admin
queue message never completes and fix formatting on another message
that was unnecessarily wrapped.
Mark provides a ixgbe patch and five ixgbevf patches. Fix a possible
infinite recursion when an adapter is removed and registers all read
as all one's in ixgbe_clear_vmdq_generic() and ixgbe_clear_rar_generic().
Converts macros to static inline functions to align kernel coding standard
and prepare for adding Live Error Recovery (LER) to ixgbevf. Change the
ethtool register test to use the normal register accessor functions and
eliminate macors used for calling register test functions to make error
exits more clear. Checks all register reads for adapter removal by checking
the status register after any register read that returns all F's since the
status register will never return 0xFFFFFFFF unless the adapter is removed.
Jacob implements SIOCGHWTSTAMP ioctl for igb which enables user processes
to read the current hardware stamp config settings non-destructively.
Todd adds the initial register read and write for surprise removal (LER)
for igb.
Christian Engelmayer fixes an igb memory leak in the igb_get_module_eeprom()
error handling path.
Ken Ichikawa provides a fix for igb, specifically for 82575 hardware to
specify -1 to the phc_index for ethtool's get_ts_info, otherwise a wrong
value will be set to the phc_index.
Christopher Paasch fixes a null pointer dereference in igb and makes sure
to unset the HAS_MSIX flag when the driver falls back to MSI only.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
wangweidong [Fri, 21 Mar 2014 01:50:43 +0000 (09:50 +0800)]
atheros/atlx: use SET_ETHTOOL_OPS directly
As commit a6e28b34205b("staging/et131x: use SET_ETHTOOL_OPS
directly"), using a wrapper around SET_ETHTOOL_OPS macro is
not actually required, remove and use SET_ETHTOOL_OPS directly.
Signed-off-by: Wang Weidong <wangweidong1@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Vince Bridgers [Fri, 21 Mar 2014 01:43:16 +0000 (20:43 -0500)]
Altera TSE: Correct typecast issue detected by kbuild test robot
This patch addresses a portable pointer arithmetic issue in the
original submission found by the kbuild test robot.
config: make ARCH=i386 allyesconfig
altera_sgdma.c: In function 'sgdma_txphysaddr':
>> altera_sgdma.c:393:33: warning: cast from
>> pointer to integer of different size [-Wpointer-to-int-cast]
dma_addr_t offs = (dma_addr_t)((dma_addr_t)desc -
^
>> altera_sgdma.c:394:5: warning: cast from
>> pointer to integer of different size [-Wpointer-to-int-cast]
(dma_addr_t)priv->tx_dma_desc);
^
altera_sgdma.c: In function 'sgdma_rxphysaddr':
>> altera_sgdma.c:403:33: warning: cast from
>> pointer to integer of different size [-Wpointer-to-int-cast]
dma_addr_t offs = (dma_addr_t)((dma_addr_t)desc -
^
>> altera_sgdma.c:404:5: warning: cast from
>> pointer to integer of different size [-Wpointer-to-int-cast]
(dma_addr_t)priv->rx_dma_desc);
^
Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Vince Bridgers <vbridgers2013@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Vince Bridgers [Fri, 21 Mar 2014 01:43:15 +0000 (20:43 -0500)]
Altera TSE: Set version number by driver's get regs
Set the version number returned by the driver's get regs routine
invoked by ethtool so formatting can be dependent on the version
number returned, and any interesting formatted output can check
the version number for specific types of register data returned.
Signed-off-by: Vince Bridgers <vbridgers2013@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Mon, 24 Mar 2014 04:44:34 +0000 (00:44 -0400)]
Merge branch 'qlcnic-next'
Shahed Shaikh says:
====================
This patch series containes following changes -
* TSO over IPv4 and IPv6, Tx checksum offload for VXLAN
* Rx checksum offload for VXLAN and support for .ndo_{add|del}_vxlan_port
netdev ops.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Shahed Shaikh [Fri, 21 Mar 2014 08:41:17 +0000 (04:41 -0400)]
qlcnic: Add VXLAN Rx offload support
This patch adds Rx checksum offload support for VXLAN.
Implements .ndo_{add|del}_vxlan_port netdev ops.
Adapter supports only one VXLAN port, so program adapter with
very first UDP port which VXLAN driver is listening to.
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Claudiu Manoil [Fri, 21 Mar 2014 07:33:17 +0000 (09:33 +0200)]
gianfar: Fix P1010 config regression (SQ polling)
The P1010 device tree restricts the number of
supported interrupt groups to 1, although the eth
controller can support 2 interrupt groups and the
driver assumes the Multi-Group mode ("fsl,etsec2" model).
So, in this case the assumption that the Multi-Group
mode (MQ_MG_MODE) devices always support 2 interrupt
groups is false. To fix this, a check for the actual
number of interrupt groups enabled in the board's
device tree has been added in gfar_probe for the
"fsl,etsec2" devices.
Without this fix, P1010 based boards claim support for
2 Tx queues to the net stack but only one is actually
allocated, leading to NULL access in xmit. This issue
was introduced by enabling Single-Queue polling for
the P1010 devices.
(71ff9e3 gianfar: Use Single-Queue polling for
"fsl,etsec2")
Fixes: 71ff9e3df7e1c5d3293af6b595309124e8c97412 Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Eric Dumazet [Mon, 24 Mar 2014 02:51:36 +0000 (19:51 -0700)]
net: optimize csum_replace2()
When changing one 16bit value by another in IP header, we can adjust
the IP checksum by doing a simple operation described in RFC 1624, as
reminded by David.
csum_partial() is a complex function on x86_64, not really suited for
small number of checksummed bytes.
I spotted csum_partial() being in the top 20 most consuming functions
(more than 1 %) in a GRO workload, which was rather unexpected.
The caller was inet_gro_complete() doing a csum_replace2() when
building the new IP header for the GRO packet.
Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sat, 22 Mar 2014 19:00:22 +0000 (15:00 -0400)]
Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge
Antonio Quartulli says:
====================
Included changes:
- use ether_addr_copy instead of memcpy when possible
- implement new multicast packet optimisation
- improve several kerneldoc sections
- minor code cleanups
here you have our patchset for net-next/linux-3.15. They are 16
patches but most of them are just small cleanups and kerneldoc
improvements.
The only big change is the one from patch 8 to 13 by Linus Lüssing
that introduces a new multicast packets optimisation. This new
component aims to reduce the air overhead by sending multicast packets
as bat-unicast when only one destination exists or by dropping them
directly at the source if the multicast group is totally empty.
In patch 11 Linus introduces an atomic_t variable, that like others
that we already have is only object of write and read, thus making the
atomic characteristic totally useless. Unfortunately this is part of
our sysfs framework, that helps the developer to introduce new knobs
by using few macros only. For this reason we decided to keep Linus'
new knob for now, but I'd like to let you know that we are in the
process of re-working such framework in order to convert all the
current (useless) atomic_t to boolean in one go.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Linus Lüssing [Sat, 15 Feb 2014 16:47:54 +0000 (17:47 +0100)]
batman-adv: Send multicast packets to nodes with a WANT_ALL flag
With this patch a node sends IPv4 multicast packets to nodes which
have a BATADV_MCAST_WANT_ALL_IPV4 flag set and IPv6 multicast packets
to nodes which have a BATADV_MCAST_WANT_ALL_IPV6 flag set, too.
Why is this needed? There are scenarios involving bridges where
multicast report snooping and multicast TT announcements are not
sufficient, which would lead to packet loss for some nodes otherwise:
MLDv1 and IGMPv1/IGMPv2 have a suppression mechanism
for multicast listener reports. When we have an MLDv1/IGMPv1/IGMPv2
querier behind a bridge then our snooping bridge is potentially not
going to see any reports even though listeners exist because according
to RFC4541 such reports are only forwarded to multicast routers:
Note that we do not need to explicitly forward to MLDv2/IGMPv3 queriers,
because these protocols have no report suppression: A bridge has no
trouble detecting MLDv2/IGMPv3 listeners.
Even though we do not support bridges yet we need to provide the
according infrastructure already to not break compatibility later.
Signed-off-by: Linus Lüssing <linus.luessing@web.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Linus Lüssing [Sat, 15 Feb 2014 16:47:53 +0000 (17:47 +0100)]
batman-adv: Add IPv4 link-local/IPv6-ll-all-nodes multicast support
With this patch a node may additionally perform the dropping or
unicasting behaviour for a link-local IPv4 and link-local-all-nodes
IPv6 multicast packet, too.
The extra counter and BATADV_MCAST_WANT_ALL_UNSNOOPABLES flag is needed
because with a future bridge snooping support integration a node with a
bridge on top of its soft interface is not able to reliably detect its
multicast listeners for IPv4 link-local and the IPv6
link-local-all-nodes addresses anymore (see RFC4541, section 2.1.2.2
and section 3).
Even though this new flag does make "no difference" now, it'll ensure
a seamless integration of multicast bridge support without needing to
break compatibility later.
Also note, that even with multicast bridge support it won't be possible
to optimize 224.0.0.x and ff02::1 towards nodes with bridges, they will
always receive these ranges.
Signed-off-by: Linus Lüssing <linus.luessing@web.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Linus Lüssing [Sat, 15 Feb 2014 16:47:52 +0000 (17:47 +0100)]
batman-adv: Modified forwarding behaviour for multicast packets
With this patch a multicast packet is not always simply flooded anymore,
the behaviour for the following cases is changed to reduce
unnecessary overhead:
If all nodes within the horizon of a certain node have signalized
multicast listener announcement capability then an IPv6 multicast packet
with a destination of IPv6 link-local scope (excluding ff02::1) coming
from the upstream of this node...
* ...is dropped if there is no according multicast listener in the
translation table,
* ...is forwarded via unicast if there is a single node with interested
multicast listeners
* ...and otherwise still gets flooded.
Signed-off-by: Linus Lüssing <linus.luessing@web.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Linus Lüssing [Sat, 15 Feb 2014 16:47:51 +0000 (17:47 +0100)]
batman-adv: Announce new capability via multicast TVLV
If the soft interface of a node is not part of a bridge then a node
announces a new multicast TVLV: The existence of this TVLV
signalizes that this node is announcing all of its multicast listeners
via the translation table infrastructure.
Signed-off-by: Linus Lüssing <linus.luessing@web.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Marek Lindner [Sat, 8 Feb 2014 15:28:18 +0000 (23:28 +0800)]
batman-adv: call unregister_netdev() to have it handle the locking for us
Reported-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Simon Wunderlich [Fri, 24 Jan 2014 21:16:25 +0000 (22:16 +0100)]
batman-adv: fix a few kerneldoc inconsistencies
Reported-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Linus Lüssing [Sun, 19 Jan 2014 21:22:46 +0000 (22:22 +0100)]
batman-adv: remove obsolete skb_reset_mac_header() in batadv_bla_tx()
Our .ndo_start_xmit handler (batadv_interface_tx()) can rely on having
the skb mac header pointer set correctly since the following commit
present in kernels >= 3.9:
"net: reset mac header in dev_start_xmit()" (6d1ccff627)
Therefore this commit removes the according, now redundant,
skb_reset_mac_header() call in batadv_bla_tx().
Signed-off-by: Linus Lüssing <linus.luessing@web.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Linus Lüssing [Sun, 19 Jan 2014 21:22:45 +0000 (22:22 +0100)]
batman-adv: use vlan_/eth_hdr() instead of skb->data in interface_tx path
Our .ndo_start_xmit handler (batadv_interface_tx()) can rely on having
the skb mac header pointer set correctly since the following commit
present in kernels >= 3.9:
"net: reset mac header in dev_start_xmit()" (6d1ccff627)
Therefore we can safely use eth_hdr() and vlan_eth_hdr() instead of
skb->data now, which spares us some ugly type casts.
At the same time set the mac_header in batadv_dat_snoop_incoming_arp_request()
before sending the skb along the TX path.
Signed-off-by: Linus Lüssing <linus.luessing@web.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
David S. Miller [Fri, 21 Mar 2014 18:21:45 +0000 (14:21 -0400)]
Merge branch 'ptp-next'
Richard Cochran says:
====================
ptp: dynamic pin control
This patch series introduces a way of changing the auxiliary PTP
Hardware Clock functions (periodic output signals and time stamping
external signals) at run time. In the past on the netdev list, we have
discussed other ways to handle this, such as module parameters and
ethtool. This series implements a new PHC ioctl because that is the
most natural way. Users already activate the auxiliary functions via
the ioctls. The sysfs interface has also been expanded so that the pin
configuration can be programmed using shell scripts.
The first patch adds the new ioctls. The PHC subsystem does most of
the work of maintaining the function-to-pin mapping. Drivers will only
need to allocate and initialize a pin configuration table and also
provide a new method that validates a particular assignment.
Patches 5 and 6 just clean up a couple of issues in the phyter driver,
and the remaining patches actually hook the phyter's pins into the new
system.
* ChangeLog
** V3
- simplify locking in the set pin logic
** V2
- fix bug in sysfs code on init error path
- rename ptp_setpin() to ptp_set_pinfunc()
- rename .setpin() to .verify() in the driver interface
- simplify ptp_find_pin() logic
- use correct test when checking whether the pin with the
calibration function is being reprogrammed
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Richard Cochran [Thu, 20 Mar 2014 21:21:58 +0000 (22:21 +0100)]
dp83640: implement programmable pin functions.
This patch adapts the dp83640 driver to allow reconfiguration of which
auxiliary function goes on which pin. The functions may be reassigned
freely with the one exception of the calibration function.
Signed-off-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Richard Cochran [Thu, 20 Mar 2014 21:21:57 +0000 (22:21 +0100)]
dp83640: correct the periodic output frequency
The phyter driver incorrectly feeds the value of the period into what
is in fact a pulse width register, resulting in the actual period
being twice the dialed value. This patch fixes the issue and renames a
variable to make the code at bit more clear.
Signed-off-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Richard Cochran [Thu, 20 Mar 2014 21:21:56 +0000 (22:21 +0100)]
dp83640: trivial fixes
This patch cleans up the input checking code on the external time stamp
function by using an unsigned rather than a signed channel index.
Also, this patch corrects the author's email address. When this macro
was last changed, the top level domain part of the email address was
left behind.
Signed-off-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Richard Cochran [Thu, 20 Mar 2014 21:21:55 +0000 (22:21 +0100)]
ptp: drivers: set the number of programmable pins.
This patch updates the many PTP Hardware Clock drivers with the
newly introduced field that advertises the number of programmable
pins. Some of these devices do have programmable pins, but the
implementation will have to wait for follow on patches.
Signed-off-by: Richard Cochran <richardcochran@gmail.com> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Richard Cochran [Thu, 20 Mar 2014 21:21:53 +0000 (22:21 +0100)]
ptp: add the pin GET/SETFUNC ioctls to the testptp program.
This patch adds a option to the test program that lists the
programmable pins on a PTP Hardware Clock device, assuming there
are any such pins. A second option lets the user reprogram the
auxiliary function of a single pin.
Signed-off-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Richard Cochran [Thu, 20 Mar 2014 21:21:52 +0000 (22:21 +0100)]
ptp: introduce programmable pins.
This patch adds a pair of new ioctls to the PTP Hardware Clock device
interface. Using the ioctls, user space programs can query each pin to
find out its current function and also reprogram a different function
if desired.
Signed-off-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Christoph Paasch [Fri, 21 Mar 2014 11:02:09 +0000 (04:02 -0700)]
igb: Unset IGB_FLAG_HAS_MSIX-flag when falling back to msi-only
Prior to cd14ef54d25 (igb: Change to use statically allocated array for
MSIx entries), having msix_entries different from NULL was an indicator
that MSIX is enabled.
In igb_set_interrupt_capabiliy we may fall back to MSI-only. Prior to
the above patch msix_entries was set to NULL by
igb_reset_interrupt_capability.
However, now we are checking the flag for IGB_FLAG_HAS_MSIX and so the
stack gets completly confused:
So, this patch unsets the flag to indicate that we are not using MSIX.
This patch does exactly this: Unsetting the flag when falling back to MSI.
Fixes: cd14ef54d25b (igb: Change to use statically allocated array for MSIx entries) Cc: Carolyn Wyborny <carolyn.wyborny@intel.com> Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Christoph Paasch [Fri, 21 Mar 2014 10:48:19 +0000 (03:48 -0700)]
igb: Fix Null-pointer dereference in igb_reset_q_vector
When igb_set_interrupt_capability() calls
igb_reset_interrupt_capability() (e.g., because CONFIG_PCI_MSI is unset),
num_q_vectors has been set but no vector has yet been allocated.
igb_reset_interrupt_capability() will then call igb_reset_q_vector,
which assumes that the vector is allocated. As this is not the case, we
are accessing a NULL-pointer.
This patch fixes it by checking that q_vector is indeed different from
NULL.
Fixes: 02ef6e1d0b0023 (igb: Fix queue allocation method to accommodate changing during runtime) Cc: Carolyn Wyborny <carolyn.wyborny@intel.com> Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Ken ICHIKAWA [Fri, 21 Mar 2014 10:37:24 +0000 (03:37 -0700)]
igb: specify phc_index of 82575 for get_ts_info
82575 has only software timestamping capability and it has
no PTP Hardware Clocks. Therefore, -1 has to be specified
to the phc_index for ethtool's get_ts_info, otherwise a wrong
value will be set to the phc_index.
v2: move the if (adapter->ptp_clock) section specifying phc_index
to above the switch statement as suggested by Matthew Vick.
adapter->ptpclock will always be NULL for 82575.
Signed-off-by: Ken ICHIKAWA <ichikawa.ken@jp.fujitsu.com> Acked-by: Matthew Vick <matthew.vick@intel.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Fix a memory leak in the igb_get_module_eeprom() error handling path.
Detected by Coverity: CID 1016508.
Signed-off-by: Christian Engelmayer <cengelma@gmx.at> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jacob Keller [Sat, 11 Jan 2014 07:20:06 +0000 (07:20 +0000)]
igb: implement SIOCGHWTSTAMP ioctl
This patch adds support for the SIOCGHWTSTAMP ioctl which enables user
processes to read the current hwtstamp_config settings
non-destructively. Previously a process had to be privileged and could
only set values, it couldn't return what is currently set without
possibly overwriting the value.
This patch adds support for this new operation into igb by keeping a
shadow copy of the config in the adapter structure, which is returned
upon request.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Acked-by: Matthew Vick <matthew.vick@intel.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Mark Rustad [Tue, 4 Mar 2014 03:02:45 +0000 (03:02 +0000)]
ixgbevf: Additional adapter removal checks
Additional checks are needed for a detected removal not to cause
problems. Some involve simply avoiding a lot of stuff that can't
do anything good, and also cases where the phony return value can
cause problems. In addition, down the adapter when the removal is
sensed.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Mark Rustad [Tue, 4 Mar 2014 03:02:40 +0000 (03:02 +0000)]
ixgbevf: Check for adapter removal on register writes
Prevent writes to an adapter that has been detected as removed
by a previous failing read.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Mark Rustad [Tue, 4 Mar 2014 03:02:34 +0000 (03:02 +0000)]
ixgbevf: Check register reads for adapter removal
Check all register reads for adapter removal by checking the status
register after any register read that returns 0xFFFFFFFF. Since the
status register will never return 0xFFFFFFFF unless the adapter is
removed, such a value from a status register read confirms the
removal. Since this patch adds so much to ixgbe_read_reg, stop
inlining it, to reduce driver bloat.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Mark Rustad [Tue, 4 Mar 2014 03:02:29 +0000 (03:02 +0000)]
ixgbevf: Make the ethtool register test use accessors
Make the ethtool register test use the normal register accessor
functions. Also eliminate macros used for calling register test
functions to make error exits clearer.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Mark Rustad [Tue, 4 Mar 2014 03:02:23 +0000 (03:02 +0000)]
ixgbevf: Use static inlines instead of macros
Kernel coding standard prefers static inline functions instead
of macros, so use them for register accessors. This is to prepare
for adding LER, Live Error Recovery, checks to those accessors.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Mark Rustad [Sat, 1 Mar 2014 05:21:00 +0000 (05:21 +0000)]
ixgbe: Break recursion in case of removal
When an adapter is removed and registers all read as all one's,
an infinite recursion can happen between ixgbe_clear_vmdq_generic
and ixgbe_clear_rar_generic. Adding a check for removal breaks
this recursion.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Mitch Williams [Thu, 6 Mar 2014 08:59:52 +0000 (08:59 +0000)]
i40evf: don't shut down admin queue on error
If the driver encounters an error while communicating with the PF
driver, don't just shut down the admin queue unconditionally. The PF
may be delayed, and shutting down the admin queue causes it to fail
completely. If this happens, the VF will never complete initialization.
Change-ID: I6192e9d8caeefb738428c3597fa2f54fa400ce7f Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Florian Fainelli [Thu, 20 Mar 2014 17:53:23 +0000 (10:53 -0700)]
net: bcmgenet: manipulate netdev_queue directly
Instead of always invoking netdev_get_tx_queue() in bcmgenet_xmit() and
bcmgenet_tx_reclaim(), just get the corresponding netdev_queue pointer
once and for all and manipulate it throughout bcmgenet_xmit() and
bcmgenet_tx_reclaim().
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Florian Fainelli [Thu, 20 Mar 2014 17:53:22 +0000 (10:53 -0700)]
net: bcmgenet: remove bogus tx queue checks
netdev_pick_tx already takes care of making sure that a given
skb->queue_mapping value will remain within the number of advertised
hardware queue number, there is no need to re-do this again in the
driver.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Florian Fainelli [Thu, 20 Mar 2014 17:53:21 +0000 (10:53 -0700)]
net: bcmgenet: add skb_tx_timestamp call
The BCMGENET driver was not TX timestamping the SKBs it queued for
transmission, do this in bcmgenet_xmit() right before kicking the
Transmit DMA engine.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Thu, 20 Mar 2014 21:22:20 +0000 (17:22 -0400)]
Merge branch 'sh_eth-next'
Laurent Pinchart says:
====================
sh_eth: Fix the race between open and MDIO bus registration
This patch series fixes the race condition that exists in the sh_eth driver
between network device open and MDIO bus registration. The actual fix is in
patch 4/5, with previous patches preparing the driver and patch 5/5 cleaning
up an unrelated issue.
I've based the idea on Sergei's attempt to fix the problem and can successfully
boot the Koelsch board over NFS with this series. I might have missed other
issues though, hence the RFC status.
The patches are based on top of the latest net-next master branch.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Laurent Pinchart [Thu, 20 Mar 2014 14:00:35 +0000 (15:00 +0100)]
sh_eth: Remove goto statements that jump straight to a return
"goto" is well accepted for error paths in the kernel but should not be
used unnecessarily. Return the correct value directly instead of using a
goto when possible.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Laurent Pinchart [Thu, 20 Mar 2014 14:00:34 +0000 (15:00 +0100)]
sh_eth: Register MDIO bus before registering the network device
Network API functions that rely on the MDIO bus can be called as soon as
the driver calls register_netdev(). Register the MDIO bus before the
network device to avoid race conditions.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Laurent Pinchart [Thu, 20 Mar 2014 14:00:33 +0000 (15:00 +0100)]
sh_eth: Simplify MDIO bus initialization and release
The network device passed to the sh_mdio_init and sh_mdio_release
functions is only used to access the sh_eth_private instance. Pass it
directly to those functions.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Laurent Pinchart [Thu, 20 Mar 2014 14:00:32 +0000 (15:00 +0100)]
sh_eth: Use the platform device as the MDIO bus parent
The MDIO bus parent is set to the network device. Beside not reflecting
the hardware topology, this prevents registering the MDIO bus before
initializing the network device. Fix it by setting the MDIO bus parent
to the platform device.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Laurent Pinchart [Thu, 20 Mar 2014 14:00:31 +0000 (15:00 +0100)]
sh_eth: Use the platform device for memory allocation
Memory allocated for the MDIO bus with the devm_kzalloc() API is
associated with the network device. While this will cause memory to be
freed at the right time, it doesn't allow allocating memory before the
network device is initialized.
Replace the network device with the parent platform device for memory
allocation to remove that dependency. This also improves consistency
with the other devm_* calls in the driver that all use the platform
device.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Aring [Thu, 20 Mar 2014 13:57:03 +0000 (14:57 +0100)]
ieee802154: dgram: cleanup set of broadcast panid
This patch is only a cleanup to use the right define for a panid field.
The broadcast address and panid broadcast is still the same value.
Signed-off-by: Alexander Aring <alex.aring@gmail.com> Cc: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Aring [Thu, 20 Mar 2014 13:57:02 +0000 (14:57 +0100)]
af_ieee802154: fix check on broadcast address
This patch fixes an issue which was introduced by commit b70ab2e87f17176d18f67ef331064441a032b5f3 ("ieee802154: enforce
consistent endianness in the 802.15.4 stack").
The correct behaviour should be a check on the broadcast address field
which is 0xffff.
Signed-off-by: Alexander Aring <alex.aring@gmail.com> Reported-by: Jan Luebbe <jlu@pengutronix.de> Cc: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Jason Gunthorpe [Wed, 19 Mar 2014 22:15:24 +0000 (16:15 -0600)]
of_mdio: Allow the DT to specify the phy ID and avoid autoprobing
This makes the generic of_mdiobus_register parse the DT compatible string for
the pattern ethernet-phy-idAAAA.BBBB. If present it should be a value that
matches the phy-id register normally readable through MDIO.
When the ID is given the phy autoprobing is defeated and the phy is
created directly.
This is necessary to support phy's that cannot be autoprobed when
of_mdiobus_register is called. Specifically, my case has the phy in reset at
of_mdiobus_register, the reset is only released once the ethernet driver
starts, before it attaches to the phy.
Tested on ARM Kirkwood with phy id 0x01410e90 (Marvell 88E1318)
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Jason Gunthorpe [Wed, 19 Mar 2014 22:15:23 +0000 (16:15 -0600)]
dt: Document a compatible entry for MDIO ethernet Phys
This describes a compatible entry of the form:
ethernet-phy-idAAAA,BBBB
Which is modelled after the PCI structured compatible entry
(pciVVVV,DDDD.SSSS.ssss.RR)
If present the OF core will be able to use this information to
directly create the correct phy without auto probing the bus.
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Acked-by: Rob Herring <robh@kernel.org> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Thu, 20 Mar 2014 20:58:01 +0000 (16:58 -0400)]
Merge branch 'cdc-next'
Ben Chan says:
====================
Adjust MTU as indicated by MBIM extended functional descriptor.
The MBIM extended functional descriptor, defined in "Universal Serial Bus
Communications Class Subclass Specification for Mobile Broadband Interface
Model, Revision 1.0, Errata-1" by USB-IF, indicates the operator preferred MTU
value via a wMTU field.
This patch set ensures that the initial MTU value set by cdc_ncm on a MBIM net
device does not exceed the wMTU value, provided the MBIM device exposes a MBIM
extended functional descriptor.
* Changelog
v2: Fixed a le16_to_cpu conversion issue in patch 2/2 pointed out by
Bjørn Mork <bjorn@mork.no>
v3: No code changes. Resubmitted to include patch 1/2 as suggested by
David Miller <davem@davemloft.net>
v4: No code changes. Resubmitted as suggested by David Miller:
- Added a summary of the patch set
- Carried the ACK from Greg Kroah-Hartman <gregkh@linuxfoundation.org>
- Added a specified the tree (net-next) to apply the patch set to
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Ben Chan [Wed, 19 Mar 2014 21:00:06 +0000 (14:00 -0700)]
net: cdc_ncm: respect operator preferred MTU reported by MBIM
According to "Universal Serial Bus Communications Class Subclass
Specification for Mobile Broadband Interface Model, Revision 1.0,
Errata-1" published by USB-IF, the wMTU field of the MBIM extended
functional descriptor indicates the operator preferred MTU for IP data
streams.
This patch modifies cdc_ncm_setup to ensure that the MTU value set on
the usbnet device does not exceed the operator preferred MTU indicated
by wMTU if the MBIM device exposes a MBIM extended functional
descriptor.
Signed-off-by: Ben Chan <benchan@chromium.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This patch adds the MBIM extended functional descriptor structure
defined in "Universal Serial Bus Communications Class Subclass
Specification for Mobile Broadband Interface Model, Revision 1.0,
Errata-1" published by USB-IF.
Signed-off-by: Ben Chan <benchan@chromium.org> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Thu, 20 Mar 2014 20:19:41 +0000 (16:19 -0400)]
Merge branch 'mlx4-next'
Or Gerlitz says:
====================
mlx4: Add support for single port VFs
The mlx4 Firmware && driver expose both ports of the device through one PCI function.
This can be non-optimal under virtualization schemes where the admin
would like the VF to expose one interface to the VM, etc.
This series from Matan Barak adds support for single ported VFs.
Since all the VF interaction with the firmware passes through the PF
driver, we can emulate to the VF they have one port, and further create
a set of the VFs which act on port1 of the device and another set which
acts on port2.
Series done against net-next commit 3ab428a "netfilter: Add missing
vmalloc.h include to nft_hash.c"
Roland, we send this through netdev, but if you have comments, will love
to hear them.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Matan Barak [Wed, 19 Mar 2014 16:11:53 +0000 (18:11 +0200)]
net/mlx4: Adapt num_vfs/probed_vf params for single port VF
A new syntax is added for the module parameters num_vfs and probe_vf.
num_vfs=p1,p2,p1+p2
probe_bf=p1,p2,p1+p2
Where p1(2) is the number of VFs on / probed VFs for physical
port1(2) and p1+p2 is the number of dual port VFs.
Single port VFs are currently supported only when the link type
for both ports of the device is Ethernet.
Signed-off-by: Matan Barak <matanb@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Matan Barak [Wed, 19 Mar 2014 16:11:52 +0000 (18:11 +0200)]
net/mlx4: Adapt code for N-Port VF
Adds support for N-Port VFs, this includes:
1. Adding support in the wrapped FW command
In wrapped commands, we need to verify and convert
the slave's port into the real physical port.
Furthermore, when sending the response back to the slave,
a reverse conversion should be made.
2. Adjusting sqpn for QP1 para-virtualization
The slave assumes that sqpn is used for QP1 communication.
If the slave is assigned to a port != (first port), we need
to adjust the sqpn that will direct its QP1 packets into the
correct endpoint.
3. Adjusting gid[5] to modify the port for raw ethernet
In B0 steering, gid[5] contains the port. It needs
to be adjusted into the physical port.
4. Adjusting number of ports in the query / ports caps in the FW commands
When a slave queries the hardware, it needs to view only
the physical ports it's assigned to.
5. Adjusting the sched_qp according to the port number
The QP port is encoded in the sched_qp, thus in modify_qp we need
to encode the correct port in sched_qp.
Signed-off-by: Matan Barak <matanb@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Matan Barak [Wed, 19 Mar 2014 16:11:51 +0000 (18:11 +0200)]
net/mlx4: Add utils for N-Port VFs
This patch adds the following utils:
1. Convert slave_id -> VF
2. Get the active ports by slave_id
3. Convert slave's port to real port
4. Get the slave's port from real port
5. Get all slaves that uses the i'th real port
6. Get all slaves that uses the i'th real port exclusively
Signed-off-by: Matan Barak <matanb@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Matan Barak [Wed, 19 Mar 2014 16:11:50 +0000 (18:11 +0200)]
net/mlx4: Add data structures to support N-Ports per VF
Adds the required data structures to support VFs with N (1 or 2)
ports instead of always using the number of physical ports.
Signed-off-by: Matan Barak <matanb@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Matan Barak [Wed, 19 Mar 2014 16:11:49 +0000 (18:11 +0200)]
IB/mlx4_ib: Adapt code to use caps.num_ports instead of a constant
Some code in the mlx4 IB driver stack assumed MLX4_MAX_PORTS ports.
Instead, we should only loop until the number of actual ports in i
the device, which is stored in dev->caps.num_ports.
Signed-off-by: Matan Barak <matanb@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Fabio Estevam [Wed, 19 Mar 2014 14:22:06 +0000 (11:22 -0300)]
smsc911x: Change clock warning message to debug level
Since passing the clock is not mandatory, change the warning message to debug,
so that we avoid getting the following clock failure message on every boot:
smsc911x: Driver version 2008-10-21
smsc911x smsc911x (unregistered net_device): couldn't get clock -2
libphy: smsc911x-mdio: probed
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Thu, 20 Mar 2014 18:19:45 +0000 (14:19 -0400)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next
Jeff Kirsher says:
====================
Intel Wired LAN Driver Updates
This series contains updates to e100, igb, igbvf, ixgbe and ixgbevf.
Stefan adds a igb patch to enable the ability strip VLAN header information
for packets bound for a VM on i350 hardware.
Joe Perches provides patches for e100, igb, igbvf, ixgbe and ixgbevf to
convert the use of __constant_<foo> to just <foo> to align with the rest
of the kernel.
Don provides two fixes for ixgbe, first resolves a link issue with DA
cables where we were not always freeing the firmware/software semaphore
after grabbing it. Second stops caching whether the management firmware
was enabled, however since this is not static, we really need to verify
with each check.
Jacob provides six fixes/cleanups for ixgbe, most notably, correct
the stop_mac_link_on d3() to check the Core Clock Disable bit before
stopping link and to fully check to see if manage firmware is running or
could be enabled before bringing down the link. Fix flow control
auto-negation for KR/KX/K4 interfaces, since setting up MAC link, the
cached autoc value and current autoc value were being incorrectly used to
determine whether link reset is required.
Emil provides a fix for ixgbe where there was a chance for aggressive
start_ndo_zmit() callers to sneak packets between enabling the Tx queues
and the link coming up. To resolve this, move the call to enable Tx
queues to after the link is established.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Emil Tantilov [Thu, 20 Mar 2014 03:47:53 +0000 (03:47 +0000)]
ixgbe: enable tx queues after link up
This patch moves the call to enable Tx queues after the link is established.
Previously there was a chance for aggressive start_ndo_xmit() callers to
sneak packets between enabling the Tx queues and the link coming up.
In addition it replaces netif_tx_start_all_queues() with
netif_tx_wake_all_queues() to allow for flushing of the qdisc.
CC: Arun Sharma <asharma@fb.com> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jacob Keller [Sat, 22 Feb 2014 01:23:58 +0000 (01:23 +0000)]
ixgbe: use ixgbe_read_pci_cfg_word
This patch replaces some direct uses of pci_read_config_word with the
protected ixgbe_read_pci_cfg_word function, which checks for whether the
adapter is removed when LER is enabled. We shouldn't use the
pci_read_config_word calls directly because of these checks.
This patch also cleans up an unnecessary save of a pointer to the mac
object, as our standard style is to just use the hw pointer.
CC: Arun Sharma <asharma@fb.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>
Jacob Keller [Sat, 22 Feb 2014 01:23:57 +0000 (01:23 +0000)]
ixgbe: remove unused media type
This patch reverts the addition of the fiber_fixed type, which ended up
never being used. We don't have plans to support this type going
forward, and there is no reason to keep an unused type around polluting
the code.
Reverts: 4e8e1bca6e2 ("ixgbe: add new media type") CC: Arun Sharma <asharma@fb.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>
This patch fixes flow control autonegotiation for KR/KX/K4 interfaces.
When setting up MAC link, the cached autoc value and current autoc value
were being incorrectly used to determine whether link reset is required.
This resulted in the driver ignoring and discarding flow control
negotiation changes that occur since the caching happened, as well as
when the mac was being setup.
This patch also splits the assignments for the 3 autoc variables into
their own block, and adds a comment explaining what each one means, in
order to help keep logic more straightforward while reading the code.
CC: Arun Sharma <asharma@fb.com> Reported-by: Sourav Chatterjee <sourav.chatterjee@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>
Jacob Keller [Sat, 22 Feb 2014 01:23:55 +0000 (01:23 +0000)]
ixgbe: fix ixgbe_stop_mac_link_on_d3_82599 to check mng correctly
Previously, we did a full check to see if MNG FW was running. Instead,
we should only check to see whether it could be enabled. Since it may
become active while down, we don't want to bring the link down.
CC: Arun Sharma <asharma@fb.com> Signed-off-by: Don Skidmore <donald.c.skidmore@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>
Don Skidmore [Wed, 19 Mar 2014 09:16:26 +0000 (09:16 +0000)]
ixgbe: fix errors related to protected AUTOC calls
Found several incorrect conditionals after calling the prot_autoc_*
functions. Likewise we weren't always freeing the FWSW semaphore after
grabbing it. This would lead to DA cables being unable to link along with
possible other errors.
CC: Arun Sharma <asharma@fb.com> CC: Emil Tantilov <emil.s.tantilov@intel.com> Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>