Emmanuel Grumbach [Wed, 28 Dec 2016 08:43:02 +0000 (10:43 +0200)]
iwlwifi: mvm: use the PROBE_RESP_QUEUE to send deauth to unknown station
When we send a deauth to a station we don't know about, we
need to use the PROBE_RESP queue. This can happen when we
send a deauth to a station that is not associated to us.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Sara Sharon [Tue, 3 Jan 2017 19:03:35 +0000 (21:03 +0200)]
iwlwifi: mvm: fix reorder timer re-arming
When NSSN is behind the reorder buffer due to timeout
the reorder timer isn't getting re-armed until NSSN
catches up. Fix it.
Fixes:
0690405fef29 ("iwlwifi: mvm: add reorder timeout per frame")
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Sara Sharon [Sun, 1 Jan 2017 16:42:23 +0000 (18:42 +0200)]
iwlwifi: mvm: fix references to first_agg_queue in DQA mode
In DQA mode, first_agg_queue is initialized to
IWL_MVM_DQA_MIN_DATA_QUEUE. This causes two bugs in the tx response
flow:
1. When TX fails, we set IEEE80211_TX_STAT_AMPDU_NO_BACK regardless
if we actually have aggregation open on the queue. This causes
mac80211 to send a BAR frame even though there is no aggregation
open.
Fix that by simply checking the AMPDU flag that is set on by
mac80211 for AMPDU packets.
2. When reclaiming frames in aggregation mode, we reclaim based on
scheduler ssn and not the SN.
The reason is that scheduler ssn may be ahead of SN due to a hole
in the BA window that was filled.
However, if we have aggregations open on IWL_MVM_DQA_BSS_CLIENT_QUEUE
the reclaim flow will still go to the code of non-aggregation
instead of the aggregation code since IWL_MVM_DQA_BSS_CLIENT_QUEUE
is smaller than IWL_MVM_DQA_MIN_DATA_QUEUE, although it is a valid
aggregation queue.
Fix that by always using the aggregation reclaim code by default in
DQA mode (currently it is implicitly used by default for all queues
except the reserved BSS queue).
Fixes:
cf961e16620f ("iwlwifi: mvm: support dqa-mode agg on non-shared queue")
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Gregory Greenman [Wed, 21 Dec 2016 14:18:44 +0000 (16:18 +0200)]
iwlwifi: mvm: fix a print of NSS for HT rate
Handling of the number of space time streams was missing for HT rate in
rate printing function. Fix it.
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Golan Ben Ami [Thu, 15 Dec 2016 08:22:36 +0000 (10:22 +0200)]
iwlwifi: pcie: Re-configure IVAR table after stop device
When getting RF_KILL and disabling radio, the device gets stopped
and reset. This erases the IVAR table that matches the interrupt
to its cause, and is essential for MSIX proper functionality.
Till now, the table wasn't re-configured after the reset, and
therefore the interrupt that enabled radio didn't fire on the
right irq, and the driver didn't handle it correctly.
To fix this, configure the IVAR table again after resetting the
device.
Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Haim Dreyfuss [Mon, 12 Dec 2016 12:09:49 +0000 (14:09 +0200)]
iwlwifi: pcie: re-configure IVAR table after suspend-resume
During the suspend/resume flow some HW blocks are reset. This causes
the IVAR table to be completely erased. This table is where interrupt
causes are bound to specific IRQs. When the table is empty the
interrupt handlers are not called correctly. Fix this by reconfiguring
the IVAR table after resume.
Fixes:
2e5d4a8f61dc ("iwlwifi: pcie: Add new configuration to enable MSIX")
Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Haim Dreyfuss [Tue, 13 Dec 2016 10:40:34 +0000 (12:40 +0200)]
iwlwifi: pcie: separate between SW and HW MSIX configuration
The MSIX configuration flow includes two different stages:
configuring the HW by writing to the IVAR table and configuring the SW
to reflect the HW configuration.
The HW configuration is needed on each HW reset,
whereas the SW configuration is only needed during the init flow.
Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Haim Dreyfuss [Mon, 12 Dec 2016 11:57:02 +0000 (13:57 +0200)]
iwlwifi: pcie: move msix conf functions above other functions
msix configuration functions should be called by other functions.
For example by pcie_d3_resume, move it above to enable it.
Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Sara Sharon [Thu, 8 Dec 2016 09:44:20 +0000 (11:44 +0200)]
iwlwifi: mvm: support new beacon template command
Support new version of beacon template command which deprecates
the use of the tx command inside.
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Johannes Berg [Tue, 13 Dec 2016 09:29:07 +0000 (10:29 +0100)]
iwlwifi: pcie: fix another RF-kill race
When resuming, it's possible for the following scenario to occur:
* iwl_pci_resume() enables the RF-kill interrupt
* iwl_pci_resume() reads the RF-kill state (e.g. to 'radio enabled')
* RF_KILL interrupt triggers, and iwl_pcie_irq_handler() reads the
state, now 'radio disabled', and acquires the &trans_pcie->mutex.
* iwl_pcie_irq_handler() further calls iwl_trans_pcie_rf_kill() to
indicate to the higher layers that the radio is now disabled (and
stops the device while at it)
* iwl_pcie_irq_handler() drops the mutex
* iwl_pci_resume() continues, acquires the mutex and calls the higher
layers to indicate that the radio is enabled.
At this point, the device is stopped but the higher layers think it's
available, and can call deeply into the driver to try to enable it.
However, this will fail since the device is actually disabled.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Sara Sharon [Wed, 23 Nov 2016 15:08:20 +0000 (17:08 +0200)]
iwlwifi: support two phys for a000 devices
Support differentiating between two phys for a000 devices
in order to load the correct firmware.
Eventually when moving completely to the new phy we will be
able to remove this.
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Luca Coelho [Tue, 13 Dec 2016 07:56:07 +0000 (09:56 +0200)]
iwlwifi: remove unnecessary cfg element in iwl_drv
The iwl_drv structure contains trans which already contains cfg, so
storing cfg separately in iwl_drv is redundant. Remove it and access
trans->cfg instead.
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Luca Coelho [Tue, 13 Dec 2016 07:48:57 +0000 (09:48 +0200)]
iwlwifi: remove unnecessary argument to iwl_drv_start()
When iwl_drv_start() is called, trans->cfg must already be set, so
there's no need to pass cfg separately, since it can be accessed
directly from trans->cfg.
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Sara Sharon [Thu, 8 Dec 2016 08:43:40 +0000 (10:43 +0200)]
iwlwifi: mvm: cleanup iwl_mvm_tx_mpdu a bit
Unify code, remove redundant assignments.
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Johannes Berg [Thu, 8 Dec 2016 09:38:08 +0000 (10:38 +0100)]
iwlwifi: mvm: align copy-break SKB payload for MQ RX
When a small frame is copied completely into the skb->head, the code
doesn't take alignment into account, making mac80211 copy it again
later on architectures that need the alignment. Avoid this by taking
the PAD flag from the device into account when copying.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Sara Sharon [Wed, 7 Dec 2016 13:04:37 +0000 (15:04 +0200)]
iwlwifi: mvm: fix pending frame counter calculation
In DQA mode the check whether to decrement the pending frames
counter relies on the tid status and not on the txq id.
This may result in an inconsistent state of the pending frames
counter in case frame is queued on a non aggregation queue but
with this TID, and will be followed by a failure to remove the
station and later on SYSASSERT 0x3421 when trying to remove the
MAC.
Such frames are for example bar and qos NDPs.
Fix it by aligning the condition of incrementing the counter
with the condition of decrementing it - rely on TID state for
DQA mode.
Also, avoid internal error like this affecting station removal
for DQA mode - since we can know for sure it is an internal
error.
Fixes:
cf961e16620f ("iwlwifi: mvm: support dqa-mode agg on non-shared queue")
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Sara Sharon [Wed, 7 Dec 2016 10:22:11 +0000 (12:22 +0200)]
iwlwifi: pcie: fix the set of DMA memory mask
Our 9000 device supports 64 bit DMA address for RX only, and
not for TX.
Setting DMA mask to 64 for the whole device is erroneous - we
can do it only for a000 devices where device is capable of
both RX & TX DMA with 64 bit address space.
Fixes:
96a6497bc3ed ("iwlwifi: pcie: add 9000 series multi queue rx DMA support")
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Liad Kaufman [Thu, 24 Nov 2016 13:31:00 +0000 (15:31 +0200)]
iwlwifi: mvm: release static queues on bcast release
A few of the static queues are enabled along with the bcast
STA. Make sure they are removed along with it, rather than
waiting for the mac ctxt release.
This is needed because we sometimes have a STA being removed
and then added again (either with the same sta_id or a
different one). If we wait for the mac ctxt release we will
try to allocate the queues again (as this is currently done
in the STA allocation and not in the MAC init) although
they weren't freed, and even if the sta_id of the STA has
changed.
Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Johannes Berg [Fri, 2 Dec 2016 09:04:49 +0000 (10:04 +0100)]
iwlwifi: mvm/pcie: adjust A-MSDU tx_cmd length in PCIe
Instead of setting the tx_cmd length in the mvm code, which is
complicated by the fact that DQA may want to temporarily store
the SKB on the side, adjust the length in the PCIe code which
also knows about this since it's responsible for duplicating
all those headers that are account for in this code.
As the PCIe code already relies on the tx_cmd->len field, this
doesn't really introduce any new dependencies.
To make this possible we need to move the memcpy() of the TX
command until after it was updated.
This does even simplify the code though, since the PCIe code
already does a lot of manipulations to build A-MSDUs correctly
and changing the length becomes a simple operation to see how
much was added/removed, rather than predicting it.
Fixes:
24afba7690e4 ("iwlwifi: mvm: support bss dynamic alloc/dealloc of queues")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Johannes Berg [Fri, 2 Dec 2016 08:57:40 +0000 (09:57 +0100)]
iwlwifi: mvm: overwrite skb info later
We don't really need clear the skb's status area nor store the
dev_cmd into it until we really commit to the frame by handing
it to the transport - defer those operations until just before
we do that.
This doesn't entirely fix the bug with frames not getting sent
out after having been deferred due to DQA, because it doesn't
restore the info->driver_data[0] place that was already set to
zero (or another value) by the A-MSDU logic.
Fixes:
24afba7690e4 ("iwlwifi: mvm: support bss dynamic alloc/dealloc of queues")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Johannes Berg [Thu, 1 Dec 2016 15:25:30 +0000 (16:25 +0100)]
iwlwifi: mvm: set AID to firmware only for associated stations
The firmware will soon actually look at the AID field, and
when it does that it'll try to ensure that the AID is never
changing. Due to the way the station is added, it may start
with an invalid AID before it's associated, so to ensure a
constant AID (once it becomes non-zero), track the station
state and set the AID only when the station is associated
and when it disassociates.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Johannes Berg [Wed, 30 Nov 2016 16:04:52 +0000 (17:04 +0100)]
iwlwifi: mvm: fix D3 replay counter value
This fixes a long-standing bug that was introduced when this code
was introduced: cfg80211 passes a pointer, but we treat it as if
it was passing a value. The result is that we pass the pointer to
the firmware, instead of the value. It's not clear how this could
ever have worked, unless the firmware is ignoring this value.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Sara Sharon [Wed, 30 Nov 2016 14:49:11 +0000 (16:49 +0200)]
iwlwifi: mvm: synchronize firmware DMA paging memory
When driver needs to access the contents of a streaming DMA buffer
without unmapping it it should call dma_sync_single_for_cpu().
Once the call has been made, the CPU "owns" the DMA buffer and can
work with it as needed.
Before the device accesses the buffer, however, ownership should be
transferred back to it with dma_sync_single_for_device().
Both calls weren't performed by the driver, resulting with odd paging
errors on some platforms. Fix it.
Fixes:
a6c4fb4441f4 ("iwlwifi: mvm: Add FW paging mechanism for the UMAC on PCI")
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Sara Sharon [Thu, 24 Nov 2016 11:48:27 +0000 (13:48 +0200)]
iwlwifi: mvm: support new alive notification
Support getting alive from two LMACs and dumping debug
data from both.
Deprecate older alive notifications no one is using.
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Johannes Berg [Fri, 2 Dec 2016 12:33:40 +0000 (13:33 +0100)]
iwlwifi: mvm: reduce usage of IEEE80211_SKB_CB()
There's already a variable with the result in scope, use that.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Sara Sharon [Wed, 16 Nov 2016 15:04:36 +0000 (17:04 +0200)]
iwlwifi: mvm: always free inactive queue when moving ownership
If iwl_mvm_find_free_queue() doesn't find a free queue, it will
return an inactive one.
However, not all the call paths free this queue before reassigning
it, which is a bug.
Check it in other paths and act accordingly.
Fixes:
9794c64f302d ("iwlwifi: mvm: support dqa queue inactivation upon timeout")
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Sara Sharon [Thu, 17 Nov 2016 09:35:05 +0000 (11:35 +0200)]
iwlwifi: mvm: support new scan API
For CDB devices we will want to configure scan parameters
per band.
Support the new scan API for now. Logic per band will be
added in the future.
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Sara Sharon [Thu, 8 Sep 2016 14:32:19 +0000 (17:32 +0300)]
iwlwifi: mvm: support new statistics APIs
For CDB arch there is another auxiliary mac.
Support statistics APIs that were changed to reflect that.
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Sara Sharon [Sun, 20 Nov 2016 11:50:39 +0000 (13:50 +0200)]
iwlwifi: mvm: cleanup incorrect and redundant define
Currently we have up to 3 phy contexts - defined by NUM_PHY_CTX.
However - some code paths validate the ID by using MAX_PHYS define
which is set to 4.
While there is no harm it is incorrect - since the maximum is 3.
Remove the define and use the correct one.
Cleanup the code a bit while at it.
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Beni Lev [Thu, 17 Nov 2016 12:03:17 +0000 (14:03 +0200)]
iwlwifi: mvm: Use aux queue for offchannel frames in dqa
Since offchannel activity doesn't always require a BSS, e.g. ANQP
sessions, offchannel frames should not use the BSS queue, because it
might not be initialized.
Use the auxilary queue instead
Fixes:
e3118ad74d7e ("iwlwifi: mvm: support tdls in dqa mode")
Signed-off-by: Beni Lev <beni.lev@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Golan Ben-Ami [Mon, 7 Nov 2016 15:40:43 +0000 (17:40 +0200)]
iwlwifi: mvm: support v2 of mfuart load notification
Add to the v1 of the mfuart loading notification, the size
of the mfuart image, and write it to dmesg once the notification
is received.
Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Sara Sharon [Wed, 31 Aug 2016 15:13:57 +0000 (18:13 +0300)]
iwlwifi: mvm: support unification of INIT and RT images
For a000 devices the INIT and RT images are unified to one
image.
The changes in the flow are the following:
* Driver load only RT firmware - meaning that the nvm access
command will be done in the RT image load flow.
* A new command (NVM_ACCESS_COMPLETE) now signals to the FW that
the driver is done accessing the NVM and FW can proceed with phy
calibrations.
* Phy DB is no longer sent from INIT FW to be restored by driver
for the RT FW - all the phy DB is now internal to the FW.
INIT complete will now follow the NVM access command, without
phy DB calls before.
* Paging command is sent earlier in the flow before NVM access
to enable a complete load of FW.
* caution must be care when restart is called since we may have
not completed init flow even though we are in RT firmware.
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Emmanuel Grumbach [Wed, 26 Oct 2016 11:21:27 +0000 (14:21 +0300)]
iwlwifi: mvm: fix PS-Poll enablement
We added the uAPSD enabled ACs and that made the
firmware choose to pull frames with uAPSD trigger
frames instead of PS-Poll.
Fix that.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Rafał Miłecki [Mon, 30 Jan 2017 15:09:52 +0000 (16:09 +0100)]
brcmfmac: be more verbose when PSM's watchdog fires
It's important to inform user so he knows things went wrong. He may also
want to get memory dump for further debugging purposes.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Rafał Miłecki [Mon, 30 Jan 2017 15:09:51 +0000 (16:09 +0100)]
brcmfmac: check brcmf_bus_get_memdump result for error
This method may be unsupported (see: USB bus) or may just fail (see:
SDIO bus).
While at it rework logic in brcmf_sdio_bus_get_memdump function to avoid
too many conditional code nesting levels.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Rafał Miłecki [Tue, 31 Jan 2017 21:54:54 +0000 (22:54 +0100)]
net: phy: broadcom: rehook BCM54612E specific init
This extra BCM54612E code in PHY driver isn't really aneg specific. Even
without it aneg works OK but the problem is no packets pass through PHY.
Moreover putting this code inside config_aneg callback didn't allow
resuming PHY correctly. When driver called phy_stop and phy_start it was
putting PHY machine into RESUMING state. After that machine was
switching into AN and NOLINK without ever calling phy_start_aneg. This
prevented this extra setup from being called and PHY didn't work.
This change has been verified to fix network on BCM47186B0 SoC device
with BCM54612E.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Wed, 1 Feb 2017 19:10:04 +0000 (14:10 -0500)]
Merge branch 'act_sample-Little-fixes'
Yotam Gigi says:
====================
net/sched: act_sample: Little fixes
Little fixes in sample tc action.
====================
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Yotam Gigi [Tue, 31 Jan 2017 09:33:54 +0000 (11:33 +0200)]
net/sched: act_psample: Remove unnecessary ASSERT_RTNL
The ASSERT_RTNL is not necessary in the init function, as it does not
touch any rtnl protected structures, as opposed to the mirred action which
does have to hold a net device.
Reported-by: Cong Wang <xiyou.wangcong@gmail.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Yotam Gigi [Tue, 31 Jan 2017 09:33:53 +0000 (11:33 +0200)]
net/sched: act_sample: Fix error path in init
Fix error path of in sample init, by releasing the tc hash in case of
failure in psample_group creation.
Fixes:
5c5670fae430 ("net/sched: Introduce sample tc action")
Reported-by: Cong Wang <xiyou.wangcong@gmail.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Wed, 1 Feb 2017 17:53:59 +0000 (12:53 -0500)]
Merge branch 'sh_eth-fixes-for-MagicPacket-handling'
Niklas Söderlund says:
====================
sh_eth: fixes for MagicPacket handling
This series contain two fixes for MagicPacket handling. It's based on
top of net-next and is tested on Koelsch.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Niklas Söderlund [Wed, 1 Feb 2017 14:41:55 +0000 (15:41 +0100)]
sh_eth: fix wakeup event reporting from MagicPacket
If a link change interrupt happens along side the MagicPacket interrupt
and the link change interrupt is ignored the interrupt handler will
return and the wakeup event is not registered. Fix this by moving the
MagicPacket check before the link change check.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reported-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Niklas Söderlund [Wed, 1 Feb 2017 14:41:54 +0000 (15:41 +0100)]
sh_eth: align usage of sh_eth_modify() with rest of driver
To be consistent with the rest of the driver when setting bits using
sh_eth_modify() the same bit should also be cleared. This have no
functional change and should have been done from the start.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Suggested-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Wed, 1 Feb 2017 17:46:17 +0000 (12:46 -0500)]
Merge tag 'wireless-drivers-next-for-davem-2017-02-01' of git://git./linux/kernel/git/kvalo/wireless-drivers-next
Kalle Valo says:
====================
wireless-drivers-next patches for 4.11
It's nice to see rt2x00 development has becoming active, for example
adding support for a new chip version. Also wcn36xx has been converted
to use the recently merged QCOM_SMD subsystem. Otherwise new features
and fixes it lots of drivers.
Major changes:
iwlwifi
* some more work in preparation for A000 family support
* add support for radiotap timestamps
* some work on our firmware debugging capabilities
wcn36xx
* convert to a proper QCOM_SMD driver (from the platform_driver interface)
ath10k
* VHT160 support
* dump Copy Engine registers during firmware crash
* search board file extension from SMBIOS
wil6210
* add disable_ap_sme module parameter
rt2x00
* support RT3352 with external PA
* support for RT3352 with 20MHz crystal
* add support for RT5350 WiSoC
brcmfmac
* add support for BCM43455 sdio device
rtl8xxxu
* add support for D-Link DWA-131 rev E1, TP-Link TL-WN822N v4 and others
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Dan Carpenter [Wed, 1 Feb 2017 08:52:15 +0000 (11:52 +0300)]
ethernet: aquantia: fix dma_mapping_error test
dma_mapping_error() returns 1 if there is an error and 0 if not.
Fixes:
018423e90bee ("net: ethernet: aquantia: Add ring support code")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Satanand Burla [Tue, 31 Jan 2017 21:04:42 +0000 (13:04 -0800)]
liquidio: fix for iq and droq cnts going negative
Flush the mmio writes before releasing spin locks.
if the maintained counts get too high > 2M force
writeback of the counts to clear them
Signed-off-by: Satanand Burla <satananda.burla@cavium.com>
Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: Raghu Vatsavayi <raghu.vatsavayi@cavium.com>
Signed-off-by: Derek Chickles <derek.chickles@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David Ahern [Wed, 1 Feb 2017 00:51:37 +0000 (16:51 -0800)]
net: ipv6: add NLM_F_APPEND in notifications when applicable
IPv6 does not set the NLM_F_APPEND flag in notifications to signal that
a NEWROUTE is an append versus a new route or a replaced one. Add the
flag if the request has it.
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Grygorii Strashko [Tue, 31 Jan 2017 20:04:04 +0000 (14:04 -0600)]
net: ethernet: ti: cpsw: fix NULL pointer dereference in switch mode
In switch mode on struct cpsw_slave->ndev field will be initialized with
proper value only for the one cpsw slave port, as result
cpsw_get_usage_count() will generate "Unable to handle kernel NULL pointer
dereference" exception when first ethernet interface is opening
cpsw_ndo_open(). This issue causes boot regression on AM335x EVM and
reproducible on am57xx-evm (switch mode).
Fix it by adding additional check for !cpsw->slaves[i].ndev in
cpsw_get_usage_count().
Cc: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Fixes:
03fd01ad0eea ("net: ethernet: ti: cpsw: don't duplicate ndev_running")
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Eric Dumazet [Tue, 31 Jan 2017 18:20:32 +0000 (10:20 -0800)]
net: reduce skb_warn_bad_offload() noise
Dmitry reported warnings occurring in __skb_gso_segment() [1]
All SKB_GSO_DODGY producers can allow user space to feed
packets that trigger the current check.
We could prevent them from doing so, rejecting packets, but
this might add regressions to existing programs.
It turns out our SKB_GSO_DODGY handlers properly set up checksum
information that is needed anyway when packets needs to be segmented.
By checking again skb_needs_check() after skb_mac_gso_segment(),
we should remove these pesky warnings, at a very minor cost.
With help from Willem de Bruijn
[1]
WARNING: CPU: 1 PID: 6768 at net/core/dev.c:2439 skb_warn_bad_offload+0x2af/0x390 net/core/dev.c:2434
lo: caps=(0x000000a2803b7c69, 0x0000000000000000) len=138 data_len=0 gso_size=15883 gso_type=4 ip_summed=0
Kernel panic - not syncing: panic_on_warn set ...
CPU: 1 PID: 6768 Comm: syz-executor1 Not tainted 4.9.0 #5
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
ffff8801c063ecd8 ffffffff82346bdf ffffffff00000001 1ffff100380c7d2e
ffffed00380c7d26 0000000041b58ab3 ffffffff84b37e38 ffffffff823468f1
ffffffff84820740 ffffffff84f289c0 dffffc0000000000 ffff8801c063ee20
Call Trace:
[<
ffffffff82346bdf>] __dump_stack lib/dump_stack.c:15 [inline]
[<
ffffffff82346bdf>] dump_stack+0x2ee/0x3ef lib/dump_stack.c:51
[<
ffffffff81827e34>] panic+0x1fb/0x412 kernel/panic.c:179
[<
ffffffff8141f704>] __warn+0x1c4/0x1e0 kernel/panic.c:542
[<
ffffffff8141f7e5>] warn_slowpath_fmt+0xc5/0x100 kernel/panic.c:565
[<
ffffffff8356cbaf>] skb_warn_bad_offload+0x2af/0x390 net/core/dev.c:2434
[<
ffffffff83585cd2>] __skb_gso_segment+0x482/0x780 net/core/dev.c:2706
[<
ffffffff83586f19>] skb_gso_segment include/linux/netdevice.h:3985 [inline]
[<
ffffffff83586f19>] validate_xmit_skb+0x5c9/0xc20 net/core/dev.c:2969
[<
ffffffff835892bb>] __dev_queue_xmit+0xe6b/0x1e70 net/core/dev.c:3383
[<
ffffffff8358a2d7>] dev_queue_xmit+0x17/0x20 net/core/dev.c:3424
[<
ffffffff83ad161d>] packet_snd net/packet/af_packet.c:2930 [inline]
[<
ffffffff83ad161d>] packet_sendmsg+0x32ed/0x4d30 net/packet/af_packet.c:2955
[<
ffffffff834f0aaa>] sock_sendmsg_nosec net/socket.c:621 [inline]
[<
ffffffff834f0aaa>] sock_sendmsg+0xca/0x110 net/socket.c:631
[<
ffffffff834f329a>] ___sys_sendmsg+0x8fa/0x9f0 net/socket.c:1954
[<
ffffffff834f5e58>] __sys_sendmsg+0x138/0x300 net/socket.c:1988
[<
ffffffff834f604d>] SYSC_sendmsg net/socket.c:1999 [inline]
[<
ffffffff834f604d>] SyS_sendmsg+0x2d/0x50 net/socket.c:1995
[<
ffffffff84371941>] entry_SYSCALL_64_fastpath+0x1f/0xc2
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Theuns Verwoerd [Mon, 30 Jan 2017 23:23:46 +0000 (12:23 +1300)]
rtnetlink: Handle IFLA_MASTER parameter when processing rtnl_newlink
Allow a master interface to be specified as one of the parameters when
creating a new interface via rtnl_newlink. Previously this would
require invoking interface creation, waiting for it to complete, and
then separately binding that new interface to a master.
In particular, this is used when creating a macvlan child interface for
VRRP in a VRF configuration, allowing the interface creator to specify
directly what master interface should be inherited by the child,
without having to deal with asynchronous complications and potential
race conditions.
Signed-off-by: Theuns Verwoerd <theuns.verwoerd@alliedtelesis.co.nz>
Acked-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Wed, 1 Feb 2017 16:22:38 +0000 (11:22 -0500)]
Merge branch 'master' of git://git./linux/kernel/git/klassert/ipsec-next
Steffen Klassert says:
====================
pull request (net-next): ipsec-next 2017-02-01
1) Some typo fixes, from Alexander Alemayhu.
2) Don't acquire state lock in get_mtu functions.
The only rece against a dead state does not matter.
From Florian Westphal.
3) Remove xfrm4_state_fini, it is unused for more than
10 years. From Florian Westphal.
4) Various rcu usage improvements. From Florian Westphal.
5) Properly handle crypto arrors in ah4/ah6.
From Gilad Ben-Yossef.
6) Try to avoid skb linearization in esp4 and esp6.
7) The esp trailer is now set up in different places,
add a helper for this.
8) With the upcomming usage of gro_cells in IPsec,
a gro merged skb can have a secpath. Drop it
before freeing or reusing the skb.
9) Add a xfrm dummy network device for napi. With
this we can use gro_cells from within xfrm,
it allows IPsec GRO without impact on the generic
networking code.
Please pull or let me know if there are problems.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 31 Jan 2017 18:44:50 +0000 (13:44 -0500)]
Merge branch 'bgmac-phy-init'
Rafał Miłecki says:
====================
net-next: use one struct bgmac & add PHY support
This patchset adds support for initializing PHY using PHY subsystem.
It's required e.g. for wireless access point devices that use bgmac
supported Ethernet device connected to some external PHY.
Implementing this required accessing phydev in bcma specific code which
wasn't possible with core code allocating struct bgmac on its own. This
is why I needed to modify alloc_etherdev usage first.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Rafał Miłecki [Tue, 31 Jan 2017 18:37:56 +0000 (19:37 +0100)]
net: bgmac: use PHY subsystem for initializing PHY
This adds support for using bgmac with PHYs supported by standalone PHY
drivers. Having any PHY initialization in bgmac is hacky and shouldn't
be extended but rather removed if anyone has hardware to test it.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Rafał Miłecki [Tue, 31 Jan 2017 18:37:55 +0000 (19:37 +0100)]
net: bgmac: drop struct bcma_mdio we don't need anymore
Adding struct bcma_mdio was a workaround for bcma code not having access
to the struct bgmac used in the core code. Now we don't duplicate this
struct we can just use it internally in bcma code.
This simplifies code & allows access to all bgmac driver details from
all places in bcma code.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Rafał Miłecki [Tue, 31 Jan 2017 18:37:54 +0000 (19:37 +0100)]
net: bgmac: allocate struct bgmac just once & don't copy it
So far were were allocating struct bgmac in 3 places: platform code,
bcma code and shared bgmac_enet_probe function. The reason for this was
bgmac_enet_probe:
1) Requiring early-filled struct bgmac
2) Calling alloc_etherdev on its own in order to use netdev_priv later
This solution got few drawbacks:
1) Was duplicating allocating code
2) Required copying early-filled struct
3) Resulted in platform/bcma code having access only to unused struct
Solve this situation by simply extracting some probe code into the new
bgmac_alloc function.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Florian Fainelli [Tue, 31 Jan 2017 03:17:16 +0000 (19:17 -0800)]
net: dsa: bcm_sf2: Fix build module
Commit
7318166cacad ("net: dsa: bcm_sf2: Add support for
ethtool::rxnfc") added a new object to build: bcm_sf2_cfp.o, but in
doing so, we essentially just built this object and no longer bcm_sf2.o.
Fix this by creating a module named bcm-sf2.ko which links in bcm_sf2.o
and bcm_sf2_cfp.o.
Fixes:
7318166cacad ("net: dsa: bcm_sf2: Add support for ethtool::rxnfc")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ganesh Goudar [Tue, 31 Jan 2017 07:51:50 +0000 (13:21 +0530)]
cxgb4: update latest firmware version supported
Change t4fw_version.h to update latest firmware version
number 1.16.26.0.
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexei Starovoitov [Tue, 31 Jan 2017 02:25:18 +0000 (18:25 -0800)]
net: ethtool: convert large order kmalloc allocations to vzalloc
under memory pressure 'ethtool -S' command may warn:
[ 2374.385195] ethtool: page allocation failure: order:4, mode:0x242c0c0
[ 2374.405573] CPU: 12 PID: 40211 Comm: ethtool Not tainted
[ 2374.423071] Call Trace:
[ 2374.423076] [<
ffffffff8148cb29>] dump_stack+0x4d/0x64
[ 2374.423080] [<
ffffffff811667cb>] warn_alloc_failed+0xeb/0x150
[ 2374.423082] [<
ffffffff81169cd3>] ? __alloc_pages_direct_compact+0x43/0xf0
[ 2374.423084] [<
ffffffff8116a25c>] __alloc_pages_nodemask+0x4dc/0xbf0
[ 2374.423091] [<
ffffffffa0023dc2>] ? cmd_exec+0x722/0xcd0 [mlx5_core]
[ 2374.423095] [<
ffffffff811b3dcc>] alloc_pages_current+0x8c/0x110
[ 2374.423097] [<
ffffffff81168859>] alloc_kmem_pages+0x19/0x90
[ 2374.423099] [<
ffffffff81186e5e>] kmalloc_order_trace+0x2e/0xe0
[ 2374.423101] [<
ffffffff811c0084>] __kmalloc+0x204/0x220
[ 2374.423105] [<
ffffffff816c269e>] dev_ethtool+0xe4e/0x1f80
[ 2374.423106] [<
ffffffff816b967e>] ? dev_get_by_name_rcu+0x5e/0x80
[ 2374.423108] [<
ffffffff816d6926>] dev_ioctl+0x156/0x560
[ 2374.423111] [<
ffffffff811d4c68>] ? mem_cgroup_commit_charge+0x78/0x3c0
[ 2374.423117] [<
ffffffff8169d542>] sock_do_ioctl+0x42/0x50
[ 2374.423119] [<
ffffffff8169d9c3>] sock_ioctl+0x1b3/0x250
[ 2374.423121] [<
ffffffff811f0f42>] do_vfs_ioctl+0x92/0x580
[ 2374.423123] [<
ffffffff8100222b>] ? do_audit_syscall_entry+0x4b/0x70
[ 2374.423124] [<
ffffffff8100287c>] ? syscall_trace_enter_phase1+0xfc/0x120
[ 2374.423126] [<
ffffffff811f14a9>] SyS_ioctl+0x79/0x90
[ 2374.423127] [<
ffffffff81002bb0>] do_syscall_64+0x50/0xa0
[ 2374.423129] [<
ffffffff817e19bc>] entry_SYSCALL64_slow_path+0x25/0x25
~1160 mlx5 counters ~= order 4 allocation which is unlikely to succeed
under memory pressure. Convert them to vzalloc() as ethtool_get_regs() does.
Also take care of drivers without counters similar to
commit
67ae7cf1eeda ("ethtool: Allow zero-length register dumps again")
and reduce warn_on to warn_on_once.
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Philippe Reynes [Mon, 30 Jan 2017 22:04:42 +0000 (23:04 +0100)]
net: aquantia: atlantic: use new api ethtool_{get|set}_link_ksettings
The ethtool api {get|set}_settings is deprecated.
We move this driver to new api {get|set}_link_ksettings.
As I don't have the hardware, I'd be very pleased if
someone may test this patch.
Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
Tested-by: Pavel Belous <pavel.s.belous@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Tue, 31 Jan 2017 16:30:02 +0000 (16:30 +0000)]
sfc: fix an off-by-one compare on an array size
encap_type should be checked to see if it is greater or equal to
the size of array map to fix an off-by-one array size check. This
fixes an array overrun read as detected by static analysis by
CoverityScan, CID#
1398883 ("Out-of-bounds-read")
Fixes:
9b41080125176841e ("sfc: insert catch-all filters for encapsulated traffic")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Kalle Valo [Tue, 31 Jan 2017 07:50:50 +0000 (09:50 +0200)]
Merge ath-next from git://git./linux/kernel/git/kvalo/ath.git
ath.git patches for 4.11. Major changes:
wcn36xx
* convert to a proper QCOM_SMD driver (from the platform_driver interface)
ath10k
* VHT160 support
* dump Copy Engine registers during firmware crash
* search board file extension from SMBIOS
wil6210
* add disable_ap_sme module parameter
Rafał Miłecki [Sat, 28 Jan 2017 22:11:34 +0000 (23:11 +0100)]
bcma: make OF code more generic (not platform_device specific)
OF allows not only specifying platform devices but also describing
devices on standard buses like PCI or USB. This change will allow
reading info from DT for bcma buses hosted on PCI cards.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Stanislaw Gruszka [Mon, 30 Jan 2017 11:12:47 +0000 (12:12 +0100)]
rt2800: enable rt3290 unconditionally on pci probe
When we restart system using sysrq RT3290 device do not initalize
properly, hance always enable it via WLAN_FUN_CTRL register on
probe.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=85461
Reported-and-tested-by: Giedrius Statkevičius <edrius.statkevicius@gmail.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Rafał Miłecki [Sat, 28 Jan 2017 13:31:22 +0000 (14:31 +0100)]
bcma: use (get|put)_device when probing/removing device driver
This allows tracking device state and e.g. makes devm work as expected.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Arend Van Spriel [Fri, 27 Jan 2017 12:27:48 +0000 (12:27 +0000)]
brcmfmac: add .update_connect_params() callback
Add support for the .update_connect_params() callback for roaming
or subsequent (re)association.
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Arend Van Spriel [Fri, 27 Jan 2017 12:27:47 +0000 (12:27 +0000)]
brcmfmac: allow wowlan support to be per device
The wowlan support is (partially) determined dynamic by checking the
device/firmware capabilities. So they can differ per device. So it
is not possible to use a static global. Instead use the global as a
template and use kmemdup(). When kmemdup() fails the template is used
unmodified.
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Arend Van Spriel [Fri, 27 Jan 2017 12:27:46 +0000 (12:27 +0000)]
brcmfmac: fix handling firmware results for wowl netdetect
For wowl netdetect the event data changed for newer chips. This
was recently fixed for scheduled scan, but same change is needed
for wowl netdetect. Removing now pointles += operation from both
result handlers.
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Arend Van Spriel [Fri, 27 Jan 2017 12:27:45 +0000 (12:27 +0000)]
brcmfmac: provide a value for struct wowlan_support::max_nd_match_sets
The driver advertises support for WOWLAN_NETDETECT but did not specify
maximum amount of netdetect match sets. This was no issue due to a bug
in nl80211. As that has been fixed, brcmfmac also needs fixing.
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Sara Sharon [Mon, 30 Jan 2017 10:34:32 +0000 (12:34 +0200)]
iwlwifi: alloc memory dynamically also for DVM
For old firmwares the memory wasn't allocated, resulting in panic.
Make it dynamically allocated as well. Allow any order of functions
call.
Fixes:
eef187a7b8a1 ("iwlwifi: enlarge number of ucode sections")
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Tested-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Stanislaw Gruszka [Sun, 29 Jan 2017 11:40:52 +0000 (12:40 +0100)]
rt2x00: fix clk_get call
clk_get() takes two arguments and might return ERR_PTR(), so we
have to nullify pointer on that case, to do not break further call
to clk_get_rate().
Reported-by: Felix Fietkau <nbd@nbd.name>
Fixes:
34db70b92fae ("rt2x00: add copy of clk for soc devices")
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
David S. Miller [Tue, 31 Jan 2017 03:05:52 +0000 (22:05 -0500)]
Merge branch 'sh_eth-E-DMAC-interrupt-mask-cleanups'
Sergei Shtylyov says:
====================
sh_eth: E-DMAC interrupt mask cleanups
Here's a set of 3 patches against DaveM's 'net-next.git' repo. The main goal
of this set is to stop using the bare numbers for the E-DMAC interrupt masks.
[1/3] sh_eth: rename EESIPR bits
[2/3] sh_eth: add missing EESIPR bits
[3/3] sh_eth: stop using bare numbers for EESIPR values
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Sergei Shtylyov [Sun, 29 Jan 2017 12:13:48 +0000 (15:13 +0300)]
sh_eth: stop using bare numbers for EESIPR values
Now that we have almost all EESIPR bits declared (and those that are
still not are most probably reserved anyway) we can at last replace the
bare numbers used for 'sh_eth_cpu_data::eesipr_value' initializers with
the bit names ORed together...
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
Sergei Shtylyov [Sun, 29 Jan 2017 12:08:09 +0000 (15:08 +0300)]
sh_eth: add missing EESIPR bits
Renesas SH77{34|63} manuals describe more EESIPR bits than the current
driver. Declare the new bits with the end goal of using the bit names
instead of the bare numbers for the 'sh_eth_cpu_data::eesipr_value'
initializers...
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
Sergei Shtylyov [Sun, 29 Jan 2017 12:07:34 +0000 (15:07 +0300)]
sh_eth: rename EESIPR bits
Since the commit
b0ca2a21f769 ("sh_eth: Add support of SH7763 to sh_eth")
the *enum* declaring the EESIPR bits (interrupt mask) went out of sync with
the *enum* declaring the EESR bits (interrupt status) WRT bit naming and
formatting. I'd like to restore the consistency by using EESIPR as the bit
name prefix, renaming the *enum* to EESIPR_BIT, and (finally) renaming the
bits according to the available Renesas SH77{34|63} manuals; additionally,
reconstruct couple names using the EESR bit declaration above...
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Mon, 30 Jan 2017 21:50:57 +0000 (16:50 -0500)]
Merge branch 'ESPRESSObin-ethernet'
Gregory CLEMENT says:
====================
dsa: Add support for the ethernet switch on the ESPRESSObin
This set of patches adds support for the Marvell Ethernet Topaz switch
family (
88E6141/
88E6341) which is found on the ESPRESSObin. With this
series the network is usable on this board.
As usual, I rebased the series on the very last net-next/master. In
this series there is no temperature support which need some patches
form Andrew Lunn.
As soon as Andrew Lunn will post the needed patch I will send a patch
to enable the temperature support.
Changelog:
v6 -> v7:
- rebased on net-next/master (
5b8784aaf29b)
- Fixed the wrong age time coeff from 15s to 3.75s.
- Remove support for temperature sensor
v5 -> v6:
- rebased on net-next/master (
d140199af510)
- Fix the redundant check on mv88e6xxx_6341_family (reported by Julia
Lawall)
- Add support for the
88E6141
- Move support for temperature sensor in the phy part
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Gregory CLEMENT [Mon, 30 Jan 2017 19:29:35 +0000 (20:29 +0100)]
net: dsa: mv88e6xxx: Add support for ethernet switch
88E6141
The Marvell
88E6341 device is single-chip, 6-port Ethernet switch with
four integrated 10/100/1000Mbps Ethernet transceivers and one high speed
SerDes interfaces.
It belongs to the Topaz family and unlike the
88E6341 it does not have
a TCAM.
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Gregory CLEMENT [Mon, 30 Jan 2017 19:29:34 +0000 (20:29 +0100)]
net: dsa: mv88e6xxx: Add support for ethernet switch
88E6341
The Marvell
88E6341 device is single-chip, 6-port Ethernet switch with
four integrated 10/100/1000Mbps Ethernet transceivers and one high speed
SerDes interfaces. It is partially compatible with switches of family
88E6352 and switches of family
88E6390.
This commit adds an initial support for this switch by describing its
capabilities to the driver and introducing a new family.
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Romain Perier [Mon, 30 Jan 2017 19:29:33 +0000 (20:29 +0100)]
net: dsa: mv88e6xxx: Don't forbid MDIO I/Os for PHY addr >= num_of_ports
Some Marvell ethernet switches have internal ethernet transceivers with
hardcoded phy addresses. These addresses can be greater than the number
of ports or its value might be different than the associated port number.
This is for example the case for MV88E6341 that has 6 ports and internal
Port 1 to Port4 PHYs mapped at SMI addresses from 0x11 to 0x14.
This commits fixes the issue by removing the condition in MDIO callbacks.
Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Dan Carpenter [Mon, 30 Jan 2017 09:55:04 +0000 (10:55 +0100)]
smc: some potential use after free bugs
Say we got really unlucky and these failed on the last iteration, then
it could lead to a use after free bug.
Fixes:
cd6851f30386 ("smc: remote memory buffers (RMBs)")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Mon, 30 Jan 2017 20:55:48 +0000 (15:55 -0500)]
Merge branch 'dsa-port-mirroring'
Florian Fainelli says:
====================
net: dsa: Port mirroring support
This patch series adds support for port mirroring in the two
Broadcom switch drivers. The major part of the functional are actually with
the plumbing between tc and the drivers.
Changes in v5:
- Added Jiri's Reviewed-by tag to first patch
- rebase against latest net-next/master after bcm_sf2 CFP series
Changes in v4:
- rebased against latest net-next/master after Vivien's changes
Changes in v3:
- removed multiline comments from added structures
- simplify error handling in dsa_slave_add_cls_matchall
Changes in v2:
- fixed filter removal logic to disable the ingress or egress mirroring
when there are no longer ports being monitored in ingress or egress
- removed a stray list_head in dsa_port structure that is not used
Tested using the two iproute2 examples:
tc qdisc add dev eth1 handle ffff: ingress
tc filter add dev eth1 parent ffff: \
matchall skip_sw \
action mirred egress mirror \
dev eth2
tc qdisc add dev eth1 handle 1: root prio
tc filter add dev eth1 parent 1: \
matchall skip_sw \
action mirred egress mirror \
dev eth2
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Florian Fainelli [Mon, 30 Jan 2017 20:41:43 +0000 (12:41 -0800)]
net: dsa: bcm_sf2: Add support for port mirroring
We can use b53_mirror_add and b53_mirror_del because the Starfighter 2
is register compatible in that specific case.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Florian Fainelli [Mon, 30 Jan 2017 20:41:42 +0000 (12:41 -0800)]
net: dsa: b53: Add support for port mirroring
Add support for configuring port mirroring through the cls_matchall
classifier. We do a full ingress or egress capture towards the capture
port. Future improvements could include leveraging the divider to allow
less frames to be captured, as well as matching specific MAC DA/SA.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Florian Fainelli [Mon, 30 Jan 2017 20:41:41 +0000 (12:41 -0800)]
net: dsa: b53: Add mirror capture register definitions
Add definitions for the different Roboswitch registers relevant for
ingress and egress mirroring.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Florian Fainelli [Mon, 30 Jan 2017 20:41:40 +0000 (12:41 -0800)]
net: dsa: Add plumbing for port mirroring
Add necessary plumbing at the slave network device level to have switch
drivers implement ndo_setup_tc() and most particularly the cls_matchall
classifier. We add support for two switch operations:
port_add_mirror and port_del_mirror() which configure, on a per-port
basis the mirror parameters requested from the cls_matchall classifier.
Code is largely borrowed from the Mellanox Spectrum switch driver.
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Mon, 30 Jan 2017 20:26:44 +0000 (15:26 -0500)]
Merge branch 'mlx4-misc-improvements'
Tariq Toukan says:
====================
mlx4 misc improvements
This patchset contains several improvements and cleanups
from the team to the mlx4 Eth and core drivers.
Series generated against net-next commit:
4e8f2fc1a55d Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Thanks,
Tariq.
v3:
* Patch 6/9: forgot to actually update the commit message in v2, now it is.
v2:
* Patch 1/9: used EOPNOTSUPP and not ENOTSUPP.
* Patch 3/9: dropped, to be submitted separately in the future.
* Patch 6/9: updated commit message.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Shaker Daibes [Sun, 29 Jan 2017 16:56:20 +0000 (18:56 +0200)]
net/mlx4_en: Check the enabling pptx/pprx flags in SET_PORT wrapper flow
Make sure pptx/pprx mask flag is set using new fields upon set port
request. In addition, move this code into a helper function for better
code readability.
Signed-off-by: Shaker Daibes <shakerd@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Shaker Daibes [Sun, 29 Jan 2017 16:56:19 +0000 (18:56 +0200)]
net/mlx4_en: Check the enabling mtu flag in SET_PORT wrapper flow
Make sure MTU mask flag is set using new field upon set port
request. In addition, move this code into a helper function for better
code readability.
Signed-off-by: Shaker Daibes <shakerd@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Shaker Daibes [Sun, 29 Jan 2017 16:56:18 +0000 (18:56 +0200)]
net/mlx4_en: Pass user MTU value to Firmware at set port command
When starting the port, driver will inform Firmware about the actual MTU
which does not include implicit headers, such as FCS or VLAN tags.
Signed-off-by: Shaker Daibes <shakerd@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ariel Levkovich [Sun, 29 Jan 2017 16:56:17 +0000 (18:56 +0200)]
net/mlx4_en: Adding support of turning off link autonegotiation via ethtool
This feature will allow the user to disable auto negotiation
on the port for mlx4 devices while setting the speed is limited
to 1GbE speeds.
Other speeds will not be accepted in autoneg off mode.
This functionality is permitted providing that the firmware
is compatible with this feature.
The above is determined by querying a new dedicated capability
bit in the device.
Signed-off-by: Ariel Levkovich <lariel@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alaa Hleihel [Sun, 29 Jan 2017 16:56:16 +0000 (18:56 +0200)]
net/mlx4_core: Get num_tc using netdev_get_num_tc
Avoid reading num_tc directly from struct net_device, but use
the helper function netdev_get_num_tc.
Fixes:
bc6a4744b827 ("net/mlx4_en: num cores tx rings for every UP")
Fixes:
f5b6345ba8da ("net/mlx4_en: User prio mapping gets corrupted when changing number of channels")
Signed-off-by: Alaa Hleihel <alaa@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Matan Barak [Sun, 29 Jan 2017 16:56:15 +0000 (18:56 +0200)]
net/mlx4_core: Add resource alloc/dealloc debugging
In order to aid debugging of functions that take a resource but
don't put it, add the last function name that successfully grabbed
this resource.
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Yishai Hadas [Sun, 29 Jan 2017 16:56:14 +0000 (18:56 +0200)]
net/mlx4_core: Device revision support
The device revision field returned by the NodeInfo MAD is incorrect
on ConnectX3 devices.
This patch is driver side handling to complete a FW fix added at 2.11.1172.
INIT_HCA - bit at offset 0x0C.12 is set to 1 so that FW will report
correct device revision.
Older FW versions won't be affected from turning on that bit,
no capability bit is needed.
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Tariq Toukan [Sun, 29 Jan 2017 16:56:13 +0000 (18:56 +0200)]
net/mlx4: Replace ENOSYS with better fitting error codes
Conform the following warning:
WARNING: ENOSYS means 'invalid syscall nr' and nothing else.
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David Ahern [Mon, 30 Jan 2017 20:07:37 +0000 (12:07 -0800)]
lwtunnel: remove device arg to lwtunnel_build_state
Nothing about lwt state requires a device reference, so remove the
input argument.
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Eric Dumazet [Mon, 30 Jan 2017 16:22:01 +0000 (08:22 -0800)]
drivers: net: generalize napi_complete_done()
napi_complete_done() allows to opt-in for gro_flush_timeout,
added back in linux-3.19, commit
3b47d30396ba
("net: gro: add a per device gro flush timer")
This allows for more efficient GRO aggregation without
sacrifying latencies.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Robert Shearman [Thu, 26 Jan 2017 18:02:24 +0000 (18:02 +0000)]
net: Avoid receiving packets with an l3mdev on unbound UDP sockets
Packets arriving in a VRF currently are delivered to UDP sockets that
aren't bound to any interface. TCP defaults to not delivering packets
arriving in a VRF to unbound sockets. IP route lookup and socket
transmit both assume that unbound means using the default table and
UDP applications that haven't been changed to be aware of VRFs may not
function correctly in this case since they may not be able to handle
overlapping IP address ranges, or be able to send packets back to the
original sender if required.
So add a sysctl, udp_l3mdev_accept, to control this behaviour with it
being analgous to the existing tcp_l3mdev_accept, namely to allow a
process to have a VRF-global listen socket. Have this default to off
as this is the behaviour that users will expect, given that there is
no explicit mechanism to set unmodified VRF-unaware application into a
default VRF.
Signed-off-by: Robert Shearman <rshearma@brocade.com>
Acked-by: David Ahern <dsa@cumulusnetworks.com>
Tested-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Mon, 30 Jan 2017 19:49:59 +0000 (14:49 -0500)]
Merge branch 'net-dsa-bcm_sf2-CFP-support'
Florian Fainelli says:
====================
net: dsa: bcm_sf2: CFP support
This patch series adds support for the Broadcom Compact Field Processor (CFP)
which is a classification and matching engine built into most Broadcom switches.
We support that using ethtool::rxnfc because it allows all known uses cases from
the users I support to work, and more importantly, it allows the selection of a
target rule index, which is later used by e.g: offloading hardware, this is an
essential feature that I could not find being supported with cls_* for instance.
Thanks!
Changes in v3:
- rebased against latest net-next/master after Vivien's changes
Changes in v2:
- fixed modular builds reported by kbuild test robot
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Florian Fainelli [Mon, 30 Jan 2017 17:48:43 +0000 (09:48 -0800)]
net: dsa: bcm_sf2: Add support for ethtool::rxnfc
Add support for configuring classification rules using the
ethtool::rxnfc API. This is useful to program the switch's CFP/TCAM to
redirect specific packets to specific ports/queues for instance. For
now, we allow any kind of IPv4 5-tuple matching.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Florian Fainelli [Mon, 30 Jan 2017 17:48:42 +0000 (09:48 -0800)]
net: dsa: bcm_sf2: Add CFP registers definitions
Add Compact Field Processor definitions for the Broadcom Starfighter 2
and compatible versions of the switch.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Florian Fainelli [Mon, 30 Jan 2017 17:48:41 +0000 (09:48 -0800)]
net: dsa: bcm_sf2: Configure traffic classes to queue mapping
By default, all traffic goes to queue 0, re-configure the traffic
classes to quality of service mapping such that priority X maps to queue
X, where X is from 0 through 7.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Florian Fainelli [Mon, 30 Jan 2017 17:48:40 +0000 (09:48 -0800)]
net: dsa: Hook {get,set}_rxnfc ethtool operations
In preparation for adding support for CFP/TCAMP in the bcm_sf2 driver add the
plumbing to call into driver specific {get,set}_rxnfc operations.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>