]> Git Repo - linux.git/log
linux.git
6 years agonet/mlx5e: Expose ethtool rss key size / indirection table functions
Or Gerlitz [Sun, 26 Aug 2018 09:53:51 +0000 (12:53 +0300)]
net/mlx5e: Expose ethtool rss key size / indirection table functions

Towards enabling RSS for the vport representors, expose the functions for
querying the rss hash key size and indirection table size via ethtool.

Signed-off-by: Or Gerlitz <[email protected]>
Reviewed-by: Or Gerlitz <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
6 years agonet/mlx5e: Expose function for building RSS params
Gavi Teitz [Sun, 19 Aug 2018 12:01:13 +0000 (15:01 +0300)]
net/mlx5e: Expose function for building RSS params

Towards enabling RSS for the vport representors, extract the
procedure for building a device's RSS params, and expose the
function.

Signed-off-by: Gavi Teitz <[email protected]>
Reviewed-by: Or Gerlitz <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
6 years agonet/mlx5e: Provide explicit directive if to create inner indirect tirs
Or Gerlitz [Tue, 28 Aug 2018 17:53:55 +0000 (20:53 +0300)]
net/mlx5e: Provide explicit directive if to create inner indirect tirs

Change the driver functions that deal with creating indirect tirs
to get a flag telling if inner ttc is desired.

A pre-step for enabling rss on the vport representors, where
inner ttc is not needed.

Signed-off-by: Or Gerlitz <[email protected]>
Reviewed-by: Or Gerlitz <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
6 years agonet/mlx5: E-Switch, Provide flow dest when creating vport rx rule
Gavi Teitz [Thu, 16 Aug 2018 21:28:53 +0000 (00:28 +0300)]
net/mlx5: E-Switch, Provide flow dest when creating vport rx rule

Currently the destination for the representor e-switch rx rule is
a TIR number. Towards changing that to potentially be a flow table,
as part of enabling RSS for representors, modify the signature of
the related e-switch API to get a flow destination.

Signed-off-by: Gavi Teitz <[email protected]>
Reviewed-by: Or Gerlitz <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
6 years agonet/mlx5e: Extract creation of rep's default flow rule
Gavi Teitz [Sun, 19 Aug 2018 11:08:27 +0000 (14:08 +0300)]
net/mlx5e: Extract creation of rep's default flow rule

Cleaning up the flow of the representors' rx initialization, towards
enabling RSS for the representors.

Signed-off-by: Gavi Teitz <[email protected]>
Reviewed-by: Or Gerlitz <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
6 years agonet/mlx5e: Enable stateless offloads for VF representor netdevs
Gavi Teitz [Thu, 16 Aug 2018 12:12:27 +0000 (15:12 +0300)]
net/mlx5e: Enable stateless offloads for VF representor netdevs

Enabled checksum and TSO offloads for the representors, in
order to increase their performance, which is required to
increase the performance of flows that cannot be offloaded.

Checksum offloads contribute to a general acceleration of all
traffic (to around 150%), whereas the TSO offload contributes
to a prominent acceleration of the representor's TX for traffic
flows with larger than MTU sized packets (to around 200%). This
is the usual case for TCP streams, as the PF, which serves as
the uplink representor, and the VF representors employ GRO before
forwarding the packets to the representor.

GRO was enabled implicitly for the representors beforehand, and
is explicitly enabled here to ensure that the representors preserve
the performance boost it provides (of around 200%) when working in
tandem with the TSO offload by the forwardee, which is the standard
case as both the PF and the VF representors employ HW TSO.

The impact of these changes can be seen in the following
measurements taken on a setup of a VM over a VF, connected
to OVS via the VF representor, to an external host:

Before current changes:
                     TCP Throughput [Gb/s]
External host to VM         ~ 10.5
VM to external host         ~ 23.5

With just checksum offloads enabled:
                     TCP Throughput [Gb/s]
External host to VM         ~ 14.9
VM to external host         ~ 28.5

With the TSO offload also enabled:
                     TCP Throughput [Gb/s]
External host to VM         ~ 30.5

Signed-off-by: Gavi Teitz <[email protected]>
Reviewed-by: Or Gerlitz <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
6 years agonet/mlx5e: Change VF representors' RQ type
Gavi Teitz [Thu, 16 Aug 2018 11:25:24 +0000 (14:25 +0300)]
net/mlx5e: Change VF representors' RQ type

The representors' RQ size was not large enough for them to achieve
high enough performance, and therefore needed to be enlarged, while
suffering a minimum hit to its memory usage. To achieve this the
representors RQ size was increased, and its type was changed to be a
striding RQ if it is supported.

Towards that goal the following changes were made:

* Extracted the sequence for setting the standard netdev's RQ parmas
  into a function

* Replaced the sequence for setting the representor's RQ params with
  the standard sequence

The impact of this change can be seen in the following measurements
taken on a setup of a VM over a VF, connected to OVS via the VF
representor, to an external host:

Before current change:
                     TCP Throughput [Gb/s]
VM to external host         ~  7.2

With the current change (measured with a striding RQ):
                     TCP Throughput [Gb/s]
VM to external host         ~ 23.5

Each representor now consumes 2 [MB] of memory for its packet
buffers.

Signed-off-by: Gavi Teitz <[email protected]>
Reviewed-by: Or Gerlitz <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
6 years agonet/mlx5e: Ethtool steering, Support masks for l3/l4 filters
Or Gerlitz [Thu, 16 Aug 2018 18:38:22 +0000 (21:38 +0300)]
net/mlx5e: Ethtool steering, Support masks for l3/l4 filters

Allow using partial masks for L3 addresses and L4 ports across
the place.

Signed-off-by: Or Gerlitz <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
6 years agoMerge tag 'iwlwifi-next-for-kalle-2018-09-28' of git://git.kernel.org/pub/scm/linux...
Kalle Valo [Mon, 1 Oct 2018 15:49:48 +0000 (18:49 +0300)]
Merge tag 'iwlwifi-next-for-kalle-2018-09-28' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

Second set of iwlwifi patches for 4.20

* TKIP implementation in new devices;
* Fix for the shared antenna setting in 22000 series;
* Report that we set the RU offset in HE code;
* Fix some register addresses in 22000 series;
* Fix one FW feature TLV that had a conflict with another value;
* A couple of fixes for SoftAP mode;
* Work continues for new 22560 hardware;
* Some fixes in the datapath;
* Some debugging and other general fixes;
* Some cleanups, small improvements and other general fixes;

6 years agob43: fix spelling mistake "hw_registred" -> "hw_registered"
Colin Ian King [Thu, 27 Sep 2018 16:11:19 +0000 (17:11 +0100)]
b43: fix spelling mistake "hw_registred" -> "hw_registered"

Trivial fix to spelling mistake struct field name, rename it.

Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
6 years agoqtnfmac_pcie: check for correct CHIP ID at pcie probe
Igor Mitsyanko [Mon, 24 Sep 2018 22:15:14 +0000 (15:15 -0700)]
qtnfmac_pcie: check for correct CHIP ID at pcie probe

Make sure that wifi device is of supported variant by checking it's CHIP ID
before completing a probe sequence.

Signed-off-by: Igor Mitsyanko <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
6 years agoqtnfmac: wait for FW load work to finish at PCIe remove
Igor Mitsyanko [Mon, 24 Sep 2018 22:15:13 +0000 (15:15 -0700)]
qtnfmac: wait for FW load work to finish at PCIe remove

Waiting for "completion" to be set in FW load thread can not be used
in case PCIe remove is called before FW load work was scheduled.
Just wait for work completion instead to avoid problems.

Signed-off-by: Igor Mitsyanko <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
6 years agoqtnfmac_pcie: extract platform-independent PCIe code
Igor Mitsyanko [Mon, 24 Sep 2018 22:15:12 +0000 (15:15 -0700)]
qtnfmac_pcie: extract platform-independent PCIe code

Extract platform-independent PCIe driver code into a separate file, and
use it from platform-specific modules.

Signed-off-by: Igor Mitsyanko <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
6 years agoqtnfmac: add missing header includes to bus.h
Igor Mitsyanko [Mon, 24 Sep 2018 22:15:11 +0000 (15:15 -0700)]
qtnfmac: add missing header includes to bus.h

A few include directives were missing in bus.h resulting in dependency
of include order in other modules. Add missing includes.

Signed-off-by: Igor Mitsyanko <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
6 years agoqtnfmac_pcie: rename platform-specific functions
Igor Mitsyanko [Mon, 24 Sep 2018 22:15:10 +0000 (15:15 -0700)]
qtnfmac_pcie: rename platform-specific functions

Rename several functions to indicate that they are platform specific.

Signed-off-by: Igor Mitsyanko <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
6 years agoqtnfmac_pcie: separate platform-independent PCIe structure
Igor Mitsyanko [Mon, 24 Sep 2018 22:15:09 +0000 (15:15 -0700)]
qtnfmac_pcie: separate platform-independent PCIe structure

Move platform-independent PCIe data structure to a separate header file
so it can be reused by different devices.

Signed-off-by: Igor Mitsyanko <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
6 years agoqtnfmac_pcie: pearl: rename spinlock tx0_lock to tx_lock
Igor Mitsyanko [Mon, 24 Sep 2018 22:15:08 +0000 (15:15 -0700)]
qtnfmac_pcie: pearl: rename spinlock tx0_lock to tx_lock

tx_lock name will later be reused when common pcie code is extracted to
separate files.

Signed-off-by: Igor Mitsyanko <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
6 years agoqtnfmac_pcie: indicate pearl-specific structures by their names
Igor Mitsyanko [Mon, 24 Sep 2018 22:15:07 +0000 (15:15 -0700)]
qtnfmac_pcie: indicate pearl-specific structures by their names

In preparation to extract common PCIe driver state, indicate
PEARL-specific structures by their name and move them to pearl-specific
source file.

Signed-off-by: Igor Mitsyanko <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
6 years agoqtnfmac_pcie: rename private Pearl PCIe state structure
Igor Mitsyanko [Mon, 24 Sep 2018 22:15:06 +0000 (15:15 -0700)]
qtnfmac_pcie: rename private Pearl PCIe state structure

In preparation to extract common pcie driver state into a separate
structure, rename Pearl-specific state to qtnf_pcie_pearl_state and move
it directly to pearl-specific PCIe source file.

Signed-off-by: Igor Mitsyanko <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
6 years agoqtnfmac_pcie: move Pearl pcie sources to pcie-specific directory
Igor Mitsyanko [Mon, 24 Sep 2018 22:15:05 +0000 (15:15 -0700)]
qtnfmac_pcie: move Pearl pcie sources to pcie-specific directory

In preparation to extract common qtnfmac PCIe driver sources into a
separate file, move existing Pearl-specific pcie driver sources to pcie/
directory.

Signed-off-by: Igor Mitsyanko <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
6 years agoqtnfmac_pcie: do not store FW name in driver state structure
Igor Mitsyanko [Mon, 24 Sep 2018 22:15:04 +0000 (15:15 -0700)]
qtnfmac_pcie: do not store FW name in driver state structure

Firmware name is only needed at probe stage, no point in keeping it in
driver state structure.

Signed-off-by: Igor Mitsyanko <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
6 years agort2800: flush and txstatus rework for rt2800mmio
Stanislaw Gruszka [Wed, 26 Sep 2018 10:24:57 +0000 (12:24 +0200)]
rt2800: flush and txstatus rework for rt2800mmio

Implement custom rt2800mmio flush routine and change txstatus
routine to read TX_STA_FIFO also in the tasklet.

Signed-off-by: Stanislaw Gruszka <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
6 years agort2x00: use different txstatus timeouts when flushing
Stanislaw Gruszka [Wed, 26 Sep 2018 10:24:56 +0000 (12:24 +0200)]
rt2x00: use different txstatus timeouts when flushing

Use different tx status timeouts for normal operation and when flushing.
This increase timeout to 2s for normal operation as when there are bad
radio conditions and frames are reposted many times device can not provide
the status for quite long. With new timeout we can still get valid status
on such bad conditions.

Signed-off-by: Stanislaw Gruszka <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
6 years agort2x00: do not check for txstatus timeout every time on tasklet
Stanislaw Gruszka [Wed, 26 Sep 2018 10:24:55 +0000 (12:24 +0200)]
rt2x00: do not check for txstatus timeout every time on tasklet

Do not check for tx status timeout everytime we perform txstatus tasklet.
Perform check once per half a second.

Signed-off-by: Stanislaw Gruszka <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
6 years agort2800mmio: use txdone/txstatus routines from lib
Stanislaw Gruszka [Wed, 26 Sep 2018 10:24:54 +0000 (12:24 +0200)]
rt2800mmio: use txdone/txstatus routines from lib

Use usb txdone/txstatus routines (now in rt2800libc) for mmio devices.

Note this also change how we handle INT_SOURCE_CSR_TX_FIFO_STATUS
interrupt. Now it is disabled since IRQ routine till end of the txstatus
tasklet (the same behaviour like others interrupts). Reason to do not
disable this interrupt was not to miss any tx status from 16 entries
FIFO register. Now, since we check for tx status timeout, we can
allow to miss some tx statuses. However this will be improved in further
patch where I also implement read status FIFO register in the tasklet.

Signed-off-by: Stanislaw Gruszka <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
6 years agort2800: move usb specific txdone/txstatus routines to rt2800lib
Stanislaw Gruszka [Wed, 26 Sep 2018 10:24:53 +0000 (12:24 +0200)]
rt2800: move usb specific txdone/txstatus routines to rt2800lib

In order to reuse usb txdone/txstatus routines for mmio, move them
to common rt2800lib.c file.

Signed-off-by: Stanislaw Gruszka <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
6 years agortlwifi: btcoex: Use proper enumerated types for Wi-Fi only interface
Nathan Chancellor [Sun, 23 Sep 2018 06:31:15 +0000 (23:31 -0700)]
rtlwifi: btcoex: Use proper enumerated types for Wi-Fi only interface

Clang warns when one enumerated type is implicitly converted to another.

drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c:1327:34:
warning: implicit conversion from enumeration type 'enum
btc_chip_interface' to different enumeration type 'enum
wifionly_chip_interface' [-Wenum-conversion]
                wifionly_cfg->chip_interface = BTC_INTF_PCI;
                                             ~ ^~~~~~~~~~~~
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c:1330:34:
warning: implicit conversion from enumeration type 'enum
btc_chip_interface' to different enumeration type 'enum
wifionly_chip_interface' [-Wenum-conversion]
                wifionly_cfg->chip_interface = BTC_INTF_USB;
                                             ~ ^~~~~~~~~~~~
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c:1333:34:
warning: implicit conversion from enumeration type 'enum
btc_chip_interface' to different enumeration type 'enum
wifionly_chip_interface' [-Wenum-conversion]
                wifionly_cfg->chip_interface = BTC_INTF_UNKNOWN;
                                             ~ ^~~~~~~~~~~~~~~~
3 warnings generated.

Use the values from the correct enumerated type, wifionly_chip_interface.

BTC_INTF_UNKNOWN = WIFIONLY_INTF_UNKNOWN = 0
BTC_INTF_PCI = WIFIONLY_INTF_PCI = 1
BTC_INTF_USB = WIFIONLY_INTF_USB = 2

Link: https://github.com/ClangBuiltLinux/linux/issues/135
Signed-off-by: Nathan Chancellor <[email protected]>
Acked-by: Ping-Ke Shih <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
6 years agoath5k: Remove unused BUG_ON
Nathan Chancellor [Fri, 21 Sep 2018 19:32:36 +0000 (12:32 -0700)]
ath5k: Remove unused BUG_ON

Clang warns that the address of a pointer will always evaluated as true
in a boolean context:

drivers/net/wireless/ath/ath5k/debug.c:1031:14: warning: address of
array 'ah->sbands' will always evaluate to 'true'
[-Wpointer-bool-conversion]
        BUG_ON(!ah->sbands);
               ~~~~~^~~~~~
./include/asm-generic/bug.h:61:45: note: expanded from macro 'BUG_ON'
#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                                            ^~~~~~~~~
./include/linux/compiler.h:77:42: note: expanded from macro 'unlikely'
# define unlikely(x)    __builtin_expect(!!(x), 0)
                                            ^
1 warning generated.

Given that this condition is always false because of the logical not,
just remove it.

Link: https://github.com/ClangBuiltLinux/linux/issues/130
Signed-off-by: Nathan Chancellor <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
6 years agorsi: Remove unnecessary boolean condition
Nathan Chancellor [Fri, 21 Sep 2018 09:48:29 +0000 (02:48 -0700)]
rsi: Remove unnecessary boolean condition

Clang warns that the address of a pointer will always evaluated as true
in a boolean context.

drivers/net/wireless/rsi/rsi_91x_mac80211.c:927:50: warning: address of
array 'key->key' will always evaluate to 'true'
[-Wpointer-bool-conversion]
        if (vif->type == NL80211_IFTYPE_STATION && key->key &&
                                                ~~ ~~~~~^~~
1 warning generated.

Link: https://github.com/ClangBuiltLinux/linux/issues/136
Signed-off-by: Nathan Chancellor <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
6 years agoipw2x00: Remove unnecessary parentheses
Nathan Chancellor [Thu, 20 Sep 2018 20:45:49 +0000 (13:45 -0700)]
ipw2x00: Remove unnecessary parentheses

Clang warns when multiple pairs of parentheses are used for a single
conditional statement.

drivers/net/wireless/intel/ipw2x00/ipw2200.c:5655:28: warning: equality
comparison with extraneous parentheses [-Wparentheses-equality]
                if ((priv->ieee->iw_mode == IW_MODE_ADHOC)) {
                     ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
drivers/net/wireless/intel/ipw2x00/ipw2200.c:5655:28: note: remove
extraneous parentheses around the comparison to silence this warning
                if ((priv->ieee->iw_mode == IW_MODE_ADHOC)) {
                    ~                    ^               ~
drivers/net/wireless/intel/ipw2x00/ipw2200.c:5655:28: note: use '=' to
turn this equality comparison into an assignment
                if ((priv->ieee->iw_mode == IW_MODE_ADHOC)) {
                                         ^~
                                         =
1 warning generated.

Link: https://github.com/ClangBuiltLinux/linux/issues/134
Signed-off-by: Nathan Chancellor <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
6 years agoopenvswitch: Use correct reply values in datapath and vport ops
Yifeng Sun [Wed, 26 Sep 2018 18:40:14 +0000 (11:40 -0700)]
openvswitch: Use correct reply values in datapath and vport ops

This patch fixes the bug that all datapath and vport ops are returning
wrong values (OVS_FLOW_CMD_NEW or OVS_DP_CMD_NEW) in their replies.

Signed-off-by: Yifeng Sun <[email protected]>
Acked-by: Pravin B Shelar <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agotls: Remove redundant vars from tls record structure
Vakul Garg [Wed, 26 Sep 2018 10:52:08 +0000 (16:22 +0530)]
tls: Remove redundant vars from tls record structure

Structure 'tls_rec' contains sg_aead_in and sg_aead_out which point
to a aad_space and then chain scatterlists sg_plaintext_data,
sg_encrypted_data respectively. Rather than using chained scatterlists
for plaintext and encrypted data in aead_req, it is efficient to store
aad_space in sg_encrypted_data and sg_plaintext_data itself in the
first index and get rid of sg_aead_in, sg_aead_in and further chaining.

This requires increasing size of sg_encrypted_data & sg_plaintext_data
arrarys by 1 to accommodate entry for aad_space. The code which uses
sg_encrypted_data and sg_plaintext_data has been modified to skip first
index as it points to aad_space.

Signed-off-by: Vakul Garg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agoMerge branch 'tipc-next'
David S. Miller [Sat, 29 Sep 2018 18:24:22 +0000 (11:24 -0700)]
Merge branch 'tipc-next'

Jon Maloy says:

====================
tipc: make connection setup more robust

In this series we make a few improvements to the connection setup and
probing mechanism, culminating in the last commit where we make it
possible for a client socket to make multiple setup attempts in case
it encounters receive buffer overflow at the listener socket.
====================

Signed-off-by: David S. Miller <[email protected]>
6 years agotipc: buffer overflow handling in listener socket
Tung Nguyen [Fri, 28 Sep 2018 18:23:22 +0000 (20:23 +0200)]
tipc: buffer overflow handling in listener socket

Default socket receive buffer size for a listener socket is 2Mb. For
each arriving empty SYN, the linux kernel allocates a 768 bytes buffer.
This means that a listener socket can serve maximum 2700 simultaneous
empty connection setup requests before it hits a receive buffer
overflow, and much fewer if the SYN is carrying any significant
amount of data.

When this happens the setup request is rejected, and the client
receives an ECONNREFUSED error.

This commit mitigates this problem by letting the client socket try to
retransmit the SYN message multiple times when it sees it rejected with
the code TIPC_ERR_OVERLOAD. Retransmission is done at random intervals
in the range of [100 ms, setup_timeout / 4], as many times as there is
room for within the setup timeout limit.

Signed-off-by: Tung Nguyen <[email protected]>
Acked-by: Ying Xue <[email protected]>
Signed-off-by: Jon Maloy <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agotipc: add SYN bit to connection setup messages
Jon Maloy [Fri, 28 Sep 2018 18:23:21 +0000 (20:23 +0200)]
tipc: add SYN bit to connection setup messages

Messages intended for intitating a connection are currently
indistinguishable from regular datagram messages. The TIPC
protocol specification defines bit 17 in word 0 as a SYN bit
to allow sanity check of such messages in the listening socket,
but this has so far never been implemented.

We do that in this commit.

Acked-by: Ying Xue <[email protected]>
Signed-off-by: Jon Maloy <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agotipc: refactor function tipc_sk_filter_connect()
Jon Maloy [Fri, 28 Sep 2018 18:23:20 +0000 (20:23 +0200)]
tipc: refactor function tipc_sk_filter_connect()

We refactor the function tipc_sk_filter_connect(), both to make it
more readable and as a preparation for the next commit.

Acked-by: Ying Xue <[email protected]>
Signed-off-by: Jon Maloy <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agotipc: refactor function tipc_sk_timeout()
Jon Maloy [Fri, 28 Sep 2018 18:23:19 +0000 (20:23 +0200)]
tipc: refactor function tipc_sk_timeout()

We refactor this function as a preparation for the coming commits in
the same series.

Acked-by: Ying Xue <[email protected]>
Signed-off-by: Jon Maloy <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agotipc: refactor function tipc_msg_reverse()
Jon Maloy [Fri, 28 Sep 2018 18:23:18 +0000 (20:23 +0200)]
tipc: refactor function tipc_msg_reverse()

The function tipc_msg_reverse() is reversing the header of a message
while reusing the original buffer. We have seen at several occasions
that this may have unfortunate side effects when the buffer to be
reversed is a clone.

In one of the following commits we will again need to reverse cloned
buffers, so this is the right time to permanently eliminate this
problem. In this commit we let the said function always consume the
original buffer and replace it with a new one when applicable.

Acked-by: Ying Xue <[email protected]>
Signed-off-by: Jon Maloy <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agotcp: up initial rmem to 128KB and SYN rwin to around 64KB
Yuchung Cheng [Thu, 27 Sep 2018 18:21:19 +0000 (11:21 -0700)]
tcp: up initial rmem to 128KB and SYN rwin to around 64KB

Previously TCP initial receive buffer is ~87KB by default and
the initial receive window is ~29KB (20 MSS). This patch changes
the two numbers to 128KB and ~64KB (rounding down to the multiples
of MSS) respectively. The patch also simplifies the calculations s.t.
the two numbers are directly controlled by sysctl tcp_rmem[1]:

  1) Initial receiver buffer budget (sk_rcvbuf): while this should
     be configured via sysctl tcp_rmem[1], previously tcp_fixup_rcvbuf()
     always override and set a larger size when a new connection
     establishes.

  2) Initial receive window in SYN: previously it is set to 20
     packets if MSS <= 1460. The number 20 was based on the initial
     congestion window of 10: the receiver needs twice amount to
     avoid being limited by the receive window upon out-of-order
     delivery in the first window burst. But since this only
     applies if the receiving MSS <= 1460, connection using large MTU
     (e.g. to utilize receiver zero-copy) may be limited by the
     receive window.

With this patch TCP memory configuration is more straight-forward and
more properly sized to modern high-speed networks by default. Several
popular stacks have been announcing 64KB rwin in SYNs as well.

Signed-off-by: Yuchung Cheng <[email protected]>
Signed-off-by: Wei Wang <[email protected]>
Signed-off-by: Neal Cardwell <[email protected]>
Signed-off-by: Eric Dumazet <[email protected]>
Reviewed-by: Soheil Hassas Yeganeh <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agohns3: Another build fix.
David S. Miller [Sat, 29 Sep 2018 18:21:06 +0000 (11:21 -0700)]
hns3: Another build fix.

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c: In function â€˜hclge_get_sset_count’:
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c:496:31: error: â€˜HNAE3_REVISION_ID_21’ undeclared (first use in this function); did you mean â€˜FADT2_REVISION_ID’?
   if (hdev->pdev->revision >= HNAE3_REVISION_ID_21 ||
                               ^~~~~~~~~~~~~~~~~~~~
                               FADT2_REVISION_ID

Signed-off-by: David S. Miller <[email protected]>
6 years agohns3: Fix the build.
David S. Miller [Sat, 29 Sep 2018 17:49:58 +0000 (10:49 -0700)]
hns3: Fix the build.

drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c: In function â€˜hns3_self_test’:
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c:278:15: error: â€˜HNS3_SELF_TEST_TYPE_NUM’ undeclared (first use in this function); did you mean â€˜HNS3_SELF_TEST_TPYE_NUM’?
  int st_param[HNS3_SELF_TEST_TYPE_NUM][2];
               ^~~~~~~~~~~~~~~~~~~~~~~
               HNS3_SELF_TEST_TPYE_NUM

Signed-off-by: David S. Miller <[email protected]>
6 years agoBluetooth: Fix debugfs NULL pointer dereference
Matias Karhumaa [Fri, 28 Sep 2018 18:54:30 +0000 (21:54 +0300)]
Bluetooth: Fix debugfs NULL pointer dereference

Fix crash caused by NULL pointer dereference when debugfs functions
le_max_key_read, le_max_key_size_write, le_min_key_size_read or
le_min_key_size_write and Bluetooth adapter was powered off.

Fix is to move max_key_size and min_key_size from smp_dev to hci_dev.
At the same time they were renamed to le_max_key_size and
le_min_key_size.

BUG: unable to handle kernel NULL pointer dereference at 00000000000002e8
PGD 0 P4D 0
Oops: 0000 [#24] SMP PTI
CPU: 2 PID: 6255 Comm: cat Tainted: G      D    OE     4.18.9-200.fc28.x86_64 #1
Hardware name: LENOVO 4286CTO/4286CTO, BIOS 8DET76WW (1.46 ) 06/21/2018
RIP: 0010:le_max_key_size_read+0x45/0xb0 [bluetooth]
Code: 00 00 00 48 83 ec 10 65 48 8b 04 25 28 00 00 00 48 89 44 24 08 31 c0 48 8b 87 c8 00 00 00 48 8d 7c 24 04 48 8b 80 48 0a 00 00 <48> 8b 80 e8 02 00 00 0f b6 48 52 e8 fb b6 b3 ed be 04 00 00 00 48
RSP: 0018:ffffab23c3ff3df0 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 00007f0b4ca2e000 RCX: ffffab23c3ff3f08
RDX: ffffffffc0ddb033 RSI: 0000000000000004 RDI: ffffab23c3ff3df4
RBP: 0000000000020000 R08: 0000000000000000 R09: 0000000000000000
R10: ffffab23c3ff3ed8 R11: 0000000000000000 R12: ffffab23c3ff3f08
R13: 00007f0b4ca2e000 R14: 0000000000020000 R15: ffffab23c3ff3f08
FS:  00007f0b4ca0f540(0000) GS:ffff91bd5e280000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000000002e8 CR3: 00000000629fa006 CR4: 00000000000606e0
Call Trace:
 full_proxy_read+0x53/0x80
 __vfs_read+0x36/0x180
 vfs_read+0x8a/0x140
 ksys_read+0x4f/0xb0
 do_syscall_64+0x5b/0x160
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Signed-off-by: Matias Karhumaa <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
6 years agoice: fix changing of ring descriptor size (ethtool -G)
Bruce Allan [Thu, 20 Sep 2018 00:23:11 +0000 (17:23 -0700)]
ice: fix changing of ring descriptor size (ethtool -G)

rx_mini_pending was set to an incorrect value. This was causing EINVAL to
always be returned to 'ethtool -G'. The driver does not support mini or
jumbo rings so the respective settings should be zero.

Also, change the valid range of the number of descriptors in the rings to
make the code simpler and easier for users to understand (this removes the
valid settings of 8 and 16). Add a system log message indicating when the
number is rounded-up from what the user specifies with the 'ethtool -G'
command (i.e. when it is not a multiple of 32), and update the log message
when a user-provided value is out of range to also indicate the stride.

Signed-off-by: Bruce Allan <[email protected]>
Signed-off-by: Anirudh Venkataramanan <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
6 years agoice: Update to capabilities admin queue command
Anirudh Venkataramanan [Thu, 20 Sep 2018 00:23:10 +0000 (17:23 -0700)]
ice: Update to capabilities admin queue command

This patch makes a couple of changes in the way the driver uses the
"get capabilities" command.

1. Get device capabilities in addition to function capabilities

2. Align to latest spec by using cap_count to determine size of the
   buffer in case of length error.

Signed-off-by: Anirudh Venkataramanan <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
6 years agoice: Query the Tx scheduler node before adding it
Anirudh Venkataramanan [Thu, 20 Sep 2018 00:23:09 +0000 (17:23 -0700)]
ice: Query the Tx scheduler node before adding it

Query the Tx scheduler tree node information from FW before adding it to
the driver's software database. This will keep the node information current
in driver.

Signed-off-by: Anirudh Venkataramanan <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
6 years agoice: Update comment for ice_fltr_mgmt_list_entry
Brett Creeley [Thu, 20 Sep 2018 00:23:08 +0000 (17:23 -0700)]
ice: Update comment for ice_fltr_mgmt_list_entry

Previously the comment stated that VSI lists should be used when a
second VSI becomes a subscriber to the "VLAN address". VSI lists
are always used for VLAN membership, so replace "VLAN address" with
"MAC address". Also note that VLAN(s) always use VSI list rules.

Signed-off-by: Brett Creeley <[email protected]>
Signed-off-by: Anirudh Venkataramanan <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
6 years agoice: update fw version check logic
Jacob Keller [Thu, 20 Sep 2018 00:23:07 +0000 (17:23 -0700)]
ice: update fw version check logic

We have MAX_FW_API_VER_BRANCH, MAX_FW_API_VER_MAJOR, and
MAX_FW_API_VER_MINOR that we use in ice_controlq.h to test when a
firmware version is newer than expected. This is currently tested by
comparing each field separately. Thus, we compare the branch field
against the MAX_FW_API_VER_BRANCH, and so forth.

This means that currently, if we suppose that the max firmware version
is defined as 0.2.1, i.e.

Then firmware 0.1.3 will fail to load. This is because the minor version
3 is greater than the max minor version 1.

This is not intuitive, because of the notion that increasing the major
firmware version to 2 should mean any firmware version with a major
version is less than 2 should be considered older than 2...

In order to allow both 0.2.1 and 0.1.3 to load, you would have to define
the "max" firmware version as 0.2.3.. It is possible that such
a firmware version doesn't even exist yet!

Fix this by replacing the current logic with an updated check that
behaves as follows:

First, we check the major version. If it is greater than the expected
version, then we prevent driver load. Additionally, a warning message is
logged to indicate to the system administrator that they need to update
their driver. This is now the only case where the driver will refuse to
load.

Second, if the major version is less than the expected version, we log
an information message indicating the NVM should be updated.

Third, if the major version is exact, we'll then check the minor
version. If the minor version is more than two versions less than
expected, we log an information message indicating the NVM should be
updated. If it is more than two versions greater than the expected
version, we log an information message that the driver should be
updated.

To support this, the ice_aq_ver_check function needs its signature
updated to pass the HW structure. Since we now pass this structure,
there is no need to pass the firmware API versions separately.

Signed-off-by: Jacob Keller <[email protected]>
Signed-off-by: Anirudh Venkataramanan <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
6 years agoice: update branding strings and supported device ids
Bruce Allan [Thu, 20 Sep 2018 00:23:06 +0000 (17:23 -0700)]
ice: update branding strings and supported device ids

Update branding strings and remove device ids 0x1594 and 0x1595.

Signed-off-by: Bruce Allan <[email protected]>
Signed-off-by: Anirudh Venkataramanan <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
6 years agoice: replace unnecessary memcpy with direct assignment
Bruce Allan [Thu, 20 Sep 2018 00:23:05 +0000 (17:23 -0700)]
ice: replace unnecessary memcpy with direct assignment

Direct assignment is preferred over a memcpy()

Signed-off-by: Bruce Allan <[email protected]>
Signed-off-by: Anirudh Venkataramanan <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
6 years agoice: use [sr]q.count when checking if queue is initialized
Jacob Keller [Thu, 20 Sep 2018 00:23:04 +0000 (17:23 -0700)]
ice: use [sr]q.count when checking if queue is initialized

When shutting down the controlqs, we check if they are initialized
before we shut them down and destroy the lock. This is important, as it
prevents attempts to access the lock of an already shutdown queue.

Unfortunately, we checked rq.head and sq.head as the value to determine
if the queue was initialized. This doesn't work, because head is not
reset when the queue is shutdown. In some flows, the adminq will have
already been shut down prior to calling ice_shutdown_all_ctrlqs. This
can result in a crash due to attempting to access the already destroyed
mutex.

Fix this by using rq.count and sq.count instead. Indeed, ice_shutdown_sq
and ice_shutdown_rq already indicate that this is the value we should be
using to determine of the queue was initialized.

Signed-off-by: Jacob Keller <[email protected]>
Signed-off-by: Anirudh Venkataramanan <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
6 years agoqed: fix spelling mistake "b_cb_registred" -> "b_cb_registered"
Colin Ian King [Thu, 27 Sep 2018 17:04:54 +0000 (18:04 +0100)]
qed: fix spelling mistake "b_cb_registred" -> "b_cb_registered"

Trivial fix to spelling mistake struct field name, rename it.

Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agoMerge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next...
David S. Miller [Fri, 28 Sep 2018 18:09:02 +0000 (11:09 -0700)]
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue

Jeff Kirsher says:

====================
100GbE Intel Wired LAN Driver Updates 2018-09-27

This series contains fixes to the ice driver only.

Jake fixes a potential crash due to attempting to access the mutex which
is already destroyed.  Fix this by using rq.count and sq.count to
determine if the queue was initialized.  Fixed the current logic for
checking the firmware version to properly handle situations when
firmware major/minor versions differ and when the branch version
differs.

Bruce replaces a memcpy() with a direct assignment, which is preferred.
Also updated the branding strings and device ids supported by the
driver.  Fixed the "ethtool -G" command in the driver, which was always
returning EINVAL when changing the descriptor ring size.

Brett update and clarified code comments.

Anirudh updates the driver to ensure we query the firmware for the
transmit scheduler node information before adding it to the driver
database, to ensure we have the current information.  Also update the
"get capabilities" command to get device and function capabilities.
====================

Signed-off-by: David S. Miller <[email protected]>
6 years agonet: sched: make function qdisc_free_cb() static
Wei Yongjun [Thu, 27 Sep 2018 14:47:56 +0000 (14:47 +0000)]
net: sched: make function qdisc_free_cb() static

Fixes the following sparse warning:

net/sched/sch_generic.c:944:6: warning:
 symbol 'qdisc_free_cb' was not declared. Should it be static?

Fixes: 3a7d0d07a386 ("net: sched: extend Qdisc with rcu")
Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agoselftests: forwarding: test for bridge sticky flag
Nikolay Aleksandrov [Thu, 27 Sep 2018 13:35:13 +0000 (16:35 +0300)]
selftests: forwarding: test for bridge sticky flag

This test adds an fdb entry with the sticky flag and sends traffic from
a different port with the same mac as a source address expecting the entry
to not change ports if the flag is operating correctly.

Signed-off-by: Nikolay Aleksandrov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agonet: bridge: explicitly zero is_sticky in fdb_create
Nikolay Aleksandrov [Thu, 27 Sep 2018 12:05:10 +0000 (15:05 +0300)]
net: bridge: explicitly zero is_sticky in fdb_create

We need to explicitly zero is_sticky when creating a new fdb, otherwise
we might get a stale value for a new entry.

Fixes: 435f2e7cc0b7 ("net: bridge: add support for sticky fdb entries")
Signed-off-by: Nikolay Aleksandrov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agoMerge branch 'hns3-next'
David S. Miller [Fri, 28 Sep 2018 17:37:42 +0000 (10:37 -0700)]
Merge branch 'hns3-next'

Salil Mehta says:

====================
Cleanups, minor additions & fixes for HNS3 driver

This patch-set contains cleans-ups, minor changes and fixes to the HNS3 driver.
====================

Signed-off-by: David S. Miller <[email protected]>
6 years agonet: hns3: Fix loss of coal configuration while doing reset
Huazhong Tan [Wed, 26 Sep 2018 18:28:40 +0000 (19:28 +0100)]
net: hns3: Fix loss of coal configuration while doing reset

The user's coal configuration will be lost after reset, so the tx_coal
and rx_coal fields are added to the struct hns_nic_priv to save the coal
configuration and used to restore the user's configuration after the reset
is complete.

Fixes: bb6b94a896d4 ("net: hns3: Add reset interface implementation in client")
Signed-off-by: Huazhong Tan <[email protected]>
Signed-off-by: Yunsheng Lin <[email protected]>
Signed-off-by: Salil Mehta <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agonet: hns3: Modify hns3_get_max_available_channels
Huazhong Tan [Wed, 26 Sep 2018 18:28:39 +0000 (19:28 +0100)]
net: hns3: Modify hns3_get_max_available_channels

The current hns3_get_max_available_channels returns the total number
of queues for the device, which makes ethtool -L set the number of queues
per channel queues incorrectly, so hns3_get_max_available_channels should
return the maximum available number of queues per channel, depending on
the total number of queues allocated and the hardware configurations.

Signed-off-by: Huazhong Tan <[email protected]>
Signed-off-by: Yunsheng Lin <[email protected]>
Signed-off-by: Peng Li <[email protected]>
Signed-off-by: Salil Mehta <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agonet: hns3: Change return type of hclge_tm_schd_info_update()
Huazhong Tan [Wed, 26 Sep 2018 18:28:38 +0000 (19:28 +0100)]
net: hns3: Change return type of hclge_tm_schd_info_update()

hclge_tm_schd_info_update should return an error when num_tc is greater
than alloc_tqps.

This patch changes the return type of hnae3_register_ae_algo from void
to int.

Signed-off-by: Huazhong Tan <[email protected]>
Signed-off-by: Yunsheng Lin <[email protected]>
Signed-off-by: Peng Li <[email protected]>
Signed-off-by: Salil Mehta <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agonet: hns3: Fix for netdev not up problem when setting mtu
Yunsheng Lin [Wed, 26 Sep 2018 18:28:37 +0000 (19:28 +0100)]
net: hns3: Fix for netdev not up problem when setting mtu

Currently hns3_nic_change_mtu will try to down the netdev before
setting mtu, and it does not up the netdev when the setting fails,
which causes netdev not up problem.

This patch fixes it by not returning when the setting fails.

Fixes: a8e8b7ff3517 ("net: hns3: Add support to change MTU in HNS3 hardware")
Signed-off-by: Yunsheng Lin <[email protected]>
Signed-off-by: Peng Li <[email protected]>
Signed-off-by: Salil Mehta <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agonet: hns3: Fix for packet buffer setting bug
Yunsheng Lin [Wed, 26 Sep 2018 18:28:36 +0000 (19:28 +0100)]
net: hns3: Fix for packet buffer setting bug

The hardware expects a unit of 128 bytes when setting
packet buffer. When calculating the packet buffer size,
hclge_rx_buffer_calc does not round up the size as a unit
of 128 byte, which may casue packet lost problem when stress
testing.

This patch fixes it by rounding up packet size when calculating.

Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: Yunsheng Lin <[email protected]>
Signed-off-by: Peng Li <[email protected]>
Signed-off-by: Salil Mehta <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agonet: hns3: Add serdes parallel inner loopback support
Fuyun Liang [Wed, 26 Sep 2018 18:28:35 +0000 (19:28 +0100)]
net: hns3: Add serdes parallel inner loopback support

This patch adds serdes parallel inner loopback support for self test.

Signed-off-by: Fuyun Liang <[email protected]>
Signed-off-by: Peng Li <[email protected]>
Signed-off-by: Salil Mehta <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agonet: hns3: Rename mac loopback to app loopback
Fuyun Liang [Wed, 26 Sep 2018 18:28:34 +0000 (19:28 +0100)]
net: hns3: Rename mac loopback to app loopback

In fact, our implementation of mac loopback is the implementation of app
loopback now. Current name is wrong. This patch renames mac loopback to
app loopback.

Signed-off-by: Fuyun Liang <[email protected]>
Signed-off-by: Peng Li <[email protected]>
Signed-off-by: Salil Mehta <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agonet: hns3: Rename loop mode
Fuyun Liang [Wed, 26 Sep 2018 18:28:33 +0000 (19:28 +0100)]
net: hns3: Rename loop mode

Our loop mode includes mac loop, serdes loop and phy loop. Not all of them
are related with mac. This patch corrects their names.

Signed-off-by: Fuyun Liang <[email protected]>
Signed-off-by: Peng Li <[email protected]>
Signed-off-by: Salil Mehta <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agonet: hns3: Set extra mac address of pause param for HW
Fuyun Liang [Wed, 26 Sep 2018 18:28:32 +0000 (19:28 +0100)]
net: hns3: Set extra mac address of pause param for HW

The extra mac address of pause param is used to do double check
for pause frame. This patch set it to HW. If we do not do that,
pfc pause frame will be transferred protocol stack when normal
flow control mode is enabled.

Signed-off-by: Fuyun Liang <[email protected]>
Signed-off-by: Peng Li <[email protected]>
Signed-off-by: Salil Mehta <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agonet: hns3: Add support for sctp checksum offload
Peng Li [Wed, 26 Sep 2018 18:28:31 +0000 (19:28 +0100)]
net: hns3: Add support for sctp checksum offload

This patch adds support for sctp checksum offload.

Signed-off-by: Fuyun Liang <[email protected]>
Signed-off-by: Peng Li <[email protected]>
Signed-off-by: Salil Mehta <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agonet: dsa: b53: Fix build with B53_SRAB enabled and B53_SERDES=m
Arnd Bergmann [Thu, 27 Sep 2018 10:02:38 +0000 (12:02 +0200)]
net: dsa: b53: Fix build with B53_SRAB enabled and B53_SERDES=m

When B53_SERDES is a loadable module, a built-in srab driver still
cannot reach it, so the previous fix is incomplete:

b53_srab.c:(.text+0x3f4): undefined reference to `b53_serdes_init'
drivers/net/dsa/b53/b53_srab.o:(.rodata+0xe64): undefined reference to `b53_serdes_link_state'
drivers/net/dsa/b53/b53_srab.o:(.rodata+0xe74): undefined reference to `b53_serdes_link_set'
drivers/net/dsa/b53/b53_srab.o:(.rodata+0xe88): undefined reference to `b53_serdes_an_restart'
drivers/net/dsa/b53/b53_srab.o:(.rodata+0xea0): undefined reference to `b53_serdes_phylink_validate'
drivers/net/dsa/b53/b53_srab.o:(.rodata+0xea4): undefined reference to `b53_serdes_config'

Add a Kconfig dependency that forces srab to also be a module
in this case, but allow it to be built-in when serdes is
disabled or built-in.

Fixes: 7a8c7f5c30f9 ("net: dsa: b53: Fix build with B53_SRAB enabled and not B53_SERDES")
Signed-off-by: Arnd Bergmann <[email protected]>
Acked-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agoBluetooth: ath3k: add more information to error message
Luiz Carlos Ramos [Thu, 27 Sep 2018 20:19:26 +0000 (17:19 -0300)]
Bluetooth: ath3k: add more information to error message

When there is an error in either ath3k_load_firmware() or
ath3k_load_fwfile(), the inlined function ath3k_log_failed_loading() is
called receiving the error returned and both the block size requested to
load and the size actually loaded. These values are printed in an error
message using the macro BT_ERR.

This patch changes that function in order to print the variable "count"
as well, to show more information when a failing firmware loading
operation happens. The calls to the older function were changed to the
new one.

This event is being monitored in a laptop with an adapter which
identifies itself as 0cf3:0036, where sometimes there are errors in the
firmware loading process.

Signed-off-by: Luiz Carlos Ramos <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
6 years agonet: phy: mdio-bcm-unimac: mark PM functions as __maybe_unused
Arnd Bergmann [Wed, 26 Sep 2018 13:14:10 +0000 (15:14 +0200)]
net: phy: mdio-bcm-unimac: mark PM functions as __maybe_unused

The newly added runtime-pm support causes a harmless warning
when CONFIG_PM is disabled:

drivers/net/phy/mdio-bcm-unimac.c:330:12: error: 'unimac_mdio_resume' defined but not used [-Werror=unused-function]
 static int unimac_mdio_resume(struct device *d)
drivers/net/phy/mdio-bcm-unimac.c:321:12: error: 'unimac_mdio_suspend' defined but not used [-Werror=unused-function]
 static int unimac_mdio_suspend(struct device *d)

Marking the functions as __maybe_unused is the easiest workaround
and avoids adding #ifdef checks.

Fixes: b78ac6ecd1b6 ("net: phy: mdio-bcm-unimac: Allow configuring MDIO clock divider")
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agophy: mscc: fix printf format
Arnd Bergmann [Wed, 26 Sep 2018 13:20:11 +0000 (15:20 +0200)]
phy: mscc: fix printf format

gcc points out that the length of the temporary buffer may not be sufficient for
large numbers of leds:

drivers/net/phy/mscc.c: In function 'vsc85xx_probe':
drivers/net/phy/mscc.c:460:45: error: '-mode' directive writing 5 bytes into a region of size between 0 and 9 [-Werror=format-overflow=]
   ret = sprintf(led_dt_prop, "vsc8531,led-%d-mode", i);
                                             ^~~~~
drivers/net/phy/mscc.c:460:9: note: 'sprintf' output between 19 and 28 bytes into a destination of size 22
   ret = sprintf(led_dt_prop, "vsc8531,led-%d-mode", i);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

While we can make a reasonable assumption that the number of LEDs is small,
the cost of making the buffer a little bigger is insignificant as well.

Fixes: 11bfdabb7ff5 ("net: phy: mscc: factorize code for LEDs mode")
Signed-off-by: Arnd Bergmann <[email protected]>
Reviewed-by: Alexandre Belloni <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agonet: ethernet: dpaa: remove unused variables
Arnd Bergmann [Wed, 26 Sep 2018 13:12:13 +0000 (15:12 +0200)]
net: ethernet: dpaa: remove unused variables

The patch that removed the only users of the oldadv/newadv variables
accidentally left the now-unused declarations behind:

drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c: In function 'dpaa_set_pauseparam':
drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c:185:14: error: unused variable 'oldadv' [-Werror=unused-variable]
drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c:185:6: error: unused variable 'newadv' [-Werror=unused-variable]

Fixes: 70814e819c11 ("net: ethernet: Add helper for set_pauseparam for Asym Pause")
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agonet: aquantia: Make function aq_fw1x_set_power() static
Wei Yongjun [Wed, 26 Sep 2018 12:20:00 +0000 (12:20 +0000)]
net: aquantia: Make function aq_fw1x_set_power() static

Fixes the following sparse warning:

drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c:873:5: warning:
 symbol 'aq_fw1x_set_power' was not declared. Should it be static?

Fixes: a0da96c08cfa ("net: aquantia: implement WOL support")
Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agonet/tls: Make function get_rec() static
Wei Yongjun [Wed, 26 Sep 2018 12:10:48 +0000 (12:10 +0000)]
net/tls: Make function get_rec() static

Fixes the following sparse warning:

net/tls/tls_sw.c:655:16: warning:
 symbol 'get_rec' was not declared. Should it be static?

Fixes: a42055e8d2c3 ("net/tls: Add support for async encryption of records for performance")
Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agonet/core: make function ___gnet_stats_copy_basic() static
Wei Yongjun [Wed, 26 Sep 2018 12:09:45 +0000 (12:09 +0000)]
net/core: make function ___gnet_stats_copy_basic() static

Fixes the following sparse warning:

net/core/gen_stats.c:166:1: warning:
 symbol '___gnet_stats_copy_basic' was not declared. Should it be static?

Fixes: 5e111210a443 ("net/core: Add new basic hardware counter")
Signed-off-by: Wei Yongjun <[email protected]>
Acked-by: Eelco Chaudron <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agonet: xen-netback: fix return type of ndo_start_xmit function
YueHaibing [Wed, 26 Sep 2018 09:18:14 +0000 (17:18 +0800)]
net: xen-netback: fix return type of ndo_start_xmit function

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.

Found by coccinelle.

Signed-off-by: YueHaibing <[email protected]>
Acked-by: Wei Liu <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agoqed: Remove set but not used variable 'p_archipelago'
YueHaibing [Thu, 27 Sep 2018 06:45:06 +0000 (06:45 +0000)]
qed: Remove set but not used variable 'p_archipelago'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/ethernet/qlogic/qed/qed_ooo.c: In function 'qed_ooo_delete_isles':
drivers/net/ethernet/qlogic/qed/qed_ooo.c:354:30: warning:
 variable 'p_archipelago' set but not used [-Wunused-but-set-variable]

drivers/net/ethernet/qlogic/qed/qed_ooo.c: In function 'qed_ooo_join_isles':
drivers/net/ethernet/qlogic/qed/qed_ooo.c:463:30: warning:
 variable 'p_archipelago' set but not used [-Wunused-but-set-variable]

Since commit 1eec2437d14c ("qed: Make OOO archipelagos into an array"),
'p_archipelago' is no longer in use.

Signed-off-by: YueHaibing <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agonet: ovs: fix return type of ndo_start_xmit function
YueHaibing [Wed, 26 Sep 2018 09:15:38 +0000 (17:15 +0800)]
net: ovs: fix return type of ndo_start_xmit function

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.

Found by coccinelle.

Signed-off-by: YueHaibing <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agoMerge branch 'netlink-nested-policy-validation'
David S. Miller [Fri, 28 Sep 2018 17:24:48 +0000 (10:24 -0700)]
Merge branch 'netlink-nested-policy-validation'

Johannes Berg says:

====================
netlink: nested policy validation

This adds nested policy validation, which lets you specify the
nested attribute type, e.g. NLA_NESTED with sub-policy, or the
new NLA_NESTED_ARRAY with sub-sub-policy.

Changes in v2:
 * move setting the bad attr pointer/message into validate_nla()
 * remove the recursion patch since that's no longer needed
 * simply skip the generic bad attr pointer/message setting in
   case of nested nla_validate() failing since that could fail
   only due to validate_nla() failing inside, which already sets
   the extack information

Changes in v3:
 * fix NLA_REJECT to have an error message if none is in policy
====================

Signed-off-by: David S. Miller <[email protected]>
6 years agonetlink: add nested array policy validation
Johannes Berg [Wed, 26 Sep 2018 09:15:34 +0000 (11:15 +0200)]
netlink: add nested array policy validation

Sometimes nested netlink attributes are just used as arrays, with
the nla_type() of each not being used; we have this in nl80211 and
e.g. NFTA_SET_ELEM_LIST_ELEMENTS.

Add the ability to validate this type of message directly in the
policy, by adding the type NLA_NESTED_ARRAY which does exactly
this: require a first level of nesting but ignore the attribute
type, and then inside each require a second level of nested and
validate those attributes against a given policy (if present).

Note that some nested array types actually require that all of
the entries have the same index, this is possible to express in
a nested policy already, apart from the validation that only the
one allowed type is used.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agonetlink: allow NLA_NESTED to specify nested policy to validate
Johannes Berg [Wed, 26 Sep 2018 09:15:33 +0000 (11:15 +0200)]
netlink: allow NLA_NESTED to specify nested policy to validate

Now that we have a validation_data pointer, and the len field in
the policy is unused for NLA_NESTED, we can allow using them both
to have nested validation. This can be nice in code, although we
still have to use nla_parse_nested() or similar which would also
take a policy; however, it also serves as documentation in the
policy without requiring a look at the code.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agonetlink: move extack setting into validate_nla()
Johannes Berg [Wed, 26 Sep 2018 09:15:32 +0000 (11:15 +0200)]
netlink: move extack setting into validate_nla()

This unifies the code between nla_parse() which sets the bad
attribute pointer and an error message, and nla_validate()
which only sets the bad attribute pointer.

It also cleans up the code for NLA_REJECT and paves the way
for nested policy validation, as it will allow us to easily
skip setting the "generic" message without any extra args
like the **error_msg now, just passing the extack through is
now enough.

While at it, remove the unnecessary label in nla_parse().

Suggested-by: David Ahern <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agonetlink: make validation_data const
Johannes Berg [Wed, 26 Sep 2018 09:15:31 +0000 (11:15 +0200)]
netlink: make validation_data const

The validation data is only used within the policy that
should usually already be const, and isn't changed in any
code that uses it. Therefore, make the validation_data
pointer const.

While at it, remove the duplicate variable in the bitfield
validation that I'd otherwise have to change to const.

Reviewed-by: David Ahern <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agonetlink: remove NLA_NESTED_COMPAT
Johannes Berg [Wed, 26 Sep 2018 09:15:30 +0000 (11:15 +0200)]
netlink: remove NLA_NESTED_COMPAT

This isn't used anywhere, so we might as well get rid of it.

Reviewed-by: David Ahern <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6 years agoiwlwifi: mvm: Allow TKIP for AP mode
Ilan Peer [Mon, 11 Jun 2018 11:05:11 +0000 (14:05 +0300)]
iwlwifi: mvm: Allow TKIP for AP mode

Support for setting keys for TKIP cipher suite was mistakenly removed
for AP mode. Fix this.

Fixes: 85aeb58cec1a ("iwlwifi: mvm: Enable security on new TX API")
Signed-off-by: Ilan Peer <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
6 years agoiwlwifi: fix LED command capability bit
Johannes Berg [Thu, 7 Jun 2018 08:49:55 +0000 (10:49 +0200)]
iwlwifi: fix LED command capability bit

The capability bit was added to the driver and had been negotiated
with the firmware, but then got forgotten in the firmware and later
reused for a different capability. Now the firmware added it in a
new bit.

Fixes: 2eabc84d2f8e ("iwlwifi: mvm: only send LEDS_CMD when the FW supports it")
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
6 years agoiwlwifi: configure power scheme to balanced for 22560 devices
Golan Ben Ami [Sun, 10 Jun 2018 11:12:26 +0000 (14:12 +0300)]
iwlwifi: configure power scheme to balanced for 22560 devices

As a temporary stage in the 22560 devices bring up, we disabled
power save, to avoid bugs related to that domain.
Now we would like to use power save so enable the balanced mode,
and allow configuring the mode via module parameter.

Signed-off-by: Golan Ben Ami <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
6 years agoiwlwifi: pcie: add infrastructure for multiple debug buffers
Sara Sharon [Wed, 23 May 2018 12:10:24 +0000 (15:10 +0300)]
iwlwifi: pcie: add infrastructure for multiple debug buffers

In future devices we will have more than one debug buffer.
Prepare the infrastructure for allocation and release of
multiple debug buffers by grouping the variables in an array
of structures and moving it to trans section, where they will
be visible to opmode and FW.

Signed-off-by: Sara Sharon <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
6 years agoiwlwifi: pcie: support transmitting SKBs with fraglist
Johannes Berg [Fri, 1 Jun 2018 08:32:55 +0000 (10:32 +0200)]
iwlwifi: pcie: support transmitting SKBs with fraglist

We want to be able to build A-MSDUs in higher layers, e.g. by
xmit_more, so support transmitting SKBs with fraglist to use
it for such.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
6 years agoiwlwifi: mvm: remove support for adjacent channel compensation
Emmanuel Grumbach [Tue, 5 Jun 2018 11:47:02 +0000 (14:47 +0300)]
iwlwifi: mvm: remove support for adjacent channel compensation

We no longer want to consider the RSSI if the beacon / probe
has been heard on an adjacent channel.
This was based on a firmware capability that is now
unavailable.

Signed-off-by: Emmanuel Grumbach <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
6 years agoiwlwifi: mvm: TLC support for Coex Schema 2
Erel Geron [Mon, 28 May 2018 14:18:47 +0000 (17:18 +0300)]
iwlwifi: mvm: TLC support for Coex Schema 2

The new coex schema requires setting the non-shared antenna
for the single_stream_ant_msk field in the TLC command.

Signed-off-by: Erel Geron <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
6 years agoiwlwifi: mvm: set wep key for all stations in soft ap mode
Avraham Stern [Mon, 4 Jun 2018 12:10:18 +0000 (15:10 +0300)]
iwlwifi: mvm: set wep key for all stations in soft ap mode

When operating as a soft ap with wep security, the key was not
configured to the fw for the stations, based on the fact that the
key will be specified in the tx command.

However, in the new tx api the tx command does not include the key,
which resulted in all data frames going out un-encrypted.

Fix it by configuring the key for all the stations as they are added.

Signed-off-by: Avraham Stern <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
6 years agoiwlwifi: mvm: use correct FIFO length
Sara Sharon [Sun, 3 Jun 2018 06:19:35 +0000 (09:19 +0300)]
iwlwifi: mvm: use correct FIFO length

Current FIFO size calculation is wrong for two reasons:
- We access lmac 0 by default
- We don't take 11ax into consideration.
Fix both.

Signed-off-by: Sara Sharon <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
6 years agoiwlwifi: pcie: set RB size according to user settings
Shaul Triebitz [Thu, 10 May 2018 14:40:44 +0000 (17:40 +0300)]
iwlwifi: pcie: set RB size according to user settings

RB size can be configured by user to be greater than 4K.
That's needed for monitor to capture big AMSDUs.
The firmware now enables different RB sizes configuration
via context info.

Signed-off-by: Shaul Triebitz <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
6 years agoiwlwifi: mvm: do not override amsdu size user settings
Shaul Triebitz [Thu, 10 May 2018 14:34:52 +0000 (17:34 +0300)]
iwlwifi: mvm: do not override amsdu size user settings

Since AMSDUs are not de-aggregated by HW in monitor mode,
we still need the option for setting large RBs (up to 12K).

Signed-off-by: Shaul Triebitz <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
6 years agoiwlwifi: pcie: fit reclaim msg to MAX_MSG_LEN
Golan Ben Ami [Tue, 5 Jun 2018 08:58:13 +0000 (11:58 +0300)]
iwlwifi: pcie: fit reclaim msg to MAX_MSG_LEN

Today, the length of a debug message in iwl_trans_pcie_reclaim
may pass the MAX_MSG_LEN, which is 110.
An example for this kind of message is:

'iwl_trans_pcie_reclaim: Read index for DMA queue txq id (2),
last_to_free 65535 is out of range [0-65536] 2 2.'

Cut the message a bit so it will fit the allowed MAX_MSG_LEN.

Signed-off-by: Golan Ben Ami <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
6 years agoiwlwifi: pcie: Fail fast if HW is inaccessible at probe
Rajat Jain [Fri, 27 Apr 2018 00:43:50 +0000 (17:43 -0700)]
iwlwifi: pcie: Fail fast if HW is inaccessible at probe

If the HW is not responding at probe time, fail immediately complaining
about it. Without this, we see that the kernel spends > 100ms trying to
load firmware (even gives an incorrect impression that it actually
loaded a firmware) and do unnecesary processing before concluding that
the device is not accessible:

 INFO kernel: [   34.092678] iwlwifi 0000:01:00.0: enabling device (0000 -> 0002)
 WARNING kernel: [   34.093560] iwlwifi 0000:01:00.0: Direct firmware load for iwl-dbg-cfg.ini failed with error -2
 INFO kernel: [   34.111523] iwlwifi 0000:01:00.0: loaded firmware version 17.318154.0 op_mode iwlmvm
 INFO kernel: [   34.173250] iwlwifi 0000:01:00.0: Detected Intel(R) Dual Band Wireless AC 7265, REV=0xFFFFFFFF
 ERR kernel: [   34.198023] iwlwifi 0000:01:00.0: iwlwifi transaction failed, dumping registers
 ERR kernel: [   34.198044] iwlwifi 0000:01:00.0: iwlwifi device config registers:

Signed-off-by: Rajat Jain <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
6 years agoiwlwifi: pcie: tx: pull tracing out of iwl_fill_data_tbs()
Johannes Berg [Fri, 1 Jun 2018 08:10:57 +0000 (10:10 +0200)]
iwlwifi: pcie: tx: pull tracing out of iwl_fill_data_tbs()

This will allow us to reuse the function later for adding fraglist
SKBs to the TFD.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
6 years agoiwlwifi: pcie: tx: unify TFD unmapping
Johannes Berg [Fri, 1 Jun 2018 08:04:44 +0000 (10:04 +0200)]
iwlwifi: pcie: tx: unify TFD unmapping

When anything fails, we unmap the whole TFD in three different
places scattered throughout the code. Unify this to a single
place.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
6 years agoiwlwifi: pcie: gen2: build A-MSDU only for GSO
Johannes Berg [Fri, 1 Jun 2018 07:45:55 +0000 (09:45 +0200)]
iwlwifi: pcie: gen2: build A-MSDU only for GSO

If the incoming frame should be an A-MSDU, it may already be one,
for example in the case of NAN multicast being encapsulated in an
A-MSDU. Thus, use the GSO algorithm to build A-MSDU only if the
skb actually contains GSO data.

Fixes: 6ffe5de35b05 ("iwlwifi: pcie: add AMSDU to gen2")
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
6 years agoiwlwifi: pcie: gen2: pull adding frags to helper routine
Johannes Berg [Fri, 1 Jun 2018 07:39:37 +0000 (09:39 +0200)]
iwlwifi: pcie: gen2: pull adding frags to helper routine

Move the skb fragment loop into a helper routine to be able
to reuse it later.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
This page took 0.116286 seconds and 4 git commands to generate.