summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet
AgeCommit message (Collapse)Author
2025-10-17r8169: reconfigure rx unconditionally before chip reset when resumingHeiner Kallweit
There's a good chance that more chip versions suffer from the same hw issue. So let's reconfigure rx unconditionally before the chip reset when resuming. This shouldn't have any side effect on unaffected chip versions. Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://patch.msgid.link/a5c2e2d2-226f-4896-b8f6-45e2d91f0e24@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-17dpaa2-eth: fix the pointer passed to PTR_ALIGN on Tx pathIoana Ciornei
The blamed commit increased the needed headroom to account for alignment. This means that the size required to always align a Tx buffer was added inside the dpaa2_eth_needed_headroom() function. By doing that, a manual adjustment of the pointer passed to PTR_ALIGN() was no longer correct since the 'buffer_start' variable was already pointing to the start of the skb's memory. The behavior of the dpaa2-eth driver without this patch was to drop frames on Tx even when the headroom was matching the 128 bytes necessary. Fix this by removing the manual adjust of 'buffer_start' from the PTR_MODE call. Closes: https://lore.kernel.org/netdev/70f0dcd9-1906-4d13-82df-7bbbbe7194c6@app.fastmail.com/T/#u Fixes: f422abe3f23d ("dpaa2-eth: increase the needed headroom to account for alignment") Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Tested-by: Mathew McBride <matt@traverse.com.au> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20251016135807.360978-1-ioana.ciornei@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-17net: enetc: correct the value of ENETC_RXB_TRUESIZEWei Fang
The ENETC RX ring uses the page halves flipping mechanism, each page is split into two halves for the RX ring to use. And ENETC_RXB_TRUESIZE is defined to 2048 to indicate the size of half a page. However, the page size is configurable, for ARM64 platform, PAGE_SIZE is default to 4K, but it could be configured to 16K or 64K. When PAGE_SIZE is set to 16K or 64K, ENETC_RXB_TRUESIZE is not correct, and the RX ring will always use the first half of the page. This is not consistent with the description in the relevant kernel doc and commit messages. This issue is invisible in most cases, but if users want to increase PAGE_SIZE to receive a Jumbo frame with a single buffer for some use cases, it will not work as expected, because the buffer size of each RX BD is fixed to 2048 bytes. Based on the above two points, we expect to correct ENETC_RXB_TRUESIZE to (PAGE_SIZE >> 1), as described in the comment. Fixes: d4fd0404c1c9 ("enetc: Introduce basic PF and VF ENETC ethernet drivers") Signed-off-by: Wei Fang <wei.fang@nxp.com> Reviewed-by: Claudiu Manoil <claudiu.manoil@nxp.com> Link: https://patch.msgid.link/20251016080131.3127122-1-wei.fang@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-17net: enetc: fix the deadlock of enetc_mdio_lockJianpeng Chang
After applying the workaround for err050089, the LS1028A platform experiences RCU stalls on RT kernel. This issue is caused by the recursive acquisition of the read lock enetc_mdio_lock. Here list some of the call stacks identified under the enetc_poll path that may lead to a deadlock: enetc_poll -> enetc_lock_mdio -> enetc_clean_rx_ring OR napi_complete_done -> napi_gro_receive -> enetc_start_xmit -> enetc_lock_mdio -> enetc_map_tx_buffs -> enetc_unlock_mdio -> enetc_unlock_mdio After enetc_poll acquires the read lock, a higher-priority writer attempts to acquire the lock, causing preemption. The writer detects that a read lock is already held and is scheduled out. However, readers under enetc_poll cannot acquire the read lock again because a writer is already waiting, leading to a thread hang. Currently, the deadlock is avoided by adjusting enetc_lock_mdio to prevent recursive lock acquisition. Fixes: 6d36ecdbc441 ("net: enetc: take the MDIO lock only once per NAPI poll cycle") Signed-off-by: Jianpeng Chang <jianpeng.chang.cn@windriver.com> Acked-by: Wei Fang <wei.fang@nxp.com> Link: https://patch.msgid.link/20251015021427.180757-1-jianpeng.chang.cn@windriver.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-17ipv6: Move ipv6_fl_list from ipv6_pinfo to inet_sock.Kuniyuki Iwashima
In {tcp6,udp6,raw6}_sock, struct ipv6_pinfo is always placed at the beginning of a new cache line because 1. __alignof__(struct tcp_sock) is 64 due to ____cacheline_aligned of __cacheline_group_begin(tcp_sock_write_tx) 2. __alignof__(struct udp_sock) is 64 due to ____cacheline_aligned of struct numa_drop_counters 3. in raw6_sock, struct numa_drop_counters is placed before struct ipv6_pinfo . struct ipv6_pinfo is 136 bytes, but the last cache line is only used by ipv6_fl_list: $ pahole -C ipv6_pinfo vmlinux struct ipv6_pinfo { ... /* --- cacheline 2 boundary (128 bytes) --- */ struct ipv6_fl_socklist * ipv6_fl_list; /* 128 8 */ /* size: 136, cachelines: 3, members: 23 */ Let's move ipv6_fl_list from struct ipv6_pinfo to struct inet_sock to save a full cache line for {tcp6,udp6,raw6}_sock. Now, struct ipv6_pinfo is 128 bytes, and {tcp6,udp6,raw6}_sock have 64 bytes less, while {tcp,udp,raw}_sock retain the same size. Before: # grep -E "^(RAW|UDP[^L\-]|TCP)" /proc/slabinfo | awk '{print $1, "\t", $4}' RAWv6 1408 UDPv6 1472 TCPv6 2560 RAW 1152 UDP 1280 TCP 2368 After: # grep -E "^(RAW|UDP[^L\-]|TCP)" /proc/slabinfo | awk '{print $1, "\t", $4}' RAWv6 1344 UDPv6 1408 TCPv6 2496 RAW 1152 UDP 1280 TCP 2368 Also, ipv6_fl_list and inet_flags (SNDFLOW bit) are placed in the same cache line. $ pahole -C inet_sock vmlinux ... /* --- cacheline 11 boundary (704 bytes) was 56 bytes ago --- */ struct ipv6_pinfo * pinet6; /* 760 8 */ /* --- cacheline 12 boundary (768 bytes) --- */ struct ipv6_fl_socklist * ipv6_fl_list; /* 768 8 */ unsigned long inet_flags; /* 776 8 */ Doc churn is due to the insufficient Type column (only 1 space short). Suggested-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com> Link: https://patch.msgid.link/20251014224210.2964778-1-kuniyu@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-17net: hibmcge: support pci_driver.shutdown()Jijie Shao
support pci_driver.shutdown() for hibmcge driver. Signed-off-by: Jijie Shao <shaojijie@huawei.com> Link: https://patch.msgid.link/20251014134018.1178385-1-shaojijie@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net: stmmac: dwmac-rk: Fix disabling set_clock_selectionSebastian Reichel
On all platforms set_clock_selection() writes to a GRF register. This requires certain clocks running and thus should happen before the clocks are disabled. This has been noticed on RK3576 Sige5, which hangs during system suspend when trying to suspend the second network interface. Note, that suspending the first interface works, because the second device ensures that the necessary clocks for the GRF are enabled. Cc: stable@vger.kernel.org Fixes: 2f2b60a0ec28 ("net: ethernet: stmmac: dwmac-rk: Add gmac support for rk3588") Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20251014-rockchip-network-clock-fix-v1-1-c257b4afdf75@collabora.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net: macb: sort #includesThéo Lebrun
Sort #include preprocessor directives. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Sean Anderson <sean.anderson@linux.dev> Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Link: https://patch.msgid.link/20251014-macb-cleanup-v1-15-31cd266e22cd@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net: macb: apply reverse christmas tree in macb_tx_map()Théo Lebrun
The arguments grew over time; follow conventions and apply reverse christmas tree (RCT). Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Link: https://patch.msgid.link/20251014-macb-cleanup-v1-14-31cd266e22cd@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net: macb: drop `count` local variable in macb_tx_map()Théo Lebrun
Local variable `count` is useless: it counts number of DMA descriptors used and returns it. But the return value is only checked for error. Drop counting the number of DMA descriptors and return a usual negative-if-error integer. Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Link: https://patch.msgid.link/20251014-macb-cleanup-v1-13-31cd266e22cd@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net: macb: drop `entry` local variable in macb_tx_map()Théo Lebrun
The pattern: entry = macb_tx_ring_wrap(bp, i); tx_skb = &queue->tx_skb[entry]; is the exact definition of: macb_tx_skb(queue, i); The pattern: entry = macb_tx_ring_wrap(bp, i); desc = macb_tx_desc(queue, entry); is redundant because macb_tx_desc() calls macb_tx_ring_wrap(). One explicit call to macb_tx_ring_wrap() is still required for checking if it is the last buffer (TX_WRAP case). Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Link: https://patch.msgid.link/20251014-macb-cleanup-v1-12-31cd266e22cd@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net: macb: replace min() with umin() callsThéo Lebrun
Whenever min(a, b) is used with a and b unsigned variables or literals, `make W=2` complains. Change four min() calls into umin(). stderr extract (GCC 11.2.0, MIPS Codescape): ./include/linux/minmax.h:68:57: warning: comparison is always true due to limited range of data type [-Wtype-limits] 68 | #define __is_nonneg(ux) statically_true((long long)(ux) >= 0) | ^~ drivers/net/ethernet/cadence/macb_main.c:2299:26: note: in expansion of macro ‘min’ 2299 | hdrlen = min(skb_headlen(skb), bp->max_tx_length); | ^~~ Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Link: https://patch.msgid.link/20251014-macb-cleanup-v1-11-31cd266e22cd@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net: macb: remove bp->queue_maskThéo Lebrun
The low 16 bits of GEM_DCFG6 tell us which queues are enabled in HW. In theory, there could be holes in the bitfield. In practice, the macb driver would fail if there were holes as most loops iterate upon bp->num_queues. Only macb_init() iterated correctly. - Drop bp->queue_mask field. - Error out at probe if a hole is in the queue mask. - Rely upon bp->num_queues for iteration. - As we drop the queue_mask probe local variable, fix RCT. - Compute queue_mask on the fly for TAPRIO using bp->num_queues. Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Link: https://patch.msgid.link/20251014-macb-cleanup-v1-10-31cd266e22cd@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net: macb: introduce DMA descriptor helpers (is 64bit? is PTP?)Théo Lebrun
Introduce macb_dma64() and macb_dma_ptp() helper functions. Many codepaths are made simpler by dropping conditional compilation. This implies two additional changes: - Always compile related structure definitions inside <macb.h>. - MACB_EXT_DESC can be dropped as it is useless now. The common case: #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT struct macb_dma_desc_64 *desc_64; if (bp->hw_dma_cap & HW_DMA_CAP_64B) { desc_64 = macb_64b_desc(bp, desc); // ... } #endif Is replaced by: if (macb_dma64(bp)) { struct macb_dma_desc_64 *desc_64 = macb_64b_desc(bp, desc); // ... } Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Link: https://patch.msgid.link/20251014-macb-cleanup-v1-9-31cd266e22cd@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net: macb: move bp->hw_dma_cap flags to bp->capsThéo Lebrun
Drop bp->hw_dma_cap field and put its two flags into bp->caps. On my specific config (eyeq5_defconfig), bloat-o-meter indicates: - macb_main.o: Before=56251, After=56359, chg +0.19% - macb_ptp.o: Before= 3976, After= 3952, chg -0.60% Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Link: https://patch.msgid.link/20251014-macb-cleanup-v1-8-31cd266e22cd@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net: macb: simplify macb_adj_dma_desc_idx()Théo Lebrun
The function body uses a switch statement on bp->hw_dma_cap and handles its four possible values: 0, is_64b, is_ptp, is_64b && is_ptp. Instead, refactor by noticing that the return value is: desc_size * MULT with MULT = 3 if is_64b && is_ptp, 2 if is_64b || is_ptp, 1 otherwise. MULT can be expressed as: 1 + is_64b + is_ptp Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Link: https://patch.msgid.link/20251014-macb-cleanup-v1-7-31cd266e22cd@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net: macb: simplify macb_dma_desc_get_size()Théo Lebrun
macb_dma_desc_get_size() does a switch on bp->hw_dma_cap and covers all four cases: 0, 64B, PTP, 64B+PTP. It also covers the #ifndef MACB_EXT_DESC separately, making it four codepaths. Instead, notice the descriptor size grows with enabled features and use plain if-statements on 64B and PTP flags. Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Link: https://patch.msgid.link/20251014-macb-cleanup-v1-6-31cd266e22cd@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net: macb: drop macb_config NULL checkingThéo Lebrun
Remove NULL checks on macb_config as it is always valid: - either it is its default value &default_gem_config, - or it got overridden using match data. Reviewed-by: Sean Anderson <sean.anderson@linux.dev> Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Link: https://patch.msgid.link/20251014-macb-cleanup-v1-5-31cd266e22cd@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net: macb: Remove local variables clk_init and init in macb_probe()Théo Lebrun
Remove local variables clk_init and init. Those function pointers are always equivalent to macb_config->clk_init and macb_config->init. Reviewed-by: Sean Anderson <sean.anderson@linux.dev> Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Link: https://patch.msgid.link/20251014-macb-cleanup-v1-4-31cd266e22cd@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net: macb: remove gap in MACB_CAPS_* flagsThéo Lebrun
MACB_CAPS_* are bit constants that get used in bp->caps. They occupy bits 0..12 + 24..31. Remove 11..23 gap by moving bits 24..31 to 13..20. Occupation bitfields: 31 29 27 25 23 21 19 17 15 13 11 09 07 05 03 01 30 28 26 24 22 20 18 16 14 12 10 08 06 04 02 00 -- Before ------------------------------------------------------ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 -- After ------------------------------------------------------- 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Link: https://patch.msgid.link/20251014-macb-cleanup-v1-3-31cd266e22cd@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net: macb: use BIT() macro for capability definitionsThéo Lebrun
Replace all capabilities values by calls to the BIT() macro. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Sean Anderson <sean.anderson@linux.dev> Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Link: https://patch.msgid.link/20251014-macb-cleanup-v1-2-31cd266e22cd@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net: stmmac: add Eswin EIC7700 glue driverShangjuan Wei
Add Ethernet controller support for Eswin's eic7700 SoC. The driver implements hardware initialization, clock configuration, delay adjustment functions based on DWC Ethernet controller, and supports device tree configuration and platform driver integration. Signed-off-by: Zhi Li <lizhi2@eswincomputing.com> Signed-off-by: Shangjuan Wei <weishangjuan@eswincomputing.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/20251015114101.1218-1-weishangjuan@eswincomputing.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net: stmmac: rename stmmac_phy_setup() to include phylinkRussell King (Oracle)
stmmac_phy_setup() does not set up any PHY, but does setup phylink. Rename this function to stmmac_phylink_setup() to reflect more what it is doing. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Reviewed-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/E1v945d-0000000Ameh-3Bs7@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net: stmmac: rearrange tc_init()Russell King (Oracle)
To make future changes easier, rearrange the use of dma_cap->l3l4fnum vs priv->flow_entries_max. Always initialise priv->flow_entries_max from dma_cap->l3l4fnum, then use priv->flow_entries_max to determine whether we allocate priv->flow_entries and set it up. This change is safe because tc_init() is only called once from stmmac_dvr_probe(). Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Link: https://patch.msgid.link/E1v945Y-0000000Ameb-2gDI@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net: stmmac: avoid PHY speed change when configuring MTURussell King (Oracle)
There is no need to do the speed-down, speed-up dance when changing the MTU as there is little power saving that can be gained from such a brief interval between these, and the autonegotiation they cause takes much longer. Move the calls to phylink_speed_up() and phylink_speed_down() into stmmac_open() and stmmac_release() respectively, reducing the work done in the __-variants of these functions. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Reviewed-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/E1v945T-0000000AmeV-2BvU@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net: stmmac: place .mac_finish() method more appropriatelyRussell King (Oracle)
Place the .mac_finish() initialiser and implementation after the .mac_config() initialiser and method which reflects the order that they appear in struct phylink_mac_ops, and the order in which they are called. This keeps logically similar code together. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/E1v945O-0000000AmeP-1k0t@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net: stmmac: dwc-qos-eth: move MDIO bus locking into stmmac_mdioRussell King (Oracle)
Rather than dwc-qos-eth manipulating the MDIO bus lock directly, add helpers to the stmmac MDIO layer and use them in dwc-qos-eth. This improves my commit 87f43e6f06a2 ("net: stmmac: dwc-qos: calibrate tegra with mdio bus idle"). Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/E1v945J-0000000AmeJ-1GOb@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16Octeontx2-af: Fix pci_alloc_irq_vectors() return value checkHarshit Mogalapalli
In cgx_probe() when pci_alloc_irq_vectors() fails the error value will be negative and that check is sufficient. err = pci_alloc_irq_vectors(pdev, nvec, nvec, PCI_IRQ_MSIX); if (err < 0 || err != nvec) { ... } When pci_alloc_irq_vectors() fail to allocate nvec number of vectors, -ENOSPC is returned, so it would be safe to remove the check that compares err with nvec. Suggested-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20251015090117.1557870-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net/mlx5e: psp, avoid 'accel' NULL pointer dereferenceCosmin Ratiu
The 'accel' parameter of mlx5e_txwqe_build_eseg_csum() and the similar 'state' parameter of mlx5e_accel_tx_ids_len() were NULL when called from mlx5i_sq_xmit() and were causing kernel panics from that context. Fix that by passing in a local empty mlx5e_accel_tx_state variable, thus guaranteeing that 'accel' is never NULL. Also remove an unnecessary check from mlx5e_tx_wqe_inline_mode(). Fixes: e5a1861a298e ("net/mlx5e: Implement PSP Tx data path") Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com> Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com> Link: https://patch.msgid.link/1760511923-890650-1-git-send-email-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net: amd-xgbe: use EOPNOTSUPP instead of ENOTSUPP in xgbe_phy_mii_read_c45Alok Tiwari
The MDIO read callback xgbe_phy_mii_read_c45() can propagate its return value up through phylink_mii_ioctl() to user space via netdev ioctls such as SIOCGMIIREG. Returning ENOTSUPP results in user space seeing "Unknown error", since ENOTSUPP is not a standard errno value. Replace ENOTSUPP with EOPNOTSUPP to align with the MDIO core’s usage and ensure user space receives a proper "Operation not supported" error instead of an unknown code. Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com> Reviewed-by: Simon Horman <horms@kernel.org> Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://patch.msgid.link/20251015025751.1532149-1-alok.a.tiwari@oracle.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net/mlx5e: Return 1 instead of 0 in invalid case in mlx5e_mpwrq_umr_entry_size()Nathan Chancellor
When building with Clang 20 or newer, there are some objtool warnings from unexpected fallthroughs to other functions: vmlinux.o: warning: objtool: mlx5e_mpwrq_mtts_per_wqe() falls through to next function mlx5e_mpwrq_max_num_entries() vmlinux.o: warning: objtool: mlx5e_mpwrq_max_log_rq_size() falls through to next function mlx5e_get_linear_rq_headroom() LLVM 20 contains an (admittedly problematic [1]) optimization [2] to convert divide by zero into the equivalent of __builtin_unreachable(), which invokes undefined behavior and destroys code generation when it is encountered in a control flow graph. mlx5e_mpwrq_umr_entry_size() returns 0 in the default case of an unrecognized mlx5e_mpwrq_umr_mode value. mlx5e_mpwrq_mtts_per_wqe(), which is inlined into mlx5e_mpwrq_max_log_rq_size(), uses the result of mlx5e_mpwrq_umr_entry_size() in a divide operation without checking for zero, so LLVM is able to infer there will be a divide by zero in this case and invokes undefined behavior. While there is some proposed work to isolate this undefined behavior and avoid the destructive code generation that results in these objtool warnings, code should still be defensive against divide by zero. As the WARN_ONCE() implies that an invalid value should be handled gracefully, return 1 instead of 0 in the default case so that the results of this division operation is always valid. Fixes: 168723c1f8d6 ("net/mlx5e: xsk: Use umr_mode to calculate striding RQ parameters") Link: https://lore.kernel.org/CAGG=3QUk8-Ak7YKnRziO4=0z=1C_7+4jF+6ZeDQ9yF+kuTOHOQ@mail.gmail.com/ [1] Link: https://github.com/llvm/llvm-project/commit/37932643abab699e8bb1def08b7eb4eae7ff1448 [2] Closes: https://github.com/ClangBuiltLinux/linux/issues/2131 Closes: https://github.com/ClangBuiltLinux/linux/issues/2132 Signed-off-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20251014-mlx5e-avoid-zero-div-from-mlx5e_mpwrq_umr_entry_size-v1-1-dc186b8819ef@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netJakub Kicinski
Cross-merge networking fixes after downstream PR (net-6.18-rc2). No conflicts or adjacent changes. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-16net: txgbe: rename txgbe_get_phy_link()Jiawen Wu
The function txgbe_get_phy_link() is more appropriately named txgbe_get_mac_link(), since it reads the link status from the MAC register. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Link: https://patch.msgid.link/20251014061726.36660-4-jiawenwu@trustnetic.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2025-10-16net: txgbe: optimize the flow to setup PHY for AML devicesJiawen Wu
To adapt to new firmware for AML devices, the driver should send the "SET_LINK_CMD" to the firmware only once when switching PHY interface mode, and no longer needs to re-trigger PHY configuration based on the RX signal interrupt (TXGBE_GPIOBIT_3). In previous firmware versions, the PHY was configured only after receiving "SET_LINK_CMD", and might remain incomplete if the RX signal was lost. To handle this case, the driver used TXGBE_GPIOBIT_3 interrupt to resend the command. This workaround is no longer necessary with the new firmware. And the unknown link speed is permitted in the mailbox buffer. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Link: https://patch.msgid.link/20251014061726.36660-3-jiawenwu@trustnetic.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2025-10-16net: txgbe: expend SW-FW mailbox buffer size to identify QSFP moduleJiawen Wu
Recent firmware updates introduce additional fields in the mailbox message to provide more information for identifying 40G and 100G QSFP modules. To accommodate these new fields, expand the mailbox buffer size by 4 bytes. Without this change, drivers built against the updated firmware cannot properly identify modules due to mismatched mailbox message lengths. The old firmware version that used the smaller mailbox buffer has never been publicly released, so there are no backward-compatibility concerns. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/20251014061726.36660-2-jiawenwu@trustnetic.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2025-10-16net: fbnic: Allow builds for all 64 bit architecturesDimitri Daskalakis
This enables aarch64 testing, but there's no reason we cannot support other architectures. Signed-off-by: Dimitri Daskalakis <dimitri.daskalakis1@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20251013211449.1377054-3-dimitri.daskalakis1@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2025-10-16net: fbnic: Fix page chunking logic when PAGE_SIZE > 4KDimitri Daskalakis
The HW always works on a 4K page size. When the OS supports larger pages, we fragment them across multiple BDQ descriptors. We were not properly incrementing the descriptor, which resulted in us specifying the last chunks id/addr and then 15 zero descriptors. This would cause packet loss and driver crashes. This is not a fix since the Kconfig prevents use outside of x86. Signed-off-by: Dimitri Daskalakis <dimitri.daskalakis1@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20251013211449.1377054-2-dimitri.daskalakis1@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2025-10-15net: airoha: npu: Add 7583 SoC supportLorenzo Bianconi
Introduce support for Airoha 7583 SoC NPU selecting proper firmware images. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20251013-airoha-npu-7583-v3-3-00f748b5a0c7@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-15net: airoha: npu: Add airoha_npu_soc_data structLorenzo Bianconi
Introduce airoha_npu_soc_data structure in order to generalize per-SoC NPU firmware info. Introduce airoha_npu_load_firmware utility routine. This is a preliminary patch in order to introduce AN7583 NPU support. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20251013-airoha-npu-7583-v3-2-00f748b5a0c7@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-15net: bcmasp: Add support for PHY-based Wake-on-LANFlorian Fainelli
If available, interrogate the PHY to find out whether we can use it for Wake-on-LAN. This can be a more power efficient way of implementing that feature, especially when the MAC is powered off in low power states. Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://patch.msgid.link/20251013172306.2250223-1-florian.fainelli@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-15tg3: prevent use of uninitialized remote_adv and local_adv variablesAlexey Simakov
Some execution paths that jump to the fiber_setup_done label could leave the remote_adv and local_adv variables uninitialized and then use it. Initialize this variables at the point of definition to avoid this. Fixes: 85730a631f0c ("tg3: Add SGMII phy support for 5719/5718 serdes") Co-developed-by: Alexandr Sapozhnikov <alsp705@gmail.com> Signed-off-by: Alexandr Sapozhnikov <alsp705@gmail.com> Signed-off-by: Alexey Simakov <bigalex934@gmail.com> Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com> Link: https://patch.msgid.link/20251014164736.5890-1-bigalex934@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-15net: bcmgenet: remove unused platform codeHeiner Kallweit
This effectively reverts b0ba512e25d7 ("net: bcmgenet: enable driver to work without a device tree"). There has never been an in-tree user of struct bcmgenet_platform_data, all devices use OF or ACPI. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Simon Horman <horms@kernel.org> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://patch.msgid.link/108b4e64-55d4-4b4e-9a11-3c810c319d66@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-15gve: Check valid ts bit on RX descriptor before hw timestampingTim Hostetler
The device returns a valid bit in the LSB of the low timestamp byte in the completion descriptor that the driver should check before setting the SKB's hardware timestamp. If the timestamp is not valid, do not hardware timestamp the SKB. Cc: stable@vger.kernel.org Fixes: b2c7aeb49056 ("gve: Implement ndo_hwtstamp_get/set for RX timestamping") Reviewed-by: Joshua Washington <joshwash@google.com> Signed-off-by: Tim Hostetler <thostet@google.com> Signed-off-by: Harshitha Ramamurthy <hramamurthy@google.com> Reviewed-by: Simon Horman <horms@kernel.org> Reviewed-by: Willem de Bruijn <willemb@google.com> Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev> Link: https://patch.msgid.link/20251014004740.2775957-1-hramamurthy@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-14net: airoha: Add get_link ethtool callbackLorenzo Bianconi
Set get_link ethtool callback to ethtool_op_get_link routine. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/20251013-airoha-ethtool-improvements-v1-2-fdd1c6fc9be1@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-14net: airoha: Add missing stats to ethtool_eth_mac_statsLorenzo Bianconi
Add the following stats to ethtool ethtool_eth_mac_stats stats: - FramesTransmittedOK - OctetsTransmittedOK - FramesReceivedOK - OctetsReceivedOK Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/20251013-airoha-ethtool-improvements-v1-1-fdd1c6fc9be1@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-14eth: fealnx: fix typo in commentsDenis Benato
There are a few typos in comments: - replace "avilable" with "available" - replace "mutlicast" with "multicast" Signed-off-by: Denis Benato <benato.denis96@gmail.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20251013183632.1226627-1-benato.denis96@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-14eth: fbnic: fix various typos in comments and stringsAlok Tiwari
Fix several minor typos and grammatical errors in comments and log (in fbnic firmware, PCI, and time modules) Changes include: - "cordeump" -> "coredump" - "of" -> "off" in RPC config comment - "healty" -> "healthy" in firmware heartbeat comment - "Firmware crashed detected!" -> "Firmware crash detected!" - "The could be caused" -> "This could be caused" - "lockng" -> "locking" in fbnic_time.c Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20251013160507.768820-1-alok.a.tiwari@oracle.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-14net: airoha: Take into account out-of-order tx completions in airoha_dev_xmit()Lorenzo Bianconi
Completion napi can free out-of-order tx descriptors if hw QoS is enabled and packets with different priority are queued to same DMA ring. Take into account possible out-of-order reports checking if the tx queue is full using circular buffer head/tail pointer instead of the number of queued packets. Fixes: 23020f0493270 ("net: airoha: Introduce ethernet support for EN7581 SoC") Suggested-by: Simon Horman <horms@kernel.org> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20251012-airoha-tx-busy-queue-v2-1-a600b08bab2d@kernel.org Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2025-10-14Octeontx2-af: Fix missing error code in cgx_probe()Harshit Mogalapalli
When CGX fails mapping to NIX, set the error code to -ENODEV, currently err is zero and that is treated as success path. Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/all/aLAdlCg2_Yv7Y-3h@stanley.mountain/ Fixes: d280233fc866 ("Octeontx2-af: Fix NIX X2P calibration failures") Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20251010204239.94237-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2025-10-14amd-xgbe: Avoid spurious link down messages during interface toggleRaju Rangoju
During interface toggle operations (ifdown/ifup), the driver currently resets the local helper variable 'phy_link' to -1. This causes the link state machine to incorrectly interpret the state as a link change event, resulting in spurious "Link is down" messages being logged when the interface is brought back up. Preserve the phy_link state across interface toggles to avoid treating the -1 sentinel value as a legitimate link state transition. Fixes: 88131a812b16 ("amd-xgbe: Perform phy connect/disconnect at dev open/stop") Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com> Reviewed-by: Dawid Osuchowski <dawid.osuchowski@linux.intel.com> Link: https://patch.msgid.link/20251010065142.1189310-1-Raju.Rangoju@amd.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>