Luca Coelho [Mon, 9 Mar 2020 07:16:11 +0000 (09:16 +0200)]
iwlwifi: add Pu/PnJ/Th device values to differentiate them
Pu, PnJ and Th devices have different combinations of PCI ID, MAC ID
and RF IDs. Use these to differentiate them and choose the correct
configuration.
This also includes a change from using soc cfg's for 0x2526
devices (PnJ/Th), which was incorrect.
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20200309091348.602bb33528cf.I3acacb07c69ed063c7f1ca78f2dce9b7b4ef3946@changeid
Luca Coelho [Mon, 9 Mar 2020 07:16:10 +0000 (09:16 +0200)]
iwlwifi: add GNSS differentiation to the device tables
Devices that also include a GNSS module have different names, so add a
new device option to differentiate them, according to the values we
have in the modules section of the subsystem device ID.
Additionally, convert the two applicable devices to use this value
instead of hardcoded subsystem IDs.
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20200309091348.1f958e558d05.I45492bb57cbbeb4cc0ec84313bade4def7377a27@changeid
Luca Coelho [Mon, 9 Mar 2020 07:16:09 +0000 (09:16 +0200)]
iwlwifi: add mac/rf types and 160MHz to the device tables
Add MAC ID, RF ID and the bit that tells us whether the device can
handle 160MHz bandwidth to the device struct.
This allows us to chose the correct structure and string depending on
these parameters. Do so for all the 0x2526 devices we already moved
to the new table.
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20200309091348.a6bef6ee8fe1.I01f7a6f49aa60d2d61633a8a8b859015681eac5b@changeid
Luca Coelho [Mon, 9 Mar 2020 07:16:08 +0000 (09:16 +0200)]
iwlwifi: combine 9260 cfgs that only change names
All the 0x2526 devices are now in the new table, so we can start
reusing configurations and adding the strings independently to all of
them, reusing them when possible.
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20200309091348.88e3d47c42a8.I1bd37ae0d0f9f79732f03badf84d7d063993b73e@changeid
Luca Coelho [Mon, 9 Mar 2020 07:16:07 +0000 (09:16 +0200)]
iwlwifi: move the remaining 0x2526 configs to the new table
Now that we have the strings separate from the rest, we can move the
remaining 0x2526 devices to the new table in preparation to reuse the
configs.
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20200309091348.a7998f8d7507.I4be8776edb8c30416efc184c66f11add5eed06de@changeid
Kalle Valo [Mon, 16 Mar 2020 05:29:55 +0000 (07:29 +0200)]
Merge ath-next from git://git./linux/kernel/git/kvalo/ath.git
ath.git patches for v5.7. Major changes:
ath10k
* support for getting btcoex settings from Device Tree
* support QCA9377 SDIO device
ath11k
* add HE rate accounting
* add thermal sensor and cooling devices
Takashi Iwai [Wed, 11 Mar 2020 09:17:39 +0000 (10:17 +0100)]
ssb: Use scnprintf() for avoiding potential buffer overflow
Since snprintf() returns the would-be-output size instead of the
actual output size, the succeeding calls may go beyond the given
buffer limit. Fix it by replacing with scnprintf().
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Takashi Iwai [Wed, 11 Mar 2020 08:47:13 +0000 (09:47 +0100)]
prism54: Use scnprintf() for avoiding potential buffer overflow
Since snprintf() returns the would-be-output size instead of the
actual output size, the succeeding calls may go beyond the given
buffer limit. Fix it by replacing with scnprintf().
Cc: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Takashi Iwai [Wed, 11 Mar 2020 08:47:12 +0000 (09:47 +0100)]
ipw2x00: Use scnprintf() for avoiding potential buffer overflow
Since snprintf() returns the would-be-output size instead of the
actual output size, the succeeding calls may go beyond the given
buffer limit. Fix it by replacing with scnprintf().
Cc: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Takashi Iwai [Wed, 11 Mar 2020 08:47:11 +0000 (09:47 +0100)]
b43legacy: Use scnprintf() for avoiding potential buffer overflow
Since snprintf() returns the would-be-output size instead of the
actual output size, the succeeding calls may go beyond the given
buffer limit. Fix it by replacing with scnprintf().
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: b43-dev@lists.infradead.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Takashi Iwai [Wed, 11 Mar 2020 08:47:10 +0000 (09:47 +0100)]
b43: Use scnprintf() for avoiding potential buffer overflow
Since snprintf() returns the would-be-output size instead of the
actual output size, the succeeding calls may go beyond the given
buffer limit. Fix it by replacing with scnprintf().
Cc: b43-dev@lists.infradead.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Takashi Iwai [Wed, 11 Mar 2020 08:47:09 +0000 (09:47 +0100)]
carl9170: Use scnprintf() for avoiding potential buffer overflow
Since snprintf() returns the would-be-output size instead of the
actual output size, the succeeding calls may go beyond the given
buffer limit. Fix it by replacing with scnprintf().
Cc: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Sergiu Cuciurean [Thu, 27 Feb 2020 14:06:34 +0000 (16:06 +0200)]
libertas: Use new structure for SPI transfer delays
In a recent change to the SPI subsystem [1], a new `delay` struct was added
to replace the `delay_usecs`. This change replaces the current
`delay_usecs` with `delay` for this driver.
The `spi_transfer_delay_exec()` function [in the SPI framework] makes sure
that both `delay_usecs` & `delay` are used (in this order to preserve
backwards compatibility).
[1] commit
bebcfd272df6 ("spi: introduce `delay` field for
`spi_transfer` + spi_transfer_delay_exec()")
Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Brian Norris [Thu, 27 Feb 2020 00:05:11 +0000 (16:05 -0800)]
mwifiex: set needed_headroom, not hard_header_len
hard_header_len provides limitations for things like AF_PACKET, such
that we don't allow transmitting packets smaller than this.
needed_headroom provides a suggested minimum headroom for SKBs, so that
we can trivally add our headers to the front.
The latter is the correct field to use in this case, while the former
mostly just prevents sending small AF_PACKET frames.
In any case, mwifiex already does its own bounce buffering [1] if we
don't have enough headroom, so hints (not hard limits) are all that are
needed.
This is the essentially the same bug (and fix) that brcmfmac had, fixed
in commit
cb39288fd6bb ("brcmfmac: use ndev->needed_headroom to reserve
additional header space").
[1] mwifiex_hard_start_xmit():
if (skb_headroom(skb) < MWIFIEX_MIN_DATA_HEADER_LEN) {
[...]
/* Insufficient skb headroom - allocate a new skb */
Fixes: 5e6e3a92b9a4 ("wireless: mwifiex: initial commit for Marvell mwifiex driver")
Signed-off-by: Brian Norris <briannorris@chromium.org>
Acked-by: Ganapathi Bhat <ganapathi.gbhat@nxp.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Xu Wang [Fri, 21 Feb 2020 10:43:03 +0000 (18:43 +0800)]
iwlegacy: Remove unneeded variable ret
Remove unneeded variable ret used to store return value.
Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
chenqiwu [Wed, 19 Feb 2020 04:15:59 +0000 (12:15 +0800)]
b43legacy: replace simple_strtol() with kstrtoint()
The simple_strtol() function is deprecated since it does not
check for the range overflow. Use kstrtoint() instead.
Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Kevin Lo [Fri, 14 Feb 2020 14:16:45 +0000 (22:16 +0800)]
rtw88: remove unused member of struct rtw_hal
Remove unused fab_version member from struct rtw_hal.
Some of the checks being made were nonsense.
Signed-off-by: Kevin Lo <kevlo@kevlo.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Dmitry Lebed [Thu, 13 Feb 2020 11:45:32 +0000 (11:45 +0000)]
qtnfmac: add interface combination check for repeater mode
Firmware supports only STA as primary interface in repeater mode.
Since the only meaningful usage of AP + STA interface combination
is repeater, reject such combination with AP as primary interface.
Signed-off-by: Dmitry Lebed <dlebed@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Sergey Matyukevich [Thu, 13 Feb 2020 11:45:31 +0000 (11:45 +0000)]
qtnfmac: assign each wiphy to its own virtual platform device
Quantenna Pearl device exposes multiple (up to 3) radio interfaces under
single PCIe function. So far all the wiphy devices were attached to the
same pcie device. As a result, all different wireless network devices
were reported under the same sysfs directory for pcie device, e.g.:
$ ls /sys/class/net/wlan0/device/net/
wlan0 wlan1
It turns out that such behavior may confuse various users of wireless
subsystem. For instance, it turned out to be the case for:
- Linux init systems, e.g. for renaming based on parent device
- OpenWRT configuration scripts
Suggested solution is to add an intermediate virtual platform device
for each radio interface.
Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Sergey Matyukevich [Thu, 13 Feb 2020 11:45:30 +0000 (11:45 +0000)]
qtnfmac: set valid edmg in cfg80211_chan_def
Make sure that edmg field of cfg80211_chan_def structure is properly
initialized by zeros. Otherwise cfg80211_chandef_valid may return
false if edmg fields contain some garbage.
Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Sergey Matyukevich [Thu, 13 Feb 2020 11:45:29 +0000 (11:45 +0000)]
qtnfmac: support WPA3 OWE in AP mode
Enable WPA3 OWE support in AP mode. Driver currently supports cards that
offload OWE processing to userspace. This patch adds all the required
tools for such offloading. Firmware requests OWE processing sending new
UPDATE_OWE event to driver, which uses cfg80211_update_owe_info_event to
notify userspace software. After OWE processing is completed, userspace
sends calculated IEs to firmware using update_owe_info cfg80211 callback.
Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Sergey Matyukevich [Thu, 13 Feb 2020 11:45:28 +0000 (11:45 +0000)]
qtnfmac: support WPA3 SAE in AP mode
Enable WPA3 SAE support in AP mode. Driver currently supports cards
that offload SAE authentication to userspace. So allow userspace
software to subscribe and to send AUTH frames. Besides, enable
AP mode support in external_auth cfg80211 callback.
Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Takashi Iwai [Wed, 11 Mar 2020 08:47:08 +0000 (09:47 +0100)]
ath5k: Use scnprintf() for avoiding potential buffer overflow
Since snprintf() returns the would-be-output size instead of the
actual output size, the succeeding calls may go beyond the given
buffer limit. Fix it by replacing with scnprintf().
Cc: Jiri Slaby <jirislaby@gmail.com>
Cc: Nick Kossifidis <mickflemm@gmail.com>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Takashi Iwai [Wed, 11 Mar 2020 08:47:07 +0000 (09:47 +0100)]
ath11k: Use scnprintf() for avoiding potential buffer overflow
Since snprintf() returns the would-be-output size instead of the
actual output size, the succeeding calls may go beyond the given
buffer limit. Fix it by replacing with scnprintf().
Cc: ath11k@lists.infradead.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Yibo Zhao [Wed, 11 Mar 2020 17:23:29 +0000 (19:23 +0200)]
ath10k: allow qca988x family to support ack rssi of tx data packets.
Hardwares tested : QCA9887
Firmwares tested : 10.4-3.9.0.1-00036
Signed-off-by: Yibo Zhao <yiboz@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Alex Elder [Wed, 11 Mar 2020 21:47:00 +0000 (16:47 -0500)]
dt-bindings: soc: qcom: fix IPA binding
The definitions for the "qcom,smem-states" and "qcom,smem-state-names"
properties need to list their "$ref" under an "allOf" keyword.
In addition, fix two problems in the example at the end:
- Use #include for header files that define needed symbolic values
- Terminate the line that includes the "ipa-shared" register space
name with a comma rather than a semicolon
Finally, update some white space in the example for better alignment.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Davide Caratti [Wed, 11 Mar 2020 18:50:53 +0000 (19:50 +0100)]
net: mptcp: don't hang before sending 'MP capable with data'
the following packetdrill script
socket(..., SOCK_STREAM, IPPROTO_MPTCP) = 3
fcntl(3, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
connect(3, ..., ...) = -1 EINPROGRESS (Operation now in progress)
> S 0:0(0) <mss 1460,sackOK,TS val 100 ecr 0,nop,wscale 8,mpcapable v1 flags[flag_h] nokey>
< S. 0:0(0) ack 1 win 65535 <mss 1460,sackOK,TS val 700 ecr 100,nop,wscale 8,mpcapable v1 flags[flag_h] key[skey=2]>
> . 1:1(0) ack 1 win 256 <nop, nop, TS val 100 ecr 700,mpcapable v1 flags[flag_h] key[ckey,skey]>
getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
fcntl(3, F_SETFL, O_RDWR) = 0
write(3, ..., 1000) = 1000
doesn't transmit 1KB data packet after a successful three-way-handshake,
using mp_capable with data as required by protocol v1, and write() hangs
forever:
PID: 973 TASK:
ffff97dd399cae80 CPU: 1 COMMAND: "packetdrill"
#0 [
ffffa9b94062fb78] __schedule at
ffffffff9c90a000
#1 [
ffffa9b94062fc08] schedule at
ffffffff9c90a4a0
#2 [
ffffa9b94062fc18] schedule_timeout at
ffffffff9c90e00d
#3 [
ffffa9b94062fc90] wait_woken at
ffffffff9c120184
#4 [
ffffa9b94062fcb0] sk_stream_wait_connect at
ffffffff9c75b064
#5 [
ffffa9b94062fd20] mptcp_sendmsg at
ffffffff9c8e801c
#6 [
ffffa9b94062fdc0] sock_sendmsg at
ffffffff9c747324
#7 [
ffffa9b94062fdd8] sock_write_iter at
ffffffff9c7473c7
#8 [
ffffa9b94062fe48] new_sync_write at
ffffffff9c302976
#9 [
ffffa9b94062fed0] vfs_write at
ffffffff9c305685
#10 [
ffffa9b94062ff00] ksys_write at
ffffffff9c305985
#11 [
ffffa9b94062ff38] do_syscall_64 at
ffffffff9c004475
#12 [
ffffa9b94062ff50] entry_SYSCALL_64_after_hwframe at
ffffffff9ca0008c
RIP:
00007f959407eaf7 RSP:
00007ffe9e95a910 RFLAGS:
00000293
RAX:
ffffffffffffffda RBX:
0000000000000008 RCX:
00007f959407eaf7
RDX:
00000000000003e8 RSI:
0000000001785fe0 RDI:
0000000000000008
RBP:
0000000001785fe0 R8:
0000000000000000 R9:
0000000000000003
R10:
0000000000000007 R11:
0000000000000293 R12:
00000000000003e8
R13:
00007ffe9e95ae30 R14:
0000000000000000 R15:
0000000000000000
ORIG_RAX:
0000000000000001 CS: 0033 SS: 002b
Fix it ensuring that socket state is TCP_ESTABLISHED on reception of the
third ack.
Fixes: 1954b86016cf ("mptcp: Check connection state before attempting send")
Suggested-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King [Wed, 11 Mar 2020 09:16:13 +0000 (09:16 +0000)]
soc: qcom: ipa: fix spelling mistake "cahces" -> "caches"
There is a spelling mistake in a dev_err message. Fix it.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Chen Zhou [Wed, 11 Mar 2020 06:54:11 +0000 (14:54 +0800)]
net: ibm: remove set but not used variables 'err'
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/net/ethernet/ibm/emac/core.c: In function __emac_mdio_write:
drivers/net/ethernet/ibm/emac/core.c:875:9: warning:
variable err set but not used [-Wunused-but-set-variable]
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jules Irenge [Wed, 11 Mar 2020 01:09:06 +0000 (01:09 +0000)]
net: Add missing annotation for *netlink_seq_start()
Sparse reports a warning at netlink_seq_start()
warning: context imbalance in netlink_seq_start() - wrong count at exit
The root cause is the missing annotation at netlink_seq_start()
Add the missing __acquires(RCU) annotation
Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jules Irenge [Wed, 11 Mar 2020 01:09:03 +0000 (01:09 +0000)]
tcp: Add missing annotation for tcp_child_process()
Sparse reports warning at tcp_child_process()
warning: context imbalance in tcp_child_process() - unexpected unlock
The root cause is the missing annotation at tcp_child_process()
Add the missing __releases(&((child)->sk_lock.slock)) annotation
Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jules Irenge [Wed, 11 Mar 2020 01:09:02 +0000 (01:09 +0000)]
raw: Add missing annotations to raw_seq_start() and raw_seq_stop()
Sparse reports warnings at raw_seq_start() and raw_seq_stop()
warning: context imbalance in raw_seq_start() - wrong count at exit
warning: context imbalance in raw_seq_stop() - unexpected unlock
The root cause is the missing annotations at raw_seq_start()
and raw_seq_stop()
Add the missing __acquires(&h->lock) annotation
Add the missing __releases(&h->lock) annotation
Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Julian Wiedmann [Tue, 10 Mar 2020 16:53:35 +0000 (17:53 +0100)]
net: sched: make newly activated qdiscs visible
In their .attach callback, mq[prio] only add the qdiscs of the currently
active TX queues to the device's qdisc hash list.
If a user later increases the number of active TX queues, their qdiscs
are not visible via eg. 'tc qdisc show'.
Add a hook to netif_set_real_num_tx_queues() that walks all active
TX queues and adds those which are missing to the hash list.
CC: Eric Dumazet <edumazet@google.com>
CC: Jamal Hadi Salim <jhs@mojatatu.com>
CC: Cong Wang <xiyou.wangcong@gmail.com>
CC: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Pavel Machek [Mon, 9 Mar 2020 22:33:23 +0000 (23:33 +0100)]
net: slcan, slip -- no need for goto when if () will do
No need to play with gotos to jump over single statement.
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jose Abreu [Mon, 9 Mar 2020 13:30:22 +0000 (14:30 +0100)]
net: stmmac: selftests: Fix L3/L4 Filtering test
Since commit
319a1d19471e, stmmac only support basic HW stats type for
action. Set this field in the L3/L4 Filtering test so that it correctly
setups the filter instead of returning EOPNOTSUPP.
Fixes: 319a1d19471e ("flow_offload: check for basic action hw stats type")
Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Bersenev [Thu, 5 Mar 2020 20:33:16 +0000 (01:33 +0500)]
cdc_ncm: Implement the 32-bit version of NCM Transfer Block
The NCM specification defines two formats of transfer blocks: with 16-bit
fields (NTB-16) and with 32-bit fields (NTB-32). Currently only NTB-16 is
implemented.
This patch adds the support of NTB-32. The motivation behind this is that
some devices such as E5785 or E5885 from the current generation of Huawei
LTE routers do not support NTB-16. The previous generations of Huawei
devices are also use NTB-32 by default.
Also this patch enables NTB-32 by default for Huawei devices.
During the 2019 ValdikSS made five attempts to contact Huawei to add the
NTB-16 support to their router firmware, but they were unsuccessful.
Signed-off-by: Alexander Bersenev <bay@hackerdom.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Martin Varghese [Thu, 12 Mar 2020 03:03:51 +0000 (08:33 +0530)]
bareudp: Fixed bareudp receive handling
Reverted commit "
2baecda bareudp: remove unnecessary udp_encap_enable() in
bareudp_socket_create()"
An explicit call to udp_encap_enable is needed as the setup_udp_tunnel_sock
does not call udp_encap_enable if the if the socket is of type v6.
Bareudp device uses v6 socket to receive v4 & v6 traffic
CC: Taehee Yoo <ap420073@gmail.com>
Fixes: 2baecda37f4e ("bareudp: remove unnecessary udp_encap_enable() in bareudp_socket_create()")
Signed-off-by: Martin Varghese <martin.varghese@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tangbin [Wed, 11 Mar 2020 02:05:37 +0000 (10:05 +0800)]
ftgmac100: Remove redundant judgement
In this function, ftgmac100_probe() can be triggered only
if the platform_device and platform_driver matches, so the
judgement at the beginning is redundant.
Signed-off-by: tangbin <tangbin@cmss.chinamobile.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Remi Pommarel [Sat, 29 Feb 2020 16:13:47 +0000 (17:13 +0100)]
ath9k: Handle txpower changes even when TPC is disabled
When TPC is disabled IEEE80211_CONF_CHANGE_POWER event can be handled to
reconfigure HW's maximum txpower.
This fixes 0dBm txpower setting when user attaches to an interface for
the first time with the following scenario:
ieee80211_do_open()
ath9k_add_interface()
ath9k_set_txpower() /* Set TX power with not yet initialized
sc->hw->conf.power_level */
ieee80211_hw_config() /* Iniatilize sc->hw->conf.power_level and
raise IEEE80211_CONF_CHANGE_POWER */
ath9k_config() /* IEEE80211_CONF_CHANGE_POWER is ignored */
This issue can be reproduced with the following:
$ modprobe -r ath9k
$ modprobe ath9k
$ wpa_supplicant -i wlan0 -c /tmp/wpa.conf &
$ iw dev /* Here TX power is either 0 or 3 depending on RF chain */
$ killall wpa_supplicant
$ iw dev /* TX power goes back to calibrated value and subsequent
calls will be fine */
Fixes: 283dd11994cde ("ath9k: add per-vif TX power capability")
Cc: stable@vger.kernel.org
Signed-off-by: Remi Pommarel <repk@triplefau.lt>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Krzysztof Kozlowski [Mon, 24 Feb 2020 18:24:47 +0000 (19:24 +0100)]
ath5k: Add proper dependency for ATH5K_AHB
The CONFIG_ATH5K_AHB could be enabled on ATH25 system without enabling
ATH5K driver itself. This does not make sense because CONFIG_ATH5K_AHB
controls object build within drivers/net/wireless/ath/ath5k/ so enabling
it without CONFIG_ATH5K brings nothing.
Add proper dependency to CONFIG_ATH5K_AHB.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Pradeep Kumar Chitrapu [Sat, 15 Feb 2020 00:25:22 +0000 (05:55 +0530)]
ath11k: add thermal sensor device support
Temperature sensor generates electrical analog voltage from temperature
of each chain. The analog voltage is converted to digital value through
ADC. For reading temperature values fom user space, hw monitoring device
is used.
Whenever the user requests for current temperature, the driver sends WMI
command and wait for response. For reading temperature,
cat /sys/class/ieee80211/phy*/device/hwmon/hwmon2/temp1_input
Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Pradeep Kumar Chitrapu [Sat, 15 Feb 2020 00:25:21 +0000 (05:55 +0530)]
ath11k: add thermal cooling device support
Thermal cooling device support is added to control the temperature by
throttling the data transmission for the given duration. Throttling is
done by suspending all data tx queues by given percentage of time. The
thermal device allows user to configure duty cycle.
Throttling can be disabled by setting the duty cycle to 0. The cooling
device can be found under /sys/class/thermal/cooling_deviceX/.
Corresponding soft link to this device can be found under phy folder.
/sys/class/ieee80211/phy*/device/cooling_device.
To set duty cycle as 40%,
echo 40 >/sys/class/ieee80211/phy*/device/cooling_device/cur_state
Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Yibo Zhao [Thu, 20 Feb 2020 04:03:25 +0000 (12:03 +0800)]
ath10k: fix not registering airtime of 11a station with WMM disable
The tid of 11a station with WMM disable reported by FW is 0x10 in
tx completion. The tid 16 is mapped to a NULL txq since buffer
MMPDU capbility is not supported. Then 11a station's airtime will
not be registered due to NULL txq check. As a results, airtime of
11a station keeps unchanged in debugfs system.
Mask the tid along with IEEE80211_QOS_CTL_TID_MASK to make it in
the valid range.
Hardwares tested : QCA9984
Firmwares tested : 10.4-3.10-00047
Signed-off-by: Yibo Zhao <yiboz@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Govindaraj Saminathan [Fri, 14 Feb 2020 02:18:44 +0000 (07:48 +0530)]
ath11k: config reorder queue for all tids during peer setup
Currently rx tid setup is happening for TID 0 and TID 16
during peer setup. And if other TID packets received for
the peer it will be redirected to rx error ring and not through
reo ring. And this rx tid configuration cannot be done
in the rx error ring path since it is a atomic context.
So moving the rx tid setup for all tids during the peer setup.
This is required to enable PN offload functionality to route
all packets through reo ring.
Co-developed-by: Tamizh Chelvam <tamizhr@codeaurora.org>
Signed-off-by: Tamizh Chelvam <tamizhr@codeaurora.org>
Signed-off-by: Govindaraj Saminathan <gsamin@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Yingying Tang [Fri, 14 Feb 2020 08:51:18 +0000 (16:51 +0800)]
ath10k: fix unsupported chip reset debugs file write
Before this change, after writing "warm_hw_reset" debugfs file, host
will send chip reset command to FW even though FW do not support this
service getting a warning print.
Though there is no FW impact before this change, this patch restricts
chip reset command sent to FW only if FW advertises the support via WMI
service bit.
Removed the redundant check and ath10k_warn() print as well.
New version FW will report chip reset service bit to host. Host allow user
to trigger WLAN chip reset only when fw report this service bit.
For older NON-TLV FW, since it do not report chip reset service bit, host
will not send chip reset command. For older TLV FW, since it report chip
reset service bit, host will send chip reset command.
Tested HW: QCA9984, WCN3990
QCA9984 FW version: WLAN.BL.3.9.0.2-00042-S-1
Signed-off-by: Yingying Tang <yintang@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Wen Gong [Fri, 14 Feb 2020 03:42:18 +0000 (11:42 +0800)]
ath10k: use kzalloc to read for ath10k_sdio_hif_diag_read
When use command to read values, it crashed.
command:
dd if=/sys/kernel/debug/ieee80211/phy0/ath10k/mem_value count=1 bs=4 skip=$((0x100233))
It will call to ath10k_sdio_hif_diag_read with address = 0x4008cc and buf_len = 4.
Then system crash:
[ 1786.013258] Unable to handle kernel paging request at virtual address
ffffffc00bd45000
[ 1786.013273] Mem abort info:
[ 1786.013281] ESR = 0x96000045
[ 1786.013291] Exception class = DABT (current EL), IL = 32 bits
[ 1786.013299] SET = 0, FnV = 0
[ 1786.013307] EA = 0, S1PTW = 0
[ 1786.013314] Data abort info:
[ 1786.013322] ISV = 0, ISS = 0x00000045
[ 1786.013330] CM = 0, WnR = 1
[ 1786.013342] swapper pgtable: 4k pages, 39-bit VAs, pgdp =
000000008542a60e
[ 1786.013350] [
ffffffc00bd45000] pgd=
0000000000000000, pud=
0000000000000000
[ 1786.013368] Internal error: Oops:
96000045 [#1] PREEMPT SMP
[ 1786.013609] Process swapper/0 (pid: 0, stack limit = 0x0000000084b153c6)
[ 1786.013623] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.19.86 #137
[ 1786.013631] Hardware name: MediaTek krane sku176 board (DT)
[ 1786.013643] pstate:
80000085 (Nzcv daIf -PAN -UAO)
[ 1786.013662] pc : __memcpy+0x94/0x180
[ 1786.013678] lr : swiotlb_tbl_unmap_single+0x84/0x150
[ 1786.013686] sp :
ffffff8008003c60
[ 1786.013694] x29:
ffffff8008003c90 x28:
ffffffae96411f80
[ 1786.013708] x27:
ffffffae960d2018 x26:
ffffff8019a4b9a8
[ 1786.013721] x25:
0000000000000000 x24:
0000000000000001
[ 1786.013734] x23:
ffffffae96567000 x22:
00000000000051d4
[ 1786.013747] x21:
0000000000000000 x20:
00000000fe6e9000
[ 1786.013760] x19:
0000000000000004 x18:
0000000000000020
[ 1786.013773] x17:
0000000000000001 x16:
0000000000000000
[ 1786.013787] x15:
00000000ffffffff x14:
00000000000044c0
[ 1786.013800] x13:
0000000000365ba4 x12:
0000000000000000
[ 1786.013813] x11:
0000000000000001 x10:
00000037be6e9000
[ 1786.013826] x9 :
ffffffc940000000 x8 :
000000000bd45000
[ 1786.013839] x7 :
0000000000000000 x6 :
ffffffc00bd45000
[ 1786.013852] x5 :
0000000000000000 x4 :
0000000000000000
[ 1786.013865] x3 :
0000000000000c00 x2 :
0000000000000004
[ 1786.013878] x1 :
fffffff7be6e9004 x0 :
ffffffc00bd45000
[ 1786.013891] Call trace:
[ 1786.013903] __memcpy+0x94/0x180
[ 1786.013914] unmap_single+0x6c/0x84
[ 1786.013925] swiotlb_unmap_sg_attrs+0x54/0x80
[ 1786.013938] __swiotlb_unmap_sg_attrs+0x8c/0xa4
[ 1786.013952] msdc_unprepare_data+0x6c/0x84
[ 1786.013963] msdc_request_done+0x58/0x84
[ 1786.013974] msdc_data_xfer_done+0x1a0/0x1c8
[ 1786.013985] msdc_irq+0x12c/0x17c
[ 1786.013996] __handle_irq_event_percpu+0xe4/0x250
[ 1786.014006] handle_irq_event_percpu+0x28/0x68
[ 1786.014015] handle_irq_event+0x48/0x78
[ 1786.014026] handle_fasteoi_irq+0xd0/0x1a0
[ 1786.014039] __handle_domain_irq+0x84/0xc4
[ 1786.014050] gic_handle_irq+0x124/0x1a4
[ 1786.014059] el1_irq+0xb0/0x128
[ 1786.014072] cpuidle_enter_state+0x298/0x328
[ 1786.014082] cpuidle_enter+0x30/0x40
[ 1786.014094] do_idle+0x190/0x268
[ 1786.014104] cpu_startup_entry+0x24/0x28
[ 1786.014116] rest_init+0xd4/0xe0
[ 1786.014126] start_kernel+0x30c/0x38c
[ 1786.014139] Code:
f8408423 f80084c3 36100062 b8404423 (
b80044c3)
[ 1786.014150] ---[ end trace
3b02ddb698ea69ee ]---
[ 1786.015415] Kernel panic - not syncing: Fatal exception in interrupt
[ 1786.015433] SMP: stopping secondary CPUs
[ 1786.015447] Kernel Offset: 0x2e8d200000 from 0xffffff8008000000
[ 1786.015458] CPU features: 0x0,
2188200c
[ 1786.015466] Memory Limit: none
For sdio chip, it need the memory which is kmalloc, if it is
vmalloc from ath10k_mem_value_read, then it have a memory error.
kzalloc of ath10k_sdio_hif_diag_read32 is the correct type, so
add kzalloc in ath10k_sdio_hif_diag_read to replace the buffer
which is vmalloc from ath10k_mem_value_read.
This patch only effect sdio chip.
Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00029.
Signed-off-by: Wen Gong <wgong@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Wen Gong [Fri, 14 Feb 2020 03:40:07 +0000 (11:40 +0800)]
ath10k: start recovery process when read int status fail for sdio
When running simulate crash stress test, it happened
"failed to read from address 0x800: -110".
Test steps:
1. Run command continuous
echo soft > /sys/kernel/debug/ieee80211/phy0/ath10k/simulate_fw_crash
2. error happened and it did not begin recovery for long time.
[74377.334846] ath10k_sdio mmc1:0001:1: simulating soft firmware crash
[74378.378217] ath10k_sdio mmc1:0001:1: failed to read from address 0x800: -110
[74378.378371] ath10k_sdio mmc1:0001:1: failed to process pending SDIO interrupts: -110
It has sdio errors since it can not read MBOX_HOST_INT_STATUS_ADDRESS,
then it has to do recovery process to recovery ath10k.
Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00042.
Signed-off-by: Wen Gong <wgong@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Erik Stromdahl [Thu, 26 Sep 2019 14:24:27 +0000 (17:24 +0300)]
ath10k: add QCA9377 sdio hw_param item
Add hardware parameters for QCA9377 sdio devices, it's now properly supported.
Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Vikas Patel [Tue, 7 Jan 2020 06:23:15 +0000 (11:53 +0530)]
ath10k: avoid consecutive OTP download to reduce boot time
Currently, OTP is downloaded twice in case of "pre-cal-dt"
and "pre-cal-file" to fetch the board ID and takes around
~2 sec more boot uptime.
First OTP download happens in "ath10k_core_probe_fw" and
second in ath10k_core_start. First boot does not need OTP
download in core start when valid board id acquired.
The second OTP download is required upon core stop/start.
This patch skips the OTP download when first OTP download
has acquired a valid board id. This patch also marks board
id invalid in "ath10k_core_stop", which will force the OTP
download in ath10k_core_start and fetches valid board id.
Tested HW: QCA9984
Tested FW: 10.4-3.6-00104
Signed-off-by: Vikas Patel <vikpatel@codeaurora.org>
Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
David S. Miller [Tue, 10 Mar 2020 23:28:54 +0000 (16:28 -0700)]
Merge branch 'ethtool-consolidate-irq-coalescing-part-3'
Jakub Kicinski says:
====================
ethtool: consolidate irq coalescing - part 3
Convert more drivers following the groundwork laid in a recent
patch set [1] and continued in [2]. The aim of the effort is to
consolidate irq coalescing parameter validation in the core.
This set converts 15 drivers in drivers/net/ethernet.
3 more conversion sets to come.
None of the drivers here checked all unsupported parameters.
[1] https://lore.kernel.org/netdev/
20200305051542.991898-1-kuba@kernel.org/
[2] https://lore.kernel.org/netdev/
20200306010602.
1620354-1-kuba@kernel.org/
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Jakub Kicinski [Tue, 10 Mar 2020 02:15:12 +0000 (19:15 -0700)]
net: gemini: reject unsupported coalescing params
Set ethtool_ops->supported_coalesce_params to let
the core reject unsupported coalescing parameters.
This driver did not previously reject unsupported parameters.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jakub Kicinski [Tue, 10 Mar 2020 02:15:11 +0000 (19:15 -0700)]
net: cxgb4vf: reject unsupported coalescing params
Set ethtool_ops->supported_coalesce_params to let
the core reject unsupported coalescing parameters.
This driver did not previously reject unsupported parameters.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jakub Kicinski [Tue, 10 Mar 2020 02:15:10 +0000 (19:15 -0700)]
net: cxgb4: reject unsupported coalescing params
Set ethtool_ops->supported_coalesce_params to let
the core reject unsupported coalescing parameters.
This driver did not previously reject unsupported parameters.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jakub Kicinski [Tue, 10 Mar 2020 02:15:09 +0000 (19:15 -0700)]
net: cxgb3: reject unsupported coalescing params
Set ethtool_ops->supported_coalesce_params to let
the core reject unsupported coalescing parameters.
This driver did not previously reject unsupported parameters.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jakub Kicinski [Tue, 10 Mar 2020 02:15:08 +0000 (19:15 -0700)]
net: cxgb2: reject unsupported coalescing params
Set ethtool_ops->supported_coalesce_params to let
the core reject unsupported coalescing parameters.
This driver did not previously reject unsupported parameters.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jakub Kicinski [Tue, 10 Mar 2020 02:15:07 +0000 (19:15 -0700)]
net: mlx4: reject unsupported coalescing params
Set ethtool_ops->supported_coalesce_params to let
the core reject unsupported coalescing parameters.
This driver did not previously reject unsupported parameters.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jakub Kicinski [Tue, 10 Mar 2020 02:15:06 +0000 (19:15 -0700)]
net: liquidio: reject unsupported coalescing params
Set ethtool_ops->supported_coalesce_params to let
the core reject unsupported coalescing parameters.
This driver did not previously reject unsupported parameters.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jakub Kicinski [Tue, 10 Mar 2020 02:15:05 +0000 (19:15 -0700)]
net: bna: reject unsupported coalescing params
Set ethtool_ops->supported_coalesce_params to let
the core reject unsupported coalescing parameters.
This driver did not previously reject unsupported parameters.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jakub Kicinski [Tue, 10 Mar 2020 02:15:04 +0000 (19:15 -0700)]
net: tg3: reject unsupported coalescing params
Set ethtool_ops->supported_coalesce_params to let
the core reject unsupported coalescing parameters.
This driver did not previously reject unsupported parameters.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jakub Kicinski [Tue, 10 Mar 2020 02:15:03 +0000 (19:15 -0700)]
net: bcmgenet: reject unsupported coalescing params
Set ethtool_ops->supported_coalesce_params to let
the core reject unsupported coalescing parameters.
This driver did not previously reject all unsupported parameters.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jakub Kicinski [Tue, 10 Mar 2020 02:15:02 +0000 (19:15 -0700)]
net: bnx2x: reject unsupported coalescing params
Set ethtool_ops->supported_coalesce_params to let
the core reject unsupported coalescing parameters.
This driver did not previously reject unsupported parameters.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jakub Kicinski [Tue, 10 Mar 2020 02:15:01 +0000 (19:15 -0700)]
net: bnx2: reject unsupported coalescing params
Set ethtool_ops->supported_coalesce_params to let
the core reject unsupported coalescing parameters.
This driver did not previously reject unsupported parameters.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jakub Kicinski [Tue, 10 Mar 2020 02:15:00 +0000 (19:15 -0700)]
net: systemport: reject unsupported coalescing params
Set ethtool_ops->supported_coalesce_params to let
the core reject unsupported coalescing parameters.
This driver did not previously reject most of unsupported
parameters.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jakub Kicinski [Tue, 10 Mar 2020 02:14:59 +0000 (19:14 -0700)]
net: aquantia: reject all unsupported coalescing params
Set ethtool_ops->supported_coalesce_params to let
the core reject unsupported coalescing parameters.
This driver only rejected some of the unsupported parameters.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jakub Kicinski [Tue, 10 Mar 2020 02:14:58 +0000 (19:14 -0700)]
net: ena: reject unsupported coalescing params
Set ethtool_ops->supported_coalesce_params to let
the core reject unsupported coalescing parameters.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Sameeh Jubran <sameehj@amazon.com>
Acked-by: Sameeh Jubran <sameehj@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Heiner Kallweit [Tue, 10 Mar 2020 22:15:00 +0000 (23:15 +0100)]
r8169: simplify getting stats by using netdev_stats_to_stats64
Let netdev_stats_to_stats64() do the copy work for us.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Heiner Kallweit [Tue, 10 Mar 2020 22:14:41 +0000 (23:14 +0100)]
r8169: let rtl8169_mark_to_asic clear rx descriptor field opts2
Clearing opts2 belongs to preparing the descriptor for DMA engine use.
Therefore move it into rtl8169_mark_to_asic().
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 10 Mar 2020 23:20:03 +0000 (16:20 -0700)]
Merge branch '100GbE' of git://git./linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says:
====================
100GbE Intel Wired LAN Driver Updates 2020-03-10
This series contains updates to ice and iavf drivers.
Cleaned up unnecessary parenthesis, which was pointed out by Sergei
Shtylyov.
Mitch updates the iavf and ice drivers to expand the limitation on the
number of queues that the driver can support to account for the newer
800-series capabilities.
Brett cleans up the error messages for both SR-IOV and non SR-IOV use
cases. Fixed the logic when the ice driver is removed and a bare-metal
VF is passing traffic, which was causing a transmit hang on the VF.
Updated the ice driver to display "Link detected" field via ethtool,
when the driver is in safe mode. Updated ice driver to properly set
VLAN pruning when transmit anti-spoof is off.
Avinash fixed a corner case in DCB, when switching from IEEE to CEE
mode, the DCBX mode does not get properly updated.
Dave updates the logic when switching from software DCB to firmware DCB
to renegotiate DCBX to ensure the firmware agent has up to date
information about the DCB settings of the link partner.
Lukasz increases the PF's mailbox receive queue size to the maximum to
prevent potential bottleneck or slow down occurring from the PF's
mailbox receive queue being full.
Bruce updates the ice driver to use strscpy() instead of strlcpy().
Cleaned up variable names that were not very descriptive with names that
had more meaning.
Anirudh replaces the use of ENOTSUPP with EOPNOTSUPP in the ice driver.
Jake fixed up a function header comment to properly reflect the variable
size and use.
v2: Dropped patch 5 of the original series, where Tony added tunnel
offload support. Based on community feedback, the patch needed
changes, so giving Tony additional time to work on those changes and
not hold up the remaining changes in the series.
====================
Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
DENG Qingfang [Tue, 10 Mar 2020 18:20:50 +0000 (02:20 +0800)]
net: dsa: mt7530: fix macro MIRROR_PORT
The inner pair of parentheses should be around the variable x
Fixes: 37feab6076aa ("net: dsa: mt7530: add support for port mirroring")
Signed-off-by: DENG Qingfang <dqfext@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
George McCollister [Tue, 10 Mar 2020 17:58:59 +0000 (12:58 -0500)]
net: dsa: microchip: use delayed_work instead of timer + work
Simplify ksz_common.c by using delayed_work instead of a combination of
timer and work.
Signed-off-by: George McCollister <george.mccollister@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 10 Mar 2020 23:04:19 +0000 (16:04 -0700)]
Merge branch 'flow_offload-follow-ups-to-HW-stats-type-patchset'
Jiri Pirko says:
====================
flow_offload: follow-ups to HW stats type patchset
This patchset includes couple of patches in reaction to the discussions
to the original HW stats patchset. The first patch is a fix,
the other two patches are basically cosmetics.
====================
Acked-by: Edward Cree <ecree@solarflare.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jiri Pirko [Tue, 10 Mar 2020 15:49:09 +0000 (16:49 +0100)]
flow_offload: restrict driver to pass one allowed bit to flow_action_hw_stats_types_check()
The intention of this helper was to allow driver to specify one type
that it supports, so not only "any" value would pass. So make the API
more strict and allow driver to pass only 1 bit that is going
to be checked.
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jiri Pirko [Tue, 10 Mar 2020 15:49:08 +0000 (16:49 +0100)]
flow_offload: turn hw_stats_type into dedicated enum
Put the values into enum and add an enum to define the bits.
Suggested-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jiri Pirko [Tue, 10 Mar 2020 15:49:07 +0000 (16:49 +0100)]
flow_offload: fix allowed types check
Change the check to see if the passed allowed type bit is enabled.
Fixes: 319a1d19471e ("flow_offload: check for basic action hw stats type")
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 10 Mar 2020 22:48:54 +0000 (15:48 -0700)]
Merge branch 'enetc-Support-extended-BD-rings-at-runtime'
Claudiu Manoil says:
====================
enetc: Support extended BD rings at runtime
First two patches are just misc code cleanup.
The 3rd patch prepares the Rx BD processing code to be extended
to processing both normal and extended BDs.
The last one adds extended Rx BD support for timestamping
without the need of a static config. Finally, the config option
FSL_ENETC_HW_TIMESTAMPING can be dropped.
Care was taken not to impact non-timestamping usecases.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Claudiu Manoil [Tue, 10 Mar 2020 12:51:24 +0000 (14:51 +0200)]
enetc: Add dynamic allocation of extended Rx BD rings
Hardware timestamping support (PTP) on Rx requires extended
buffer descriptors, double the size of normal Rx descriptors.
On the current controller revision only the timestamping offload
requires extended Rx descriptors.
Since Rx timestamping can be turned on/off at runtime, make Rx ring
allocation configurable at runtime too. As a result, the static
config option FSL_ENETC_HW_TIMESTAMPING can be dropped and the
extended descriptors can be used only when Rx timestamping gets
activated.
The extension has the same size as the base descriptor, making
the descriptor iterators easy to update for the extended case.
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Claudiu Manoil [Tue, 10 Mar 2020 12:51:23 +0000 (14:51 +0200)]
enetc: Clean up Rx BD iteration
Improve maintainability of the code iterating the Rx buffer
descriptors to prepare it to support iterating extended Rx BD
descriptors as well.
Don't increment by one the h/w descriptor pointers explicitly,
provide an iterator that takes care of the h/w details.
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Claudiu Manoil [Tue, 10 Mar 2020 12:51:22 +0000 (14:51 +0200)]
enetc: Clean up of ehtool stats len
Refactor the stats len computation code to make it easier
to add new stats counters.
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Claudiu Manoil [Tue, 10 Mar 2020 12:51:21 +0000 (14:51 +0200)]
enetc: Drop redundant device node check
The existence of the DT port node is the first thing checked
at probe time, and probing won't reach this point if the node
is missing.
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Lukas Wunner [Tue, 10 Mar 2020 10:49:46 +0000 (11:49 +0100)]
pktgen: Allow on loopback device
When pktgen is used to measure the performance of dev_queue_xmit()
packet handling in the core, it is preferable to not hand down
packets to a low-level Ethernet driver as it would distort the
measurements.
Allow using pktgen on the loopback device, thus constraining
measurements to core code.
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jiri Pirko [Tue, 10 Mar 2020 10:11:57 +0000 (11:11 +0100)]
flow_offload: use flow_action_for_each in flow_action_mixed_hw_stats_types_check()
Instead of manually iterating over entries, use flow_action_for_each
helper. Move the helper and wrap it to fit to 80 cols on the way.
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Acked-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jacob Keller [Thu, 27 Feb 2020 18:15:05 +0000 (10:15 -0800)]
ice: fix incorrect size description of ice_get_nvm_version
The function comment for ice_get_nvm_version indicated that the ver_hi
and ver_lo values were 16 bits. In fact, they are only uint8_t values,
meaning that they have a maximum size of 8 bits. Fix the comment to
match the correct size.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Bruce Allan [Thu, 27 Feb 2020 18:15:04 +0000 (10:15 -0800)]
ice: use variable name more descriptive than type
The variable name 'type' is not very descriptive. Replace instances of
those with a variable name that is more descriptive or replace it if not
needed.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Anirudh Venkataramanan [Thu, 27 Feb 2020 18:15:03 +0000 (10:15 -0800)]
ice: Use EOPNOTSUPP instead of ENOTSUPP
Using ENOTSUPP almost always results in some bizarre error message to
be printed in userspace. This is likely because ENOTSUPP was defined for
the NFS protocol (as per a comment in include/linux/errno.h). Use
EOPNOTSUPP instead.
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Tony Nguyen [Thu, 27 Feb 2020 18:15:02 +0000 (10:15 -0800)]
ice: Fix format specifier
Commit
ed5a3f664c55 ("ice: Removing hung_queue variable to use txqueue
function parameter") began utilizing the txqueue variable over the
hung_queue variable. hung_queue was an int where txqueue is an unsigned
int. Update the format specifiers to reflect the new type.
Fixes: ed5a3f664c55 ("ice: Removing hung_queue variable to use txqueue function parameter")
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Bruce Allan [Thu, 27 Feb 2020 18:15:01 +0000 (10:15 -0800)]
ice: fix use of deprecated strlcpy()
checkpatch complains "CHECK:DEPRECATED_API: Deprecated use of 'strlcpy',
prefer 'stracpy or strscpy' instead"; use strscpy.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Lukasz Czapnik [Thu, 27 Feb 2020 18:15:00 +0000 (10:15 -0800)]
ice: Increase mailbox receive queue length to maximum
Currently the PF's mailbox receive queue is only 512 entries. This fine,
but considering that all VF's mailbox send queues funnel into the PF's
single mailbox receive queue, let's increase it to the maximum size. This
will help prevent any possible bottleneck/slowdown occurring from the PF's
mailbox receive queue being full.
Signed-off-by: Lukasz Czapnik <lukasz.czapnik@intel.com>
Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Brett Creeley [Thu, 27 Feb 2020 18:14:59 +0000 (10:14 -0800)]
ice: Correct setting VLAN pruning
VLAN pruning is not always being set correctly due to a previous change
that set Tx antispoof off. ice_vsi_is_vlan_pruning_ena() currently checks
for both Tx antispoof and Rx pruning. The expectation for this function is
to only check Rx pruning so fix the check.
Fixes: cd6d6b83316a ("ice: Fix VF spoofchk")
Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Dave Ertman [Thu, 27 Feb 2020 18:14:58 +0000 (10:14 -0800)]
ice: renegotiate link after FW DCB on
When switching from SW DCB to FW DCB it is necessary
to renegotiate DCBx so that the FW agent can have up
to date information about the DCB settings of the link
partner.
Perform an autoneg restart on the link when activating
FW DCB.
Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Avinash JD [Thu, 27 Feb 2020 18:14:57 +0000 (10:14 -0800)]
ice: Fix corner case when switching from IEEE to CEE
While testing DCB for a corner case in which mode is switched from IEEE to
CEE and pfc_ena bitmask unchanged then DCBX mode doesn't get updated.
This is happening because the function ice_dcb_get_mode() is called
in a "no change detected block" instead of "change detected block".
Signed-off-by: Avinash JD <avinash.dayanand@intel.com>
Signed-off-by: Scott Register <scottx.register@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Brett Creeley [Thu, 27 Feb 2020 18:14:56 +0000 (10:14 -0800)]
ice: Display Link detected via Ethtool in safe mode
Currently the "Link detected" field is not shown when the device goes
into safe mode. This is because the safe mode Ethtool ops does not set the
get_link function. Fix this by setting the safe mode Ethtool op get_link
function.
Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Brett Creeley [Thu, 27 Feb 2020 18:14:55 +0000 (10:14 -0800)]
ice: Fix removing driver while bare-metal VFs pass traffic
Currently, if there are bare-metal VFs passing traffic and the ice
driver is removed, there is a possibility of VFs triggering a Tx timeout
right before iavf_remove(). This is causing iavf_close() to not be
called because there is a check in the beginning of iavf_remove() that
bails out early if (adapter->state < IAVF_DOWN_PENDING). This makes it
so some resources do not get cleaned up. Specifically, free_irq()
is never called for data interrupts, which results in the following line
of code to trigger:
pci_disable_msix()
free_msi_irqs()
...
BUG_ON(irq_has_action(entry->irq + i));
...
To prevent the Tx timeout from occurring on the VF during driver unload
for ice and the iavf there are a few changes that are needed.
[1] Don't disable all active VF Tx/Rx queues prior to calling
pci_disable_sriov.
[2] Call ice_free_vfs() before disabling the service task.
[3] Disable VF resets when the ice driver is being unloaded by setting
the pf->state flag __ICE_VF_RESETS_DISABLED.
Changing [1] and [2] allow each VF driver's remove flow to successfully
send VIRTCHNL requests, which includes queue disable. This prevents
unexpected Tx timeouts because the PF driver is no longer forcefully
disabling queues.
Due to [1] and [2] there is a possibility that the PF driver will get a
VFLR or reset request over VIRTCHNL from a VF during PF driver unload.
Prevent that by doing [3].
Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Brett Creeley [Thu, 27 Feb 2020 18:14:53 +0000 (10:14 -0800)]
ice: Improve clarity of prints and variables
Currently when the device runs out of MSI-X interrupts a cryptic and
unhelpful message is printed. This will cause confusion when hitting this
case. Fix this by clearing up the error message for both SR-IOV and non
SR-IOV use cases.
Also, make a few minor changes to increase clarity of variables.
1. Change per VF MSI-X and queue pair variables in the PF structure.
2. Use ICE_NONQ_VECS_VF when determining pf->num_msix_per_vf instead of
the magic number "1". This vector is reserved for the OICR.
All of the resource tracking functions were moved to avoid adding
any forward declaration function prototypes.
Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Mitch Williams [Thu, 27 Feb 2020 18:14:52 +0000 (10:14 -0800)]
ice: allow bigger VFs
Unlike the XL710 series, 800-series hardware can allocate more than 4
MSI-X vectors per VF. This patch enables that functionality. We
dynamically allocate vectors and queues depending on how many VFs are
enabled. Allocating the maximum number of VFs replicates XL710
behavior with 4 queues and 4 vectors. But allocating a smaller number
of VFs will give you 16 queues and 16 vectors.
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Mitch Williams [Thu, 27 Feb 2020 18:14:51 +0000 (10:14 -0800)]
iavf: Enable support for up to 16 queues
Previous devices could only allocate 4 MSI-X vectors per VF so there was a
limitation of 4 queues. 800-series hardware can allocate more than 4 MSI-X
vectors, so expand the limitation on the number of queues that the driver
can support to account for these capabilities.
Fix ethtool channel operations to accommodate this change and adjust the
reporting of max number of queues to what is given to us by the PF. Since
we're not requesting queues above this value, just trigger reset to
activate the queues, which we already own.
Finally, fix a test condition that would display an incorrect error
message.
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jeff Kirsher [Fri, 21 Feb 2020 22:15:27 +0000 (14:15 -0800)]
ice: Cleanup unneeded parenthesis
Sergei Shtylyov pointed out that two instances of parenthesis are not
needed, so remove them.
Suggested-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
David S. Miller [Tue, 10 Mar 2020 03:13:16 +0000 (20:13 -0700)]
Merge branch 'net-Add-support-for-Synopsys-DesignWare-XPCS'
Jose Abreu says:
====================
net: Add support for Synopsys DesignWare XPCS
This adds support for Synopsys DesignWare XPCS in net subsystem and
integrates it into stmmac.
At 1/8, we start by removing the limitation of stmmac selftests that needed
a PHY to pass all the tests.
Then at 2/8 we use some helpers in stmmac so that some code can be
simplified.
At 3/8, we fallback to dev_fwnode() so that PCI based setups wich may
not have CONFIG_OF can still use FW node.
At 4/8, we adapt stmmac to the new PHYLINK changes as suggested by Russell
King.
We proceed by doing changes in PHYLINK in order to support XPCS: At 5/8 we
add some missing speeds that USXGMII supports and at 6/8 we check if
Autoneg is supported after initial parameters are validated.
Support for XPCS is finally introduced at 7/8, along with the usage of it
in stmmac driver at 8/8.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Jose Abreu [Mon, 9 Mar 2020 08:36:27 +0000 (09:36 +0100)]
net: stmmac: Integrate it with DesignWare XPCS
Adds all the necessary logic so that stmmac can be used with Synopsys
DesignWare XPCS.
Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jose Abreu [Mon, 9 Mar 2020 08:36:26 +0000 (09:36 +0100)]
net: phy: Add Synopsys DesignWare XPCS MDIO module
Synopsys DesignWare XPCS is an MMD that can manage link status,
auto-negotiation, link training, ...
In this commit we add basic support for XPCS using USXGMII interface and
Clause 73 Auto-negotiation.
This is highly tied with PHYLINK and can't be used without it. A given
ethernet driver can use the provided callbacks to add the support for
XPCS.
Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jose Abreu [Mon, 9 Mar 2020 08:36:25 +0000 (09:36 +0100)]
net: phylink: Test if MAC/PCS support Autoneg
We may have cases where MAC or PCS do not support Autoneg. Check if it
is supported after validate callback is called.
Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>