]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
9 years agoMAINTAINERS: update for mwifiex driver maintainers
Avinash Patil [Wed, 24 Jun 2015 11:22:21 +0000 (16:52 +0530)]
MAINTAINERS: update for mwifiex driver maintainers

Amit & Nishant would be taking care of maintaining mwifiex driver here
onwards on account of organizational changes.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Frank Huang <frankh@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: do not short circuit exit from mwifiex_set_mgmt_ies
John Linville [Tue, 23 Jun 2015 19:04:03 +0000 (15:04 -0400)]
mwifiex: do not short circuit exit from mwifiex_set_mgmt_ies

Without this change, the code simply exits after calling
mwifiex_uap_set_head_tail_ies, leving the call to
mwifiex_set_mgmt_beacon_data_ies as dead code.

Coverity CID #1271292

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: avoid freeing improper pointer in mwifiex_set_wowlan_mef_entry
John Linville [Tue, 23 Jun 2015 18:45:45 +0000 (14:45 -0400)]
mwifiex: avoid freeing improper pointer in mwifiex_set_wowlan_mef_entry

mwifiex_set_wowlan_mef_entry attempts to free a passed-in pointer in
case of an error.  The only caller (mwifiex_set_mef_filter) passes that
pointer as an offset into allocated memory, so any attempt to free that
will not be the actual allocated pointer.

Address this by changing mwifiex_set_wowlan_mef_entry to not do any
free, and to cause mwifiex_set_mef_filter to do the appropriate free if
the call to mwifiex_set_wowlan_mef_entry fails.

Coverity CID #1295879

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowireless: cw1200: Remove redundant spi driver bus initialization
Antonio Borneo [Tue, 23 Jun 2015 14:53:05 +0000 (22:53 +0800)]
wireless: cw1200: Remove redundant spi driver bus initialization

In ancient times it was necessary to manually initialize the bus
field of an spi_driver to spi_bus_type. These days this is done in
spi_register_driver(), so we can drop the manual assignment.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
To: Solomon Peachy <pizza@shaftnet.org>
To: Kalle Valo <kvalo@codeaurora.org>
To: linux-wireless@vger.kernel.org
To: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: handle multichannel event
Avinash Patil [Mon, 22 Jun 2015 13:36:23 +0000 (19:06 +0530)]
mwifiex: handle multichannel event

This patch adds support to handle multichannel event from FW.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: separate interface combination for multichannel and DFS
Avinash Patil [Mon, 22 Jun 2015 13:36:22 +0000 (19:06 +0530)]
mwifiex: separate interface combination for multichannel and DFS

Multichannel and DFS cannot be supported at same time. So when multichannel
operation is enabled by module parameter, we enable number of channel as 2
while registering wiphy. For all other cases we advertise DFS support to
cfg80211. Patch also adds support for radar detect widths parameter.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: advertise multichannel support to cfg80211
Avinash Patil [Mon, 22 Jun 2015 13:36:21 +0000 (19:06 +0530)]
mwifiex: advertise multichannel support to cfg80211

This patch adds support to advetise mwifiex multichannel support to
cfg80211. If module parameter drcs is enabled and FW supports multichannel
operation we advertise this support to cfg80211. As of now 2 simultaneous
channels are supported.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: support to set multichannel policy to FW
Avinash Patil [Mon, 22 Jun 2015 13:36:20 +0000 (19:06 +0530)]
mwifiex: support to set multichannel policy to FW

This patch adds support for setting multichannel policy as module parameter
to FW. Value of 1 indicates Multichannel support is enabled
and value of 0 disables it.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: extend tx_data pause to AP interface as well
Avinash Patil [Mon, 22 Jun 2015 13:36:19 +0000 (19:06 +0530)]
mwifiex: extend tx_data pause to AP interface as well

This patch adds support to extend TX Data pause for AP intefaces.
Also for station role, support for pausing/unpausing all traffic
when mac address parameter is BSSID is added.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: enable traffic only when port is open
Avinash Patil [Mon, 22 Jun 2015 13:36:18 +0000 (19:06 +0530)]
mwifiex: enable traffic only when port is open

This patch adds support to enable data traffic only when port is open.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: support for bypass tx queue
Avinash Patil [Mon, 22 Jun 2015 13:36:17 +0000 (19:06 +0530)]
mwifiex: support for bypass tx queue

This patch adds support for another TX queue in driver- bypass
TX queue. This queue is used for sending data/mgmt packets while
in disconnected state i.e. when port is yet not unblocked.
TDLS setup packets would also be queued in this queue.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: update domain_info upon band change in start_ap
Avinash Patil [Mon, 22 Jun 2015 13:36:16 +0000 (19:06 +0530)]
mwifiex: update domain_info upon band change in start_ap

It was observed that AP beacons would not reflect correct regulatory
information upon starting AP in A band. This was because of missing
AP config band update in set_channel of start_ap. Also we configure 11D
settings info FW only for specific band. So we need to download domain
info to FW even if domain remains unchanged but band is changed.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: add cfg80211 tdls channel switch handler
Xinming Hu [Mon, 22 Jun 2015 13:36:15 +0000 (19:06 +0530)]
mwifiex: add cfg80211 tdls channel switch handler

This patch add cfg80211 tdls_chan_switch and tdls_cancel_chan_switch
handler.
With this handlers, mwifiex would support TDLS channel switch feature.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: enhance tdls link setup condition
Xinming Hu [Mon, 22 Jun 2015 13:36:14 +0000 (19:06 +0530)]
mwifiex: enhance tdls link setup condition

TDLS link status - channel switching, off channel or base channel itself
indicates that TDLS link is setup.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: enable tdls channel switch ext_cap
Xinming Hu [Mon, 22 Jun 2015 13:36:13 +0000 (19:06 +0530)]
mwifiex: enable tdls channel switch ext_cap

This patch enable tdls channel switch ext capability in tdls action
frame, and also configure basic tdls channel switch parameters while
tdls setup completed and tdls link is enabled..

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: add tdls config command
Xinming Hu [Mon, 22 Jun 2015 13:36:12 +0000 (19:06 +0530)]
mwifiex: add tdls config command

This patch add support for a new tdls configuration command
which is used for configuration of tdls channel switch parameters.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: process tdls channel switch event
Xinming Hu [Mon, 22 Jun 2015 13:36:11 +0000 (19:06 +0530)]
mwifiex: process tdls channel switch event

This patch add support for tdls channel switch event process.
We block TX queues for particular RA list depending upon channel
switch state. If channel switch state is moving to base channel,
we unblock RA lists for AP. If channel switch state is moving to off
channel, we unblock TDLS peer RA lists.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: add tdls channel switch status
Xinming Hu [Mon, 22 Jun 2015 13:36:10 +0000 (19:06 +0530)]
mwifiex: add tdls channel switch status

This patch add new tdls status used for tdls channel switch.
Driver in turn would block cmd path and data path if tdls
channel switching. Data path to non tdls peer should be blocked
if tdls channel switch to off-channel.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: do not increase tx_pkts_queued if receive address tx paused
Xinming Hu [Mon, 22 Jun 2015 13:36:09 +0000 (19:06 +0530)]
mwifiex: do not increase tx_pkts_queued if receive address tx paused

If tx_pkts_queued is increased for tx paused receive address, tx process
will be triggered for this packet. But since RA list was tx paused,
there will be an infinite loop in mwifiex_wmm_process_tx waiting for the
event(tx pause, tdls cs) to cancel tx pause. This will be an dead loop,
since main_process was locked at this time, there will be no opportunity
to process event.

So do not increase tx_pkts_queued if receive address tx paused,
this will be restored RA list is unpaused.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: block data traffic to tx paused receive address
Xinming Hu [Mon, 22 Jun 2015 13:36:08 +0000 (19:06 +0530)]
mwifiex: block data traffic to tx paused receive address

Data traffic to tx paused receive address should be blocked.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: add tx data pause support
Avinash Patil [Mon, 22 Jun 2015 13:36:07 +0000 (19:06 +0530)]
mwifiex: add tx data pause support

This patch adds support to enable TX data pause feature for mwifiex.
Whenever FW TX buffers reach threshold, FW would send TX pause event
to driver. Driver in turn would block data traffic to that particular
receiver address.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: rtl8192cu: Remove rtl8723 code
Taehee Yoo [Fri, 19 Jun 2015 18:28:15 +0000 (03:28 +0900)]
rtlwifi: rtl8192cu: Remove rtl8723 code

In the rtlwifi/rtl8192cu, rtl8723 code is dead code.
So I remove it.

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoMerge ath-next from ath.git.
Kalle Valo [Tue, 21 Jul 2015 08:36:56 +0000 (11:36 +0300)]
Merge ath-next from ath.git.

Major changes in ath10k:

* enable VHT for IBSS
* initial work to support qca99x0 and the corresponding 10.4 firmware branch

9 years agoath9k: DFS - add pulse chirp detection for FCC
Zefir Kurtisi [Tue, 16 Jun 2015 10:52:16 +0000 (12:52 +0200)]
ath9k: DFS - add pulse chirp detection for FCC

FCC long pulse radar (type 5) requires pulses to be
checked for chirping. This patch implements chirp
detection based on the FFT data provided for long
pulses.

A chirp is detected when a set of criteria defined
by FCC pulse characteristics is met, including
* have at least 4 FFT samples
* max_bin index moves equidistantly between samples
* the gradient is within defined range

The chirp detection has been tested with reference
radar generating devices and proved to work reliably.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: DFS - consider ext_channel pulses only in HT40 mode
Zefir Kurtisi [Tue, 16 Jun 2015 09:46:42 +0000 (11:46 +0200)]
ath9k: DFS - consider ext_channel pulses only in HT40 mode

The chip reports radar pulses on extension channel
even if operating in HT20 mode. This patch adds a
sanity check for HT40 mode before it feeds pulses
on extension channel to the pattern detector.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoipw2100: fix timeout bug - always evaluated to 0
Nicholas Mc Guire [Mon, 15 Jun 2015 17:24:35 +0000 (19:24 +0200)]
ipw2100: fix timeout bug - always evaluated to 0

commit 2c86c275015c ("Add ipw2100 wireless driver.") introduced
HW_PHY_OFF_LOOP_DELAY (HZ / 5000) which always evaluated to 0. Clarified
by Stanislav Yakovlev <stas.yakovlev@gmail.com> that it should be 50
milliseconds thus fixed up to msecs_to_jiffies(50).

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Acked-by: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath10k: tweak interface combinations
Michal Kazior [Thu, 9 Jul 2015 11:08:39 +0000 (13:08 +0200)]
ath10k: tweak interface combinations

Concurrent AP/GO operation on different channels
isn't really supported well by the firmware so
it's better to remove it from being advertised.

Also tune the way station and p2p client interface
limits are expressed to allow station + 2x p2p
client or station + p2p client + p2p go.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: fix per-vif queue locking
Michal Kazior [Thu, 9 Jul 2015 11:08:38 +0000 (13:08 +0200)]
ath10k: fix per-vif queue locking

Whenever any vdev was supposed to be paused all Tx
queues were stopped (except offchannel) instead of
only these associated with the given vdev.

This caused subtle issues with
multi-channel/multi-vif scenarios, e.g.
authentication of station vif could sometimes fail
depending on fw tx pause request timing.

Fixes: b4aa539dd8f2 ("ath10k: implement tx pause wmi event")
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: update vdev ps state on start
Michal Kazior [Thu, 9 Jul 2015 11:08:37 +0000 (13:08 +0200)]
ath10k: update vdev ps state on start

Psmode can be forcefully enabled when vdev isn't
started. It isn't guaranteed that mac80211 will
re-issue psmode setting after vdev is started
unless actual bss_conf.ps value has changed.

Even if this doesn't fix any problems now it may
prevent future breakage.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: fix hw roc expiration notifcation
Michal Kazior [Thu, 9 Jul 2015 11:08:36 +0000 (13:08 +0200)]
ath10k: fix hw roc expiration notifcation

The expiration function must not be called when
roc is explicitly cancelled by mac80211. However
since fcf9844636be ("ath10k: fix hw roc
expiration") the notification was never sent when
roc actually expired.

This fixes some P2P connection setup issues.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: limit multi-vif ps more aggresivelly
Michal Kazior [Thu, 9 Jul 2015 11:08:35 +0000 (13:08 +0200)]
ath10k: limit multi-vif ps more aggresivelly

Further testing proved that multi-channel AP+STA
on QCA6174 with RM.2.0-00088 should have powersave
force-disabled to avoid beacon misses/skipping on
either side which in turn could disrupt
communication.

Since AP never has arvif->ps don't even bother
checking it. Other combinations may be broken as
well so disallow powersave with multivif outright
unless firmware advertises otherwise.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: don't set cck/ofdm scan flags
Michal Kazior [Thu, 9 Jul 2015 11:08:34 +0000 (13:08 +0200)]
ath10k: don't set cck/ofdm scan flags

mac80211 already does provide complete IEs for
Probe Requests for hw scan and ath10k firmware was
appending duplicate Supported Rates IEs
unnecessarily.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: Fix target to cpu address conversion logic
Vasanthakumar Thiagarajan [Fri, 3 Jul 2015 13:55:27 +0000 (19:25 +0530)]
ath10k: Fix target to cpu address conversion logic

In commit 418ca5992e2f ("ath10k: Make target cpu address to
CE address conversion chip specific") mask 0x7fff is added
by mistake instead of 0x7ff. Fix this regression.

Fixes: 418ca5992e2f ("ath10k: Make target cpu address to CE address conversion chip specific")
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: fix QCA61X4 boot up
Bartosz Markowski [Fri, 3 Jul 2015 13:33:49 +0000 (15:33 +0200)]
ath10k: fix QCA61X4 boot up

commit a521ee983d312db7 ("ath10k: Add new reg_address/mask to hw register
table") broke QCA61x4 support by providing wrong
fw_indicator_address, which should have been 0x0003a028 instead of 0x00009028.

User experience was a failing boot up sequence (crashing device during
initialization):

[  181.663874] ath10k_pci 0000:02:00.0: enabling device (0000 -> 0002)
[  181.664787] ath10k_pci 0000:02:00.0: pci irq msi-x interrupts 8 irq_mode 0 reset_mode 0
[  181.688886] ath10k_pci 0000:02:00.0: device has crashed during init
[  181.688897] ath10k_pci 0000:02:00.0: failed to wait for target after cold reset: -70
[  181.688902] ath10k_pci 0000:02:00.0: failed to reset chip: -70
[  181.689774] ath10k_pci: probe of 0000:02:00.0 failed with error -70

Fix it by updating the address with correct value.

Fixes: a521ee983d31 ("ath10k: Add new reg_address/mask to hw register table")
Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoMerge branch 'be2net-next'
David S. Miller [Sat, 11 Jul 2015 06:24:31 +0000 (23:24 -0700)]
Merge branch 'be2net-next'

Sathya Perla says:

====================
be2net: patch set

Hi David, the following patch set has code cleanup patches, minor enhancements
and non-critical fixes. Pls consider applying to the net-next tree. Thanks!

Patch 1 removes duplicate code in be_setup_wol() routine making it simpler
and more readable.

Patch 2 fixes the the bridge mode return value for the ndo_bridge_getlink()
call. Instead of just relying on the SRIOV enabled state, the driver now
queries the FW, for the actual mode of bridge.

Patch 3 removes code for setting D0 power state as it's already done
in pci_enable_device()

Patch 4 fixes a bad return value in be_check_ufi_compatibility() routine
introduced by an earlier commit.

Patch 5 fixes a field in udp header being accessed while in network endian
format.

Patch 6 fixes the be_mcc_notify() routine to return an error status when
the FW/HW is in an error state.

Patch 7 fixes the be_cmd_rx_filter() routine to issue the RX_FILTER cmd
and not wait for a completion from the FW. If the FW/adapter
is in an error state, this change helps in not holding up the rtnl_lock
and keeping bottom halves disabled while the driver timesout waiting for
a response from the FW.

Patch 8 fixes the be_cmd_set_loopback() routine to issue the LOOPBACK cmd
and not wait for the FW completion while spin_lock_bh() is held on the
mcc_lock. As the cmd is always issued from ethtool in a process context,
it can sleep till the FW completion is received.

Patch 9 bumps up the driver version to 10.6.0.3
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobe2net: bump up the driver version to 10.6.0.3
Sathya Perla [Fri, 10 Jul 2015 09:32:51 +0000 (05:32 -0400)]
be2net: bump up the driver version to 10.6.0.3

Signed-off-by: Sathya Perla <sathya.perla@avagotech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobe2net: make SET_LOOPBACK_MODE cmd asynchrounous
Suresh Reddy [Fri, 10 Jul 2015 09:32:50 +0000 (05:32 -0400)]
be2net: make SET_LOOPBACK_MODE cmd asynchrounous

The SET_LOOPBACK_MODE command is always issued from ethtool only in a
process context. So, while waiting for the cmd to complete, the driver
can sleep instead of holding spin_lock_bh() on the mcc_lock. This is done
by calling be_mcc_notify() instead of be_mcc_notify_wait() (that returns
only after the cmd completes while the MCCQ is locked).

Signed-off-by: Suresh Reddy <suresh.reddy@avagotech.com>
Signed-off-by: Sathya Perla <sathya.perla@avagotech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobe2net: make the RX_FILTER command asynchronous
Suresh Reddy [Fri, 10 Jul 2015 09:32:49 +0000 (05:32 -0400)]
be2net: make the RX_FILTER command asynchronous

This fix makes the RX_FILTER cmd asynchronous, i.e., the caller issues
this cmd and doesn't wait for a completion from the FW. If the FW/adapter
is in an error state, this change helps in not holding up the rtnl_lock
and keeping bottom halves disabled while the driver timesout waiting for
a response from the FW.

Signed-off-by: Suresh Reddy <suresh.reddy@avagotech.com>
Signed-off-by: Sathya Perla <sathya.perla@avagotech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobe2net: return error status from be_mcc_notify()
Suresh Reddy [Fri, 10 Jul 2015 09:32:48 +0000 (05:32 -0400)]
be2net: return error status from be_mcc_notify()

When the adapter is in error state, return error from be_mcc_notify()
so that the caller routines need not sleep waiting for a response.

Signed-off-by: Suresh Reddy <suresh.reddy@avagotech.com>
Signed-off-by: Sathya Perla <sathya.perla@avagotech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobe2net: convert dest field in udp-hdr to host-endian
Venkat Duvvuru [Fri, 10 Jul 2015 09:32:47 +0000 (05:32 -0400)]
be2net: convert dest field in udp-hdr to host-endian

The "dest" field in the UDP-hdr of a TX skb is in network endian format.
Convert it to host endian before accessing it. The os2bmc patch,
mentioned below introduced this code.

Fixes: 760c295e0e8d ("be2net: Support for OS2BMC")
Signed-off-by: Venkat Duvvuru <VenkatKumar.Duvvuru@Emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@avagotech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobe2net: fix wrong return value in be_check_ufi_compatibility()
Vasundhara Volam [Fri, 10 Jul 2015 09:32:46 +0000 (05:32 -0400)]
be2net: fix wrong return value in be_check_ufi_compatibility()

In the commit a6e6ff6eee12f3e
("be2net: simplify UFI compatibility checking"), a return value of "-1"
was incorrectly used in place of "false". This patch fixes it.

Fixes: a6e6ff6eee12f3e ("be2net: simplify UFI compatibility checking")
Signed-off-by: Vasundhara Volam <vasundhara.volam@avagotech.com>
Signed-off-by: Sathya Perla <sathya.perla@avagotech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobe2net: remove redundant D0 power state set
Kalesh Purayil [Fri, 10 Jul 2015 09:32:45 +0000 (05:32 -0400)]
be2net: remove redundant D0 power state set

pci_enable_device() call sets device power state to D0; there is no need
doing it again.

Signed-off-by: Kalesh AP <kalesh.purayil@avagotech.com>
Signed-off-by: Sathya Perla <sathya.perla@avagotech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobe2net: query FW to check if EVB is enabled
Kalesh Purayil [Fri, 10 Jul 2015 09:32:44 +0000 (05:32 -0400)]
be2net: query FW to check if EVB is enabled

The current code assumes that bridge functionality (EVB) in the adapter
is enabled only when SR-IOV is enabled. This is not always true.
This patch uses the GET_HSW_CONFIG FW cmd to query this from the FW.

Signed-off-by: Kalesh AP <kalesh.purayil@avagotech.com>
Signed-off-by: Sathya Perla <sathya.perla@avagotech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobe2net: remove duplicate code in be_setup_wol()
Kalesh Purayil [Fri, 10 Jul 2015 09:32:43 +0000 (05:32 -0400)]
be2net: remove duplicate code in be_setup_wol()

This change will make be_setup_wol() routine more compact and readable
by removing some duplicate code.

Signed-off-by: Kalesh AP <kalesh.purayil@avagotech.com>
Signed-off-by: Sathya Perla <sathya.perla@avagotech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoipv6: Do not iterate over all interfaces when finding source address on specific...
YOSHIFUJI Hideaki/吉藤英明 [Fri, 10 Jul 2015 07:58:31 +0000 (16:58 +0900)]
ipv6: Do not iterate over all interfaces when finding source address on specific interface.

If outgoing interface is specified and the candidate address is
restricted to the outgoing interface, it is enough to iterate
over that given interface only.

Signed-off-by: YOSHIFUJI Hideaki <hideaki.yoshifuji@miraclelinux.com>
Acked-by: Erik Kline <ek@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: Drop owner assignment from platform_driver
Krzysztof Kozlowski [Fri, 10 Jul 2015 06:29:23 +0000 (15:29 +0900)]
net: Drop owner assignment from platform_driver

platform_driver does not need to set an owner because
platform_driver_register() will set it.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: phy: Support setting polarity in marvell phy driver
David Thomson [Fri, 10 Jul 2015 04:28:25 +0000 (16:28 +1200)]
net: phy: Support setting polarity in marvell phy driver

Support manually setting the polarity to mdi or mdix

Signed-off-by: David Thomson <david.thomson@alliedtelesis.co.nz>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: phy: Pass mdix ethtool setting through to phy driver
David Thomson [Fri, 10 Jul 2015 01:56:54 +0000 (13:56 +1200)]
net: phy: Pass mdix ethtool setting through to phy driver

Pass the mdix setting from ethtool down to the phy driver, to allow
driver specific implementations of manually setting the polarity.

Signed-off-by: David Thomson <david.thomson@alliedtelesis.co.nz>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotcp: do not export tcp_init_xmit_timers()
Eric Dumazet [Thu, 9 Jul 2015 16:01:40 +0000 (18:01 +0200)]
tcp: do not export tcp_init_xmit_timers()

After commit 900f65d361d3 ("tcp: move duplicate code from
tcp_v4_init_sock()/tcp_v6_init_sock()"), we no longer
need to export tcp_init_xmit_timers()

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobridge: mdb: fill state in br_mdb_notify
Nikolay Aleksandrov [Thu, 9 Jul 2015 10:11:10 +0000 (03:11 -0700)]
bridge: mdb: fill state in br_mdb_notify

Fill also the port group state when sending notifications.

Signed-off-by: Satish Ashok <sashok@cumulusnetworks.com>
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoroute: remove unsed variable in __mkroute_input
Masatake YAMATO [Thu, 9 Jul 2015 03:46:35 +0000 (12:46 +0900)]
route: remove unsed variable in __mkroute_input

flags local variable in __mkroute_input is not used as a variable.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoipv6: Nonlocal bind
Tom Herbert [Wed, 8 Jul 2015 23:58:22 +0000 (16:58 -0700)]
ipv6: Nonlocal bind

Add support to allow non-local binds similar to how this was done for IPv4.
Non-local binds are very useful in emulating the Internet in a box, etc.

This add the ip_nonlocal_bind sysctl under ipv6.

Testing:

Set up nonlocal binding and receive routing on a host, e.g.:

ip -6 rule add from ::/0 iif eth0 lookup 200
ip -6 route add local 2001:0:0:1::/64 dev lo proto kernel scope host table 200
sysctl -w net.ipv6.ip_nonlocal_bind=1

Set up routing to 2001:0:0:1::/64 on peer to go to first host

ping6 -I 2001:0:0:1::1 peer-address -- to verify

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'tw_cleanups'
David S. Miller [Thu, 9 Jul 2015 22:12:21 +0000 (15:12 -0700)]
Merge branch 'tw_cleanups'

Eric Dumazet says:

====================
inet: timewait cleanups

Another round of patches to make tw handling simpler.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoinet: inet_twsk_deschedule factorization
Eric Dumazet [Wed, 8 Jul 2015 21:28:30 +0000 (14:28 -0700)]
inet: inet_twsk_deschedule factorization

inet_twsk_deschedule() calls are followed by inet_twsk_put().

Only particular case is in inet_twsk_purge() but there is no point
to defer the inet_twsk_put() after re-enabling BH.

Lets rename inet_twsk_deschedule() to inet_twsk_deschedule_put()
and move the inet_twsk_put() inside.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoinet: simplify timewait refcounting
Eric Dumazet [Wed, 8 Jul 2015 21:28:29 +0000 (14:28 -0700)]
inet: simplify timewait refcounting

timewait sockets have a complex refcounting logic.
Once we realize it should be similar to established and
syn_recv sockets, we can use sk_nulls_del_node_init_rcu()
and remove inet_twsk_unhash()

In particular, deferred inet_twsk_put() added in commit
13475a30b66cd ("tcp: connect() race with timewait reuse")
looks unecessary : When removing a timewait socket from
ehash or bhash, caller must own a reference on the socket
anyway.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoinet: remove BUG_ON() in twsk_destructor()
Eric Dumazet [Wed, 8 Jul 2015 21:28:28 +0000 (14:28 -0700)]
inet: remove BUG_ON() in twsk_destructor()

Kernel will crash the same if one of the pointer is NULL anyway.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoipv6: use flag instead of u16 for hop in inet6_skb_parm
Florian Westphal [Wed, 8 Jul 2015 21:32:12 +0000 (23:32 +0200)]
ipv6: use flag instead of u16 for hop in inet6_skb_parm

Hop was always either 0 or sizeof(struct ipv6hdr).

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agodsa: mv88e6352/mv88e6xxx: Add support for Marvell 88E6320 and 88E6321
Aleksey S. Kazantsev [Wed, 8 Jul 2015 03:38:15 +0000 (20:38 -0700)]
dsa: mv88e6352/mv88e6xxx: Add support for Marvell 88E6320 and 88E6321

MV88E6320 and MV88E6321 are largely compatible to MV886352,
but are members of a different chip family.

Signed-off-by: Aleksey S. Kazantsev <ioctl@yandex.ru>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'tcp-in-slow-start'
David S. Miller [Thu, 9 Jul 2015 21:22:53 +0000 (14:22 -0700)]
Merge branch 'tcp-in-slow-start'

Yuchung Cheng says:

====================
tcp: fixes some congestion control corner cases

This patch series fixes corner cases of TCP congestion control.
First issue is to avoid continuing slow start when cwnd reaches ssthresh.
Second issue is incorrectly processing order of congestion state and
cwnd update when entering fast recovery or undoing cwnd.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotcp: update congestion state first before raising cwnd
Yuchung Cheng [Thu, 9 Jul 2015 20:16:31 +0000 (13:16 -0700)]
tcp: update congestion state first before raising cwnd

The congestion state and cwnd can be updated in the wrong order.
For example, upon receiving a dubious ACK, we incorrectly raise
the cwnd first (tcp_may_raise_cwnd()/tcp_cong_avoid()) because
the state is still Open, then enter recovery state to reduce cwnd.

For another example, if the ACK indicates spurious timeout or
retransmits, we first revert the cwnd reduction and congestion
state back to Open state.  But we don't raise the cwnd even though
the ACK does not indicate any congestion.

To fix this problem we should first call tcp_fastretrans_alert() to
process the dubious ACK and update the congestion state, then call
tcp_may_raise_cwnd() that raises cwnd based on the current state.

Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Nandita Dukkipati <nanditad@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotcp: do not slow start when cwnd equals ssthresh
Yuchung Cheng [Thu, 9 Jul 2015 20:16:30 +0000 (13:16 -0700)]
tcp: do not slow start when cwnd equals ssthresh

In the original design slow start is only used to raise cwnd
when cwnd is stricly below ssthresh. It makes little sense
to slow start when cwnd == ssthresh: especially
when hystart has set ssthresh in the initial ramp, or after
recovery when cwnd resets to ssthresh. Not doing so will
also help reduce the buffer bloat slightly.

Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Nandita Dukkipati <nanditad@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotcp: add tcp_in_slow_start helper
Yuchung Cheng [Thu, 9 Jul 2015 20:16:29 +0000 (13:16 -0700)]
tcp: add tcp_in_slow_start helper

Add a helper to test the slow start condition in various congestion
control modules and other places. This is to prepare a slight improvement
in policy as to exactly when to slow start.

Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Nandita Dukkipati <nanditad@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: skb_defer_rx_timestamp should check for phydev before setting up classify
Alexander Duyck [Thu, 9 Jul 2015 18:02:52 +0000 (11:02 -0700)]
net: skb_defer_rx_timestamp should check for phydev before setting up classify

This change makes it so that the call skb_defer_rx_timestamp will first
check for a phydev before going in and manipulating the skb->data and
skb->len values.  By doing this we can avoid unnecessary work on network
devices that don't support phydev.  As a result we reduce the total
instruction count needed to process this on most devices.

Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotcp: v1 always send a quick ack when quickacks are enabled
Jon Maxwell [Wed, 8 Jul 2015 00:12:28 +0000 (10:12 +1000)]
tcp: v1 always send a quick ack when quickacks are enabled

V1 of this patch contains Eric Dumazet's suggestion to move the per
dst RTAX_QUICKACK check into tcp_in_quickack_mode(). Thanks Eric.

I ran some tests and after setting the "ip route change quickack 1"
knob there were still many delayed ACKs sent. This occured
because when icsk_ack.quick=0 the !icsk_ack.pingpong value is
subsequently ignored as tcp_in_quickack_mode() checks both these
values. The condition for a quick ack to trigger requires
that both icsk_ack.quick != 0 and icsk_ack.pingpong=0. Currently
only icsk_ack.pingpong is controlled by the knob. But the
icsk_ack.quick value changes dynamically depending on heuristics.
The crux of the matter is that delayed acks still cannot be entirely
disabled even with the RTAX_QUICKACK per dst knob enabled. This
patch ensures that a quick ack is always sent when the RTAX_QUICKACK
per dst knob is turned on.

The "ip route change quickack 1" knob was recently added to enable
quickacks. It was modeled around the TCP_QUICKACK setsockopt() option.
This issue is that even with "ip route change quickack 1" enabled
we still see delayed ACKs under some conditions. It would be nice
to be able to completely disable delayed ACKs.

Here is an example:

# netstat -s|grep dela
    3 delayed acks sent

For all routes enable the knob

# ip route change quickack 1

Generate some traffic across a slow link and we still see the delayed
acks.

# netstat -s|grep dela
    106 delayed acks sent
    1 delayed acks further delayed because of locked socket

The issue is that both the "ip route change quickack 1" knob and
the TCP_QUICKACK option set the icsk_ack.pingpong variable to 0.
However at the business end in the __tcp_ack_snd_check() routine,
tcp_in_quickack_mode() checks that both icsk_ack.quick != 0
and icsk_ack.pingpong=0 in order to trigger a quickack. As
icsk_ack.quick is determined by heuristics it can be 0. When
that occurs the icsk_ack.pingpong value is ignored and a delayed
ACK is sent regardless.

This patch moves the RTAX_QUICKACK per dst check into the
tcp_in_quickack_mode() routine which ensures that a quickack is
always sent when the quickack knob is enabled for that dst.

Signed-off-by: Jon Maxwell <jmaxwell37@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agorocker: add change MTU support
Scott Feldman [Wed, 8 Jul 2015 23:06:47 +0000 (16:06 -0700)]
rocker: add change MTU support

Implement ndo_change_mtu: on MTU change, reallocate Rx ring bufs and signal
HW of new port MTU value.

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Tested-by: Simon Horman <simon.horman@netronome.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoneterion: s2io: Use module_pci_driver
Vaishali Thakkar [Thu, 9 Jul 2015 04:55:39 +0000 (10:25 +0530)]
neterion: s2io: Use module_pci_driver

Use module_pci_driver for drivers whose init and exit functions
only register and unregister, respectively.

A simplified version of the Coccinelle semantic patch that performs
this transformation is as follows:

@a@
identifier f, x;
@@
-static f(...) { return pci_register_driver(&x); }

@b depends on a@
identifier e, a.x;
statement S;
@@
-static e(...) {
-pci_unregister_driver(&x);
-DBG_PRINT(INIT_DBG,"S");
- }

@c depends on a && b@
identifier a.f;
declarer name module_init;
@@
-module_init(f);

@d depends on a && b && c@
identifier b.e, a.x;
declarer name module_exit;
declarer name module_pci_driver;
@@
-module_exit(e);
+module_pci_driver(x);

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agocxgb4vf: Fix check to use new User Doorbell mechanism
Hariprasad Shenai [Thu, 9 Jul 2015 09:25:46 +0000 (14:55 +0530)]
cxgb4vf: Fix check to use new User Doorbell mechanism

If we don't have access to the new User GTS (T5+), use the old doorbell
mechanism; otherwise use the new BAR2 mechanism.

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotest_bpf: extend tests for 32-bit endianness conversion
Xi Wang [Wed, 8 Jul 2015 21:00:56 +0000 (14:00 -0700)]
test_bpf: extend tests for 32-bit endianness conversion

Currently "ALU_END_FROM_BE 32" and "ALU_END_FROM_LE 32" do not test if
the upper bits of the result are zeros (the arm64 JIT had such bugs).
Extend the two tests to catch this.

Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'cxgb4-t6'
David S. Miller [Wed, 8 Jul 2015 23:13:55 +0000 (16:13 -0700)]
Merge branch 'cxgb4-t6'

Hariprasad Shenai says:

====================
Cleanup, T6 changes and register range update

This patch series adds the following:
Don't use entire L2T table, update register ranges for T6 adapter,
read stats for only available channels for T6 and enable cim_la dump for
T6 adapter also.

This patch series has been created against net-next tree and includes
patches on cxgb4 driver.

We have included all the maintainers of respective drivers. Kindly review
the change and let us know in case of any review comments.
====================

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agocxgb4: Enable cim_la dump to support T6
Hariprasad Shenai [Tue, 7 Jul 2015 16:19:21 +0000 (21:49 +0530)]
cxgb4: Enable cim_la dump to support T6

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agocxgb4: Read stats for only available channels
Hariprasad Shenai [Tue, 7 Jul 2015 16:19:20 +0000 (21:49 +0530)]
cxgb4: Read stats for only available channels

Updating the driver to read the stats of only available channels. T6 and
later has only 2 channels

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agocxgb4: Update register ranges for T6 adapter
Hariprasad Shenai [Tue, 7 Jul 2015 16:19:19 +0000 (21:49 +0530)]
cxgb4: Update register ranges for T6 adapter

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agocxgb4: Don't use entire L2T table, use only its slice
Hariprasad Shenai [Tue, 7 Jul 2015 16:19:18 +0000 (21:49 +0530)]
cxgb4: Don't use entire L2T table, use only its slice

The driver was retrieving the parameters for the bounds of its
slice of the L2T from the firmware and then throwing those away and
using the entire table. This corrects that problem.

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: ec_bhf: Use module_pci_driver
Vaishali Thakkar [Tue, 7 Jul 2015 07:02:54 +0000 (12:32 +0530)]
net: ec_bhf: Use module_pci_driver

Use module_pci_driver for drivers whose init and exit functions
only register and unregister, respectively.

A simplified version of the Coccinelle semantic patch that performs
this transformation is as follows:

@a@
identifier f, x;
@@
-static f(...) { return pci_register_driver(&x); }

@b depends on a@
identifier e, a.x;
@@
-static e(...) { pci_unregister_driver(&x); }

@c depends on a && b@
identifier a.f;
declarer name module_init;
@@
-module_init(f);

@d depends on a && b && c@
identifier b.e, a.x;
declarer name module_exit;
declarer name module_pci_driver;
@@
-module_exit(e);
+module_pci_driver(x);

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agohv_netvsc: Add support to set MTU reservation from guest side
Haiyang Zhang [Mon, 6 Jul 2015 21:11:37 +0000 (14:11 -0700)]
hv_netvsc: Add support to set MTU reservation from guest side

When packet encapsulation is in use, the MTU needs to be reduced for
headroom reservation.
The existing code takes the updated MTU value only from the host side.
But vSwitch extensions, such as Open vSwitch, require the flexibility
to change the MTU to different values from within a guest during the
lifecycle of a vNIC, when the encapsulation protocol is changed. The
patch supports this kind of MTU changes.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoifb: add multiqueue operation
Eric Dumazet [Mon, 6 Jul 2015 20:05:28 +0000 (22:05 +0200)]
ifb: add multiqueue operation

Add multiqueue capabilities to ifb netdevice.

This removes last bottleneck for ingress when mq qdisc can be used
to shard load from multiple RX queues on physical device.

Tested:

# netem based setup, installed at receiver side
ETH=eth0
IFB=ifb10
EST="est 1sec 4sec" # Optional rate estimator
RTT_HALF=2ms
#REORDER=20us
#LOSS="loss 1"
TXQ=8

ip link add ifb10 numtxqueues $TXQ type ifb
ip link set dev $IFB up

tc qdisc add dev $ETH ingress 2>/dev/null

tc filter add dev $ETH parent ffff: \
   protocol ip u32 match u32 0 0 flowid 1:1 \
action mirred egress redirect dev $IFB

tc qdisc del dev $IFB root 2>/dev/null

tc qdisc add dev $IFB root handle 1: mq
for i in `seq 1 $TXQ`
do
 slot=$( printf %x $(( i )) )
 tc qd add dev $IFB parent 1:$slot $EST netem \
limit 100000 delay $RTT_HALF $REORDER $LOSS
done

lpaa24:~# tc -s -d qd sh dev ifb10
qdisc mq 1: root
 Sent 316544766 bytes 5265927 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 98880b 1648p requeues 0
qdisc netem 8002: parent 1:1 limit 100000 delay 2.0ms
 Sent 39601416 bytes 658721 pkt (dropped 0, overlimits 0 requeues 0)
 rate 38235Kbit 79657pps backlog 12240b 204p requeues 0
qdisc netem 8003: parent 1:2 limit 100000 delay 2.0ms
 Sent 39472866 bytes 657227 pkt (dropped 0, overlimits 0 requeues 0)
 rate 38234Kbit 79655pps backlog 10620b 176p requeues 0
qdisc netem 8004: parent 1:3 limit 100000 delay 2.0ms
 Sent 39703417 bytes 659699 pkt (dropped 0, overlimits 0 requeues 0)
 rate 38320Kbit 79831pps backlog 12780b 213p requeues 0
qdisc netem 8005: parent 1:4 limit 100000 delay 2.0ms
 Sent 39565149 bytes 658011 pkt (dropped 0, overlimits 0 requeues 0)
 rate 38174Kbit 79530pps backlog 11880b 198p requeues 0
qdisc netem 8006: parent 1:5 limit 100000 delay 2.0ms
 Sent 39506078 bytes 657354 pkt (dropped 0, overlimits 0 requeues 0)
 rate 38195Kbit 79571pps backlog 12480b 208p requeues 0
qdisc netem 8007: parent 1:6 limit 100000 delay 2.0ms
 Sent 39675994 bytes 658849 pkt (dropped 0, overlimits 0 requeues 0)
 rate 38323Kbit 79838pps backlog 12600b 210p requeues 0
qdisc netem 8008: parent 1:7 limit 100000 delay 2.0ms
 Sent 39532042 bytes 658367 pkt (dropped 0, overlimits 0 requeues 0)
 rate 38177Kbit 79536pps backlog 13140b 219p requeues 0
qdisc netem 8009: parent 1:8 limit 100000 delay 2.0ms
 Sent 39488164 bytes 657705 pkt (dropped 0, overlimits 0 requeues 0)
 rate 38192Kbit 79568pps backlog 13Kb 222p requeues 0

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agocxgb4: Add PCI device ids for few more T5 and T6 adapters
Hariprasad Shenai [Mon, 6 Jul 2015 17:08:34 +0000 (22:38 +0530)]
cxgb4: Add PCI device ids for few more T5 and T6 adapters

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet/mlx4_core: Add extra check for total vfs for SRIOV
Carol Soto [Mon, 6 Jul 2015 14:20:19 +0000 (09:20 -0500)]
net/mlx4_core: Add extra check for total vfs for SRIOV

Add extra check for total vfs for SRIOV to check if that value is
bigger than total vfs in pci SRIOV capabalities. Fix a check and
print of the number of maximum vfs that hw can handle. Fix a check
and print of the number of maximum vfs per port that driver can handle.

Signed-off-by: Carol L Soto <clsoto@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agosamples: bpf: enable trace samples for s390x
Michael Holzheu [Mon, 6 Jul 2015 14:20:07 +0000 (16:20 +0200)]
samples: bpf: enable trace samples for s390x

The trace bpf samples do not compile on s390x because they use x86
specific fields from the "pt_regs" structure.

Fix this and access the fields via new PT_REGS macros.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: macb: Add SG support for Zynq SOC family
Punnaiah Choudary Kalluri [Mon, 6 Jul 2015 04:32:53 +0000 (10:02 +0530)]
net: macb: Add SG support for Zynq SOC family

Enable SG support for Zynq SOC family devices.

Signed-off-by: Punnaiah Choudary Kalluri <punnaia@xilinx.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoxen-netback: remove duplicated function definition
Li, Liang Z [Mon, 6 Jul 2015 00:42:56 +0000 (08:42 +0800)]
xen-netback: remove duplicated function definition

There are two duplicated xenvif_zerocopy_callback() definitions.
Remove one of them.

Signed-off-by: Liang Li <liang.z.li@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'sch_act_lockless'
David S. Miller [Wed, 8 Jul 2015 20:50:42 +0000 (13:50 -0700)]
Merge branch 'sch_act_lockless'

Eric Dumazet says:

====================
net_sched: act: lockless operation

As mentioned by Alexei last week in Budapest, it is a bit weird
to take a spinlock in order to drop a packet in a tc filter...

Lets add percpu infra for tc actions and use it for gact & mirred.

Before changes, my host with 8 RX queues was handling 5 Mpps with gact,
and more than 11 Mpps after.

Mirred change is not yet visible if ifb+qdisc is used, as ifb is
not yet multi queue enabled, but is a step forward.
====================

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet_sched: act_mirred: remove spinlock in fast path
Eric Dumazet [Mon, 6 Jul 2015 12:18:09 +0000 (05:18 -0700)]
net_sched: act_mirred: remove spinlock in fast path

Like act_gact, act_mirred can be lockless in packet processing

1) Use percpu stats
2) update lastuse only every clock tick to avoid false sharing
3) use rcu to protect tcfm_dev
4) Remove spinlock usage, as it is no longer needed.

Next step : add multi queue capability to ifb device

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet_sched: act_gact: remove spinlock in fast path
Eric Dumazet [Mon, 6 Jul 2015 12:18:08 +0000 (05:18 -0700)]
net_sched: act_gact: remove spinlock in fast path

Final step for gact RCU operation :

1) Use percpu stats
2) update lastuse only every clock tick to avoid false sharing
3) Remove spinlock acquisition, as it is no longer needed.

Since this is the last contended lock in packet RX when tc gact is used,
this gives impressive gain.

My host with 8 RX queues was handling 5 Mpps before the patch,
and more than 11 Mpps after patch.

Tested:

On receiver :

dev=eth0
tc qdisc del dev $dev ingress 2>/dev/null
tc qdisc add dev $dev ingress
tc filter del dev $dev root pref 10 2>/dev/null
tc filter del dev $dev pref 10 2>/dev/null
tc filter add dev $dev est 1sec 4sec parent ffff: protocol ip prio 1 \
u32 match ip src 7.0.0.0/8 flowid 1:15 action drop

Sender sends packets flood from 7/8 network

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet_sched: act_gact: read tcfg_ptype once
Eric Dumazet [Mon, 6 Jul 2015 12:18:07 +0000 (05:18 -0700)]
net_sched: act_gact: read tcfg_ptype once

Third step for gact RCU operation :

Following patch will get rid of spinlock protection,
so we need to read tcfg_ptype once.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet_sched: act_gact: use a separate packet counters for gact_determ()
Eric Dumazet [Mon, 6 Jul 2015 12:18:06 +0000 (05:18 -0700)]
net_sched: act_gact: use a separate packet counters for gact_determ()

Second step for gact RCU operation :

We want to get rid of the spinlock protecting gact operations.
Stats (packets/bytes) will soon be per cpu.

gact_determ() would not work without a central packet counter,
so lets add it for this mode.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet_sched: act_gact: make tcfg_pval non zero
Eric Dumazet [Mon, 6 Jul 2015 12:18:05 +0000 (05:18 -0700)]
net_sched: act_gact: make tcfg_pval non zero

First step for gact RCU operation :

Instead of testing if tcfg_pval is zero or not, just make it 1.

No change in behavior, but slightly faster code.

The smp_rmb()/smp_wmb() barriers, while not strictly needed at this
stage are added for upcoming spinlock removal.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: sched: add percpu stats to actions
Eric Dumazet [Mon, 6 Jul 2015 12:18:04 +0000 (05:18 -0700)]
net: sched: add percpu stats to actions

Reuse existing percpu infrastructure John Fastabend added for qdisc.

This patch adds a new cpustats parameter to tcf_hash_create() and all
actions pass false, meaning this patch should have no effect yet.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: sched: extend percpu stats helpers
Eric Dumazet [Mon, 6 Jul 2015 12:18:03 +0000 (05:18 -0700)]
net: sched: extend percpu stats helpers

qdisc_bstats_update_cpu() and other helpers were added to support
percpu stats for qdisc.

We want to add percpu stats for tc action, so this patch add common
helpers.

qdisc_bstats_update_cpu() is renamed to qdisc_bstats_cpu_update()
qdisc_qstats_drop_cpu() is renamed to qdisc_qstats_cpu_drop()

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agomlx4: TCP/UDP packets have L4 hash
Eric Dumazet [Thu, 2 Jul 2015 11:24:44 +0000 (13:24 +0200)]
mlx4: TCP/UDP packets have L4 hash

Mellanox driver has the knowledge if rxhash is a L4 hash,
if it receives a non fragmented TCP or UDP frame and
NETIF_F_RXCSUM is enabled on netdev.

ip_summed value is CHECKSUM_UNNECESSARY in this case.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Amir Vadai <amirv@mellanox.com>
Cc: Ido Shamay <idos@mellanox.com>
Acked-by: Ido Shamay <idos@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'tcp-policer-drops'
David S. Miller [Wed, 8 Jul 2015 20:29:46 +0000 (13:29 -0700)]
Merge branch 'tcp-policer-drops'

Yuchung Cheng says:

====================
tcp: reducing lost retransmits in recovery

This patch series reduces lost retransmits in recovery, in particular
when dealing with traffic policers. The main problem is that
slow start in recovery under policing can cause massive lost and
retransmit storms: any excess sending rate turns into drops. The
solution is to avoid doing slow start when lost retransmit is
detected and use packet conservation instead.

On networks with traffic policers the patches have lowered the
TCP loss rates by ~20% from Google servers without latency regressions.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotcp: PRR uses CRB mode by default and SS mode conditionally
Yuchung Cheng [Wed, 1 Jul 2015 21:11:15 +0000 (14:11 -0700)]
tcp: PRR uses CRB mode by default and SS mode conditionally

PRR slow start is often too aggressive especially when drops are
caused by traffic policers. The policers mainly use token bucket
to enforce the rate so sending (twice) faster than the delivery
rate causes excessive drops.

This patch changes PRR to the conservative reduction bound
(CRB) mode in RFC 6937 by default. CRB follows the packet
conservation rule to send at most the delivery rate by default.

But if many packets are lost and the pipe is empty, CRB may take N
round trips to repair N losses. We conditionally turn on slow start
mode if all these conditions are made to speed up the recovery:

  1) on the second round or later in recovery
  2) retransmission sent in the previous round is delivered on this ACK
  3) no retransmission is marked lost on this ACK

By using packet conservation by default, this change reduces the loss
retransmits signicantly on networks that deploy traffic policers,
up to 20% reduction of overall loss rate.

Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Nandita Dukkipati <nanditad@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotcp: reduce cwnd if retransmit is lost in CA_Loss
Yuchung Cheng [Wed, 1 Jul 2015 21:11:14 +0000 (14:11 -0700)]
tcp: reduce cwnd if retransmit is lost in CA_Loss

If the retransmission in CA_Loss is lost again, we should not
continue to slow start or raise cwnd in congestion avoidance mode.
Instead we should enter fast recovery and use PRR to reduce cwnd,
following the principle in RFC5681:

"... or the loss of a retransmission, should be taken as two
 indications of congestion and, therefore, cwnd (and ssthresh) MUST
 be lowered twice in this case."

This is especially important to reduce loss when the CA_Loss
state was caused by a traffic policer dropping the entire inflight.
The CA_Loss state has a problem where a loss of L packets causes the
sender to send a burst of L packets. So a policer that's dropping
most packets in a given RTT can cause a huge retransmit storm. By
contrast, PRR includes logic to bound the number of outbound packets
that result from a given ACK. So switching to CA_Recovery on lost
retransmits in CA_Loss avoids this retransmit storm problem when
in CA_Loss.

Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Nandita Dukkipati <nanditad@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agocxgb4: Fix incorrect sequence numbers shown in devlog
Hariprasad Shenai [Fri, 3 Jul 2015 10:40:51 +0000 (16:10 +0530)]
cxgb4: Fix incorrect sequence numbers shown in devlog

Part of commit 49aa284fe64c4c1 ("cxgb4: Add support for devlog")
change introduced a real bug where the Device Log Sequence Numbers are
no longer being converted from firmware Big-Endian to local CPU-Endian
format.

This patch moves all of the translation into the devlog_show() routine.
The only endianness code now in devlog_open() is the small loop to find the
earliest (lowest Sequence Number) Device Log entry in the circular buffer.

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoipv6: Make MLD packets to only be processed locally
Angga [Fri, 3 Jul 2015 02:40:52 +0000 (14:40 +1200)]
ipv6: Make MLD packets to only be processed locally

Before commit daad151263cf ("ipv6: Make ipv6_is_mld() inline and use it
from ip6_mc_input().") MLD packets were only processed locally. After the
change, a copy of MLD packet goes through ip6_mr_input, causing
MRT6MSG_NOCACHE message to be generated to user space.

Make MLD packet only processed locally.

Fixes: daad151263cf ("ipv6: Make ipv6_is_mld() inline and use it from ip6_mc_input().")
Signed-off-by: Hermin Anggawijaya <hermin.anggawijaya@alliedtelesis.co.nz>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonetlink: Delete an unnecessary check before the function call "module_put"
Markus Elfring [Thu, 2 Jul 2015 16:38:12 +0000 (18:38 +0200)]
netlink: Delete an unnecessary check before the function call "module_put"

The module_put() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet-RDS: Delete an unnecessary check before the function call "module_put"
Markus Elfring [Thu, 2 Jul 2015 15:58:21 +0000 (17:58 +0200)]
net-RDS: Delete an unnecessary check before the function call "module_put"

The module_put() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet-ipv6: Delete an unnecessary check before the function call "free_percpu"
Markus Elfring [Thu, 2 Jul 2015 14:30:24 +0000 (16:30 +0200)]
net-ipv6: Delete an unnecessary check before the function call "free_percpu"

The free_percpu() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobridge: vlan: fix usage of vlan 0 and 4095 again
Nikolay Aleksandrov [Thu, 2 Jul 2015 12:48:17 +0000 (05:48 -0700)]
bridge: vlan: fix usage of vlan 0 and 4095 again

Vlan ids 0 and 4095 were disallowed by commit:
8adff41c3d25 ("bridge: Don't use VID 0 and 4095 in vlan filtering")
but then the check was removed when vlan ranges were introduced by:
bdced7ef7838 ("bridge: support for multiple vlans and vlan ranges in setlink and dellink requests")
So reintroduce the vlan range check.
Before patch:
[root@testvm ~]# bridge vlan add vid 0 dev eth0 master
(succeeds)
After Patch:
[root@testvm ~]# bridge vlan add vid 0 dev eth0 master
RTNETLINK answers: Invalid argument

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Fixes: bdced7ef7838 ("bridge: support for multiple vlans and vlan ranges in setlink and dellink requests")
Acked-by: Toshiaki Makita <toshiaki.makita1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetoot...
David S. Miller [Thu, 2 Jul 2015 19:17:11 +0000 (12:17 -0700)]
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth

Johan Hedberg says:

====================
pull request: bluetooth 2015-07-02

A couple of regressions crept in because of a patch to use proper list
APIs rather than manually reading & writing the next/prev pointers
(commit 835a6a2f8603237a3e6cded5a6765090ecb06ea5). Turns out this was
masking a few bugs: a missing INIT_LIST_HEAD() call and incorrectly
using list_del() rather than list_del_init(). The two patches in this
set fix these, and it'd be nice they could still make it to 4.2-rc1 to
avoid new bug reports from users.

Please let me know if there are any issues pulling. Thanks.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>