aboutsummaryrefslogtreecommitdiff
path: root/drivers/net
AgeCommit message (Collapse)AuthorFilesLines
2021-12-15net: fec: fix system hang during suspend/resumeJoakim Zhang1-12/+34
1. During normal suspend (WoL not enabled) process, system has posibility to hang. The root cause is TXF interrupt coming after clocks disabled, system hang when accessing registers from interrupt handler. To fix this issue, disable all interrupts when system suspend. 2. System also has posibility to hang with WoL enabled during suspend, after entering stop mode, then magic pattern coming after clocks disabled, system will be waked up, and interrupt handler will be called, system hang when access registers. To fix this issue, disable wakeup irq in .suspend(), and enable it in .resume(). Signed-off-by: Joakim Zhang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-12-15net: ocelot: add support to get port mac from device-treeClément Léger1-1/+4
Add support to get mac from device-tree using of_get_ethdev_address. Reviewed-by: Vladimir Oltean <[email protected]> Signed-off-by: Clément Léger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-12-15sun4i-emac.c: remove unnecessary branchConley Lee1-18/+0
According to the current implementation of emac_rx, every arrived packet will be processed in the while loop. So, there is no remain packet last time. The skb_last field and this branch for dealing with it is unnecessary. Signed-off-by: Conley Lee <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-12-14net/mlx5e: Move goto action checks into tc_action goto post parse opRoi Dayan2-19/+35
Move goto action checks from parse nic/fdb funcs into the tc action infra goto post parse op. While moving this part also use NL_SET_ERR_MSG_MOD() instead of NL_SET_ERR_MSG(). Signed-off-by: Roi Dayan <[email protected]> Reviewed-by: Oz Shlomo <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2021-12-14net/mlx5e: Move vlan action chunk into tc action vlan post parse opRoi Dayan2-38/+51
Move vlan prio tag rewrite handling into tc action infra vlan post parse op. Signed-off-by: Roi Dayan <[email protected]> Reviewed-by: Oz Shlomo <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2021-12-14net/mlx5e: Add post_parse() op to tc action infrastructureRoi Dayan2-0/+15
The post_parse() op should be called after the parse op was called for all actions. It could be an action state is dependent on other actions. In the new op an action can fail the parse if the state is not valid anymore. Signed-off-by: Roi Dayan <[email protected]> Reviewed-by: Oz Shlomo <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2021-12-14net/mlx5e: Move sample attr allocation to tc_action sample parse opRoi Dayan3-12/+6
There is no reason to wait with the kmalloc to after parsing all other actions. There could still be a failure later and before offloading the rule. So alloc the mem when parsing. The memory is being released on mlx5e_flow_put() which is called also on error flow. Signed-off-by: Roi Dayan <[email protected]> Reviewed-by: Oz Shlomo <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2021-12-14net/mlx5e: TC action parsing loopRoi Dayan1-42/+46
Introduce a common function to implement the generic parsing loop. The same function can be used for parsing NIC and FDB (Switchdev mode) flows. Signed-off-by: Roi Dayan <[email protected]> Reviewed-by: Oz Shlomo <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2021-12-14net/mlx5e: Add redirect ingress to tc action infraRoi Dayan5-51/+83
Add parsing support by implementing struct mlx5e_tc_act for this action. Signed-off-by: Roi Dayan <[email protected]> Reviewed-by: Oz Shlomo <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2021-12-14net/mlx5e: Add sample and ptype to tc_action infraRoi Dayan6-28/+90
Add parsing support by implementing struct mlx5e_tc_act for this action. Signed-off-by: Roi Dayan <[email protected]> Reviewed-by: Oz Shlomo <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2021-12-14net/mlx5e: Add ct to tc action infraRoi Dayan5-30/+64
Add parsing support by implementing struct mlx5e_tc_act for this action. Signed-off-by: Roi Dayan <[email protected]> Reviewed-by: Oz Shlomo <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2021-12-14net/mlx5e: Add mirred/redirect to tc action infraRoi Dayan7-261/+382
Add parsing support by implementing struct mlx5e_tc_act for this action. Signed-off-by: Roi Dayan <[email protected]> Reviewed-by: Oz Shlomo <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2021-12-14net/mlx5e: Add mpls push/pop to tc action infraRoi Dayan5-34/+102
Add parsing support by implementing struct mlx5e_tc_act for this action. Signed-off-by: Roi Dayan <[email protected]> Reviewed-by: Oz Shlomo <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2021-12-14net/mlx5e: Add vlan push/pop/mangle to tc action infraRoi Dayan8-221/+314
Add parsing support by implementing struct mlx5e_tc_act for this action. Signed-off-by: Roi Dayan <[email protected]> Reviewed-by: Oz Shlomo <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2021-12-14net/mlx5e: Add pedit to tc action infraRoi Dayan7-169/+222
Add parsing support by implementing struct mlx5e_tc_act for this action. Signed-off-by: Roi Dayan <[email protected]> Reviewed-by: Oz Shlomo <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2021-12-14net/mlx5e: Add csum to tc action infraRoi Dayan5-45/+67
Add parsing support by implementing struct mlx5e_tc_act for this action. Signed-off-by: Roi Dayan <[email protected]> Reviewed-by: Oz Shlomo <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2021-12-14net/mlx5e: Add tunnel encap/decap to tc action infraRoi Dayan5-21/+81
Add parsing support by implementing struct mlx5e_tc_act for this action. Signed-off-by: Roi Dayan <[email protected]> Reviewed-by: Oz Shlomo <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2021-12-14net/mlx5e: Add goto to tc action infraRoi Dayan7-76/+99
Add parsing support by implementing struct mlx5e_tc_act for this action. Signed-off-by: Roi Dayan <[email protected]> Reviewed-by: Oz Shlomo <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2021-12-14net/mlx5e: Add tc action infrastructureRoi Dayan9-47/+297
Add an infrastructure to help parsing tc actions in a generic way. Supporting an action parser means implementing struct mlx5e_tc_act for that action. The infrastructure will give the possibility to be generic when parsing tc actions, i.e. parse_tc_nic_actions() and parse_tc_fdb_actions(). To parse tc actions a user needs to allocate a parse_state instance and pass it when iterating over the tc actions parsers. If a parser doesn't exists then a user can treat it as unsupported. To add an action parser a user needs to implement two callbacks. The can_offload() callback to quickly check if an action can be offloaded. The parse_action() callback to do actual parsing and prepare for offload. Add implementation for drop, trap, mark and accept action parsers with this commit to act as examples and implement usage of the new infrastructure for those actions. Signed-off-by: Roi Dayan <[email protected]> Reviewed-by: Oz Shlomo <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
2021-12-14net: dsa: hellcreek: Add missing PTP via UDP rulesKurt Kanzenbach1-4/+60
The switch supports PTP for UDP transport too. Therefore, add the missing static FDB entries to ensure correct forwarding of these packets. Fixes: ddd56dfe52c9 ("net: dsa: hellcreek: Add PTP clock support") Signed-off-by: Kurt Kanzenbach <[email protected]> Acked-by: Richard Cochran <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2021-12-14net: dsa: hellcreek: Allow PTP P2P measurements on blocked portsKurt Kanzenbach1-1/+1
Allow PTP peer delay measurements on blocked ports by STP. In case of topology changes the PTP stack can directly start with the correct delays. Fixes: ddd56dfe52c9 ("net: dsa: hellcreek: Add PTP clock support") Signed-off-by: Kurt Kanzenbach <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Acked-by: Richard Cochran <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2021-12-14net: dsa: hellcreek: Add STP forwarding ruleKurt Kanzenbach1-0/+14
Treat STP as management traffic. STP traffic is designated for the CPU port only. In addition, STP traffic has to pass blocked ports. Fixes: e4b27ebc780f ("net: dsa: Add DSA driver for Hirschmann Hellcreek switches") Signed-off-by: Kurt Kanzenbach <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Acked-by: Richard Cochran <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2021-12-14net: dsa: hellcreek: Fix insertion of static FDB entriesKurt Kanzenbach1-2/+5
The insertion of static FDB entries ignores the pass_blocked bit. That bit is evaluated with regards to STP. Add the missing functionality. Fixes: e4b27ebc780f ("net: dsa: Add DSA driver for Hirschmann Hellcreek switches") Signed-off-by: Kurt Kanzenbach <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Acked-by: Richard Cochran <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2021-12-14ice: Don't put stale timestamps in the skbKarol Kolacinski2-7/+10
The driver has to check if it does not accidentally put the timestamp in the SKB before previous timestamp gets overwritten. Timestamp values in the PHY are read only and do not get cleared except at hardware reset or when a new timestamp value is captured. The cached_tstamp field is used to detect the case where a new timestamp has not yet been captured, ensuring that we avoid sending stale timestamp data to the stack. Fixes: ea9b847cda64 ("ice: enable transmit timestamps for E810 devices") Signed-off-by: Karol Kolacinski <[email protected]> Tested-by: Gurucharan G <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2021-12-14ice: Use div64_u64 instead of div_u64 in adjfineKarol Kolacinski1-1/+1
Change the division in ice_ptp_adjfine from div_u64 to div64_u64. div_u64 is used when the divisor is 32 bit but in this case incval is 64 bit and it caused incorrect calculations and incval adjustments. Fixes: 06c16d89d2cb ("ice: register 1588 PTP clock device object for E810 devices") Signed-off-by: Karol Kolacinski <[email protected]> Tested-by: Gurucharan G <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2021-12-14wilc1000: Rename workqueue from "WILC_wq" to "NETDEV-wq"David Mosberger-Tang2-11/+14
This follows normal Linux convention and is more useful since the new name will make it apparent which network device the work-queue is for (e.g., the name will be "wlan0-wq" for network device "wlan0"). hif_workqueue allocation has to move from cfg80211.c:wilc_cfg80211_init() to netdev.c:wilc_netdev_ifc_init() because the network device name is not known until after the netdev is registered. The move also makes sense because netdev.c is already responsible for destroying the work queue when it is no longer needed. Signed-off-by: David Mosberger-Tang <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-12-14wilc1000: Rename tx task from "K_TXQ_TASK" to NETDEV-txDavid Mosberger-Tang1-1/+1
This follows normal Linux conventions and is also more useful because the netdevice name is part of the task name (e.g., "wlan0-tx" for network device "wlan0"). Signed-off-by: David Mosberger-Tang <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-12-14wilc1000: Rename irq handler from "WILC_IRQ" to netdev nameDavid Mosberger-Tang1-1/+1
This change follows normal Linux convention and the new name is more useful since it'll be clear which irq handler statistics correspond to which net device. Signed-off-by: David Mosberger-Tang <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-12-14wilc1000: Rename SPI driver from "WILC_SPI" to "wilc1000_spi"David Mosberger-Tang2-3/+3
The name "wilc1000_spi" follows normal Linux conventions and also is analogous to the SDIO driver, which uses "wilc1000_sdio". Signed-off-by: David Mosberger-Tang <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-12-14wilc1000: Fix spurious "FW not responding" errorDavid Mosberger-Tang1-1/+2
When deinitializing the driver, one or more "FW not responding" error appears on the console. This appears to be due to wilc_wlan_stop() disabling host/WILC1000 communication, but then right afterwards, it tries to release the bus with chip-sleep enabled. The problem is enabling the chip-sleep cannot success once host/WILC1000 communication is disabled. Fix by only releasing the bus. Signed-off-by: David Mosberger-Tang <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-12-14wilc1000: Remove misleading USE_SPI_DMA macroDavid Mosberger-Tang1-5/+0
The USE_SPI_DMA macro name suggests that it could be set to 1 to control whether or not SPI DMA should be used. However, that's not what it does. If set to 1, it'll set the SPI messages' "is_dma_mapped" flag to true, even though the tx/rx buffers aren't actually DMA mapped by the driver. In other words, setting this flag to 1 will break the driver. Best to clean up this confusion by removing the macro altogether. There is no need to explicitly initialize "is_dma_mapped" because the message is cleared to zero anyhow, so "is_dma_mapped" is set to false by default. Signed-off-by: David Mosberger-Tang <[email protected]> Acked-by: Ajay Singh <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-12-14wilc1000: Fix missing newline in error messageDavid Mosberger-Tang1-1/+1
Add missing newline in pr_err() message. Signed-off-by: David Mosberger-Tang <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-12-14wilc1000: Fix copy-and-paste typo in wilc_set_mac_addressDavid Mosberger-Tang1-1/+1
The messages appears to have been copied from wilc_get_mac_address and says "get" when it should say "set". Signed-off-by: David Mosberger-Tang <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-12-14rtw89: coex: Update COEX to 5.5.8Ching-Te Ku1-1/+1
Update COEX version. Signed-off-by: Ching-Te Ku <[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-12-14rtw89: coex: Cancel PS leaving while C2H comesChing-Te Ku1-2/+0
It's unnecessary to leave WL PS while C2H comes. Signed-off-by: Ching-Te Ku <[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-12-14rtw89: coex: Update BT counters while receiving reportChing-Te Ku1-17/+15
Move _chk_btc_err and update_bt_cnt to _chk_btc_report(), so we can update counter/info to COEX at a proper moment, instead of relying on a user does cat the debug info periodically. Signed-off-by: Ching-Te Ku <[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-12-14rtw89: coex: Define LPS state for BTC usingChing-Te Ku2-4/+10
To distinguish three types of LPS state. Signed-off-by: Ching-Te Ku <[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-12-14rtw89: coex: Add MAC API to get BT polluted counterChing-Te Ku4-2/+18
Add function to get and parse BT polluted counter. When WLAN Tx was dropped by BT, the packet will be marked as BT polluted. Signed-off-by: Ching-Te Ku <[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-12-14rtw89: coex: Not to send H2C when WL not ready and count H2CChing-Te Ku1-2/+25
Prevent to send H2C request to FW when BTC is not initialized or WL is under power saving. Add counter to count the H2C success or fail. Signed-off-by: Ching-Te Ku <[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-12-14rtw89: coex: correct C2H header lengthChing-Te Ku1-0/+2
To resolve C2H handle length mismatch, or it will parse the c2h content out of array. Signed-off-by: Ching-Te Ku <[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-12-14ice: Remove unused ICE_FLOW_SEG_HDRS_L2_MASKTony Nguyen1-2/+0
Remove the unused define ICE_FLOW_SEG_HDRS_L2_MASK. Reported-by: Jesse Brandeburg <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> Acked-by: Paul Menzel <[email protected]> Tested-by: Gurucharan G <[email protected]>
2021-12-14ice: Remove unnecessary castsDan Carpenter1-4/+2
The "bitmap" variable is already an unsigned long so there is no need for this cast. Signed-off-by: Dan Carpenter <[email protected]> Tested-by: Gurucharan G <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2021-12-14ice: Propagate error codesTony Nguyen8-99/+45
As all functions now return standard error codes, propagate the values being returned instead of converting them to generic values. Signed-off-by: Tony Nguyen <[email protected]> Tested-by: Gurucharan G <[email protected]>
2021-12-14ice: Remove excess error variablesTony Nguyen10-282/+223
ice_status previously had a variable to contain these values where other error codes had a variable as well. With ice_status now being an int, there is no need for two variables to hold error values. In cases where this occurs, remove one of the excess variables and use a single one. Some initialization of variables are no longer needed and have been removed. Signed-off-by: Tony Nguyen <[email protected]> Tested-by: Gurucharan G <[email protected]>
2021-12-14ice: Cleanup after ice_status removalTony Nguyen28-350/+265
Clean up code after changing ice_status to int. Rearrange to fix reverse Christmas tree and pull lines up where applicable. Signed-off-by: Tony Nguyen <[email protected]> Tested-by: Gurucharan G <[email protected]>
2021-12-14ice: Remove enum ice_statusTony Nguyen22-654/+568
Replace uses of ice_status to, as equivalent as possible, error codes. Remove enum ice_status and its helper conversion function as they are no longer needed. Signed-off-by: Tony Nguyen <[email protected]> Tested-by: Gurucharan G <[email protected]>
2021-12-14ice: Use int for ice_statusTony Nguyen33-859/+863
To prepare for removal of ice_status, change the variables from ice_status to int. This eases the transition when values are changed to return standard int error codes over enum ice_status. Signed-off-by: Tony Nguyen <[email protected]> Tested-by: Gurucharan G <[email protected]>
2021-12-14ice: Remove string printing for ice_statusTony Nguyen9-236/+163
Remove the ice_stat_str() function which prints the string representation of the ice_status error code. With upcoming changes moving away from ice_status, there will be no need for this function. Signed-off-by: Tony Nguyen <[email protected]> Tested-by: Gurucharan G <[email protected]>
2021-12-14ice: Refactor status flow for DDP loadWojciech Drewek4-182/+272
Before this change, final state of the DDP pkg load process was dependent on many variables such as: ice_status, pkg version, ice_aq_err. The last one had be stored in hw->pkg_dwnld_status. It was impossible to conclude this state just from ice_status, that's why logging process of DDP pkg load in the caller was a little bit complicated. With this patch new status enum is introduced - ice_ddp_state. It covers all the possible final states of the loading process. What's tricky for ice_ddp_state is that not only ICE_DDP_PKG_SUCCESS(=0) means that load was successful. Actually three states mean that: - ICE_DDP_PKG_SUCCESS - ICE_DDP_PKG_SAME_VERSION_ALREADY_LOADED - ICE_DDP_PKG_COMPATIBLE_ALREADY_LOADED ice_is_init_pkg_successful can tell that information. One ddp_state should not be used outside of ice_init_pkg which is ICE_DDP_PKG_ALREADY_LOADED. It is more generic, it is used in ice_dwnld_cfg_bufs to see if pkg is already loaded. At this point we can't use one of the specific one (SAME_VERSION, COMPATIBLE, NOT_SUPPORTED) because we don't have information on the package currently loaded in HW (we are before calling ice_get_pkg_info). We can get rid of hw->pkg_dwnld_status because we are immediately mapping aq errors to ice_ddp_state in ice_dwnld_cfg_bufs. Other errors like ICE_ERR_NO_MEMORY, ICE_ERR_PARAM are mapped the generic ICE_DDP_PKG_ERR. Suggested-by: Jacob Keller <[email protected]> Signed-off-by: Wojciech Drewek <[email protected]> Tested-by: Tony Brelinski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2021-12-14ice: Refactor promiscuous functionsBrett Creeley4-102/+156
Some of the promiscuous mode functions take a boolean to indicate set/clear, which affects readability. Refactor and provide an interface for the promiscuous mode code with explicit set and clear promiscuous mode operations. Signed-off-by: Brett Creeley <[email protected]> Tested-by: Konrad Jankowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>