summaryrefslogtreecommitdiffstats
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2021-11-26nfc: fdp: Merge the same judgmentwengjianfeng1-3/+1
Combine two judgments that return the same value Signed-off-by: wengjianfeng <wengjianfeng@yulong.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Link: https://lore.kernel.org/r/20211126013130.27112-1-samirweng1979@163.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-25net: ipa: support enhanced channel flow controlAlex Elder3-5/+19
IPA v4.2 introduced GSI channel flow control, used instead of IPA endpoint DELAY mode to prevent a TX channel from injecting packets into the IPA core. It used a new FLOW_CONTROLLED channel state which could be entered using GSI generic commands. IPA v4.11 extended the channel flow control model. Rather than having a distinct FLOW_CONTROLLED channel state, each channel has a "flow control" property that can be enabled or not--independent of the channel state. The AP (or modem) can modify this property using the same GSI generic commands as before. The AP only uses channel flow control on modem TX channels, and only when recovering from a modem crash. The AP has no way to discover the state of a modem channel, so the fact that (starting with IPA v4.11) flow control no longer uses a distinct channel state is invisible to the AP. So enhanced flow control generally does not change the way AP uses flow control. There are a few small differences, however: - There is a notion of "primary" or "secondary" flow control, and when enabling or disabling flow control that must be specified in a new field in the GSI generic command register. For now, we always specify 0 (meaning "primary"). - When disabling flow control, it's possible a request will need to be retried. We retry up to 5 times in this case. - Another new generic command allows the current flow control state to be queried. We do not use this. Other than the need for retries, the code essentially works the same way as before. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-25net: ipa: introduce channel flow controlAlex Elder4-32/+82
One quirk for certain versions of IPA is that endpoint DELAY mode does not work properly. IPA DELAY mode prevents any packets from being delivered to the IPA core for processing on a TX endpoint. The AP uses DELAY mode when the modem crashes, to prevent modem TX endpoints from generating traffic during crash recovery. Without this, there is a chance the hardware will stall during recovery from a modem crash. To achieve a similar effect, a GSI FLOW_CONTROLLED channel state was created. A STARTED TX channel can be placed in FLOW_CONTROLLED state, which prevents the transfer of any more packets. A channel in FLOW_CONTROLLED state can be either returned to STARTED state, or can be transitioned to STOPPED state. Because this operates on GSI channels, two generic commands were added to allow the AP to control this state for modem channels (similar to the ALLOCATE and HALT channel commands). Previously the code assumed this quirk only applied to IPA v4.2. In fact, channel flow control (rather than endpoint DELAY mode) should be used for all versions *starting* with IPA v4.2. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-25mctp: serial: remove unnecessary ldisc data checkJeremy Kerr1-3/+0
Jiri assures me that a ldisc->open with tty->disc_data set should never happen, so this check doesn't do anything. Reported-by: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-25mctp: serial: enforce fixed MTUJeremy Kerr1-0/+7
The current serial driver requires a maximum MTU of 68, and it doesn't make sense to set a MTU below the MCTP-required baseline (of 68) either. This change sets the min_mtu & max_mtu of the mctp netdev, essentially disallowing changes. By using these instead of a ndo_change_mtu op, we get the netlink extacks reported too. Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-25mctp: serial: cancel tx work on ldisc closeJeremy Kerr1-0/+1
We want to ensure that the tx work has finished before returning from the ldisc close op, so do a synchronous cancel. Reported-by: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-25net: ipa: rearrange GSI structure fieldsAlex Elder1-4/+4
The dummy net_device is a large field in the GSI structure, but it is not at all interesting from the perspective of debugging. Move it to the end of the GSI structure so the other fields are easier to find in memory. The channel and event ring arrays are also very large, so move them near the end of the structure as well. Swap the position of the result and completion fields to improve structure packing. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-25net: ipa: GSI only needs one completionAlex Elder2-37/+12
A mutex ensures we never submit more than one GSI command of any kind at once. This means the per-channel and per-event ring completion structures provide no benefit. Instead, just use the single (existing) GSI completion to signal the completion of GSI commands of all types. This makes gsi_evt_ring_init() a trivial function with no inverse, so open-code it in its sole caller and get rid of the function. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-25net: ipa: skip SKB copy if no netdevAlex Elder1-10/+11
In ipa_endpoint_skb_copy(), a new socket buffer structure is allocated so that some data can be copied into it. However, after doing this, if the endpoint has a null netdev pointer, we just drop free the socket buffer. Instead, check endpoint->netdev pointer first, and just return early if it's null. Also return early if the SKB allocation fails, to avoid the deeper indentation in the normal path. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-25net: ipa: explicitly disable HOLB drop during setupAlex Elder1-0/+2
During setup, ipa_endpoint_program() programs each endpoint with various configuration parameters. One of those registers defines whether to drop packets when a head-of-line blocking condition is detected on an RX endpoint. We currently assume this is disabled; instead, explicitly set it to be disabled. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-25net: ipa: rework how HOL_BLOCK handling is specifiedAlex Elder1-4/+16
The head-of-line block (HOLB) drop timer is only meaningful when dropping packets due to blocking is enabled. Given that, redefine the interface so the timer is specified when enabling HOLB drop, and use a different function when disabling. To enable and disable HOLB drop, these functions will now be used: ipa_endpoint_init_hol_block_enable(endpoint, milliseconds) ipa_endpoint_init_hol_block_disable(endpoint) The existing ipa_endpoint_init_hol_block_enable() becomes a helper function, renamed ipa_endpoint_init_hol_block_en(), and used with ipa_endpoint_init_hol_block_timer() to enable HOLB block on an endpoint. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-25net: ipa: zero unused portions of filter table memoryAlex Elder1-7/+41
Not all filter table entries are used. Only certain endpoints support filtering, and the table begins with a bitmap indicating which endpoints use the "slots" that follow for filter rules. Currently, unused filter table entries are not initialized. Instead, zero-fill the entire unused portion of the filter table memory regions, to make it more obvious that memory is unused (and not subsequently modified). This is not strictly necessary, but the result is reassuring when looking at filter table memory. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-25net: ipa: kill ipa_modem_init()Alex Elder3-16/+4
A recent commit made disabling the SMP2P "setup ready" interrupt unrelated to ipa_modem_stop(). Given that, it seems fitting to get rid of ipa_modem_init() and ipa_modem_exit() (which are trivial wrapper functions), and call ipa_smp2p_init() and ipa_smp2p_exit() directly instead. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-25net: dsa: felix: enable cut-through forwarding between ports by defaultVladimir Oltean3-10/+154
The VSC9959 switch embedded within NXP LS1028A (and that version of Ocelot switches only) supports cut-through forwarding - meaning it can start the process of looking up the destination ports for a packet, and forward towards those ports, before the entire packet has been received (as opposed to the store-and-forward mode). The up side is having lower forwarding latency for large packets. The down side is that frames with FCS errors are forwarded instead of being dropped. However, erroneous frames do not result in incorrect updates of the FDB or incorrect policer updates, since these processes are deferred inside the switch to the end of frame. Since the switch starts the cut-through forwarding process after all packet headers (including IP, if any) have been processed, packets with large headers and small payload do not see the benefit of lower forwarding latency. There are two cases that need special attention. The first is when a packet is multicast (or flooded) to multiple destinations, one of which doesn't have cut-through forwarding enabled. The switch deals with this automatically by disabling cut-through forwarding for the frame towards all destination ports. The second is when a packet is forwarded from a port of lower link speed towards a port of higher link speed. This is not handled by the hardware and needs software intervention. Since we practically need to update the cut-through forwarding domain from paths that aren't serialized by the rtnl_mutex (phylink mac_link_down/mac_link_up ops), this means we need to serialize physical link events with user space updates of bonding/bridging domains. Enabling cut-through forwarding is done per {egress port, traffic class}. I don't see any reason why this would be a configurable option as long as it works without issues, and there doesn't appear to be any user space configuration tool to toggle this on/off, so this patch enables cut-through forwarding on all eligible ports and traffic classes. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://lore.kernel.org/r/20211125125808.2383984-2-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-25net: ocelot: remove "bridge" argument from ocelot_get_bridge_fwd_maskVladimir Oltean1-6/+8
The only called takes ocelot_port->bridge and passes it as the "bridge" argument to this function, which then compares it with ocelot_port->bridge. This is not useful. Instead, we would like this function to return 0 if ocelot_port->bridge is not present, which is what this patch does. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://lore.kernel.org/r/20211125125808.2383984-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-25net: dsa: qca8k: Fix spelling mistake "Mismateched" -> "Mismatched"Colin Ian King1-1/+1
There is a spelling mistake in a netdev_err error message. Fix it. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://lore.kernel.org/r/20211125002932.49217-1-colin.i.king@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-25net: stmmac: perserve TX and RX coalesce value during XDP setupOng Boon Leong1-2/+3
When XDP program is loaded, it is desirable that the previous TX and RX coalesce values are not re-inited to its default value. This prevents unnecessary re-configurig the coalesce values that were working fine before. Fixes: ac746c8520d9 ("net: stmmac: enhance XDP ZC driver level switching performance") Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com> Tested-by: Kurt Kanzenbach <kurt@linutronix.de> Link: https://lore.kernel.org/r/20211124114019.3949125-1-boon.leong.ong@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-25tsnep: Add missing of_node_put() in tsnep_mdio_init()Yang Yingliang1-1/+2
The node pointer is returned by of_get_child_by_name() with refcount incremented in tsnep_mdio_init(). Calling of_node_put() to aovid the refcount leak in tsnep_mdio_init(). Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20211124084048.175456-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-25veth: use ethtool_sprintf instead of snprintfTonghao Zhang1-17/+10
use ethtools api ethtool_sprintf to instead of snprintf. Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com> Link: https://lore.kernel.org/r/20211125025444.13115-1-xiangxia.m.yue@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-25net: macb: convert to phylink_generic_validate()Russell King (Oracle)1-103/+30
Populate the supported interfaces bitmap and MAC capabilities mask for the macb driver and remove the old validate implementation. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Link: https://lore.kernel.org/r/E1mpuRv-00D4rb-Lz@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-25r8169: disable detection of chip version 60Heiner Kallweit1-2/+5
It seems only XID 609 made it to the mass market. Therefore let's disable detection of the other RTL8125a XID's. If nobody complains we can remove support for RTL_GIGA_MAC_VER_60 later. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://lore.kernel.org/r/2cd3df01-5f8b-08dd-6def-3f31a3014bde@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-24net: dsa: qca8k: fix warning in LAG featureAnsuel Smith1-2/+2
Fix warning reported by bot. Make sure hash is init to 0 and fix wrong logic for hash_type in qca8k_lag_can_offload. Reported-by: kernel test robot <lkp@intel.com> Fixes: def975307c01 ("net: dsa: qca8k: add LAG support") Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Link: https://lore.kernel.org/r/20211123154446.31019-1-ansuelsmth@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-24cxgb4: allow reading unrecognized port module eepromRahul Lakkireddy1-1/+10
Even if firmware fails to recognize the plugged-in port module type, allow reading port module EEPROM anyway. This helps in obtaining necessary diagnostics information for debugging and analysis. Signed-off-by: Manoj Malviya <manojmalviya@chelsio.com> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> Link: https://lore.kernel.org/r/1637682437-31407-1-git-send-email-rahul.lakkireddy@chelsio.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-24gro: remove rcu_read_lock/rcu_read_unlock from gro_complete handlersEric Dumazet1-3/+0
All gro_complete() handlers are called from napi_gro_complete() while rcu_read_lock() has been called. There is no point stacking more rcu_read_lock() Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-24gro: remove rcu_read_lock/rcu_read_unlock from gro_receive handlersEric Dumazet1-4/+1
All gro_receive() handlers are called from dev_gro_receive() while rcu_read_lock() has been called. There is no point stacking more rcu_read_lock() Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-24tsnep: Fix resource_size cocci warningGerhard Engleder2-2/+0
The following warning is fixed, by removing the unused resource size: drivers/net/ethernet/engleder/tsnep_main.c:1155:21-24: WARNING: Suspicious code. resource_size is maybe missing with io Reported-by: kernel test robot <lkp@intel.com> Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com> Link: https://lore.kernel.org/r/20211124205225.13985-1-gerhard@engleder-embedded.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-24tsnep: fix platform_no_drv_owner.cocci warningYang Li1-1/+0
Remove .owner field if calls are used which set it automatically Eliminate the following coccicheck warning: ./drivers/net/ethernet/engleder/tsnep_main.c:1263:3-8: No need to set .owner here. The core will do it. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Reviewed-by: Gerhard Engleder <gerhard@engleder-embedded.com> Link: https://lore.kernel.org/r/1637721384-70836-2-git-send-email-yang.lee@linux.alibaba.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-24net: hns3: add dql info when tx timeoutYufeng Mo1-0/+7
When tx timeout occurs, the info of dql maybe helpful, so print these info to hns3_get_tx_timeo_queue_info(). Signed-off-by: Yufeng Mo <moyufeng@huawei.com> Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-11-24net: hns3: debugfs add drop packet statistics of multicast and broadcast for iguJie Wang1-4/+4
Currently, there is no way to get drop packet number of multicast and broadcast in IGU hardware module, it is not convenient to find problem when multicast packet or broadcast packet is dropped in IGU, so this patch adds statistics for them in debugfs. Signed-off-by: Jie Wang <wangjie125@huawei.com> Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-11-24net: hns3: format the output of the MAC addressYufeng Mo4-31/+74
Printing the whole MAC addresse may bring security risks. Therefore, the MAC address is partially encrypted to improve security. Signed-off-by: Yufeng Mo <moyufeng@huawei.com> Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-11-24net: hns3: add log for workqueue scheduled lateYufeng Mo4-2/+33
When the mbx or reset message arrives, the driver is informed through an interrupt. This task can be processed only after the workqueue is scheduled. In some cases, this workqueue scheduling takes a long time. As a result, the mbx or reset service task cannot be processed in time. So add some warning message to improve debugging efficiency for this case. Signed-off-by: Yufeng Mo <moyufeng@huawei.com> Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-11-24lan78xx: Clean up some inconsistent indentingJiapeng Chong1-2/+1
Eliminate the follow smatch warning: drivers/net/usb/lan78xx.c:4961 lan78xx_resume() warn: inconsistent indenting. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-11-23net: stmmac: Calculate CDC error only onceKurt Kanzenbach2-10/+7
The clock domain crossing error (CDC) is calculated at every fetch of Tx or Rx timestamps. It includes a division. Especially on arm32 based systems it is expensive. It also requires two conditionals in the hotpath. Add a compensation value cache to struct plat_stmmacenet_data and subtract it unconditionally in the RX/TX functions which spares the conditionals. The value is initialized to 0 and if supported calculated in the PTP initialization code. Suggested-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de> Link: https://lore.kernel.org/r/20211122111931.135135-1-kurt@linutronix.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-23net: remove .ndo_change_proto_downJakub Kicinski3-16/+2
.ndo_change_proto_down was added seemingly to enable out-of-tree implementations. Over 2.5yrs later we still have no real users upstream. Hardwire the generic implementation for now, we can revert once real users materialize. (rocker is a test vehicle, not a user.) We need to drop the optimization on the sysfs side, because unlike ndos priv_flags will be changed at runtime, so we'd need READ_ONCE/WRITE_ONCE everywhere.. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-11-23Merge branch '100GbE' of ↵David S. Miller6-4/+163
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== 100GbE Intel Wired LAN Driver Updates 2021-11-22 Shiraz Saleem says: Currently E800 devices come up as RoCEv2 devices by default. This series add supports for users to configure iWARP or RoCEv2 functionality per PCI function. devlink parameters is used to realize this and is keyed off similar work in [1]. [1] https://lore.kernel.org/linux-rdma/20210810132424.9129-1-parav@nvidia.com/ ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2021-11-23net: marvell: mvpp2: Add support for 5gbase-rMarek Behún1-7/+37
Add support for PHY_INTERFACE_MODE_5GBASER. Signed-off-by: Marek Behún <kabel@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-11-23phy: marvell: phy-mvebu-cp110-comphy: add support for 5gbase-rMarek Behún1-0/+9
Add support for PHY_INTERFACE_MODE_5GBASER mode within the Marvell CP110 common PHY driver. This is currently only supported via SMC calls to TF-A. Legacy support may be added later, if needed. Signed-off-by: Marek Behún <kabel@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-11-23tsnep: Fix set MAC addressGerhard Engleder1-1/+1
Commit 4dfb9982644b ("tsn: Fix build.") fixed compilation with const dev_addr. In tsnep_netdev_set_mac_address() the call of ether_addr_copy() was replaced with dev_set_mac_address(), which calls ndo_set_mac_address(). This results in an endless recursive loop because ndo_set_mac_address is set to tsnep_netdev_set_mac_address. Call eth_hw_addr_set() instead of dev_set_mac_address() in ndo_set_mac_address()/tsnep_netdev_set_mac_address() to copy the address as intended. [ 26.563303] Insufficient stack space to handle exception! [ 26.563312] ESR: 0x96000047 -- DABT (current EL) [ 26.563317] FAR: 0xffff80000a507fc0 [ 26.563320] Task stack: [0xffff80000a508000..0xffff80000a50c000] [ 26.563324] IRQ stack: [0xffff80000a0c0000..0xffff80000a0c4000] [ 26.563327] Overflow stack: [0xffff00007fbaf2b0..0xffff00007fbb02b0] [ 26.563333] CPU: 3 PID: 381 Comm: ifconfig Not tainted 5.16.0-rc1-zynqmp #60 [ 26.563340] Hardware name: TSN endpoint (DT) [ 26.563343] pstate: a0000005 (NzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 26.563351] pc : inetdev_event+0x4/0x560 [ 26.563364] lr : raw_notifier_call_chain+0x54/0x78 [ 26.563372] sp : ffff80000a508040 [ 26.563374] x29: ffff80000a508040 x28: ffff00000132b800 x27: 0000000000000000 [ 26.563386] x26: 0000000000000000 x25: ffff800000ea5058 x24: 0904030201020001 [ 26.563396] x23: ffff800000ea5058 x22: ffff80000a5080e0 x21: 0000000000000009 [ 26.563405] x20: 00000000fffffffa x19: ffff80000a009510 x18: 0000000000000000 [ 26.563414] x17: 0000000000000000 x16: 0000000000000000 x15: 0000ffffd1341030 [ 26.563422] x14: ffffffffffffffff x13: 0000000000000020 x12: 0101010101010101 [ 26.563432] x11: 0000000000000020 x10: 0101010101010101 x9 : 7f7f7f7f7f7f7f7f [ 26.563441] x8 : 7f7f7f7f7f7f7f7f x7 : fefefeff30677364 x6 : 0000000080808080 [ 26.563450] x5 : 0000000000000000 x4 : ffff800008dee170 x3 : ffff80000a50bd42 [ 26.563459] x2 : ffff80000a5080e0 x1 : 0000000000000009 x0 : ffff80000a0092d0 [ 26.563470] Kernel panic - not syncing: kernel stack overflow [ 26.563474] CPU: 3 PID: 381 Comm: ifconfig Not tainted 5.16.0-rc1-zynqmp #60 [ 26.563481] Hardware name: TSN endpoint (DT) [ 26.563484] Call trace: [ 26.563486] dump_backtrace+0x0/0x1b0 [ 26.563497] show_stack+0x18/0x68 [ 26.563504] dump_stack_lvl+0x68/0x84 [ 26.563513] dump_stack+0x18/0x34 [ 26.563519] panic+0x164/0x324 [ 26.563524] nmi_panic+0x64/0x98 [ 26.563533] panic_bad_stack+0x108/0x128 [ 2k6.563539] handle_bad_stack+0x38/0x68 [ 26.563548] __bad_stack+0x88/0x8c [ 26.563553] inetdev_event+0x4/0x560 [ 26.563560] call_netdevice_notifiers_info+0x58/0xa8 [ 26.563569] dev_set_mac_address+0x78/0x110 [ 26.563576] tsnep_netdev_set_mac_address+0x38/0x60 [tsnep] [ 26.563591] dev_set_mac_address+0xc4/0x110 [ 26.563599] tsnep_netdev_set_mac_address+0x38/0x60 [tsnep] ... [ 26.565444] dev_set_mac_address+0xc4/0x110 [ 26.565452] tsnep_netdev_set_mac_address+0x38/0x60 [tsnep] [ 26.565462] dev_set_mac_address+0xc4/0x110 [ 26.565469] dev_set_mac_address_user+0x44/0x68 [ 26.565477] dev_ifsioc+0x30c/0x568 [ 26.565483] dev_ioctl+0x124/0x3f0 [ 26.565489] sock_do_ioctl+0xb4/0xf8 [ 26.565497] sock_ioctl+0x2f4/0x398 [ 26.565503] __arm64_sys_ioctl+0xa8/0xe8 [ 26.565511] invoke_syscall+0x44/0x108 [ 26.565520] el0_svc_common.constprop.3+0x94/0xf8 [ 26.565527] do_el0_svc+0x24/0x88 [ 26.565534] el0_svc+0x20/0x50 [ 26.565541] el0t_64_sync_handler+0x90/0xb8 [ 26.565548] el0t_64_sync+0x180/0x184 [ 26.565556] SMP: stopping secondary CPUs [ 26.565622] Kernel Offset: disabled [ 26.565624] CPU features: 0x0,00004002,00000846 [ 26.565628] Memory Limit: none [ 27.843428] ---[ end Kernel panic - not syncing: kernel stack overflow ]--- Fixes: 4dfb9982644b ("tsn: Fix build.") Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-11-23net: dsa: qca8k: add LAG supportAnsuel Smith2-0/+210
Add LAG support to this switch. In Documentation this is described as trunk mode. A max of 4 LAGs are supported and each can support up to 4 port. The current tx mode supported is Hash mode with both L2 and L2+3 mode. When no port are present in the trunk, the trunk is disabled in the switch. When a port is disconnected, the traffic is redirected to the other available port. The hash mode is global and each LAG require to have the same hash mode set. To change the hash mode when multiple LAG are configured, it's required to remove each LAG and set the desired hash mode to the last. An error is printed when it's asked to set a not supported hadh mode. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-11-23net: dsa: qca8k: add support for mirror modeAnsuel Smith2-0/+99
The switch supports mirror mode. Only one port can set as mirror port and every other port can set to both ingress and egress mode. The mirror port is disabled and reverted to normal operation once every port is removed from sending packet to it. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-11-23mctp: Add MCTP-over-serial transport bindingJeremy Kerr3-0/+529
This change adds a MCTP Serial transport binding, as defined by DMTF specificiation DSP0253 - "MCTP Serial Transport Binding". This is implemented as a new serial line discipline, and can be attached to arbitrary tty devices. From the Kconfig description: This driver provides an MCTP-over-serial interface, through a serial line-discipline, as defined by DMTF specification "DSP0253 - MCTP Serial Transport Binding". By attaching the ldisc to a serial device, we get a new net device to transport MCTP packets. This allows communication with external MCTP endpoints which use serial as their transport. It can also be used as an easy way to provide MCTP connectivity between virtual machines, by forwarding data between simple virtual serial devices. Say y here if you need to connect to MCTP endpoints over serial. To compile as a module, use m; the module will be called mctp-serial. Once the N_MCTP line discipline is set [using ioctl(TCIOSETD)], we get a new netdev suitable for MCTP communication. The 'mctp' utility[1] provides a simple wrapper for this ioctl, using 'link serial <device>': # mctp link serial /dev/ttyS0 & # mctp link dev lo index 1 address 0x00:00:00:00:00:00 net 1 mtu 65536 up dev mctpserial0 index 5 address 0x(no-addr) net 1 mtu 68 down [1]: https://github.com/CodeConstruct/mctp Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-11-23mlxsw: pci: Add shutdown method in PCI driverDanielle Ratson1-0/+1
On an arm64 platform with the Spectrum ASIC, after loading and executing a new kernel via kexec, the following trace [1] is observed. This seems to be caused by the fact that the device is not properly shutdown before executing the new kernel. Fix this by implementing a shutdown method which mirrors the remove method, as recommended by the kexec maintainer [2][3]. [1] BUG: Bad page state in process devlink pfn:22f73d page:fffffe00089dcf40 refcount:-1 mapcount:0 mapping:0000000000000000 index:0x0 flags: 0x2ffff00000000000() raw: 2ffff00000000000 0000000000000000 ffffffff089d0201 0000000000000000 raw: 0000000000000000 0000000000000000 ffffffffffffffff 0000000000000000 page dumped because: nonzero _refcount Modules linked in: CPU: 1 PID: 16346 Comm: devlink Tainted: G B 5.8.0-rc6-custom-273020-gac6b365b1bf5 #44 Hardware name: Marvell Armada 7040 TX4810M (DT) Call trace: dump_backtrace+0x0/0x1d0 show_stack+0x1c/0x28 dump_stack+0xbc/0x118 bad_page+0xcc/0xf8 check_free_page_bad+0x80/0x88 __free_pages_ok+0x3f8/0x418 __free_pages+0x38/0x60 kmem_freepages+0x200/0x2a8 slab_destroy+0x28/0x68 slabs_destroy+0x60/0x90 ___cache_free+0x1b4/0x358 kfree+0xc0/0x1d0 skb_free_head+0x2c/0x38 skb_release_data+0x110/0x1a0 skb_release_all+0x2c/0x38 consume_skb+0x38/0x130 __dev_kfree_skb_any+0x44/0x50 mlxsw_pci_rdq_fini+0x8c/0xb0 mlxsw_pci_queue_fini.isra.0+0x28/0x58 mlxsw_pci_queue_group_fini+0x58/0x88 mlxsw_pci_aqs_fini+0x2c/0x60 mlxsw_pci_fini+0x34/0x50 mlxsw_core_bus_device_unregister+0x104/0x1d0 mlxsw_devlink_core_bus_device_reload_down+0x2c/0x48 devlink_reload+0x44/0x158 devlink_nl_cmd_reload+0x270/0x290 genl_rcv_msg+0x188/0x2f0 netlink_rcv_skb+0x5c/0x118 genl_rcv+0x3c/0x50 netlink_unicast+0x1bc/0x278 netlink_sendmsg+0x194/0x390 __sys_sendto+0xe0/0x158 __arm64_sys_sendto+0x2c/0x38 el0_svc_common.constprop.0+0x70/0x168 do_el0_svc+0x28/0x88 el0_sync_handler+0x88/0x190 el0_sync+0x140/0x180 [2] https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1195432.html [3] https://patchwork.kernel.org/project/linux-scsi/patch/20170212214920.28866-1-anton@ozlabs.org/#20116693 Cc: Eric Biederman <ebiederm@xmission.com> Signed-off-by: Danielle Ratson <danieller@nvidia.com> Signed-off-by: Ido Schimmel <idosch@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-11-23mlxsw: spectrum_router: Remove deadcode in mlxsw_sp_rif_mac_profile_findDanielle Ratson1-3/+0
The function idr_for_each_entry() already checks that the next entry in the IDR is not NULL. Therefore, checking that again in every iteration leads to deadcode. Remove the unnecessary check in order to avoid that. Addresses-Coverity: ("Logically dead code") Signed-off-by: Danielle Ratson <danieller@nvidia.com> Signed-off-by: Ido Schimmel <idosch@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-11-22RDMA/irdma: Set protocol based on PF rdma_mode flagShiraz Saleem1-1/+2
Set the RDMA protocol to use at driver bind time based on the ice PF's rdma_mode flag. Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Tested-by: Leszek Kaliszczuk <leszek.kaliszczuk@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2021-11-22net/ice: Add support for enable_iwarp and enable_roce devlink paramShiraz Saleem5-3/+161
Allow support for 'enable_iwarp' and 'enable_roce' devlink params to turn on/off iWARP or RoCE protocol support for E800 devices. For example, a user can turn on iWARP functionality with, devlink dev param set pci/0000:07:00.0 name enable_iwarp value true cmode runtime This add an iWARP auxiliary rdma device, ice.iwarp.<>, under this PF. A user request to enable both iWARP and RoCE under the same PF is rejected since this device does not support both protocols simultaneously on the same port. Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Tested-by: Leszek Kaliszczuk <leszek.kaliszczuk@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2021-11-22net: dsa: qca8k: add support for mdb_add/delAnsuel Smith1-0/+99
Add support for mdb add/del function. The ARL table is used to insert the rule. The rule will be searched, deleted and reinserted with the port mask updated. The function will check if the rule has to be updated or insert directly with no deletion of the old rule. If every port is removed from the port mask, the rule is removed. The rule is set STATIC in the ARL table (aka it doesn't age) to not be flushed by fast age function. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-11-22net: dsa: qca8k: add set_ageing_time supportAnsuel Smith2-0/+28
qca8k support setting ageing time in step of 7s. Add support for it and set the max value accepted of 7645m. Documentation talks about support for 10000m but that values doesn't make sense as the value doesn't match the max value in the reg. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-11-22net: dsa: qca8k: add support for port fast agingAnsuel Smith2-0/+12
The switch supports fast aging by flushing any rule in the ARL table for a specific port. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-11-22net: dsa: qca8k: add additional MIB counter and make it dynamicAnsuel Smith2-3/+24
We are currently missing 2 additionals MIB counter present in QCA833x switch. QC832x switch have 39 MIB counter and QCA833X have 41 MIB counter. Add the additional MIB counter and rework the MIB function to print the correct supported counter from the match_data struct. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-11-22net: dsa: qca8k: initial conversion to regmap helperAnsuel Smith1-60/+47
Convert any qca8k set/clear/pool to regmap helper and add missing config to regmap_config struct. Read/write/rmw operation are reworked to use the regmap helper internally to keep the delta of this patch low. These additional function will then be dropped when the code split will be proposed. Ipq40xx SoC have the internal switch based on the qca8k regmap but use mmio for read/write/rmw operation instead of mdio. In preparation for the support of this internal switch, convert the driver to regmap API to later split the driver to common and specific code. The overhead introduced by the use of regamp API is marginal as the internal mdio will bypass it by using its direct access and regmap will be used only by configuration functions or fdb access. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>