aboutsummaryrefslogtreecommitdiff
path: root/drivers/net
AgeCommit message (Collapse)AuthorFilesLines
2021-04-21mt76: mt7615: fix entering driver-own state on mt7663Felix Fietkau1-2/+10
Fixes hardware wakeup issues Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7615: fix hardware error recovery for mt7663Felix Fietkau5-11/+53
MT7663 uses different bits for communicating reset commands/status between MCU and host. Also add an extra initial reset command. Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7921: add dumping Tx power tableSean Wang5-0/+151
Dump the tx power table saved in offload firmware. Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: introduce single-sku support for mt7663/mt7921Lorenzo Bianconi6-1/+170
Introduce support for rate-txpower compensation for mt7663/mt7921 chipsets. Rate-txpower limit is specified through dts Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7615: do not use mt7615 single-sku values for mt7663Lorenzo Bianconi1-0/+5
mt7663 mcu relies on different APIs to configure APIs per-rate power limit respect to mt7615 driver. Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7615: implement support for using DT rate power limitsFelix Fietkau2-2/+69
Limits are used to update the channel max_power settings and also passed to the firmware on channel changes Signed-off-by: Felix Fietkau <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: extend DT rate power limits to support 11ax devicesShayne Chen2-23/+40
Enable parsing per-rate txpower limits from DT for 11ax chipsets. Co-developed-by: Felix Fietkau <[email protected]> Signed-off-by: Felix Fietkau <[email protected]> Tested-by: Evelyn Tsai <[email protected]> Signed-off-by: Shayne Chen <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: add functions for parsing rate power limits from DTFelix Fietkau2-0/+216
This subnode can be used to set per-rate tx power limits either per country code / regdomain or globally. These limits are typically provided by the device manufacturers and are used to limit sideband emissions and stay within regulatory limits Signed-off-by: Felix Fietkau <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: flush tx status queue on DMA resetFelix Fietkau5-0/+10
After DMA reset, tx status information for queued frames will never arrive. Flush the queue to free skbs immediately instead of waiting for a timeout Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7921: add mt7921_dma_cleanup in mt7921_unregister_deviceLorenzo Bianconi1-1/+2
In order to avoid memory leaks, clean the dma engine unloading the module Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7615: use ieee80211_free_txskb() in mt7615_tx_token_put()Ryder Lee1-2/+6
We should use ieee80211_free_txskb() to report skb status avoid wrong aql accounting after reset. Cc: [email protected] Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7615: only free skbs after mt7615_dma_reset() when reset happensRyder Lee1-3/+3
In mt7615_mac_reset_work(), make sure freeing skbs after mt7615_dma_reset(). Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7915: only free skbs after mt7915_dma_reset() when reset happensRyder Lee1-3/+3
In mt7915_mac_reset_work(), make sure freeing skbs after mt7915_dma_reset(). Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7915: fix memleak when mt7915_unregister_device()Ryder Lee1-2/+1
mt7915_tx_token_put() should get call before mt76_free_pending_txwi(). Fixes: f285dfb98562 ("mt76: mt7915: reset token when mac_reset happens") Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7615: fix memleak when mt7615_unregister_device()Ryder Lee1-2/+1
mt7615_tx_token_put() should get call before mt76_free_pending_txwi(). Fixes: a6275e934605 ("mt76: mt7615: reset token when mac_reset happens") Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7915: fix rate setting of tx descriptor in testmodeShayne Chen1-6/+19
Fix ofdm rate index and ldpc setting in rate setting field of tx descriptor. Signed-off-by: Shayne Chen <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7915: rework mt7915_tm_set_tx_len()Shayne Chen1-17/+5
Rework mt7915_tm_set_tx_len() with mt76_testmode_alloc_skb() to support larger packet based on a longer tx_time. Signed-off-by: Shayne Chen <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: testmode: add support to send larger packetShayne Chen4-35/+131
Add support to send larger packet in testmode to meet requirements of some test cases. The limit of max packet size is determined based on tx rate mode setting. Signed-off-by: Shayne Chen <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21rtlwifi: implement set_tim by update beacon contentPing-Ke Shih4-0/+37
Once beacon content is changed, we update the content to wifi card by send_beacon_frame(). Then, STA with PS can wake up properly to receive its packets. Since we update beacon content to PCI wifi devices every beacon interval, the only one usb device, 8192CU, needs to update beacon content when mac80211 calling set_tim. Reported-by: Maciej S. Szmigiero <[email protected]> Signed-off-by: Ping-Ke Shih <[email protected]> Tested-by: Maciej S. Szmigiero <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-04-21libertas_tf: Remove duplicate struct declarationWan Jiabing1-1/+0
struct lbtf_private is declared twice. One has been declared at 157th line. Remove the duplicate. Signed-off-by: Wan Jiabing <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-04-21rtw88: refine napi deinit flowPo-Hao Huang2-5/+15
We used to stop napi before disabling irqs. And it turns out to cause some problem when we try to stop device while interrupt arrives. To safely stop pci, we do three steps: 1. disable interrupt 2. synchronize_irq 3. stop_napi Since step 2 and 3 may not finish as expected when interrupt is enabled, use rtwpci->running to decide whether interrupt should be re-enabled at the time. Fixes: 9e2fd29864c5 ("rtw88: add napi support") Signed-off-by: Po-Hao Huang <[email protected]> Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-04-21rtw88: Fix potential unrecoverable tx queue stopYu-Yen Ting1-2/+8
If there are lots of packets to be transmitted, the driver would check whether the available descriptors are sufficient according the read/write point of tx queue. Once the available descriptor is not enough, ieee80211_stop_queue is called. TX ISR, meanwhile, is releasing the tx resources after the packets are transmitted. This routine may call ieee80211_wake_queue by checking the available descriptor. The potential queue stop problem would occur when the tx queue is stopped due to the heavy traffic. Then thare is no chance to wake the queue up because the read point is not updated immediately, as a result, no more packets coulde be transmitted in this queue. This patch makes sure the ieee80211_wake_queue could be called properly and avoids the race condition when ring->r.rp, ring->queue_stopped are updated. Signed-off-by: Yu-Yen Ting <[email protected]> Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-04-21rtw88: 8821c: Don't set RX_FLAG_DECRYPTED if packet has no encryptionGuo-Feng Fan1-1/+2
The value of GET_RX_DESC_SWDEC() indicates that if this RX packet requires software decryption or not. And software decryption is required when the packet was encrypted and the hardware failed to decrypt it. So, GET_RX_DESC_SWDEC() is negative does not mean that this packet is decrypted, it might just have no encryption at all. To actually see if the packet is decrypted, driver needs to further check if the hardware has successfully decrypted it, with a specific type of encryption algorithm. Signed-off-by: Guo-Feng Fan <[email protected]> Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-04-21rtw88: 8822c: debug: allow debugfs to enable/disable TXGAPKGuo-Feng Fan3-2/+112
Use "cat dm_cap" to show all features; where, prefix +/- means feature is enabled/disabled: $ cat dm_cap DM capability 0x00000002 ( 1) +TXGAPK To control dm_cap: use "echo +1 > dm_cap" to enable TXGAPK use "echo -1 > dm_cap" to disable TXGAPK Below is an example to disable TXGAPK. $ echo -1 > dm_cap $ cat dm_cap DM capability 0x00000000 ( 1) -TXGAPK Below is an example to show TXGAPK status $ echo 1 > dm_cap; cat dm_cap ( 1) +TXGAPK path 0: 0x56 = 0x88c89 [TXGAPK] offset 1 0 [TXGAPK] offset 1 1 [TXGAPK] offset 1 2 [TXGAPK] offset 1 3 [TXGAPK] offset 0 4 [TXGAPK] offset 0 5 [TXGAPK] offset 0 6 [TXGAPK] offset 0 7 [TXGAPK] offset 0 8 [TXGAPK] offset 0 9 path 1: 0x56 = 0x89c89 [TXGAPK] offset 1 0 [TXGAPK] offset 1 1 [TXGAPK] offset 1 2 [TXGAPK] offset 1 3 [TXGAPK] offset 0 4 [TXGAPK] offset 0 5 [TXGAPK] offset 0 6 [TXGAPK] offset 0 7 [TXGAPK] offset 0 8 [TXGAPK] offset 0 9 Signed-off-by: Guo-Feng Fan <[email protected]> Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-04-21rtw88: 8822c: Add gap-k calibration to improve long range performanceGuo-Feng Fan6-1/+809
gap-k is a calibration mechanism to eliminate power gaps between two nearly rate groups. This mechanism improves performance in long range test by applying proper power value to those rate groups which have nonlinear power gap. Signed-off-by: Guo-Feng Fan <[email protected]> Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-04-21rtw88: 8822c: reorder macro position according to the register numberGuo-Feng Fan2-143/+148
This patch doesn't change logic at all, just a refactor patch. 1. Move BIT MASK and BIT definition along with the register definition 2. Remove redundant definition 3. Align macros with Tab key Signed-off-by: Guo-Feng Fan <[email protected]> Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-04-20net: wwan: mhi_wwan_ctrl: Fix RX buffer starvationLoic Poulain1-4/+4
The mhi_wwan_rx_budget_dec function is supposed to return true if RX buffer budget has been successfully decremented, allowing to queue a new RX buffer for transfer. However the current implementation is broken when RX budget is '1', in which case budget is decremented but false is returned, preventing to requeue one buffer, and leading to RX buffer starvation. Fixes: fa588eba632d ("net: Add Qcom WWAN control driver") Signed-off-by: Loic Poulain <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-20net: davinci_emac: Fix incorrect masking of tx and rx error channelColin Ian King1-2/+2
The bit-masks used for the TXERRCH and RXERRCH (tx and rx error channels) are incorrect and always lead to a zero result. The mask values are currently the incorrect post-right shifted values, fix this by setting them to the currect values. (I double checked these against the TMS320TCI6482 data sheet, section 5.30, page 127 to ensure I had the correct mask values for the TXERRCH and RXERRCH fields in the MACSTATUS register). Addresses-Coverity: ("Operands don't affect result") Fixes: a6286ee630f6 ("net: Add TI DaVinci EMAC driver") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-20net: marvell: prestera: fix port event handling on initVadym Kochan1-1/+2
For some reason there might be a crash during ports creation if port events are handling at the same time because fw may send initial port event with down state. The crash points to cancel_delayed_work() which is called when port went is down. Currently I did not find out the real cause of the issue, so fixed it by cancel port stats work only if previous port's state was up & runnig. The following is the crash which can be triggered: [ 28.311104] Unable to handle kernel paging request at virtual address 000071775f776600 [ 28.319097] Mem abort info: [ 28.321914] ESR = 0x96000004 [ 28.324996] EC = 0x25: DABT (current EL), IL = 32 bits [ 28.330350] SET = 0, FnV = 0 [ 28.333430] EA = 0, S1PTW = 0 [ 28.336597] Data abort info: [ 28.339499] ISV = 0, ISS = 0x00000004 [ 28.343362] CM = 0, WnR = 0 [ 28.346354] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000100bf7000 [ 28.352842] [000071775f776600] pgd=0000000000000000, p4d=0000000000000000 [ 28.359695] Internal error: Oops: 96000004 [#1] PREEMPT SMP [ 28.365310] Modules linked in: prestera_pci(+) prestera uio_pdrv_genirq [ 28.372005] CPU: 0 PID: 1291 Comm: kworker/0:1H Not tainted 5.11.0-rc4 #1 [ 28.378846] Hardware name: DNI AmazonGo1 A7040 board (DT) [ 28.384283] Workqueue: prestera_fw_wq prestera_fw_evt_work_fn [prestera_pci] [ 28.391413] pstate: 60000085 (nZCv daIf -PAN -UAO -TCO BTYPE=--) [ 28.397468] pc : get_work_pool+0x48/0x60 [ 28.401442] lr : try_to_grab_pending+0x6c/0x1b0 [ 28.406018] sp : ffff80001391bc60 [ 28.409358] x29: ffff80001391bc60 x28: 0000000000000000 [ 28.414725] x27: ffff000104fc8b40 x26: ffff80001127de88 [ 28.420089] x25: 0000000000000000 x24: ffff000106119760 [ 28.425452] x23: ffff00010775dd60 x22: ffff00010567e000 [ 28.430814] x21: 0000000000000000 x20: ffff80001391bcb0 [ 28.436175] x19: ffff00010775deb8 x18: 00000000000000c0 [ 28.441537] x17: 0000000000000000 x16: 000000008d9b0e88 [ 28.446898] x15: 0000000000000001 x14: 00000000000002ba [ 28.452261] x13: 80a3002c00000002 x12: 00000000000005f4 [ 28.457622] x11: 0000000000000030 x10: 000000000000000c [ 28.462985] x9 : 000000000000000c x8 : 0000000000000030 [ 28.468346] x7 : ffff800014400000 x6 : ffff000106119758 [ 28.473708] x5 : 0000000000000003 x4 : ffff00010775dc60 [ 28.479068] x3 : 0000000000000000 x2 : 0000000000000060 [ 28.484429] x1 : 000071775f776600 x0 : ffff00010775deb8 [ 28.489791] Call trace: [ 28.492259] get_work_pool+0x48/0x60 [ 28.495874] cancel_delayed_work+0x38/0xb0 [ 28.500011] prestera_port_handle_event+0x90/0xa0 [prestera] [ 28.505743] prestera_evt_recv+0x98/0xe0 [prestera] [ 28.510683] prestera_fw_evt_work_fn+0x180/0x228 [prestera_pci] [ 28.516660] process_one_work+0x1e8/0x360 [ 28.520710] worker_thread+0x44/0x480 [ 28.524412] kthread+0x154/0x160 [ 28.527670] ret_from_fork+0x10/0x38 [ 28.531290] Code: a8c17bfd d50323bf d65f03c0 9278dc21 (f9400020) [ 28.537429] ---[ end trace 5eced933df3a080b ]--- Fixes: 501ef3066c89 ("net: marvell: prestera: Add driver for Prestera family ASIC devices") Signed-off-by: Vadym Kochan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-20net: phy: at803x: fix probe error if copper page is selectedMichael Walle1-6/+17
The commit c329e5afb42f ("net: phy: at803x: select correct page on config init") selects the copper page during probe. This fails if the copper page was already selected. In this case, the value of the copper page (which is 1) is propagated through phy_restore_page() and is finally returned for at803x_probe(). Fix it, by just using the at803x_page_write() directly. Also in case of an error, the regulator is not disabled and leads to a WARN_ON() when the probe fails. This couldn't happen before, because at803x_parse_dt() was the last call in at803x_probe(). It is hard to see, that the parse_dt() actually enables the regulator. Thus move the regulator_enable() to the probe function and undo it in case of an error. Fixes: c329e5afb42f ("net: phy: at803x: select correct page on config init") Signed-off-by: Michael Walle <[email protected]> Reviewed-by: David Bauer <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-20net: mana: remove redundant initialization of variable errColin Ian King1-1/+1
The variable err is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-20sfc: ef10: fix TX queue lookup in TX event handlingEdward Cree1-2/+1
We're starting from a TXQ label, not a TXQ type, so efx_channel_get_tx_queue() is inappropriate. This worked by chance, because labels and types currently match on EF10, but we shouldn't rely on that. Fixes: 12804793b17c ("sfc: decouple TXQ type from label") Signed-off-by: Edward Cree <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-20sfc: farch: fix TX queue lookup in TX event handlingEdward Cree1-4/+4
We're starting from a TXQ label, not a TXQ type, so efx_channel_get_tx_queue() is inappropriate (and could return NULL, leading to panics). Fixes: 12804793b17c ("sfc: decouple TXQ type from label") Cc: [email protected] Signed-off-by: Edward Cree <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-20sfc: farch: fix TX queue lookup in TX flush done handlingEdward Cree1-4/+4
We're starting from a TXQ instance number ('qid'), not a TXQ type, so efx_get_tx_queue() is inappropriate (and could return NULL, leading to panics). Fixes: 12804793b17c ("sfc: decouple TXQ type from label") Reported-by: Trevor Hemsley <[email protected]> Cc: [email protected] Signed-off-by: Edward Cree <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-20virtio-net: fix use-after-free in page_to_skb()Eric Dumazet1-1/+4
KASAN/syzbot had 4 reports, one of them being: BUG: KASAN: slab-out-of-bounds in memcpy include/linux/fortify-string.h:191 [inline] BUG: KASAN: slab-out-of-bounds in page_to_skb+0x5cf/0xb70 drivers/net/virtio_net.c:480 Read of size 12 at addr ffff888014a5f800 by task systemd-udevd/8445 CPU: 0 PID: 8445 Comm: systemd-udevd Not tainted 5.12.0-rc8-next-20210419-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: <IRQ> __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x141/0x1d7 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:436 check_region_inline mm/kasan/generic.c:180 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:186 memcpy+0x20/0x60 mm/kasan/shadow.c:65 memcpy include/linux/fortify-string.h:191 [inline] page_to_skb+0x5cf/0xb70 drivers/net/virtio_net.c:480 receive_mergeable drivers/net/virtio_net.c:1009 [inline] receive_buf+0x2bc0/0x6250 drivers/net/virtio_net.c:1119 virtnet_receive drivers/net/virtio_net.c:1411 [inline] virtnet_poll+0x568/0x10b0 drivers/net/virtio_net.c:1516 __napi_poll+0xaf/0x440 net/core/dev.c:6962 napi_poll net/core/dev.c:7029 [inline] net_rx_action+0x801/0xb40 net/core/dev.c:7116 __do_softirq+0x29b/0x9fe kernel/softirq.c:559 invoke_softirq kernel/softirq.c:433 [inline] __irq_exit_rcu+0x136/0x200 kernel/softirq.c:637 irq_exit_rcu+0x5/0x20 kernel/softirq.c:649 common_interrupt+0xa4/0xd0 arch/x86/kernel/irq.c:240 Fixes: fb32856b16ad ("virtio-net: page_to_skb() use build_skb when there's sufficient tailroom") Signed-off-by: Eric Dumazet <[email protected]> Reported-by: syzbot <[email protected]> Reported-by: Guenter Roeck <[email protected]> Reported-by: Mat Martineau <[email protected]> Cc: Xuan Zhuo <[email protected]> Cc: Jason Wang <[email protected]> Cc: "Michael S. Tsirkin" <[email protected]> Cc: [email protected] Acked-by: Michael S. Tsirkin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-20phy: nxp-c45-tja11xx: fix phase offset calculationRadu Pirea (NXP OSS)1-1/+1
Fix phase offset calculation. Signed-off-by: Radu Pirea (NXP OSS) <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-20net: enetc: automatically select IERB moduleMichael Walle1-1/+1
Now that enetc supports flow control we have to make sure the settings in the IERB are correct. Therefore, we actually depend on the enetc-ierb module. Previously it was possible that this module was disabled while the enetc was enabled. Fix it by automatically select the enetc-ierb module. Fixes: e7d48e5fbf30 ("net: enetc: add a mini driver for the Integrated Endpoint Register Block") Signed-off-by: Michael Walle <[email protected]> Acked-by: Vladimir Oltean <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-20virtio-net: restrict build_skb() use to some archesEric Dumazet1-1/+1
build_skb() is supposed to be followed by skb_reserve(skb, NET_IP_ALIGN), so that IP headers are word-aligned. (Best practice is to reserve NET_IP_ALIGN+NET_SKB_PAD, but the NET_SKB_PAD part is only a performance optimization if tunnel encaps are added.) Unfortunately virtio_net has not provisioned this reserve. We can only use build_skb() for arches where NET_IP_ALIGN == 0 We might refine this later, with enough testing. Fixes: fb32856b16ad ("virtio-net: page_to_skb() use build_skb when there's sufficient tailroom") Signed-off-by: Eric Dumazet <[email protected]> Reported-by: Guenter Roeck <[email protected]> Cc: Xuan Zhuo <[email protected]> Cc: Jason Wang <[email protected]> Cc: "Michael S. Tsirkin" <[email protected]> Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
2021-04-20net: wwan: Fix bit ops double shiftLoic Poulain2-4/+6
bit operation helpers such as test_bit, clear_bit, etc take bit position as parameter and not value. Current usage causes double shift => BIT(BIT(0)). Fix that in wwan_core and mhi_wwan_ctrl. Fixes: 9a44c1cc6388 ("net: Add a WWAN subsystem") Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Loic Poulain <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-20net: dsa: mv88e6xxx: Allow dynamic reconfiguration of tag protocolTobias Waldekranz1-0/+39
For devices that supports both regular and Ethertyped DSA tags, allow the user to change the protocol. Additionally, because there are ethernet controllers that do not handle regular DSA tags in all cases, also allow the protocol to be changed on devices with undocumented support for EDSA. But, in those cases, make sure to log the fact that an undocumented feature has been enabled. Signed-off-by: Tobias Waldekranz <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-20net: dsa: mv88e6xxx: Mark chips with undocumented EDSA tag supportTobias Waldekranz2-35/+46
All devices are capable of using regular DSA tags. Support for Ethertyped DSA tags sort into three categories: 1. No support. Older chips fall into this category. 2. Full support. Datasheet explicitly supports configuring the CPU port to receive FORWARDs with a DSA tag. 3. Undocumented support. Datasheet lists the configuration from category 2 as "reserved for future use", but does empirically behave like a category 2 device. So, instead of listing the one true protocol that should be used by a particular chip, specify the level of support for EDSA (support for regular DSA is implicit on all chips). As before, we use EDSA for all chips that fully supports it. In upcoming changes, we will use this information to support dynamically changing the tag protocol. Signed-off-by: Tobias Waldekranz <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-20Merge tag 'mac80211-next-for-net-next-2021-04-20' of ↵David S. Miller9-45/+40
git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Johannes Berg says: ==================== Another set of updates, all over the map: * set sk_pacing_shift for 802.3->802.11 encap offload * some monitor support for 802.11->802.3 decap offload * HE (802.11ax) spec updates * userspace API for TDLS HE support * along with various other small features, cleanups and fixups ==================== Signed-off-by: David S. Miller <[email protected]>
2021-04-20mlxsw: spectrum_qdisc: Index future FIFOs by band numberPetr Machata1-7/+6
mlxsw used to hold an array of qdiscs indexed by the TC number. In the previous patch, it was changed to allocate child qdiscs dynamically, and they are now indexed by band number. Follow suit with the array of future FIFOs. Signed-off-by: Petr Machata <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-20mlxsw: spectrum_qdisc: Allocate child qdiscs dynamicallyPetr Machata1-32/+83
Instead of keeping qdiscs in globally-preallocated arrays, introduce a per-qdisc-kind value num_classes, and then allocate the necessary child qdiscs (if any) based on that value. Since now dynamic allocation is involved, mlxsw_sp_qdisc_replace() gets messy enough that it is worth it to split it to two cases: a new qdisc allocation and a change of existing qdisc. (Note that the change also includes what TC formally calls replace, if the qdisc kind is the same.) Signed-off-by: Petr Machata <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-20mlxsw: spectrum_qdisc: Guard all qdisc accesses with a lockPetr Machata1-16/+73
The FIFO handler currently guards accesses to the future FIFO tracking by asserting RTNL. In the future, the changes to the qdisc state will be more thorough, so other qdiscs will need this guarding is as well. In order to not further the RTNL infestation, instead convert to a custom lock that will guard accesses to the qdisc state. Signed-off-by: Petr Machata <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-20mlxsw: spectrum_qdisc: Track children per qdiscPetr Machata1-46/+118
mlxsw currently allows a two-level structure of qdiscs: the root and possibly a number of children. In order to support offloading more general qdisc trees, introduce to struct mlxsw_sp_qdisc a pointer to child qdiscs. Refer to the child qdiscs through this pointer, instead of going through the tclass_qdiscs in qdisc_state. Additionally introduce a field num_classes, which holds number of given qdisc's children. Also introduce a generic function for walking qdisc trees. Rewrite mlxsw_sp_qdisc_find() and _find_by_handle() to use the generic walker. For now, keep the qdisc_state.tclass_qdisc, and just point root_qdiscs's children to this array. Following patches will make the allocation dynamic. Signed-off-by: Petr Machata <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-20mlxsw: spectrum_qdisc: Promote backlog reduction to mlxsw_sp_qdisc_destroy()Petr Machata1-30/+18
When a qdisc is removed, it is necessary to update the backlog value at its parent--unless the qdisc is at root position. RED, TBF and FIFO all do that, each separately. Since all of them need to do this, just promote the operation directly to mlxsw_sp_qdisc_destroy(), instead of deferring it to individual destructors. Since FIFO dtor thus becomes trivial, remove it. Add struct mlxsw_sp_qdisc.parent to point at the parent qdisc. This will be handy later as deeper structures are offloaded. Use the parent qdisc to find the chain of parents whose backlog value needs to be updated. Signed-off-by: Petr Machata <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-20mlxsw: spectrum_qdisc: Track tclass_num as int, not u8Petr Machata1-6/+6
tclass_num is just a number, a value that would be ordinarily passed around as an int. (Which is unlike a u8 prio_bitmap.) In several places, tclass_num already is an int. Convert the remaining instances. Signed-off-by: Petr Machata <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-20mlxsw: spectrum_qdisc: Drop an always-true conditionPetr Machata1-4/+1
The function mlxsw_sp_qdisc_compare() is invoked a couple lines above this check, which will bounce any requests where this condition does not hold. Therefore drop it. Signed-off-by: Petr Machata <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-20mlxsw: spectrum_qdisc: Simplify mlxsw_sp_qdisc_compare()Petr Machata1-15/+7
The purpose of this function is to filter out events that are related to qdiscs that are not offloaded, or are not offloaded anymore. But the function is unnecessarily thorough: - mlxsw_sp_qdisc pointer is never NULL in the context where it is called - Two qdiscs with the same handle will never have different types. Even when replacing one qdisc with another in the same class, Linux will not permit handle reuse unless the qdisc type also matches. Simplify the function by omitting these two unnecessary conditions. Signed-off-by: Petr Machata <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>