firefly-linux-kernel-4.4.55.git
10 years agoiwlwifi: mvm: protect TDLS discovery session
Arik Nemtsov [Tue, 20 May 2014 15:16:42 +0000 (18:16 +0300)]
iwlwifi: mvm: protect TDLS discovery session

Use the new mac80211 callback to protect a TDLS discovery session so we
can hear the discovery-response packet.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: disallow new TDLS stations when appropriate
Arik Nemtsov [Thu, 15 May 2014 08:44:40 +0000 (11:44 +0300)]
iwlwifi: mvm: disallow new TDLS stations when appropriate

HW/FW constraints dictate that TDLS should only be used when a single
phy ctx is active. We also support at most 4 TDLS peers. We don't
support TDLS on a P2P vif.

Unify and move a phy-ctx counting implementation from the power-mgmt code
in order to simplify implementation.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: Use CS tx block bit for AP/GO
Andrei Otcheretianski [Sun, 25 May 2014 14:24:22 +0000 (17:24 +0300)]
iwlwifi: mvm: Use CS tx block bit for AP/GO

An AP/GO may perform the channel switch slightly before its stations.
This scenario may result in packet loss, since the transmission may start
before the client is actually on a new channel. In order to prevent
potential packet loss disable tx to all the stations when the channel
switch flow starts. Clear the disable_tx bit when a station is seen on a
target channel, or after IWL_MVM_CS_UNBLOCK_TX_TIMEOUT beacons on a new
channel. In addition call ieee80211_sta_block_awake in order to inform
mac80211 that the frames for this station should be buffered.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: Reflect GO channel switch in NoA
Andrei Otcheretianski [Sun, 4 May 2014 08:48:12 +0000 (11:48 +0300)]
iwlwifi: mvm: Reflect GO channel switch in NoA

According to the spec, GO/AP should perform the channel switch just
before "beacon 0". However, since the exact timing isn't defined,
it may result in a sudden GO disappearance from the channel.
Prevent potential packet loss when performing the CS by scheduling
NoA time event and executing the channel switch flow when a notification
from fw is received.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: Protect mvm->csa_vif with RCU
Andrei Otcheretianski [Thu, 5 Jun 2014 13:40:36 +0000 (16:40 +0300)]
iwlwifi: mvm: Protect mvm->csa_vif with RCU

Currently mvm->csa_vif is protected with mvm mutex. The RCU protection
is required for "iwlwifi: mvm: Reflect GO channel switch in NoA" patch.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: Use beacon_get_template instead of beacon_get
Andrei Otcheretianski [Thu, 10 Apr 2014 18:46:16 +0000 (21:46 +0300)]
iwlwifi: mvm: Use beacon_get_template instead of beacon_get

Call ieee80211_beacon_get_template instead of ieee80211_beacon_get and sync the
CSA counters with mac80211 after each beacon transmission.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: CSA unbind-bind flow support for client
Luciano Coelho [Wed, 5 Mar 2014 13:41:48 +0000 (15:41 +0200)]
iwlwifi: mvm: CSA unbind-bind flow support for client

Implement support for unbind-bind flow for the client roles.  This
includes telling the firmware that we are not associated, removing
time-events, removing quotas and updating power management during the
actual switch, and redoing everything in the new channel.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: add switch_vif_chanctx operation
Luciano Coelho [Tue, 20 May 2014 20:31:05 +0000 (23:31 +0300)]
iwlwifi: mvm: add switch_vif_chanctx operation

Implement the switch_vif_chanctx operation with support for a
single-vif and SWAP mode.  The REASSIGN mode and multi-vifs are not
supported yet.

This operation needs to implement 4 steps, namely unassign, remove,
add and assign the chanctx.  In order to do this, split out these
operations into locked and non-locked parts, thus allowing us to call
them while locked.

Additionally, in order to allow us to restart the hardware when
something fails, add a boolean to the iwl_mvm_nic_restart() function
that tells whether the restart was triggered by a FW error or
something else.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: remove update type argument from quota update
Johannes Berg [Fri, 6 Jun 2014 13:18:45 +0000 (15:18 +0200)]
iwlwifi: mvm: remove update type argument from quota update

It turns out that adding the update type argument was pointless as
quota update is never called from the add_interface() callback.
Therefore, IWL_MVM_QUOTA_UPDATE_TYPE_NEW isn't actually needed and
then only a "disabled_vif" argument is needed for the upcoming CSA
work.

Remove the whole enum iwl_mvm_quota_update_type and pass the right
arguments (always NULL for disabled vif right now) to the function
in all current call sites.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: don't pass update type to quota iterator
Johannes Berg [Fri, 23 May 2014 14:17:13 +0000 (16:17 +0200)]
iwlwifi: mvm: don't pass update type to quota iterator

Simplify the quota iterator by not passing the update type,
it only needs to know whether or not to skip an interface.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: validate that we don't send zero quota
Johannes Berg [Fri, 23 May 2014 14:13:57 +0000 (16:13 +0200)]
iwlwifi: mvm: validate that we don't send zero quota

The firmware currently deals with zero quota for a given
binding, but it seems odd to send that down. Make sure
that we don't do that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: don't send zero quota to the firmware
Johannes Berg [Fri, 23 May 2014 14:15:11 +0000 (16:15 +0200)]
iwlwifi: mvm: don't send zero quota to the firmware

There are some cases where we can currently send zero quota
for a valid binding, e.g. if we update while an interface is
bound to a channel context but not yet acting as an AP.

Avoid this by reordering the checks.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: let iwl_mvm_update_quotas disregard a disabled vif
Luciano Coelho [Tue, 13 May 2014 19:28:35 +0000 (22:28 +0300)]
iwlwifi: mvm: let iwl_mvm_update_quotas disregard a disabled vif

In some cases (e.g. when we're doing a channel switch), we may need to
disable the quota of a vif temporarily.  In order to do so, add an
argument to the iwl_mvm_update_quotas() function to tell if the passed
vif is a new one or if it should be disregarded.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: 8000: drop a print when the address is invalid
Eran Harary [Sun, 29 Jun 2014 08:53:06 +0000 (11:53 +0300)]
iwlwifi: 8000: drop a print when the address is invalid

when driver takes the MAC address from the HW section and
it isn't valid - print an error.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix endianity in scan command
David Spinadel [Wed, 25 Jun 2014 10:17:53 +0000 (13:17 +0300)]
iwlwifi: mvm: fix endianity in scan command

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: init lmac scan command
David Spinadel [Thu, 12 Jun 2014 16:29:40 +0000 (19:29 +0300)]
iwlwifi: mvm: init lmac scan command

Initialize LMAC scan command.
Fix EBS flag to be dependant on TLV flg and fix other bugs.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: add unified LMAC scan API
David Spinadel [Sun, 4 May 2014 09:51:10 +0000 (12:51 +0300)]
iwlwifi: mvm: add unified LMAC scan API

Add new scan API that uses the same command 0x51 for both regular and
sched scan.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: don't save debugfs files
Eliad Peller [Sun, 15 Jun 2014 09:02:20 +0000 (12:02 +0300)]
iwlwifi: mvm: rs: don't save debugfs files

These file are removed recursively anyway, so there's no
point saving them just to redundantly remove them later.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: don't clear persistent fields
Eliad Peller [Wed, 11 Jun 2014 12:51:33 +0000 (15:51 +0300)]
iwlwifi: mvm: rs: don't clear persistent fields

iwl_mvm_rs_rate_init() is called multiple times to re-init
the rate scaling statistics (e.g. after some idle time).

It clears all the lq_sta sta, including some fields that
shouldn't be cleared (e.g. debugfs pointers). Fix it
by adding a new 'persistent' sub-struct, and
avoid clearing it on (re-)init.

Move the initialization of the persistent fields to
rs_alloc_sta instead.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: warn about empty OTP
Eran Harary [Tue, 1 Jul 2014 14:31:38 +0000 (17:31 +0300)]
iwlwifi: mvm: warn about empty OTP

Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: BT Coex - relax constraints when TTC / RRC is active
Emmanuel Grumbach [Mon, 30 Jun 2014 07:26:02 +0000 (10:26 +0300)]
iwlwifi: mvm: BT Coex - relax constraints when TTC / RRC is active

When TxTxCo-Running is active, we can relax the constraints
on the rate control.
When RxRxCo-Running is active, we can relax the constrains
on SMPS.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: BT Coex - fix debugfs with old API
Emmanuel Grumbach [Wed, 2 Jul 2014 14:33:52 +0000 (17:33 +0300)]
iwlwifi: mvm: BT Coex - fix debugfs with old API

Fix the debugfs hook to make it able to display the data
with the old firmware API.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: BT Coex - add High Band retention
Emmanuel Grumbach [Wed, 11 Jun 2014 12:37:25 +0000 (15:37 +0300)]
iwlwifi: mvm: BT Coex - add High Band retention

Tell the firmware if TTC should be enabled when switching
to High Band.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: BT Coex - convert reduced Tx power to new API
Emmanuel Grumbach [Thu, 22 May 2014 09:48:27 +0000 (12:48 +0300)]
iwlwifi: mvm: BT Coex - convert reduced Tx power to new API

No need to send the big BT_COEX_CMD command, we have now
a much thiner command that updates only what is needed.
Adapt the code to that.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: BT Coex - convert the co-running update to new API
Emmanuel Grumbach [Wed, 2 Apr 2014 09:23:09 +0000 (12:23 +0300)]
iwlwifi: mvm: BT Coex - convert the co-running update to new API

No need to send the big BT_COEX_CMD command, we have now
a much thiner command that updates only what is needed.
Adapt the code to that.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: BT Coex - convert the sw boost update to new API
Emmanuel Grumbach [Wed, 2 Apr 2014 09:23:09 +0000 (12:23 +0300)]
iwlwifi: mvm: BT Coex - convert the sw boost update to new API

No need to send the big BT_COEX_CMD command, we have now
a much thiner command that updates only what is needed.
Adapt the code to that, and open the patch to the updates.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: BT Coex - new API
Emmanuel Grumbach [Wed, 2 Apr 2014 06:55:16 +0000 (09:55 +0300)]
iwlwifi: mvm: BT Coex - new API

Start the new BT Coex implementation.
Don't react to notifications for now - only the initial
configuration is implemented. The rest will happen in next
patches.
Since coex.c now uses the new the new structures in all
functions, we need to adapt the code to compile, even if it
doesn't run yet.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: BT Coex - prepare towards new API
Emmanuel Grumbach [Wed, 2 Apr 2014 06:31:36 +0000 (09:31 +0300)]
iwlwifi: mvm: BT Coex - prepare towards new API

A new API is coming. This new API is not backward
compatible. So we need to keep the old commands to be able
to work with the former API.
Move all the current code into a new file: coex_legacy.
If a firmware with the new API is detected, we currently
just bail out since the implementation of the new API will
come in future patches.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: remove unused flags from TX command
Emmanuel Grumbach [Wed, 2 Jul 2014 09:00:51 +0000 (12:00 +0300)]
iwlwifi: mvm: remove unused flags from TX command

These flags are not used by the firmware anyway.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: rename iwl_fw_error_fw_mon to iwl_fw_error_dump_fw_mon
Emmanuel Grumbach [Thu, 26 Jun 2014 06:54:23 +0000 (09:54 +0300)]
iwlwifi: rename iwl_fw_error_fw_mon to iwl_fw_error_dump_fw_mon

This is matches the convention of the other structures.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: read the mac address in family 8000
Eran Harary [Wed, 11 Jun 2014 08:37:09 +0000 (11:37 +0300)]
iwlwifi: mvm: read the mac address in family 8000

In family 8000 products the MAC address in the OTP could be in either:
- WFPM address
- PCIE address
In sdio product we should read it from the WFPM, in pcie product we
should read it from the PCIe location.
This is relevant only from otp version 0xE08 and above.
While at it, fix the bytes order in version 0xE08.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Reviewed-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: wait for d0i3 exit in add interface flow
Gregory Greenman [Wed, 25 Jun 2014 12:08:50 +0000 (14:08 +0200)]
iwlwifi: mvm: wait for d0i3 exit in add interface flow

This patch makes sure there're no target accesses in the add
interface flow before d0i3 exit completes.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: update layout of firmware error dump
Emmanuel Grumbach [Wed, 25 Jun 2014 13:21:43 +0000 (16:21 +0300)]
iwlwifi: mvm: update layout of firmware error dump

The memory was not zeroed - fix that. Also update the
iwl_fw_error_dump_info structure.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: kill iwl_mvm_fw_error_rxf_dump
Emmanuel Grumbach [Wed, 25 Jun 2014 11:08:58 +0000 (14:08 +0300)]
iwlwifi: mvm: kill iwl_mvm_fw_error_rxf_dump

Its content can move to the caller.
While at it, move iwl_mvm_fw_error_rxf_dump to caller.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: don't collect logs in the interrupt thread
Emmanuel Grumbach [Wed, 25 Jun 2014 10:46:10 +0000 (13:46 +0300)]
iwlwifi: mvm: don't collect logs in the interrupt thread

Instead of reading all the data in the context of the
interrupt thread, collect the data in the restart flow
before the actual restart takes place so that the device
still has all the information.
Remove iwl_mvm_fw_error_sram_dump and move its content to
iwl_mvm_fw_error_dump.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: remove wrong comment about alignment in iwl-fw-error-dump.h
Emmanuel Grumbach [Tue, 24 Jun 2014 11:34:28 +0000 (14:34 +0300)]
iwlwifi: remove wrong comment about alignment in iwl-fw-error-dump.h

The chunks of data do not need to be multipliers of 4 nor
4-bytes aligned.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: fix naming mistake for the fw_monitor module parameter
Emmanuel Grumbach [Thu, 26 Jun 2014 06:13:26 +0000 (09:13 +0300)]
iwlwifi: fix naming mistake for the fw_monitor module parameter

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoMerge remote-tracking branch 'wireless-next/master' into iwlwifi-next
Emmanuel Grumbach [Sun, 6 Jul 2014 08:15:30 +0000 (11:15 +0300)]
Merge remote-tracking branch 'wireless-next/master' into iwlwifi-next

10 years agoMerge remote-tracking branch 'iwlwifi-fixes/master' into iwlwifi-next
Emmanuel Grumbach [Sun, 6 Jul 2014 08:15:23 +0000 (11:15 +0300)]
Merge remote-tracking branch 'iwlwifi-fixes/master' into iwlwifi-next

10 years agoiwlwifi: mvm: disable CTS to Self
Emmanuel Grumbach [Thu, 3 Jul 2014 17:46:35 +0000 (20:46 +0300)]
iwlwifi: mvm: disable CTS to Self

Firmware folks seem say that this flag can make trouble.
Drop it. The advantage of CTS to self is that it slightly
reduces the cost of the protection, but make the protection
less reliable.

Cc: <stable@vger.kernel.org> [3.13+]
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: dvm: don't enable CTS to self
Emmanuel Grumbach [Wed, 25 Jun 2014 06:12:30 +0000 (09:12 +0300)]
iwlwifi: dvm: don't enable CTS to self

We should always prefer to use full RTS protection. Using
CTS to self gives a meaningless improvement, but this flow
is much harder for the firmware which is likely to have
issues with it.

CC: <stable@vger.kernel.org>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoi40e/i40evf: Bump i40e to 0.4.21 and i40evf to 0.9.40
Catherine Sullivan [Wed, 4 Jun 2014 08:45:29 +0000 (08:45 +0000)]
i40e/i40evf: Bump i40e to 0.4.21 and i40evf to 0.9.40

Bump.

Change-ID: Ie0c36583ffd9997679f46bdf89bc462d3e992995
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e: Implement set_settings for ethtool
Catherine Sullivan [Wed, 4 Jun 2014 08:45:28 +0000 (08:45 +0000)]
i40e: Implement set_settings for ethtool

Implement set_settings for ethtool in i40e.

Change-ID: Ie3c3fe18e8ff86c3f25b842844b3d9aabc9bba57
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e: Add set_pauseparam to ethtool
Catherine Sullivan [Wed, 4 Jun 2014 08:45:27 +0000 (08:45 +0000)]
i40e: Add set_pauseparam to ethtool

Add i40e implementation of setpauseparam to ethtool.

Change-ID: Ie7766b2091ec8f934737573c9ffd426081966718
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e/i40evf: Add set_fc and init of FC settings
Catherine Sullivan [Wed, 4 Jun 2014 08:45:26 +0000 (08:45 +0000)]
i40e/i40evf: Add set_fc and init of FC settings

Add function set_fc to set the requested FC mode. This patch also
adds the init of FC setting to get_link_info and replaces the init
code to set FC off by default in main. Also adds i40e_set_phy_config
to support this.

Change-ID: I7b25bbaec81f15777137ab324a095f916e44351d
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e: move nway reset
Jesse Brandeburg [Wed, 4 Jun 2014 08:45:25 +0000 (08:45 +0000)]
i40e: move nway reset

Just move nway reset up, will be used in the next patch.

Change-ID: Ice3b631fa2044debc5c4541b42872a48163f8452
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e/i40evf: Add new HW link info variable an_enabled and function update_link_info
Catherine Sullivan [Wed, 4 Jun 2014 08:45:24 +0000 (08:45 +0000)]
i40e/i40evf: Add new HW link info variable an_enabled and function update_link_info

Add a new variable, hw.phy.link_info.an_enabled, to track whether autoneg is
enabled.  Also add a new function update_link_info that will update that
variable as well as calling get_link_info to update the rest of the link info.
Also add get_phy_capabilities to support this.

Change-ID: I5157ef03492b6dd8ec5e608ba0cf9b0db9c01710
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e: Finish implementation of ethtool get settings
Jesse Brandeburg [Wed, 4 Jun 2014 08:45:23 +0000 (08:45 +0000)]
i40e: Finish implementation of ethtool get settings

Finish the i40e implementation of get_settings for ethtool.

Change-ID: Iec81835aa9380723ae9288bcb79b30a6a1ecd498
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e: disable TPH
Jesse Brandeburg [Wed, 4 Jun 2014 08:45:21 +0000 (08:45 +0000)]
i40e: disable TPH

TPH is not currently enabled in this product, make sure it
isn't enabled by default.

Change-ID: Ibb1a10799c33c4c76dec06fcd53b1d6efa13c1f5
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e: Fix a boundary condition and turning off of ntuple
Anjali Singhai Jain [Wed, 4 Jun 2014 08:45:20 +0000 (08:45 +0000)]
i40e: Fix a boundary condition and turning off of ntuple

When turning off ntuple with a FD table full situation,
the driver would have auto disabled FD filter additions.
Clear the auto disable flag for FD_SB so that when the
feature is turned on again using "ethtool -K ethx ntuple on"
we can start adding filters once again.

Change-ID: I036a32e7331bcae765b657c8abb4fa070940b163
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40evf: invite vector 0 to the interrupt party
Mitch Williams [Wed, 4 Jun 2014 08:45:19 +0000 (08:45 +0000)]
i40evf: invite vector 0 to the interrupt party

The i40evf_irq_enable and i40evf_fire_sw_interrupt functions were
unfairly discriminating against MSI-X vector 0, just because it doesn't
handle traffic. That doesn't mean it's not essential to the operation of
the driver. This change allows the watchdog to fire vector 0 via
software, which makes the driver tolerant of dropped interrupts on that
vector.

Buck up, vector 0! You can be part of our gang!

Change-ID: I37131d955018a6b3e711e1732d21428acd0d767e
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e: tolerate lost interrupts
Mitch Williams [Wed, 4 Jun 2014 08:45:18 +0000 (08:45 +0000)]
i40e: tolerate lost interrupts

If the AQ interrupt gets lost for some reason, VF communications will
stall as the VFs have no way of reaching the PF, which is essentially
deaf. The VFs end up waiting forever for a reply that will never come.

To alleviate this condition, go ahead and check the ARQ every time we
run the service task. Remove the check for a pending event, and get rid
of a chatty error message that is now meaningless.

Change-ID: I0fc9d18169cd45c98f60188aef872cd6cee9a027
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e/i40evf: Force a shifted '1' to be unsigned
Paul M Stillwell Jr [Wed, 4 Jun 2014 08:45:17 +0000 (08:45 +0000)]
i40e/i40evf: Force a shifted '1' to be unsigned

Force a shifted '1' to be unsiged to avoid shifting a signed int

Change-ID: I688cbd082af0f2e1df548fda25847a5ca04babcf
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40evf: don't violate scope
Mitch Williams [Wed, 4 Jun 2014 08:45:16 +0000 (08:45 +0000)]
i40evf: don't violate scope

Move a declaration up one level so we don't dereference it out of scope.
This didn't cause any panics, but the details->async field would
mysteriously disappear, causing unnecessary delays when sending AQ
commands. Also, the code is just plain wrong.

Change-ID: I753f64f13c55e5d75ea4351e29b14fb53b2f0104
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e/i40evf: Do not free the dummy packet buffer synchronously
Anjali Singhai Jain [Wed, 4 Jun 2014 08:45:15 +0000 (08:45 +0000)]
i40e/i40evf: Do not free the dummy packet buffer synchronously

The HW still needs to consume it and freeing it in the function
that created it would mean we will be racing with the HW. The
i40e_clean_tx_ring() routine will free up the buffer attached once
the HW has consumed it.  The clean_fdir_tx_irq function had to be fixed
to handle the freeing correctly.

Cases where we program more than one filter per flow (Ipv4), the
code had to be changed to allocate dummy buffer multiple times
since it will be freed by the clean routine.  This also fixes an issue
where the filter program routine was not checking if there were
descriptors available for programming a filter.

Change-ID: Idf72028fd873221934e319d021ef65a1e51acaf7
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoMerge branch 'sctp'
David S. Miller [Thu, 3 Jul 2014 01:44:14 +0000 (18:44 -0700)]
Merge branch 'sctp'

Daniel Borkmann says:

====================
Misc SCTP updates

Daniel Borkmann (2):
  net: sctp: improve timer slack calculation for transport HBs
  net: sctp: only warn in proc_sctp_do_alpha_beta if write
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
10 years agonet: sctp: only warn in proc_sctp_do_alpha_beta if write
Daniel Borkmann [Mon, 30 Jun 2014 11:52:09 +0000 (13:52 +0200)]
net: sctp: only warn in proc_sctp_do_alpha_beta if write

Only warn if the value is written to alpha or beta. We don't care
emitting a one-time warning when only reading it.

Reported-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Reviewed-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: sctp: improve timer slack calculation for transport HBs
Daniel Borkmann [Mon, 30 Jun 2014 11:52:08 +0000 (13:52 +0200)]
net: sctp: improve timer slack calculation for transport HBs

RFC4960, section 8.3 says:

  On an idle destination address that is allowed to heartbeat,
  it is recommended that a HEARTBEAT chunk is sent once per RTO
  of that destination address plus the protocol parameter
  'HB.interval', with jittering of +/- 50% of the RTO value,
  and exponential backoff of the RTO if the previous HEARTBEAT
  is unanswered.

Currently, we calculate jitter via sctp_jitter() function first,
and then add its result to the current RTO for the new timeout:

  TMO = RTO + (RAND() % RTO) - (RTO / 2)
              `------------------------^-=> sctp_jitter()

Instead, we can just simplify all this by directly calculating:

  TMO = (RTO / 2) + (RAND() % RTO)

With the help of prandom_u32_max(), we don't need to open code
our own global PRNG, but can instead just make use of the per
CPU implementation of prandom with better quality numbers. Also,
we can now spare us the conditional for divide by zero check
since no div or mod operation needs to be used. Note that
prandom_u32_max() won't emit the same result as a mod operation,
but we really don't care here as we only want to have a random
number scaled into RTO interval.

Note, exponential RTO backoff is handeled elsewhere, namely in
sctp_do_8_2_transport_strike().

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'be2net'
David S. Miller [Thu, 3 Jul 2014 01:41:05 +0000 (18:41 -0700)]
Merge branch 'be2net'

Sathya Perla says:

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

v2 change: merged 2 lines into one in patch 4

Patch 1 refactors be_cmd_get_profile_config() routine to reduce
code duplication by using the be_cmd_notify_wait() routine, instead
of using a separate variant of the code for MBOX and MCCQ.

Patch 2 introduces the required FW-cmd code in the PF to query
RSS support on a VF. This is in preparation for patch 3.

Patch 3 adds support for the PF driver to re-configure the resource
distribution in FW based on the number of VFs enabled by the user. When
the user is not interested in enabling VFs, all resources of a port are
set-aside for the PF. If less than maximum number of VFs are enabled, then
each VF gets a better share of the resources and can now enable RSS (if
the interface supports it.)

Patch 4 is a minor fix to re-enable HW vlan filtering as soon as the number
of vlans programmed is within the HW limit.

Please consider applying to net-next tree. Thanks!
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobe2net: re-enable vlan filtering mode asap
Kalesh AP [Mon, 30 Jun 2014 07:31:33 +0000 (13:01 +0530)]
be2net: re-enable vlan filtering mode asap

While adding vlans, when the HW limit of vlan filters is reached, the
driver enables vlan promiscuous mode.
Similarily, while removing vlans, the driver must re-enable HW filtering
as soon as the number of vlan filters is within the HW limit.

Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobe2net: create optimal number of queues on SR-IOV config
Vasundhara Volam [Mon, 30 Jun 2014 07:31:32 +0000 (13:01 +0530)]
be2net: create optimal number of queues on SR-IOV config

If SR-IOV is enabled in the adapter, the FW distributes queue resources
evenly across the PF and it's VFs. If the user is not interested in enabling
VFs, the queues set aside for VFs are wasted.
This patch adds support for the PF driver to re-configure the resource
distribution in FW based on the number of VFs enabled by the user.
This also allows for supporting RSS queues on VFs, when less number of VFs
are enabled per PF. When maximum number of VFs are enabled, each VF typically
gets only one RXQ.

Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobe2net: read VF's capabilities from GET_PROFILE_CONFIG cmd
Vasundhara Volam [Mon, 30 Jun 2014 07:31:31 +0000 (13:01 +0530)]
be2net: read VF's capabilities from GET_PROFILE_CONFIG cmd

The PF driver must query the FW for VF's interface capabilities
to know if the VF is RSS capable or not.
This patch is in preparation for enabling RSS on VFs on Skyhawk-R.

Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobe2net: remove be_cmd_get_profile_config_mbox/mccq() variants
Vasundhara Volam [Mon, 30 Jun 2014 07:31:30 +0000 (13:01 +0530)]
be2net: remove be_cmd_get_profile_config_mbox/mccq() variants

Fix be_cmd_get_profile_cmd() to use be_cmd_notify_wait() routine,
which uses MBOX if MCCQ has not been created. Doing this reduces
code duplication; we don't need the _mbox/_mccq() variants anymore.

Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agodrivers/net/hyperv/netvsc.c: remove unnecessary null test before kfree
Fabian Frederick [Sat, 28 Jun 2014 18:44:19 +0000 (20:44 +0200)]
drivers/net/hyperv/netvsc.c: remove unnecessary null test before kfree

Fix checkpatch warning:
WARNING: kfree(NULL) is safe this check is probably not required

Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: netdev@vger.kernel.org
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agosh_eth: remove checks around dev_kfree_skb() calls
Sergei Shtylyov [Sat, 28 Jun 2014 00:10:00 +0000 (04:10 +0400)]
sh_eth: remove checks around dev_kfree_skb() calls

Since consume_skb() (and hence dev_kfree_skb() macro) checks the passed pointer
for NULL, there's no need to check for NULL before invoking dev_kfree_skb().

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMAINTAINERS: Update tg3 maintainer
Prashant Sreedharan [Fri, 27 Jun 2014 23:21:50 +0000 (16:21 -0700)]
MAINTAINERS: Update tg3 maintainer

Signed-off-by: Prashant Sreedharan <prashant@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'qlcnic-next'
David S. Miller [Thu, 3 Jul 2014 00:11:00 +0000 (17:11 -0700)]
Merge branch 'qlcnic-next'

Harish Patil says:

====================
qlcnic: Enhance Tx timeout debug data collection.

The following set of patches are for enhancing Tx timeout debug collection

- Collect a firmware dump on first Tx timeout if netif_msg_tx_err() is set
- Log Receive and Status ring info on Tx timeout, in addition to Tx ring info
- Log additional Tx ring info if netif_msg_tx_err() is set
- Update driver version to 5.3.61

Please apply this series to net-next.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoqlcnic: Update version to 5.3.61
Harish Patil [Fri, 27 Jun 2014 23:01:39 +0000 (19:01 -0400)]
qlcnic: Update version to 5.3.61

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoqlcnic: Enhance Tx timeout debug data collection.
Harish Patil [Fri, 27 Jun 2014 23:01:38 +0000 (19:01 -0400)]
qlcnic: Enhance Tx timeout debug data collection.

- Collect a firmware dump on first Tx timeout if netif_msg_tx_err() is set
- Log Receive and Status ring info on Tx timeout, in addition to Tx ring info
- Log additional Tx ring info if netif_msg_tx_err() is set

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet/caif/caif_socket.c: remove unnecessary null test before debugfs_remove_recursive
Fabian Frederick [Fri, 27 Jun 2014 21:07:43 +0000 (23:07 +0200)]
net/caif/caif_socket.c: remove unnecessary null test before debugfs_remove_recursive

based on checkpatch:
"debugfs_remove_recursive(NULL) is safe this check is probably not required"

Cc: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agodrivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c: remove unnecessary null test before...
Fabian Frederick [Fri, 27 Jun 2014 20:51:52 +0000 (22:51 +0200)]
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c: remove unnecessary null test before debugfs_remove_recursive

Fix checkpatch warning:
"WARNING: debugfs_remove_recursive(NULL) is safe this check is probably not required"

Cc: Hariprasad S <hariprasad@chelsio.com>
Cc: netdev@vger.kernel.org
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoinet: move ipv6only in sock_common
Eric Dumazet [Fri, 27 Jun 2014 15:36:16 +0000 (08:36 -0700)]
inet: move ipv6only in sock_common

When an UDP application switches from AF_INET to AF_INET6 sockets, we
have a small performance degradation for IPv4 communications because of
extra cache line misses to access ipv6only information.

This can also be noticed for TCP listeners, as ipv6_only_sock() is also
used from __inet_lookup_listener()->compute_score()

This is magnified when SO_REUSEPORT is used.

Move ipv6only into struct sock_common so that it is available at
no extra cost in lookups.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net...
David S. Miller [Wed, 2 Jul 2014 06:09:32 +0000 (23:09 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/jkirsher/net-next

Jeff Kirsher says:

====================
Intel Wired LAN Driver Updates 2014-07-01

This series contains updates to i40e, i40evf, igb and ixgbe.

Shannon adds the Base Address High and Low to the admin queue structure
to simplify the logic in the configuration routines.  Also adds code to
clear all queues and interrupts to help clean up after a PXE or other
early boot activity.

Kevin fixes mask assignment value since -1 cannot be used for unsigned
integer types.

Mitch fixes an issue where in some circumstances the reply from the PF
would come back before we were able to properly modify the admin queue
pending and required flags.  This would mess up the flags and put the
driver in an indeterminate state, so fix this by simply setting the flags
before sending the request to the admin queue.  Also changes the branding
string for i40evf to reduce confusion and to match up with our other
marketing materials.

Kamil adds a new variable defining admin send queue (ASQ) command write
back timeout to allow for dynamic modification of this timeout.

Anjali fix a bug in the flow director filter replay logic, so that we
call a replay after a sideband reset correctly.

Jesse adds code to initialize all members of the context descriptor to
prevent possible stale data.

Christopher fixes i40e to prevent writing to reserved bits, since the
queue index is only 0-127.

Jacob removes the unneeded header export.h from the i40e PTP code.
Fixes ixgbe PTP code where the PPS signal was not correct, as it
generates a one half HZ clock signal, it only generates one level
change per second.  To generate a full clock, we need two level changes
per second.

Todd provides a fix for igb to bring up link when the PHY has powered
up, which was reported by Jeff Westfahl.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobonding: allow to add vlans on top of empty bond
Jiri Pirko [Fri, 27 Jun 2014 14:13:12 +0000 (16:13 +0200)]
bonding: allow to add vlans on top of empty bond

This limitation maybe had some reason in the past, but now there is not
one -> removing this.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Acked-by: Veaceslav Falico <vfalico@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'cxgb4-next'
David S. Miller [Wed, 2 Jul 2014 01:56:15 +0000 (18:56 -0700)]
Merge branch 'cxgb4-next'

Hariprasad Shenai says:

====================
cxgb4: Fix for PCI passthrough and some Misc. fixes

This patch series fixes probe failure in VM when PF is exposed through PCI
Passthrough. Adds support to use firmware interface to get BAR0 value.
Replace the backdoor mechanism to access the HW memory with PCIe Window method
which fixes memory I/O. Also adds device ID of few more adapters for cxgb4 and
cxgb4vf driver.

The patches series is created against 'net-next' tree.
And includes patches on cxgb4, cxgb4vf and iw_cxgb4 driver.

Since this patch-series contains mainly cxgb4 related changes, we would like to
request this patch series to get merged via David Miller's 'net-next' tree.

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: David S. Miller <davem@davemloft.net>
10 years agocxgb4vf: Adds device ID for few more Chelsio T4 Adapters
Hariprasad Shenai [Fri, 27 Jun 2014 13:53:51 +0000 (19:23 +0530)]
cxgb4vf: Adds device ID for few more Chelsio T4 Adapters

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agocxgb4: Adds device ID for few more Chelsio T4 Adapters
Hariprasad Shenai [Fri, 27 Jun 2014 13:53:50 +0000 (19:23 +0530)]
cxgb4: Adds device ID for few more Chelsio T4 Adapters

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agocxgb4: Replaced the backdoor mechanism to access the HW memory with PCIe Window method
Hariprasad Shenai [Fri, 27 Jun 2014 13:53:49 +0000 (19:23 +0530)]
cxgb4: Replaced the backdoor mechanism to access the HW memory with PCIe Window method

Rip out a bunch of redundant PCI-E Memory Window Read/Write routines,
collapse the more general purpose routines into a single routine
thereby eliminating the need for a large stack frame (and extra data
copying) in the outer routine, change everything to use the improved
routine t4_memory_rw.

Based on origninal work by Casey Leedom <leedom@chelsio.com> and
Steve Wise <swise@opengridcomputing.com>

Signed-off-by: Casey Leedom <leedom@chelsio.com>
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agocxgb4: Use FW interface to get BAR0 value
Hariprasad Shenai [Fri, 27 Jun 2014 13:53:48 +0000 (19:23 +0530)]
cxgb4: Use FW interface to get BAR0 value

Use the firmware interface to get the BAR0 value since we really don't want
to use the PCI-E Configuration Space Backdoor access which is owned by the
firmware.

Set up PCI-E Memory Window registers using the true values programmed into
BAR registers.  When the PF4 "Master Function" is exported to a Virtual
Machine, the values returned by pci_resource_start() will be for the
synthetic PCI-E Configuration Space and not the real addresses. But we need
to program the PCI-E Memory Window address decoders with the real addresses
that we're going to be using in order to have accesses through the Memory
Windows work.

Based on origninal work by Casey Leedom <leedom@chelsio.com>

Signed-off-by: Casey Leedom <leedom@chelsio.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agordma/cxgb4: Fixes cxgb4 probe failure in VM when PF is exposed through PCI Passthrough
Hariprasad Shenai [Fri, 27 Jun 2014 13:53:47 +0000 (19:23 +0530)]
rdma/cxgb4: Fixes cxgb4 probe failure in VM when PF is exposed through PCI Passthrough

Change logic which determines our Physical Function at PCI Probe time.
Now we read the PL_WHOAMI register and get the Physical Function.

Pass Physical Function to Upper Layer Drivers in lld_info structure in the
new field "pf" added to lld_info.  This is useful for the cases where the
PF, say PF4, is attached to a Virtual Machine via some form of "PCI
Pass Through" technology and the PCI Function shows up as PF0 in the VM.

Based on original work by Casey Leedom <leedom@chelsio.com>

Signed-off-by: Casey Leedom <leedom@chelsio.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'dp83640-next'
David S. Miller [Wed, 2 Jul 2014 01:53:01 +0000 (18:53 -0700)]
Merge branch 'dp83640-next'

Stefan Sørensen says:

====================
dp83640: Increase support perout pins

This patch series increases the number of periodic output pins supported
on the dp83640 to 7, and allows for reprogramming the calibration pin.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoptp: Allow reassigning calibration pin function
Stefan Sørensen [Fri, 27 Jun 2014 10:05:33 +0000 (12:05 +0200)]
ptp: Allow reassigning calibration pin function

The ptp pin function programming does not allow calibration pin to change
function. This is problematic on hardware that uses the default calibration
pin for other purposes.

Removing this limitation does not impact calibration if userspace does not
reprogram the calibration pin.

Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agodp83640: Get calibration pin with ptp_find_pin
Stefan Sørensen [Fri, 27 Jun 2014 10:05:32 +0000 (12:05 +0200)]
dp83640: Get calibration pin with ptp_find_pin

For consistency, use the ptp_find_pin function to get the calibration pin,
not gpio_tab.

Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agodp83640: Verify calibration pin assignment
Stefan Sørensen [Fri, 27 Jun 2014 10:05:31 +0000 (12:05 +0200)]
dp83640: Verify calibration pin assignment

This constraints the pin assignment to not allow the calibration function to
be reassigned and only allow reassigning the calibratin pin if only one phy is
connected.

Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agodp83640: Increase supported perout pins to 7
Stefan Sørensen [Fri, 27 Jun 2014 10:05:30 +0000 (12:05 +0200)]
dp83640: Increase supported perout pins to 7

This patch increases the number of supported periodic output pins from
1 to 7. The last pin is reserved for sync.

Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agodp83640: Program pulsewidth2 values of perout triggers 0 and 1
Stefan Sørensen [Fri, 27 Jun 2014 10:05:29 +0000 (12:05 +0200)]
dp83640: Program pulsewidth2 values of perout triggers 0 and 1

Periodic output triggers 0 and 1 of the dp83640 has a programmable
duty-cycle which is controlled by the Pulsewidth2 field of the trigger
data register.  This field is not documented in the datasheet, but it
is described in the "PHYTER Software Development Guide" section
3.1.4.1. Failing to set the field can result in unstable/no trigger
output.

Add programming of the Pulsewidth2 field, setting it to the same value
as the Pulsewidth field for a 50% duty cycle.

Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'bnx2x-next'
David S. Miller [Tue, 1 Jul 2014 22:52:37 +0000 (15:52 -0700)]
Merge branch 'bnx2x-next'

Yuval Mintz says:

====================
bnx2x: Enhancement patch series

This patch series introduces the ability to propagate link parameters
to VFs as well as control the VF link via hypervisor.

In addition, it contains 2 small improvements [one IOV-related and the
other improves performance on machines with short cache lines].

Please consider applying these patches to `net-next'.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobnx2x: Fail probe of VFs using an old incompatible driver
Yuval Mintz [Thu, 26 Jun 2014 11:31:06 +0000 (14:31 +0300)]
bnx2x: Fail probe of VFs using an old incompatible driver

There are linux distributions where the inbox bnx2x driver contains SRIOV
support but doesn't contain the changes introduced in b9871bcf
"bnx2x: VF RSS support - PF side".

A VF in a VM running that distribution over a new hypervisor will access
incorrect addresses when trying to transmit packets, causing an attention
in the hypervisor and making that VF inactive until FLRed.

The driver in the VM has to ne upgraded [no real way to overcome this], but
due to the HW attention currently arising upgrading the driver in the VM
would not suffice [since the VF needs also be FLRed if the previous driver
was already loaded].

This patch causes the PF to fail the acquire message from a VF running an
old problematic driver; The VF will then gracefully fail it's probe preventing
the HW attention [and allow clean upgrade of driver in VM].

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobnx2x: enlarge minimal alignemnt of data offset
Dmitry Kravkov [Thu, 26 Jun 2014 11:31:05 +0000 (14:31 +0300)]
bnx2x: enlarge minimal alignemnt of data offset

This improves the performance of driver on machine with L1_CACHE_SHIFT of at
most 32 bytes [HW was planned for 64-byte aligned fastpath data].

Signed-off-by: Dmitry Kravkov <Dmitry.Kravkov@qlogic.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobnx2x: VF can report link speed
Dmitry Kravkov [Thu, 26 Jun 2014 11:31:04 +0000 (14:31 +0300)]
bnx2x: VF can report link speed

Until now VFs were oblvious to the actual configured link parameters.
This patch does 2 things:

  1. It enables a PF to inform its VF using the bulletin board of the link
     configured, and allows the VF to present that information.

  2. It adds support of `ndo_set_vf_link_state', allowing the hypervisor
     to set the VF link state.

Signed-off-by: Dmitry Kravkov <Dmitry.Kravkov@qlogic.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'pktgen'
David S. Miller [Tue, 1 Jul 2014 22:50:56 +0000 (15:50 -0700)]
Merge branch 'pktgen'

Jesper Dangaard Brouer says:

====================
Optimizing pktgen for single CPU performance

This series focus on optimizing "pktgen" for single CPU performance.

V2-series:
 - Removed some patches
 - Doc real reason for TX ring buffer filling up

NIC tuning for pktgen:
 http://netoptimizer.blogspot.dk/2014/06/pktgen-for-network-overload-testing.html

General overload setup according to:
 http://netoptimizer.blogspot.dk/2014/04/basic-tuning-for-network-overload.html

Hardware:
 System: CPU E5-2630
 NIC: Intel ixgbe/82599 chip

Testing done with net-next git tree on top of
 commit 6623b41944 ("Merge branch 'master' of...jkirsher/net-next")

Pktgen script exercising race condition:
 https://github.com/netoptimizer/network-testing/blob/master/pktgen/unit_test01_race_add_rem_device_loop.sh

Tool for measuring LOCK overhead:
 https://github.com/netoptimizer/network-testing/blob/master/src/overhead_cmpxchg.c
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agopktgen: RCU-ify "if_list" to remove lock in next_to_run()
Jesper Dangaard Brouer [Thu, 26 Jun 2014 11:16:59 +0000 (13:16 +0200)]
pktgen: RCU-ify "if_list" to remove lock in next_to_run()

The if_lock()/if_unlock() in next_to_run() adds a significant
overhead, because its called for every packet in busy loop of
pktgen_thread_worker().  (Thomas Graf originally pointed me
at this lock problem).

Removing these two "LOCK" operations should in theory save us approx
16ns (8ns x 2), as illustrated below we do save 16ns when removing
the locks and introducing RCU protection.

Performance data with CLONE_SKB==100000, TX-size=512, rx-usecs=30:
 (single CPU performance, ixgbe 10Gbit/s, E5-2630)
 * Prev   : 5684009 pps --> 175.93ns (1/5684009*10^9)
 * RCU-fix: 6272204 pps --> 159.43ns (1/6272204*10^9)
 * Diff   : +588195 pps --> -16.50ns

To understand this RCU patch, I describe the pktgen thread model
below.

In pktgen there is several kernel threads, but there is only one CPU
running each kernel thread.  Communication with the kernel threads are
done through some thread control flags.  This allow the thread to
change data structures at a know synchronization point, see main
thread func pktgen_thread_worker().

Userspace changes are communicated through proc-file writes.  There
are three types of changes, general control changes "pgctrl"
(func:pgctrl_write), thread changes "kpktgend_X"
(func:pktgen_thread_write), and interface config changes "etcX@N"
(func:pktgen_if_write).

Userspace "pgctrl" and "thread" changes are synchronized via the mutex
pktgen_thread_lock, thus only a single userspace instance can run.
The mutex is taken while the packet generator is running, by pgctrl
"start".  Thus e.g. "add_device" cannot be invoked when pktgen is
running/started.

All "pgctrl" and all "thread" changes, except thread "add_device",
communicate via the thread control flags.  The main problem is the
exception "add_device", that modifies threads "if_list" directly.

Fortunately "add_device" cannot be invoked while pktgen is running.
But there exists a race between "rem_device_all" and "add_device"
(which normally don't occur, because "rem_device_all" waits 125ms
before returning). Background'ing "rem_device_all" and running
"add_device" immediately allow the race to occur.

The race affects the threads (list of devices) "if_list".  The if_lock
is used for protecting this "if_list".  Other readers are given
lock-free access to the list under RCU read sections.

Note, interface config changes (via proc) can occur while pktgen is
running, which worries me a bit.  I'm assuming proc_remove() takes
appropriate locks, to assure no writers exists after proc_remove()
finish.

I've been running a script exercising the race condition (leading me
to fix the proc_remove order), without any issues.  The script also
exercises concurrent proc writes, while the interface config is
getting removed.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Reviewed-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agopktgen: avoid expensive set_current_state() call in loop
Jesper Dangaard Brouer [Thu, 26 Jun 2014 11:16:49 +0000 (13:16 +0200)]
pktgen: avoid expensive set_current_state() call in loop

Avoid calling set_current_state() inside the busy-loop in
pktgen_thread_worker().  In case of pkt_dev->delay, then it is still
used/enabled in pktgen_xmit() via the spin() call.

The set_current_state(TASK_INTERRUPTIBLE) uses a xchg, which implicit
is LOCK prefixed.  I've measured the asm LOCK operation to take approx
8ns on this E5-2630 CPU.  Performance increase corrolate with this
measurement.

Performance data with CLONE_SKB==100000, rx-usecs=30:
 (single CPU performance, ixgbe 10Gbit/s, E5-2630)
 * Prev:  5454050 pps --> 183.35ns (1/5454050*10^9)
 * Now:   5684009 pps --> 175.93ns (1/5684009*10^9)
 * Diff:  +229959 pps -->  -7.42ns

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agopktgen: document tuning for max NIC performance
Jesper Dangaard Brouer [Thu, 26 Jun 2014 11:16:27 +0000 (13:16 +0200)]
pktgen: document tuning for max NIC performance

Using pktgen I'm seeing the ixgbe driver "push-back", due TX ring
running full.  Thus, the TX ring is artificially limiting pktgen.
(Diagnose via "ethtool -S", look for "tx_restart_queue" or "tx_busy"
counters.)

Using ixgbe, the real reason behind the TX ring running full, is due
to TX ring not being cleaned up fast enough. The ixgbe driver combines
TX+RX ring cleanups, and the cleanup interval is affected by the
ethtool --coalesce setting of parameter "rx-usecs".

Do not increase the default NIC TX ring buffer or default cleanup
interval.  Instead simply document that pktgen needs special NIC
tuning for maximum packet per sec performance.

Performance results with pktgen with clone_skb=100000.
TX ring size 512 (default), adjusting "rx-usecs":
 (Single CPU performance, E5-2630, ixgbe)
 - 3935002 pps - rx-usecs:  1 (irqs:  9346)
 - 5132350 pps - rx-usecs: 10 (irqs: 99157)
 - 5375111 pps - rx-usecs: 20 (irqs: 50154)
 - 5454050 pps - rx-usecs: 30 (irqs: 33872)
 - 5496320 pps - rx-usecs: 40 (irqs: 26197)
 - 5502510 pps - rx-usecs: 50 (irqs: 21527)

TX ring size adjusting (ethtool -G), "rx-usecs==1" (default):
 - 3935002 pps - tx-size:  512
 - 5354401 pps - tx-size:  768
 - 5356847 pps - tx-size: 1024
 - 5327595 pps - tx-size: 1536
 - 5356779 pps - tx-size: 2048
 - 5353438 pps - tx-size: 4096

Notice after commit 6f25cd47d (pktgen: fix xmit test for BQL enabled
devices) pktgen uses netif_xmit_frozen_or_drv_stopped() and ignores
the BQL "stack" pause (QUEUE_STATE_STACK_XOFF) flag.  This allow us to put
more pressure on the TX ring buffers.

It is the ixgbe_maybe_stop_tx() call that stops the transmits, and
pktgen respecting this in the call to netif_xmit_frozen_or_drv_stopped(txq).

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoopenvswitch: introduce rtnl ops stub
Jiri Pirko [Thu, 26 Jun 2014 07:58:26 +0000 (09:58 +0200)]
openvswitch: introduce rtnl ops stub

This stub now allows userspace to see IFLA_INFO_KIND for ovs master and
IFLA_INFO_SLAVE_KIND for slave.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agortnetlink: allow to register ops without ops->setup set
Jiri Pirko [Thu, 26 Jun 2014 07:58:25 +0000 (09:58 +0200)]
rtnetlink: allow to register ops without ops->setup set

So far, it is assumed that ops->setup is filled up. But there might be
case that ops might make sense even without ->setup. In that case,
forbid to newlink and dellink.

This allows to register simple rtnl link ops containing only ->kind.
That allows consistent way of passing device kind (either device-kind or
slave-kind) to userspace.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: fix some typos in comment
Ying Xue [Thu, 26 Jun 2014 07:56:31 +0000 (15:56 +0800)]
net: fix some typos in comment

In commit 371121057607e3127e19b3fa094330181b5b031e("net:
QDISC_STATE_RUNNING dont need atomic bit ops") the
__QDISC_STATE_RUNNING is renamed to __QDISC___STATE_RUNNING,
but the old names existing in comment are not replaced with
the new name completely.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoipv6: Allow accepting RA from local IP addresses.
Ben Greear [Wed, 25 Jun 2014 21:44:53 +0000 (14:44 -0700)]
ipv6: Allow accepting RA from local IP addresses.

This can be used in virtual networking applications, and
may have other uses as well.  The option is disabled by
default.

A specific use case is setting up virtual routers, bridges, and
hosts on a single OS without the use of network namespaces or
virtual machines.  With proper use of ip rules, routing tables,
veth interface pairs and/or other virtual interfaces,
and applications that can bind to interfaces and/or IP addresses,
it is possibly to create one or more virtual routers with multiple
hosts attached.  The host interfaces can act as IPv6 systems,
with radvd running on the ports in the virtual routers.  With the
option provided in this patch enabled, those hosts can now properly
obtain IPv6 addresses from the radvd.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoipv6: Add more debugging around accept-ra logic.
Ben Greear [Wed, 25 Jun 2014 21:44:52 +0000 (14:44 -0700)]
ipv6: Add more debugging around accept-ra logic.

This is disabled by default, just like similar debug info
already in this module.  But, makes it easier to find out
why RA is not being accepted when debugging strange behaviour.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agob43: add more bcma cores
Rafał Miłecki [Tue, 1 Jul 2014 14:33:57 +0000 (16:33 +0200)]
b43: add more bcma cores

This adds some cores with 0x2057 radio which will be supported soon as
well as core 40 that I missed in the earlier firmware patch.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>