Lendacky, Thomas [Wed, 2 Jul 2014 18:04:46 +0000 (13:04 -0500)]
amd-xgbe: Performance enhancements
This patch provides some general performance enhancements for the
driver:
- Modify the default coalescing settings (reduce usec, increase frames)
- Change the AXI burst length to 256 bytes (default was 16 bytes which
was smaller than a cache line)
- Change the AXI cache settings to write-back/write-allocate which
allocate cache entries for received packets during the DMA since the
packet will be processed soon afterwards
- Combine ioread/iowrite when disabling both the Tx and Rx interrupts
- Change to processing the Tx/Rx channels in pairs
- Only recycle the Rx descriptors when a threshold of dirty descriptors
is reached
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Lendacky, Thomas [Wed, 2 Jul 2014 18:04:40 +0000 (13:04 -0500)]
amd-xgbe: Call netif_napi_del on ndo_stop operation
Currently the napi context is added using netif_napi_add each time
the ndo_open operation is called. However, there is not a
corresponding netif_napi_del call during the ndo_stop operation. If
the device ndo_open operation was called more than once an infinite
loop occurs during module unload. Add a call to netif_napi_del during
the ndo_stop operation.
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Lendacky, Thomas [Wed, 2 Jul 2014 18:04:34 +0000 (13:04 -0500)]
amd-xgbe: Clear the proper MTL interrupt register
When initializing the MTL interrupts the interrupt status
register is written to instead of the interrupt enable register.
Since no MTL interrupts are being enabled and the default state
is for MTL interrupts to be disabled this did not cause a problem,
but needs to be fixed to target the correct register.
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Lendacky, Thomas [Wed, 2 Jul 2014 18:04:28 +0000 (13:04 -0500)]
amd-xgbe: Fix debugfs compatibility change with kstrtouint
The initial change from sscanf to kstrtouint broke backward
compatbility by using a base of "0" in the kstrtouint call.
This allowed for entering decimal, hexadecimal or octal as
input where previously the sscanf always interpreted the input
as hexadecimal. Additionally, -EIO was returned on error prior
to this change and now it is whatever the error value that is
returned by kstrtouint.
Change the base value of the kstrtouint from 0 to 16 and return
-EIO on error.
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Rasmus Villemoes [Wed, 2 Jul 2014 12:12:01 +0000 (14:12 +0200)]
net: arcnet: Remove "#define bool int"
The header file include/linux/arcdevice.h #defines bool to int, if
bool is not already #defined. However, the files which use that header
file seem to rely on that #define (unconditionally) being in effect:
the prototypes for the functions arcrimi_reset, com20020_reset,
com90io_reset, com90xx_reset (whose addresses are assigned to the
hw.reset member of struct arcnet_local) use int explicitly.
Moreover, that #define is an accident waiting to happen (scenario:
inclusion of arcdevice.h followed by inclusion of some header which
declares function prototypes using bool). Also, #include
<linux/types.h> must appear before #include <linux/arcdevice.h> (the
compiler wouldn't like "typedef _Bool int").
Since none of the files using arcdevice.h declare variables of type
"bool", the patch is actually quite simple, unlike the commit message.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Govindarajulu Varadarajan [Wed, 2 Jul 2014 10:12:15 +0000 (15:42 +0530)]
enic: fix return values in enic_set_coalesce
enic_set_coalesce() has two problems.
* It should return -EINVAL and not -EOPNOTSUPP for invalid coalesce values.
* In case of MSIX, enic_set_coalesce return error after applying requested
coalescing setting partially. We should either apply all the setting requeste
and return success or apply non and return error.
* This patch also simplifies the algo.
This was introduced by
'
7c2ce6e60f703 enic: Add support for adaptive interrupt coalescing'
These changes were suggested by Ben Hutchings here
http://www.spinics.net/lists/netdev/msg283972.html
Also change enic driver version.
Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jiri Pirko [Wed, 2 Jul 2014 09:55:38 +0000 (11:55 +0200)]
bonding: remove no longer relevant vlan warnings
These warnings are no longer relevant. Even when last slave is
removed, there is a valid address assigned to bond (random).
The correct functionality of vlans is ensured by maintaining unicast
list in vlan_sync_address().
Suggested-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Acked-by: Veaceslav Falico <vfalico@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 8 Jul 2014 04:29:31 +0000 (21:29 -0700)]
Merge branch 'at86rf230-next'
Alexander Aring says:
====================
at86rf230: rework driver implementation
this patch series includes a rework of the at86rf230 driver.
There are several changes:
- Add regmap support.
- Merge at86rf212 operations with generic at86rf2xx operations, all chips
supports these operations.
- Drop of irqworker. This is a workqueue which will scheduled by an irq to
handle synchronous spi handling. Instead using asynchronous spi handling,
then no scheduler is involved at irq handling.
- Also detected some bugs by receiving frame like CRC can be correct and a
802.15.4 frame length could be above 127 bytes. This would crash the whole
kernel (but should be handled by the mac layer). Another bug is the handling
with RX_SAFE_MODE which protect the frame buffer after a readout. This is
currently not working because we read out the buffer twice and the first one
to get the frame size. Solution is to readout always the whole frame buffer.
- Added some timing relevants things from the datasheet for state changes And
IEEE 802.15.4 standard like interframe spacing. Interframe spacing is needed
to insert some receiving space time between frame transmitting. This should be
also handled by MAC layer, but it's currently a workaround to add this inside
the driver layer.
- Add some callback setting for chip specific handling, instead of runtime decisions
if (is_chip_type()). Callbacks are set only once at probe time.
- We don't using a force state change anymore. A force state change will do a
abort of receiving frames while we want to transmit a new frame. This should
decrease the drop rate of packets.
- And many others changes and bug fixes...
changes since v3:
- fix irq polarity in patch ("at86rf230: rework irq_pol setting").
changes since v2:
- add check if necessary functions are implemented when hw flags are set in patch
("mac802154: at86rf230: add hw flags and merge ops"). I choosed the second variant.
- remove unnecessary includes for workqueue and mutex in patch
("at86rf230: rework transmit and receive").
- remove unnecessary cast in patch ("at86rf230: rework transmit and receive").
- acivate regmap cache with REGCACHE_RBTREE in patch
("at86rf230: add regmap support").
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Aring [Wed, 2 Jul 2014 22:20:55 +0000 (00:20 +0200)]
at86rf230: add new author
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Aring [Wed, 2 Jul 2014 22:20:54 +0000 (00:20 +0200)]
at86rf230: add sleep cycle timing
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Aring [Wed, 2 Jul 2014 22:20:53 +0000 (00:20 +0200)]
at86rf230: add timing for channel switch
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Aring [Wed, 2 Jul 2014 22:20:52 +0000 (00:20 +0200)]
at86rf230: rework reset to trx_off state change
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Aring [Wed, 2 Jul 2014 22:20:51 +0000 (00:20 +0200)]
at86rf230: rework state change and start/stop
This patch removes the current synchron state change function and add a
new function for a state assert. Change the start and stop callbacks to
use this new synchron state change behaviour. It's a wrapper around the
async state change function.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Aring [Wed, 2 Jul 2014 22:20:50 +0000 (00:20 +0200)]
at86rf230: rework irq_pol setting
This patch rework the irq_pol register setting for rising and falling
interrupt settings only. The default behaviour should be rising flag.
Also use IRQ_TYPE_* defines instead of IRQF_* defines. There is no
functionality change but irq_get_trigger_type returns IRQ_TYPE_* defines.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Aring [Wed, 2 Jul 2014 22:20:49 +0000 (00:20 +0200)]
at86rf230: move RX_SAFE_MODE setting to hw_init
There is no need to set this bit in start callback which could be
called more than once.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Aring [Wed, 2 Jul 2014 22:20:48 +0000 (00:20 +0200)]
at86rf230: rework transmit and receive handling
This patch is a complete reimplementation of transmit and receive
handling for the at86rf230 driver.
It solves also six bugs:
First:
The RX_SAFE_MODE is enabled and the transceiver doesn't leave the
receive state while the framebuffer isn't read by a CMD_FB command.
This is useful to read out the frame and don't get into another receive
or transmit state, otherwise the frame would be overwritten.
The current driver do twice CMD_FB calls, the first one leaves this
protection.
Second:
Sometimes the CRC calculation is correct and the length field is greater
127. The current mac802154 layer and filter of a at86rf2xx doesn't check
on this and the kernel crashes. In this case the frame is corrupted, we
send the whole receive buffer to the next layer which can be useful for
sniffing.
Thrid:
There is a undocumented race condition. When we are go into the
RX_AACK_ON state the transceiver could be changed into RX_AACK_BUSY
state. This is a normal behaviour. In this case the transceiver received
a SHR while assert wasn't finished.
Fourth:
It also handle some more "correct" state changes. In aret mode the
transceiver need to go to TX_ON before the transceiver go into
RX_AACK_ON.
Fifth:
The programming model [0] describes also a error handling in ARET mode
if the trac status is different than zero. This is patch adds support
for handling this.
Sixth:
In receive handling the transceiver should also get the trac status
according [0]. The driver could use the trac status as error statistic
handling, but the driver doesn't use this currently. There is maybe some
timing behaviour or the read of this register change some transceiver
states.
In addition the irqworker is removed. Instead we do async spi calls and
no scheduling is involved anymore. The transmit function is also
asynchron but with a wait_for_completion handling. The mac802154 layer
doesn't support asynchron transmit handling right now.
The state change behaviour is now changes, before it was:
1. assert while(!STATE_TRANSITION_IN_PROGRESS)
2. state change
3. assert while(!STATE_TRANSITION_IN_PROGRESS)
4. assert once(wanted state != current state)
Sometimes a unexcepted state change occurs when 4. assert was violated.
The new state change behaviour is:
1. assert while(!STATE_TRANSITION_IN_PROGRESS)
2. state change
3. wait state change timing according datasheet
4. assert once(wanted state != current state)
This behaviour is described in the at86rf231 software programming model [0].
The state change documentation in this programming guide should also valid for
at86rf212 and at86rf233 chips.
The transceiver don't do a FORCE_TX_ON while we want to transmit a PDU.
The new behaviour is a TX_ON and wait a receiving time (tFrame + tPAck).
If we are still in RX_AACK_BUSY then we transmit a FORCE_TX_ON as timeout
handling. The different is that FORCE_TX_ON aborts receiving and TX_ON
waits if RX_AACK_BUSY is finished. This should decrease the drop rate of
packets.
[0] http://www.atmel.com/Images/AVR2022_swpm231-2.0.zip
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Aring [Wed, 2 Jul 2014 22:20:47 +0000 (00:20 +0200)]
at86rf230: add support for at86rf23x desense
To set the CCA_ED_THRES register the calculation for at86rf23x is
different than for at86rf212. This patch adds a new callback for this
calculation in chip data struct.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Aring [Wed, 2 Jul 2014 22:20:46 +0000 (00:20 +0200)]
at86rf230: remove is212 and add driver data
This patch adds a new at86rf2xx_chip_data structure which holds device
specific attributes. Instead of runtime decisions "if (is212())" we set
callbacks/attributes while device detection.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Aring [Wed, 2 Jul 2014 22:20:45 +0000 (00:20 +0200)]
at86rf230: rework detect device handling
This patch drops the current lowlevel spi calls for the detect device
function instead we handle this via regmap. Also put the detection of
in a seperate function and set all device specific attributes while detection.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Aring [Wed, 2 Jul 2014 22:20:44 +0000 (00:20 +0200)]
at86rf230: add regmap support
This patch adds regmap support for the at86rf230 driver and drop the
lowlevel spi access functions and use the regmap access functions.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Aring [Wed, 2 Jul 2014 22:20:43 +0000 (00:20 +0200)]
mac802154: at86rf230: add hw flags and merge ops
This patch adds new mac802154 hw flags for transmit power, csma and
listen before transmit (lbt). These flags indicates that the transceiver
supports these features. If the flags are set and the driver doesn't
implement the necessary functions, then ieee802154_register_device
returns -ENOSYS "Function not implemented".
This patch merges also all at86rf230 operations into one operations structure
and set the right hw flags for the at86rf230 transceivers.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 8 Jul 2014 04:22:58 +0000 (21:22 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/jkirsher/net-next
Jeff Kirsher says:
====================
Intel Wired LAN Driver Updates 2014-07-02
This series contains updates to i40e and i40evf.
Anjali fixes a possible race where we were trying to free the dummy packet
buffer in the function that created it, so cleanup the dummy packet buffer
in i40e_clean_tx_ring() instead. Also fixes an issue where the filter
program routine was not checking if there were descriptors available for
programming a filter.
Mitch fixes unnecessary delays when sending the admin queue commands by
moving a declaration up one level so we do not dereference it out of scope.
Fixes an issue with the VF where if the admin queue interrupts get lost for
some reason, the VF communication will stall as the VFs have no way of
reaching the PF. To alleviate this condition, go ahead and check the ARQ
every time we run the service task. Updates i40evf to allow the watchdog
to fire vector 0 via software, which makes the driver tolerant of dropped
interrupts on that vector.
Paul fixes a shifted '1' to be unsigned to avoid shifting a signed integer.
Jesse disables TPH by default since it is currently not enabled in the
current hardware. Also finishes the i40e implementation of get_settings
for ethtool.
Catherine adds a new variable (hw.phy.link_info.an_enabled) to track whether
auto-negotiation is enabled, along with the functionality to update the
variable. Adds the functionality to set the requested flow control mode.
Adds i40e implementation of setpauseparam and set_settings to ethtool.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 8 Jul 2014 04:21:45 +0000 (21:21 -0700)]
Merge branch 'fec-next'
Russell King says:
====================
Freescale ethernet driver updates
Here's the first batch of patches for the Freescale FEC ethernet driver.
They require the previously applied "net: fec: Don't clear IPV6 header
checksum field when IP accelerator enable" patch.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Russell King [Mon, 7 Jul 2014 23:23:30 +0000 (00:23 +0100)]
net: fec: fix missing kmalloc() failure check in fec_enet_alloc_buffers()
fec_enet_alloc_buffers() assumes that kmalloc() will never fail, which
is an invalid assumption. Fix this by implementing a common error
cleanup path, and use it to also clean up after failed bounce buffer
allocation.
Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Russell King [Mon, 7 Jul 2014 23:23:25 +0000 (00:23 +0100)]
net: fec: ensure fec_enet_free_buffers() properly cleans the rings
Ensure that we do not double-free any allocations, and that any transmit
skbuffs are properly freed when we clean up the rings.
Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Russell King [Mon, 7 Jul 2014 23:23:19 +0000 (00:23 +0100)]
net: fec: clean up transmit descriptor setup
Avoid writing any state until we're certain we can proceed with the
transmission: this avoids writing mapping error address values to the
descriptors, or setting the skbuff pointer until we have successfully
mapped the skb.
Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Russell King [Mon, 7 Jul 2014 23:23:14 +0000 (00:23 +0100)]
net: fec: make rx skb handling more robust
Allocate, and then map the receive skb before writing any data to the
ring descriptor or storing the skb. When freeing the receive ring
entries, unmap and free the skb, and then clear the stored skb pointer.
This means we have ring data and skb pointer in one of two states:
either both fully setup, or nothing setup.
This simplifies the cleanup, as we can use just the skb pointer to
indicate whether the descriptor is setup, and thus avoids potentially
calling dma_unmap_single() on a DMA error value.
Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Russell King [Mon, 7 Jul 2014 23:23:09 +0000 (00:23 +0100)]
net: fec: remove useless fep->opened
napi_disable() waits until the NAPI processing has completed, and then
prevents any further polls. At this point, the driver then clears
fep->opened. The NAPI poll function uses this to stop processing in
the receive path. Hence, it will never see this variable cleared,
because the NAPI poll has to complete before it will be cleared.
Therefore, this variable serves no purpose, so let's remove it.
Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Russell King [Mon, 7 Jul 2014 23:23:04 +0000 (00:23 +0100)]
net: fec: stop the phy before shutting down the MAC
When the network interface goes down, stop the phy to prevent further
link up status changes before taking the MAC or netif sections down.
This prevents further reception of link up events which could
potentially call fec_restart().
Since phy_stop() takes the mutex which adjust_link() runs under, we
also ensure that adjust_link() will not already be processing a link
up event.
We also need to do this when suspending as well - we don't want a
mis-timed phy state change to restart the MAC after we have stopped
it for suspend, and thus need to restart the phy when resuming.
Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Russell King [Mon, 7 Jul 2014 23:22:59 +0000 (00:22 +0100)]
net: fec: ensure that a disconnected phy isn't configured
When we disconnect from a phy, we should forget our pointer to it so we
don't accidentally try to configure it. We handle a NULL phy pointer
correctly in most places, except fec_enet_set_pauseparam(). Fix this
too.
Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Russell King [Mon, 7 Jul 2014 23:22:54 +0000 (00:22 +0100)]
net: fec: remove checking for NULL phy_dev in fec_enet_close()
fep->phy_dev can not be NULL here for two reasons:
- fec_enet_open() will have successfully connected the phy, or will have
failed.
- fec_enet_open() will have called phy_start(fep->phy_dev), which
unconditionally dereferences this pointer.
If it were to be NULL here, then fec_enet_open() will have already
oopsed.
Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Russell King [Mon, 7 Jul 2014 23:22:49 +0000 (00:22 +0100)]
net: fec: use netif_tx_disable() rather than netif_stop_queue()
We use netif_stop_queue() in several places where we want to ensure that
the start_xmit function is not running. netif_stop_queue() is not
sufficient to achieve that - it merely sets a flag to indicate that the
transmit queue(s) should not be run.
netif_tx_disable() gives this guarantee, since it takes the transmit
queue lock while marking the queue stopped. This will wait for the
transmit function to complete before returning.
Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Russell King [Mon, 7 Jul 2014 23:22:44 +0000 (00:22 +0100)]
net: fec: fix interrupt handling races
While running: while :; do iperf -c <HOST> -P 4; done, transmit timeouts
are regularly reported. With the tx ring dumping in place, we can see
that all entries are in use, and the hardware has finished transmitting
these packets. However, the driver has not reclaimed these ring
entries.
This can occur if the interrupt handler is invoked at the wrong moment -
eg:
CPU0 CPU1
fec_enet_tx()
interrupt, IEVENT = FEC_ENET_TXF
FEC_ENET_TXF cleared
napi_schedule_prep()
napi_complete()
The result is that we clear the transmit interrupt, but we don't trigger
any cleaning of the transmit ring. Instead, use a different strategy:
- When receiving a transmit or receive interrupt, disable both tx and rx
interrupts, but do not acknowledge them. Schedule a napi poll. Don't
loop.
- When we are polled, read IEVENT, acknowledging the pending transmit
and receive interrupts, before then going on to process the
appropriate rings.
This allows us to avoid the race, and has a number of other advantages:
- we cut down on the number of transmit interrupts we have to process.
- we only look at the rings which have pending events.
- we gain additional throughput: the iperf total bandwidth increases
from about 180Mbps to 240Mbps:
[ 3] 0.0-10.0 sec 68.1 MBytes 57.0 Mbits/sec
[ 5] 0.0-10.0 sec 72.4 MBytes 60.5 Mbits/sec
[ 4] 0.0-10.1 sec 76.1 MBytes 63.5 Mbits/sec
[ 6] 0.0-10.1 sec 71.9 MBytes 59.9 Mbits/sec
[SUM] 0.0-10.1 sec 288 MBytes 241 Mbits/sec
Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Russell King [Mon, 7 Jul 2014 23:22:39 +0000 (00:22 +0100)]
net: fec: fix ethtool set_pauseparam duplex bug
Setting the pause parameters causes a running network interface to be
restarted. However, the restart forces the FEC into half-duplex mode,
whether or not the remote end is in half-duplex mode. Misconfigured
duplex mode is a known source of problems on a link.
Fix this by always preserving the duplex mode on configuration changes.
Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Russell King [Mon, 7 Jul 2014 23:22:34 +0000 (00:22 +0100)]
net: fec: iMX6 FEC does not support half-duplex gigabit
The iMX6 gigabit FEC does not support half-duplex gigabit operation.
Phys attacked to the FEC may support this, and we currently do nothing
to disable this feature. This may result in an invalid configuration.
Mask out phy support for gigabit half-duplex operation.
Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 8 Jul 2014 04:14:29 +0000 (21:14 -0700)]
Merge branch 'net-hash-tx'
Tom Herbert says:
====================
net: Improvements and applications of packet flow hash in transmit path
This patch series includes some patches which improve and make use
of skb->hash in the transmit path.
What is included:
- Infrastructure to save a precomputed hash in the sock structure.
For connected TCP and UDP sockets we only need to compute the
flow hash once and not once for every packet.
- Call skb_get_hash in get_xps_queue and __skb_tx_hash. This eliminates
the awkward access to skb->sk->sk_hash in the lower transmit path.
- Move UDP source port generation into a common function in udp.h This
implementation is mostly based on vxlan_src_port.
- Use non-zero IPv6 flow labels in flow_dissector as port information
for flow hash calculation.
- Implement automatic flow label generation on transmit (per RFC 6438).
- Don't repeatedly try to compute an L4 hash in skb_get_hash if we've
already tried to find one in software stack calculation.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Tom Herbert [Wed, 2 Jul 2014 04:33:17 +0000 (21:33 -0700)]
net: Only do flow_dissector hash computation once per packet
Add sw_hash flag to skbuff to indicate that skb->hash was computed
from flow_dissector. This flag is checked in skb_get_hash to avoid
repeatedly trying to compute the hash (ie. in the case that no L4 hash
can be computed).
Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Tom Herbert [Wed, 2 Jul 2014 04:33:10 +0000 (21:33 -0700)]
ipv6: Implement automatic flow label generation on transmit
Automatically generate flow labels for IPv6 packets on transmit.
The flow label is computed based on skb_get_hash. The flow label will
only automatically be set when it is zero otherwise (i.e. flow label
manager hasn't set one). This supports the transmit side functionality
of RFC 6438.
Added an IPv6 sysctl auto_flowlabels to enable/disable this behavior
system wide, and added IPV6_AUTOFLOWLABEL socket option to enable this
functionality per socket.
By default, auto flowlabels are disabled to avoid possible conflicts
with flow label manager, however if this feature proves useful we
may want to enable it by default.
It should also be noted that FreeBSD has already implemented automatic
flow labels (including the sysctl and socket option). In FreeBSD,
automatic flow labels default to enabled.
Performance impact:
Running super_netperf with 200 flows for TCP_RR and UDP_RR for
IPv6. Note that in UDP case, __skb_get_hash will be called for
every packet with explains slight regression. In the TCP case
the hash is saved in the socket so there is no regression.
Automatic flow labels disabled:
TCP_RR:
86.53% CPU utilization
127/195/322 90/95/99% latencies
1.40498e+06 tps
UDP_RR:
90.70% CPU utilization
118/168/243 90/95/99% latencies
1.50309e+06 tps
Automatic flow labels enabled:
TCP_RR:
85.90% CPU utilization
128/199/337 90/95/99% latencies
1.40051e+06
UDP_RR
92.61% CPU utilization
115/164/236 90/95/99% latencies
1.4687e+06
Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Tom Herbert [Wed, 2 Jul 2014 04:33:01 +0000 (21:33 -0700)]
flow_dissector: Use IPv6 flow label in flow_dissector
This patch implements the receive side to support RFC 6438 which is to
use the flow label as an ECMP hash. If an IPv6 flow label is set
in a packet we can use this as input for computing an L4-hash. There
should be no need to parse any transport headers in this case.
Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Tom Herbert [Wed, 2 Jul 2014 04:32:49 +0000 (21:32 -0700)]
vxlan: Call udp_flow_src_port
In vxlan and OVS vport-vxlan call common function to get source port
for a UDP tunnel. Removed vxlan_src_port since the functionality is
now in udp_flow_src_port.
Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Tom Herbert [Wed, 2 Jul 2014 04:32:39 +0000 (21:32 -0700)]
udp: Add function to make source port for UDP tunnels
This patch adds udp_flow_src_port function which is intended to be
a common function that UDP tunnel implementations call to set the source
port. The source port is chosen so that a hash over the outer headers
(IP addresses and UDP ports) acts as suitable hash for the flow of the
encapsulated packet. In this manner, UDP encapsulation works with RSS
and ECMP based wrt the inner flow.
Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Tom Herbert [Wed, 2 Jul 2014 04:32:27 +0000 (21:32 -0700)]
net: Call skb_get_hash in get_xps_queue and __skb_tx_hash
Call standard function to get a packet hash instead of taking this from
skb->sk->sk_hash or only using skb->protocol.
Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Tom Herbert [Wed, 2 Jul 2014 04:32:17 +0000 (21:32 -0700)]
net: Save TX flow hash in sock and set in skbuf on xmit
For a connected socket we can precompute the flow hash for setting
in skb->hash on output. This is a performance advantage over
calculating the skb->hash for every packet on the connection. The
computation is done using the common hash algorithm to be consistent
with computations done for packets of the connection in other states
where thers is no socket (e.g. time-wait, syn-recv, syn-cookies).
This patch adds sk_txhash to the sock structure. inet_set_txhash and
ip6_set_txhash functions are added which are called from points in
TCP and UDP where socket moves to established state.
skb_set_hash_from_sk is a function which sets skb->hash from the
sock txhash value. This is called in UDP and TCP transmit path when
transmitting within the context of a socket.
Tested: ran super_netperf with 200 TCP_RR streams over a vxlan
interface (in this case skb_get_hash called on every TX packet to
create a UDP source port).
Before fix:
95.02% CPU utilization
154/256/505 90/95/99% latencies
1.13042e+06 tps
Time in functions:
0.28% skb_flow_dissect
0.21% __skb_get_hash
After fix:
94.95% CPU utilization
156/254/485 90/95/99% latencies
1.15447e+06
Neither __skb_get_hash nor skb_flow_dissect appear in perf
Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Tom Herbert [Wed, 2 Jul 2014 04:32:05 +0000 (21:32 -0700)]
flow_dissector: Abstract out hash computation
Move the hash computation located in __skb_get_hash to be a separate
function which takes flow_keys as input. This will allow flow hash
computation in other contexts where we only have addresses and ports.
Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 8 Jul 2014 03:56:55 +0000 (20:56 -0700)]
Merge branch 'systemport-next'
Florian Fainelli says:
====================
net: systemport: PM and Wake-on-LAN support
This patchset brings Power Management and Wake-on-LAN support to the
Broadcom SYSTEM PORT driver.
S2 and S3 modes are supported, while we only support Wake-on-LAN using
MagicPackets for now
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Florian Fainelli [Wed, 2 Jul 2014 04:08:40 +0000 (21:08 -0700)]
net: systemport: add Wake-on-LAN support
Support for Wake-on-LAN using Magic Packet with or without SecureOn
password is implemented doing the following:
- setting the password to the relevant UniMAC registers
- flagging the device as a wakeup source for the system, as well as
its Wake-on-LAN interrupt
- prepare the hardware for entering WoL mode
- enabling the MPD interrupt to wake us
The Device Tree binding documentation is also reflected to specify the
third optional Wake-on-LAN interrupt line.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Florian Fainelli [Wed, 2 Jul 2014 04:08:39 +0000 (21:08 -0700)]
net: systemport: rename rx_csum_en to rx_chk_en
This boolean tells us whether we are using the RXCHK hardware block,
so use a variable name that reflects that. RXCHK might be used in the
future to implement Wake-on-LAN using ARP or unicast packets.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Florian Fainelli [Wed, 2 Jul 2014 04:08:38 +0000 (21:08 -0700)]
net: systemport: add suspend and resume support
Implement the hardware recommended suspend/resume procedure for
SYSTEMPORT. We leverage the previous factoring work such that we can
logically break all suspend/resume operations into disctint RX and TX
code paths.
When the system enters S3, we will loose all register contents, so
make sure that we correctly re-program all the hardware and software
views of the RX & TX rings as well.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Florian Fainelli [Wed, 2 Jul 2014 04:08:37 +0000 (21:08 -0700)]
net: systemport: add bcm_sysport_netif_{enable,stop}
Factor common code that either enables or disables the network
interface with the networking stack. We are going to reuse these
functions for suspend/resume callbacks.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Florian Fainelli [Wed, 2 Jul 2014 04:08:36 +0000 (21:08 -0700)]
net: systemport: update umac_enable_set to take a bitmask
Quite often we need to enable either the transmitter or the receiver
bits in UMAC_CMD, use umac_enable_set() to do that for us.
This is a preliminary change to introduce suspend/resume support in the
driver.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Varka Bhadram [Wed, 2 Jul 2014 03:31:09 +0000 (09:01 +0530)]
6lowpan: mac802154: fix coding style issues
This patch fixed the coding style issues reported by checkpatch.pl
following issues fixed:
CHECK: Alignment should match open parenthesis
WARNING: line over 80 characters
CHECK: Blank lines aren't necessary before a close brace '}'
WARNING: networking block comments don't use an empty /* line, use /* Comment...
WARNING: Missing a blank line after declarations
WARNING: networking block comments start with * on subsequent lines
CHECK: braces {} should be used on all arms of this statement
Signed-off-by: Varka Bhadram <varkab@cdac.in>
Tested-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Rami Rosen [Tue, 1 Jul 2014 18:17:35 +0000 (21:17 +0300)]
netlink: Fix do_one_broadcast() prototype.
This patch changes the prototype of the do_one_broadcast() method so that it will return void.
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 8 Jul 2014 02:55:49 +0000 (19:55 -0700)]
Merge branch 'tipc-next'
Erik Hugne says:
====================
tipc: link state processing improvements
Message delivery is separated from the link state processing, and
we fix a bug in receive-path triggered acks.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Erik Hugne [Tue, 1 Jul 2014 08:22:41 +0000 (10:22 +0200)]
tipc: fix link acknowledge logic in receive path
Link state acks triggered from the receive path is done before
the last received packet have been processed by the link layer.
The effect of this is that the last received packet will not be
included in the ack. This causes problems if the link window is
set to TIPC_MIN_LINK_WIN, where the ack interval will be equal to
the link tolerance, and the link enters a stop-and-go behavior.
We move the ack logic to after link state processing, just before
the packet is delivered to higher layers.
Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: Carl Sigurjonsson <carl.sigurjonsson@ericsson.com>
Reviewed-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Erik Hugne [Tue, 1 Jul 2014 08:22:40 +0000 (10:22 +0200)]
tipc: refactor message delivery out of tipc_rcv
This is a cosmetic change, separating message delivery from the
link state processing.
Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Neal Cardwell [Mon, 30 Jun 2014 19:09:49 +0000 (15:09 -0400)]
tcp: switch snt_synack back to measuring transmit time of first SYNACK
Always store in snt_synack the time at which the server received the
first client SYN and attempted to send the first SYNACK.
Recent commit
aa27fc501 ("tcp: tcp_v[46]_conn_request: fix snt_synack
initialization") resolved an inconsistency between IPv4 and IPv6 in
the initialization of snt_synack. This commit brings back the idea
from
843f4a55e (tcp: use tcp_v4_send_synack on first SYN-ACK), which
was going for the original behavior of snt_synack from the commit
where it was added in
9ad7c049f0f79 ("tcp: RFC2988bis + taking RTT
sample from 3WHS for the passive open side") in v3.1.
In addition to being simpler (and probably a tiny bit faster),
unconditionally storing the time of the first SYNACK attempt has been
useful because it allows calculating a performance metric quantifying
how long it took to establish a passive TCP connection.
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Cc: Octavian Purdila <octavian.purdila@intel.com>
Cc: Jerry Chu <hkchu@google.com>
Acked-by: Octavian Purdila <octavian.purdila@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 8 Jul 2014 00:07:05 +0000 (17:07 -0700)]
Merge branch 'tlan-next'
Ondrej Zary says:
====================
tlan: Link handling improvements and Olicom fixes
This patch series improves link handling in tlan driver, allowing the
cable to be (un)plugged anytime and NetworkManager to work properly.
Also there are some bugfixes related to Olicom OC-2326 card.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Ondrej Zary [Mon, 30 Jun 2014 16:38:37 +0000 (18:38 +0200)]
tlan: Isolate external PHY when using internal PHY
When using internal 10 Mbps PHY, isolate the external PHY from MII bus.
External PHY must be kept powered up because it passes TX from tlan chip to
network.
This fixes weird link-loss problems under load with OC-2326 card at 10 Mbps.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ondrej Zary [Mon, 30 Jun 2014 16:38:36 +0000 (18:38 +0200)]
tlan: Enable device at resume
pci_disable_device() is called in _suspend but there's no corresponding
pci_enable_device() in _resume.
This causes "disabling already-disabled device" warning on 2nd suspend.
Add pci_enable_device() call to _resume to fix this problem.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ondrej Zary [Mon, 30 Jun 2014 16:38:35 +0000 (18:38 +0200)]
tlan: Don't disable internal PHY on cards that use it in 10 Mbps mode
In tlan_reset_adapter, we disable internal PHY when an external one is used.
On cards which use internal PHY in 10 Mbps mode, we enable it later when
setting 10 Mbps mode but it does not really work (PHY fails to reset).
Leave it enabled instead.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ondrej Zary [Mon, 30 Jun 2014 16:38:34 +0000 (18:38 +0200)]
tlan: Add PHY reset timeout
Add a timeout to prevent infinite loop waiting for PHY to reset.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ondrej Zary [Mon, 30 Jun 2014 16:38:33 +0000 (18:38 +0200)]
tlan: Make autonegotiation faster
Reduce the autonegotiation poll interval from 8 seconds to 2.
This greatly reduces the time needed to detect link presence,
especially on Olicom cards at 10 Mbps (two autonegoatiations required).
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ondrej Zary [Mon, 30 Jun 2014 16:38:32 +0000 (18:38 +0200)]
tlan: Don't scream if no link
Remove excess printks when the link is down.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ondrej Zary [Mon, 30 Jun 2014 16:38:31 +0000 (18:38 +0200)]
tlan: Restart autonegotiation on link loss
When link is lost on a card which uses internal PHY for 10 Mbit speeds,
restart autonegotiation to allow switching between 10 and 100 Mbps speeds.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ondrej Zary [Mon, 30 Jun 2014 16:38:30 +0000 (18:38 +0200)]
tlan: Fix MAC address byte order on OC-2325/OC-2326
Olicom OC-2325 and OC-2326 cards have the MAC address byte-swapped in EEPROM.
Byte-swap the MAC address if it's located at offset 0xF8.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ondrej Zary [Mon, 30 Jun 2014 16:38:29 +0000 (18:38 +0200)]
tlan: Add ethtool support
Add basic ethtool support to tlan driver:
- driver info - link detect (this allows NetworkManager to detect carrier)
- EEPROM read
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ondrej Zary [Mon, 30 Jun 2014 16:38:28 +0000 (18:38 +0200)]
tlan: Enable link monitoring
Enable old link monitoring code and modify it:
- control LINK LED
- use separate timer so it does not interfere with ACT LED
Tested with Olicom OC-2326.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ondrej Zary [Mon, 30 Jun 2014 16:38:27 +0000 (18:38 +0200)]
tlan: Enable activity LED on Olicom OC-2325 and OC-2326
Olicom OC-2325 and OC-2326 ethernet cards have an activity LED but it does not
work with tlan driver as it's not enabled. Enable it.
Tested with OC-2326.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Himangi Saraogi [Sat, 28 Jun 2014 18:36:29 +0000 (00:06 +0530)]
batman-adv: Use kasprintf
kasprintf combines kmalloc and sprintf, and takes care of the size
calculation itself.
The semantic patch that makes this change is as follows:
// <smpl>
@@
expression a,flag;
expression list args;
statement S;
@@
a =
- \(kmalloc\|kzalloc\)(...,flag)
+ kasprintf(flag,args)
<... when != a
if (a == NULL || ...) S
...>
- sprintf(a,args);
// </smpl>
Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Mon, 7 Jul 2014 23:57:32 +0000 (16:57 -0700)]
Merge branch 'ptp-vlan'
Stefan Sørensen says:
====================
Add ptp vlan support
This patch series adds functionality for running ptp/ieee1588 over vlan.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Stefan Sørensen [Fri, 27 Jun 2014 09:59:11 +0000 (11:59 +0200)]
vlan: Pass SIOC[SG]HWTSTAMP ioctls to real device
This allows applications to enable hardware timestamping without being aware
of it being a vlan device and figuring out the real device.
Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stefan Sørensen [Fri, 27 Jun 2014 09:59:10 +0000 (11:59 +0200)]
ptp: Classify ptp over ip over vlan packets
This extends the ptp bpf to also match ptp over ip over vlan packets. The ptp
classes are changed to orthogonal bitfields representing version, transport
and vlan values to simplify matching.
Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stefan Sørensen [Fri, 27 Jun 2014 09:59:09 +0000 (11:59 +0200)]
net: Simplify ptp class checks
Replace two switch statements enumerating all valid ptp classes with an if
statement matching for not PTP_CLASS_NONE.
Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Catherine Sullivan [Wed, 4 Jun 2014 08:45:29 +0000 (08:45 +0000)]
i40e/i40evf: Bump i40e to 0.4.21 and i40evf to 0.9.40
Bump.
Change-ID: Ie0c36583ffd9997679f46bdf89bc462d3e992995
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Catherine Sullivan [Wed, 4 Jun 2014 08:45:28 +0000 (08:45 +0000)]
i40e: Implement set_settings for ethtool
Implement set_settings for ethtool in i40e.
Change-ID: Ie3c3fe18e8ff86c3f25b842844b3d9aabc9bba57
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Catherine Sullivan [Wed, 4 Jun 2014 08:45:27 +0000 (08:45 +0000)]
i40e: Add set_pauseparam to ethtool
Add i40e implementation of setpauseparam to ethtool.
Change-ID: Ie7766b2091ec8f934737573c9ffd426081966718
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Catherine Sullivan [Wed, 4 Jun 2014 08:45:26 +0000 (08:45 +0000)]
i40e/i40evf: Add set_fc and init of FC settings
Add function set_fc to set the requested FC mode. This patch also
adds the init of FC setting to get_link_info and replaces the init
code to set FC off by default in main. Also adds i40e_set_phy_config
to support this.
Change-ID: I7b25bbaec81f15777137ab324a095f916e44351d
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jesse Brandeburg [Wed, 4 Jun 2014 08:45:25 +0000 (08:45 +0000)]
i40e: move nway reset
Just move nway reset up, will be used in the next patch.
Change-ID: Ice3b631fa2044debc5c4541b42872a48163f8452
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Catherine Sullivan [Wed, 4 Jun 2014 08:45:24 +0000 (08:45 +0000)]
i40e/i40evf: Add new HW link info variable an_enabled and function update_link_info
Add a new variable, hw.phy.link_info.an_enabled, to track whether autoneg is
enabled. Also add a new function update_link_info that will update that
variable as well as calling get_link_info to update the rest of the link info.
Also add get_phy_capabilities to support this.
Change-ID: I5157ef03492b6dd8ec5e608ba0cf9b0db9c01710
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jesse Brandeburg [Wed, 4 Jun 2014 08:45:23 +0000 (08:45 +0000)]
i40e: Finish implementation of ethtool get settings
Finish the i40e implementation of get_settings for ethtool.
Change-ID: Iec81835aa9380723ae9288bcb79b30a6a1ecd498
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jesse Brandeburg [Wed, 4 Jun 2014 08:45:21 +0000 (08:45 +0000)]
i40e: disable TPH
TPH is not currently enabled in this product, make sure it
isn't enabled by default.
Change-ID: Ibb1a10799c33c4c76dec06fcd53b1d6efa13c1f5
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Anjali Singhai Jain [Wed, 4 Jun 2014 08:45:20 +0000 (08:45 +0000)]
i40e: Fix a boundary condition and turning off of ntuple
When turning off ntuple with a FD table full situation,
the driver would have auto disabled FD filter additions.
Clear the auto disable flag for FD_SB so that when the
feature is turned on again using "ethtool -K ethx ntuple on"
we can start adding filters once again.
Change-ID: I036a32e7331bcae765b657c8abb4fa070940b163
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>
Mitch Williams [Wed, 4 Jun 2014 08:45:19 +0000 (08:45 +0000)]
i40evf: invite vector 0 to the interrupt party
The i40evf_irq_enable and i40evf_fire_sw_interrupt functions were
unfairly discriminating against MSI-X vector 0, just because it doesn't
handle traffic. That doesn't mean it's not essential to the operation of
the driver. This change allows the watchdog to fire vector 0 via
software, which makes the driver tolerant of dropped interrupts on that
vector.
Buck up, vector 0! You can be part of our gang!
Change-ID: I37131d955018a6b3e711e1732d21428acd0d767e
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Mitch Williams [Wed, 4 Jun 2014 08:45:18 +0000 (08:45 +0000)]
i40e: tolerate lost interrupts
If the AQ interrupt gets lost for some reason, VF communications will
stall as the VFs have no way of reaching the PF, which is essentially
deaf. The VFs end up waiting forever for a reply that will never come.
To alleviate this condition, go ahead and check the ARQ every time we
run the service task. Remove the check for a pending event, and get rid
of a chatty error message that is now meaningless.
Change-ID: I0fc9d18169cd45c98f60188aef872cd6cee9a027
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Paul M Stillwell Jr [Wed, 4 Jun 2014 08:45:17 +0000 (08:45 +0000)]
i40e/i40evf: Force a shifted '1' to be unsigned
Force a shifted '1' to be unsiged to avoid shifting a signed int
Change-ID: I688cbd082af0f2e1df548fda25847a5ca04babcf
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Mitch Williams [Wed, 4 Jun 2014 08:45:16 +0000 (08:45 +0000)]
i40evf: don't violate scope
Move a declaration up one level so we don't dereference it out of scope.
This didn't cause any panics, but the details->async field would
mysteriously disappear, causing unnecessary delays when sending AQ
commands. Also, the code is just plain wrong.
Change-ID: I753f64f13c55e5d75ea4351e29b14fb53b2f0104
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Anjali Singhai Jain [Wed, 4 Jun 2014 08:45:15 +0000 (08:45 +0000)]
i40e/i40evf: Do not free the dummy packet buffer synchronously
The HW still needs to consume it and freeing it in the function
that created it would mean we will be racing with the HW. The
i40e_clean_tx_ring() routine will free up the buffer attached once
the HW has consumed it. The clean_fdir_tx_irq function had to be fixed
to handle the freeing correctly.
Cases where we program more than one filter per flow (Ipv4), the
code had to be changed to allocate dummy buffer multiple times
since it will be freed by the clean routine. This also fixes an issue
where the filter program routine was not checking if there were
descriptors available for programming a filter.
Change-ID: Idf72028fd873221934e319d021ef65a1e51acaf7
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>
David S. Miller [Thu, 3 Jul 2014 01:44:14 +0000 (18:44 -0700)]
Merge branch 'sctp'
Daniel Borkmann says:
====================
Misc SCTP updates
Daniel Borkmann (2):
net: sctp: improve timer slack calculation for transport HBs
net: sctp: only warn in proc_sctp_do_alpha_beta if write
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Daniel Borkmann [Mon, 30 Jun 2014 11:52:09 +0000 (13:52 +0200)]
net: sctp: only warn in proc_sctp_do_alpha_beta if write
Only warn if the value is written to alpha or beta. We don't care
emitting a one-time warning when only reading it.
Reported-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Reviewed-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Borkmann [Mon, 30 Jun 2014 11:52:08 +0000 (13:52 +0200)]
net: sctp: improve timer slack calculation for transport HBs
RFC4960, section 8.3 says:
On an idle destination address that is allowed to heartbeat,
it is recommended that a HEARTBEAT chunk is sent once per RTO
of that destination address plus the protocol parameter
'HB.interval', with jittering of +/- 50% of the RTO value,
and exponential backoff of the RTO if the previous HEARTBEAT
is unanswered.
Currently, we calculate jitter via sctp_jitter() function first,
and then add its result to the current RTO for the new timeout:
TMO = RTO + (RAND() % RTO) - (RTO / 2)
`------------------------^-=> sctp_jitter()
Instead, we can just simplify all this by directly calculating:
TMO = (RTO / 2) + (RAND() % RTO)
With the help of prandom_u32_max(), we don't need to open code
our own global PRNG, but can instead just make use of the per
CPU implementation of prandom with better quality numbers. Also,
we can now spare us the conditional for divide by zero check
since no div or mod operation needs to be used. Note that
prandom_u32_max() won't emit the same result as a mod operation,
but we really don't care here as we only want to have a random
number scaled into RTO interval.
Note, exponential RTO backoff is handeled elsewhere, namely in
sctp_do_8_2_transport_strike().
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Thu, 3 Jul 2014 01:41:05 +0000 (18:41 -0700)]
Merge branch 'be2net'
Sathya Perla says:
====================
be2net: patch set
v2 change: merged 2 lines into one in patch 4
Patch 1 refactors be_cmd_get_profile_config() routine to reduce
code duplication by using the be_cmd_notify_wait() routine, instead
of using a separate variant of the code for MBOX and MCCQ.
Patch 2 introduces the required FW-cmd code in the PF to query
RSS support on a VF. This is in preparation for patch 3.
Patch 3 adds support for the PF driver to re-configure the resource
distribution in FW based on the number of VFs enabled by the user. When
the user is not interested in enabling VFs, all resources of a port are
set-aside for the PF. If less than maximum number of VFs are enabled, then
each VF gets a better share of the resources and can now enable RSS (if
the interface supports it.)
Patch 4 is a minor fix to re-enable HW vlan filtering as soon as the number
of vlans programmed is within the HW limit.
Please consider applying to net-next tree. Thanks!
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Kalesh AP [Mon, 30 Jun 2014 07:31:33 +0000 (13:01 +0530)]
be2net: re-enable vlan filtering mode asap
While adding vlans, when the HW limit of vlan filters is reached, the
driver enables vlan promiscuous mode.
Similarily, while removing vlans, the driver must re-enable HW filtering
as soon as the number of vlan filters is within the HW limit.
Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vasundhara Volam [Mon, 30 Jun 2014 07:31:32 +0000 (13:01 +0530)]
be2net: create optimal number of queues on SR-IOV config
If SR-IOV is enabled in the adapter, the FW distributes queue resources
evenly across the PF and it's VFs. If the user is not interested in enabling
VFs, the queues set aside for VFs are wasted.
This patch adds support for the PF driver to re-configure the resource
distribution in FW based on the number of VFs enabled by the user.
This also allows for supporting RSS queues on VFs, when less number of VFs
are enabled per PF. When maximum number of VFs are enabled, each VF typically
gets only one RXQ.
Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vasundhara Volam [Mon, 30 Jun 2014 07:31:31 +0000 (13:01 +0530)]
be2net: read VF's capabilities from GET_PROFILE_CONFIG cmd
The PF driver must query the FW for VF's interface capabilities
to know if the VF is RSS capable or not.
This patch is in preparation for enabling RSS on VFs on Skyhawk-R.
Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vasundhara Volam [Mon, 30 Jun 2014 07:31:30 +0000 (13:01 +0530)]
be2net: remove be_cmd_get_profile_config_mbox/mccq() variants
Fix be_cmd_get_profile_cmd() to use be_cmd_notify_wait() routine,
which uses MBOX if MCCQ has not been created. Doing this reduces
code duplication; we don't need the _mbox/_mccq() variants anymore.
Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Fabian Frederick [Sat, 28 Jun 2014 18:44:19 +0000 (20:44 +0200)]
drivers/net/hyperv/netvsc.c: remove unnecessary null test before kfree
Fix checkpatch warning:
WARNING: kfree(NULL) is safe this check is probably not required
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: netdev@vger.kernel.org
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
Sergei Shtylyov [Sat, 28 Jun 2014 00:10:00 +0000 (04:10 +0400)]
sh_eth: remove checks around dev_kfree_skb() calls
Since consume_skb() (and hence dev_kfree_skb() macro) checks the passed pointer
for NULL, there's no need to check for NULL before invoking dev_kfree_skb().
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Prashant Sreedharan [Fri, 27 Jun 2014 23:21:50 +0000 (16:21 -0700)]
MAINTAINERS: Update tg3 maintainer
Signed-off-by: Prashant Sreedharan <prashant@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Thu, 3 Jul 2014 00:11:00 +0000 (17:11 -0700)]
Merge branch 'qlcnic-next'
Harish Patil says:
====================
qlcnic: Enhance Tx timeout debug data collection.
The following set of patches are for enhancing Tx timeout debug collection
- Collect a firmware dump on first Tx timeout if netif_msg_tx_err() is set
- Log Receive and Status ring info on Tx timeout, in addition to Tx ring info
- Log additional Tx ring info if netif_msg_tx_err() is set
- Update driver version to 5.3.61
Please apply this series to net-next.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Harish Patil [Fri, 27 Jun 2014 23:01:39 +0000 (19:01 -0400)]
qlcnic: Update version to 5.3.61
Signed-off-by: Harish Patil <harish.patil@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>