]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
6 weeks agonet: hns3: fix spelling mistake "reg_um" -> "reg_num"
Jijie Shao [Mon, 23 Jun 2025 04:00:37 +0000 (12:00 +0800)] 
net: hns3: fix spelling mistake "reg_um" -> "reg_num"

There are spelling mistakes in hclgevf_get_regs. Fix them.

Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250623040043.857782-2-shaojijie@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agopppoe: drop PACKET_OTHERHOST before skb_share_check()
Qingfang Deng [Mon, 23 Jun 2025 03:34:31 +0000 (11:34 +0800)] 
pppoe: drop PACKET_OTHERHOST before skb_share_check()

Align with ip_rcv() by dropping PACKET_OTHERHOST packets before
calling skb_share_check(). This avoids unnecessary skb processing
for packets that will be discarded anyway.

Signed-off-by: Qingfang Deng <dqfext@gmail.com>
Acked-by: Guillaume Nault <gnault@redhat.com>
Link: https://patch.msgid.link/20250623033431.408810-1-dqfext@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agoudp_tunnel: fix deadlock in udp_tunnel_nic_set_port_priv()
Paolo Abeni [Mon, 23 Jun 2025 10:53:55 +0000 (12:53 +0200)] 
udp_tunnel: fix deadlock in udp_tunnel_nic_set_port_priv()

While configuring a vxlan tunnel in a system with a i40e NIC driver, I
observe the following deadlock:

 WARNING: possible recursive locking detected
 6.16.0-rc2.net-next-6.16_92d87230d899+ #13 Tainted: G            E
 --------------------------------------------
 kworker/u256:4/1125 is trying to acquire lock:
 ffff88921ab9c8c8 (&utn->lock){+.+.}-{4:4}, at: i40e_udp_tunnel_set_port (/home/pabeni/net-next/include/net/udp_tunnel.h:343 /home/pabeni/net-next/drivers/net/ethernet/intel/i40e/i40e_main.c:13013) i40e

 but task is already holding lock:
 ffff88921ab9c8c8 (&utn->lock){+.+.}-{4:4}, at: udp_tunnel_nic_device_sync_work (/home/pabeni/net-next/net/ipv4/udp_tunnel_nic.c:739) udp_tunnel

 other info that might help us debug this:
  Possible unsafe locking scenario:

        CPU0
        ----
   lock(&utn->lock);
   lock(&utn->lock);

  *** DEADLOCK ***

  May be due to missing lock nesting notation

 4 locks held by kworker/u256:4/1125:
 #0: ffff8892910ca158 ((wq_completion)udp_tunnel_nic){+.+.}-{0:0}, at: process_one_work (/home/pabeni/net-next/kernel/workqueue.c:3213)
 #1: ffffc900244efd30 ((work_completion)(&utn->work)){+.+.}-{0:0}, at: process_one_work (/home/pabeni/net-next/kernel/workqueue.c:3214)
 #2: ffffffff9a14e290 (rtnl_mutex){+.+.}-{4:4}, at: udp_tunnel_nic_device_sync_work (/home/pabeni/net-next/net/ipv4/udp_tunnel_nic.c:737) udp_tunnel
 #3: ffff88921ab9c8c8 (&utn->lock){+.+.}-{4:4}, at: udp_tunnel_nic_device_sync_work (/home/pabeni/net-next/net/ipv4/udp_tunnel_nic.c:739) udp_tunnel

 stack backtrace:
 Hardware name: Dell Inc. PowerEdge R7525/0YHMCJ, BIOS 2.2.5 04/08/2021
i
 Call Trace:
  <TASK>
 dump_stack_lvl (/home/pabeni/net-next/lib/dump_stack.c:123)
 print_deadlock_bug (/home/pabeni/net-next/kernel/locking/lockdep.c:3047)
 validate_chain (/home/pabeni/net-next/kernel/locking/lockdep.c:3901)
 __lock_acquire (/home/pabeni/net-next/kernel/locking/lockdep.c:5240)
 lock_acquire.part.0 (/home/pabeni/net-next/kernel/locking/lockdep.c:473 /home/pabeni/net-next/kernel/locking/lockdep.c:5873)
 __mutex_lock (/home/pabeni/net-next/kernel/locking/mutex.c:604 /home/pabeni/net-next/kernel/locking/mutex.c:747)
 i40e_udp_tunnel_set_port (/home/pabeni/net-next/include/net/udp_tunnel.h:343 /home/pabeni/net-next/drivers/net/ethernet/intel/i40e/i40e_main.c:13013) i40e
 udp_tunnel_nic_device_sync_by_port (/home/pabeni/net-next/net/ipv4/udp_tunnel_nic.c:230 /home/pabeni/net-next/net/ipv4/udp_tunnel_nic.c:249) udp_tunnel
 __udp_tunnel_nic_device_sync.part.0 (/home/pabeni/net-next/net/ipv4/udp_tunnel_nic.c:292) udp_tunnel
 udp_tunnel_nic_device_sync_work (/home/pabeni/net-next/net/ipv4/udp_tunnel_nic.c:742) udp_tunnel
 process_one_work (/home/pabeni/net-next/kernel/workqueue.c:3243)
 worker_thread (/home/pabeni/net-next/kernel/workqueue.c:3315 /home/pabeni/net-next/kernel/workqueue.c:3402)
 kthread (/home/pabeni/net-next/kernel/kthread.c:464)

AFAICS all the existing callsites of udp_tunnel_nic_set_port_priv() are
already under the utn lock scope, avoid (re-)acquiring it in such a
function.

Fixes: 1ead7501094c ("udp_tunnel: remove rtnl_lock dependency")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/95a827621ec78c12d1564ec3209e549774f9657d.1750675978.git.pabeni@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agoMerge branch 'pse-improve-documentation-clarity'
Paolo Abeni [Tue, 24 Jun 2025 08:57:45 +0000 (10:57 +0200)] 
Merge branch 'pse-improve-documentation-clarity'

Kory Maincent says:

====================
PSE: Improve documentation clarity

Thanks to new PSE driver being proposed on the mailinglist figured out
there was some unclear documentation, which lead the developer on the
wrong path. Clarify these documentation.

The changes focus on clarifying the setup_pi_matrix callback behavior
and improving device tree binding descriptions, particularly around
channel-to-PI mapping relationships that are critical for proper PSE
controller integration.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
====================

Link: https://patch.msgid.link/20250620-poe_doc_improve-v1-0-96357bb95d52@bootlin.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
6 weeks agonet: pse-pd: tps23881: Clarify setup_pi_matrix callback documentation
Kory Maincent [Fri, 20 Jun 2025 10:02:40 +0000 (12:02 +0200)] 
net: pse-pd: tps23881: Clarify setup_pi_matrix callback documentation

Improve the setup_pi_matrix callback documentation to clarify its purpose
and usage. The enhanced description explains that PSE PI devicetree nodes
are pre-parsed before this callback is invoked, and drivers should utilize
pcdev->pi[x]->pairset[y].np to map PSE controller hardware ports to their
corresponding Power Interfaces.

This clarification helps driver implementers understand the callback's
role in establishing the hardware-to-PI relationship mapping.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Link: https://patch.msgid.link/20250620-poe_doc_improve-v1-2-96357bb95d52@bootlin.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
6 weeks agodt-bindings: pse: tps23881: Clarify channels property description
Kory Maincent [Fri, 20 Jun 2025 10:02:39 +0000 (12:02 +0200)] 
dt-bindings: pse: tps23881: Clarify channels property description

Improve the channels property description to better explain the
relationship between physical delivery channels and PSE PI pairsets.
The previous description was unclear about how channels are referenced
and used in the port matrix mapping.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Link: https://patch.msgid.link/20250620-poe_doc_improve-v1-1-96357bb95d52@bootlin.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
6 weeks agoMerge branch 'add-support-for-25g-50g-and-100g-to-fbnic'
Paolo Abeni [Tue, 24 Jun 2025 07:31:48 +0000 (09:31 +0200)] 
Merge branch 'add-support-for-25g-50g-and-100g-to-fbnic'

Alexander Duyck says:

====================
Add support for 25G, 50G, and 100G to fbnic

The fbnic driver up till now had avoided actually reporting link as the
phylink setup only supported up to 40G configurations. This changeset is
meant to start addressing that by adding support for 50G and 100G interface
types.

With that basic support added fbnic can then set those types based on the
EEPROM configuration provided by the firmware and then report those speeds
out using the information provided via the phylink call for getting the
link ksettings. This provides the basic MAC support and enables supporting
the speeds as well as configuring flow control.

After this I plan to add support for a PHY that will represent the SerDes
PHY being used to manage the link as we need a way to indicate link
training into phylink to prevent link flaps on the PCS while the SerDes is
in training, and then after that I will look at rolling support for our
PCS/PMA into the XPCS driver.
====================

Link: https://patch.msgid.link/175028434031.625704.17964815932031774402.stgit@ahduyck-xeon-server.home.arpa
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
6 weeks agofbnic: Add support for setting/getting pause configuration
Alexander Duyck [Wed, 18 Jun 2025 22:08:09 +0000 (15:08 -0700)] 
fbnic: Add support for setting/getting pause configuration

Phylink already handles most of the pieces necessary for configuring
autonegotation. With that being the case we can add support for
getting/setting pause now by just passing through the ethtool call to the
phylink code.

Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/175028448974.625704.14427543910503058114.stgit@ahduyck-xeon-server.home.arpa
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
6 weeks agofbnic: Add support for reporting link config
Alexander Duyck [Wed, 18 Jun 2025 22:08:02 +0000 (15:08 -0700)] 
fbnic: Add support for reporting link config

This change adds some basic support for reporting the current link config
to the user via ethtool. Currently the main components reported are the
carrier status, link speed, and FEC.

For now we are handling the FEC directly as phylink doesn't have support
for it. The plan is to work on incorporating FEC support into phylink and
eventually adding the ability for us to set the FEC configuration through
phylink itself.

In addition as we don't yet have SFP or PHY support the listed modes
supported are including ones not supported by the media we are attached to.
That will hopefully be addressed once we can get the QSFP modules
supported.

Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Link: https://patch.msgid.link/175028448275.625704.60592644122010798.stgit@ahduyck-xeon-server.home.arpa
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
6 weeks agofbnic: Set correct supported modes and speeds based on FW setting
Alexander Duyck [Wed, 18 Jun 2025 22:07:55 +0000 (15:07 -0700)] 
fbnic: Set correct supported modes and speeds based on FW setting

The fbnic driver was using the XLGMII link mode to enable phylink, however
that mode wasn't the correct one to use as the NIC doesn't actually use
XLGMII, it is using a combinations of 25G, 50G, and 100G interface modes
and configuring those via pins exposed on the PCS, MAC, and PHY interfaces.
To more accurately reflect that we should drop the uxe of XGMII and XLGMII
and instead use the correct interface types.

Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Link: https://patch.msgid.link/175028447568.625704.17971496887030109107.stgit@ahduyck-xeon-server.home.arpa
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
6 weeks agofbnic: Update FW link mode values to represent actual link modes
Alexander Duyck [Wed, 18 Jun 2025 22:07:48 +0000 (15:07 -0700)] 
fbnic: Update FW link mode values to represent actual link modes

Make it so that the enum we use for the FW values represents actual link
modes that will be normally advertised by a link partner.

Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Link: https://patch.msgid.link/175028446893.625704.10103673858068429312.stgit@ahduyck-xeon-server.home.arpa
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
6 weeks agofbnic: Replace link_mode with AUI
Alexander Duyck [Wed, 18 Jun 2025 22:07:42 +0000 (15:07 -0700)] 
fbnic: Replace link_mode with AUI

The way we were using "link_mode" was really more to describe the interface
between the attachment unit interface(s) we were using on the device.
Specifically the AUI is describing the modulation and the number of lanes
we are using. So we can simplify this by replacing link_mode with aui.

Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Link: https://patch.msgid.link/175028446219.625704.8050098629750896117.stgit@ahduyck-xeon-server.home.arpa
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
6 weeks agofbnic: Retire "AUTO" flags and cleanup handling of FW link settings
Alexander Duyck [Wed, 18 Jun 2025 22:07:35 +0000 (15:07 -0700)] 
fbnic: Retire "AUTO" flags and cleanup handling of FW link settings

There were several issues in the way we were handling the link info coming
from firmware.

First is the fact that we were carrying around "AUTO" flags to indicate
that we needed to populate the values. We can just drop this and assume
that we will always be populating the settings from firmware. With this we
can also clean up the masking as the "AUTO" flags were just there to be
stripped anyway.

Second since we are getting rid of the "AUTO" setting we still need a way
to report that the link is not configured. We convert the link_mode "AUTO"
to "UNKNOWN" to do this. With this we can avoid reporting link up in the
phylink_pcs_get_state call as we will just set link to 0 and return without
updating the link speed. This is preferred versus the driver just forcing
50G which makes it harder to recover when the FW does start providing valid
settings.

With this the plan is to eventually replace the link_mode we use with the
interface_mode from phylink for all intents and purposes and have the two
be interchangeable. At that point we can convert the FW provided settings
over to something closer to link partner settings and give phylink greater
control of the interface allowing for user override of the settings and an
asynchronous setup of the link versus having to pull early settings from
firmware.

Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Link: https://patch.msgid.link/175028445548.625704.1367708155813490215.stgit@ahduyck-xeon-server.home.arpa
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
6 weeks agofbnic: Do not consider mailbox "initialized" until we have verified fw version
Alexander Duyck [Wed, 18 Jun 2025 22:07:28 +0000 (15:07 -0700)] 
fbnic: Do not consider mailbox "initialized" until we have verified fw version

In order for us to make use of the information in the PHY we need to verify
that the FW capabilities message has been processed. To do so we should
poll until the FW version in the capabilities message is at least at the
minimum level needed to verify that the FW can support the basic PHY config
messages.

As such this change adds logic so that we will poll the mailbox until such
time as the FW version can be populated with an acceptable value. If it
doesn't reach a sufficicient value the mailbox will be considered to have
timed out.

Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Link: https://patch.msgid.link/175028444873.625704.10269838393153693403.stgit@ahduyck-xeon-server.home.arpa
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
6 weeks agonet: phy: Add interface types for 50G and 100G
Alexander Duyck [Wed, 18 Jun 2025 22:07:22 +0000 (15:07 -0700)] 
net: phy: Add interface types for 50G and 100G

Add support for 802.3cd based interface types 50GBASE-R and 100GBASE-P.
This choice in naming is based on section 135 of the 802.3-2022 IEEE
Standard.

In addition it is adding support for what I am referring to as LAUI
which is based on annex 135C of the IEEE Standard, and shares many
similarities with the 25/50G consortium. The main difference between the
two is that IEEE spec refers to LAUI as the AUI before the RS(544/514) FEC,
whereas the 25/50G use this lane and frequency combination after going
through RS(528/514), Base-R or no FEC at all.

Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Link: https://patch.msgid.link/175028444205.625704.4191700324472974116.stgit@ahduyck-xeon-server.home.arpa
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
6 weeks agopage_pool: import Jesper's page_pool benchmark
Jesper Dangaard Brouer [Thu, 19 Jun 2025 18:15:18 +0000 (18:15 +0000)] 
page_pool: import Jesper's page_pool benchmark

We frequently consult with Jesper's out-of-tree page_pool benchmark to
evaluate page_pool changes.

Import the benchmark into the upstream linux kernel tree so that (a)
we're all running the same version, (b) pave the way for shared
improvements, and (c) maybe one day integrate it with nipa, if possible.

Import bench_page_pool_simple from commit 35b1716d0c30 ("Add
page_bench06_walk_all"), from this repository:
https://github.com/netoptimizer/prototype-kernel.git

Changes done during upstreaming:
- Fix checkpatch issues.
- Remove the tasklet logic not needed.
- Move under tools/testing
- Create ksft for the benchmark.
- Changed slightly how the benchmark gets build. Out of tree, time_bench
  is built as an independent .ko. Here it is included in
  bench_page_pool.ko

Steps to run:

```
mkdir -p /tmp/run-pp-bench
make -C ./tools/testing/selftests/net/bench
make -C ./tools/testing/selftests/net/bench install INSTALL_PATH=/tmp/run-pp-bench
rsync --delete -avz --progress /tmp/run-pp-bench mina@$SERVER:~/
ssh mina@$SERVER << EOF
  cd ~/run-pp-bench && sudo ./test_bench_page_pool.sh
EOF
```

Note that by default, the Makefile will build the benchmark for the
currently installed kernel in /lib/modules/$(shell uname -r)/build. To
build against the current tree, do:

make KDIR=$(pwd) -C ./tools/testing/selftests/net/bench

Output (from Jesper):

```
sudo ./test_bench_page_pool.sh
(benchmark dmesg logs snipped)

Fast path results:
no-softirq-page_pool01 Per elem: 23 cycles(tsc) 6.571 ns

ptr_ring results:
no-softirq-page_pool02 Per elem: 60 cycles(tsc) 16.862 ns

slow path results:
no-softirq-page_pool03 Per elem: 265 cycles(tsc) 73.739 ns
```

Output (from me):

```
sudo ./test_bench_page_pool.sh
(benchmark dmesg logs snipped)

Fast path results:
no-softirq-page_pool01 Per elem: 11 cycles(tsc) 4.177 ns

ptr_ring results:
no-softirq-page_pool02 Per elem: 51 cycles(tsc) 19.117 ns

slow path results:
no-softirq-page_pool03 Per elem: 168 cycles(tsc) 62.469 ns
```

Results of course will vary based on hardware/kernel/configs, and some
variance may be there from run to run due to some noise.

Signed-off-by: Mina Almasry <almasrymina@google.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Jesper Dangaard Brouer <hawk@kernel.org>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://patch.msgid.link/20250619181519.3102426-1-almasrymina@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agoMerge branch 'rework-irq-handling-in-mtk_eth_soc'
Jakub Kicinski [Tue, 24 Jun 2025 01:14:03 +0000 (18:14 -0700)] 
Merge branch 'rework-irq-handling-in-mtk_eth_soc'

Frank Wunderlich says:

====================
rework IRQ handling in mtk_eth_soc

From: Frank Wunderlich <frank-w@public-files.de>

This series introduces named IRQs while keeping the index based way
for older dts.
Further it makes some cleanup like adding consts for index access and
avoids loading first IRQ which was not used on non SHARED_INT SoCs.
====================

Link: https://patch.msgid.link/20250619132125.78368-1-linux@fw-web.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agonet: ethernet: mtk_eth_soc: only use legacy mode on missing IRQ name
Frank Wunderlich [Thu, 19 Jun 2025 13:21:24 +0000 (15:21 +0200)] 
net: ethernet: mtk_eth_soc: only use legacy mode on missing IRQ name

If platform_get_irq_byname returns -ENXIO fall back to legacy (index
based) mode, but on other errors function should return this error.

Suggested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250619132125.78368-5-linux@fw-web.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agonet: ethernet: mtk_eth_soc: skip first IRQ if not used
Frank Wunderlich [Thu, 19 Jun 2025 13:21:23 +0000 (15:21 +0200)] 
net: ethernet: mtk_eth_soc: skip first IRQ if not used

On SoCs with dedicated RX and TX interrupts (all except MT7621 and
MT7628) platform_get_irq() is called for the first IRQ (eth->irq[0])
but it is never used.
Skip the first IRQ and reduce the IRQ-count to 2.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250619132125.78368-4-linux@fw-web.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agonet: ethernet: mtk_eth_soc: add consts for irq index
Frank Wunderlich [Thu, 19 Jun 2025 13:21:22 +0000 (15:21 +0200)] 
net: ethernet: mtk_eth_soc: add consts for irq index

Use consts instead of fixed integers for accessing IRQ array.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Daniel Golle <daniel@makrotopia.org>
Link: https://patch.msgid.link/20250619132125.78368-3-linux@fw-web.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agonet: ethernet: mtk_eth_soc: support named IRQs
Frank Wunderlich [Thu, 19 Jun 2025 13:21:21 +0000 (15:21 +0200)] 
net: ethernet: mtk_eth_soc: support named IRQs

Add named interrupts and keep index based fallback for existing
devicetrees.

Currently only rx and tx IRQs are defined to be used with mt7988, but
later extended with RSS/LRO support.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250619132125.78368-2-linux@fw-web.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agoMerge branch 'selftests-drv-net-stats-use-skip-instead-of-xfail'
Jakub Kicinski [Tue, 24 Jun 2025 00:06:29 +0000 (17:06 -0700)] 
Merge branch 'selftests-drv-net-stats-use-skip-instead-of-xfail'

Jakub Kicinski says:

====================
selftests: drv-net: stats: use skip instead of xfail

Alex posted support for configuring pause frames in fbnic. This flipped
the pause stats test from xfail to fail. Because CI considered xfail as
pass it now flags the test as failing. This shouldn't happen. Also we
currently report pause and FEC tests as passing on virtio which doesn't
make sense.
====================

Link: https://patch.msgid.link/20250620161109.2146242-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agoselftests: drv-net: stats: use skip instead of xfail for unsupported features
Jakub Kicinski [Fri, 20 Jun 2025 16:11:09 +0000 (09:11 -0700)] 
selftests: drv-net: stats: use skip instead of xfail for unsupported features

XFAIL is considered a form of a pass by our CI. For HW devices returning
XFAIL for unsupported features is counter-productive because our CI
knows not to expect any HW test to pass until it sees 10 passes in a row.
If we return xfail the test shows up as pass even if the device doesn't
support the feature. netdevsim supports all features necessary for
the stats test so there is no concern about running the test in SW mode.

Make the test skip rather than xfail if driver doesn't support FEC or pause.

Link: https://patch.msgid.link/20250620161109.2146242-3-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agoselftests: drv-net: stats: fix pylint issues
Jakub Kicinski [Fri, 20 Jun 2025 16:11:08 +0000 (09:11 -0700)] 
selftests: drv-net: stats: fix pylint issues

Small adjustments to make pylint happy.

One warning about unused argument remains because the test uses
global variables rather than attaching netlink sockets to cfg.
Fixing this would be too much of a change for a linter fix commit
like this one.

Link: https://patch.msgid.link/20250620161109.2146242-2-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agoMerge branch 'net-lockless-sk_sndtimeo-and-sk_rcvtimeo'
Jakub Kicinski [Tue, 24 Jun 2025 00:05:14 +0000 (17:05 -0700)] 
Merge branch 'net-lockless-sk_sndtimeo-and-sk_rcvtimeo'

Eric Dumazet says:

====================
net: lockless sk_sndtimeo and sk_rcvtimeo

This series completes the task of making sk->sk_sndtimeo and
sk->sk_rcvtimeo lockless.
====================

Link: https://patch.msgid.link/20250620155536.335520-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agonet: make sk->sk_rcvtimeo lockless
Eric Dumazet [Fri, 20 Jun 2025 15:55:36 +0000 (15:55 +0000)] 
net: make sk->sk_rcvtimeo lockless

Followup of commit 285975dd6742 ("net: annotate data-races around
sk->sk_{rcv|snd}timeo").

Remove lock_sock()/release_sock() from ksmbd_tcp_rcv_timeout()
and add READ_ONCE()/WRITE_ONCE() where it is needed.

Also SO_RCVTIMEO_OLD and SO_RCVTIMEO_NEW can call sock_set_timeout()
without holding the socket lock.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20250620155536.335520-3-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agonet: make sk->sk_sndtimeo lockless
Eric Dumazet [Fri, 20 Jun 2025 15:55:35 +0000 (15:55 +0000)] 
net: make sk->sk_sndtimeo lockless

Followup of commit 285975dd6742 ("net: annotate data-races around
sk->sk_{rcv|snd}timeo").

Remove lock_sock()/release_sock() from sock_set_sndtimeo(),
and add READ_ONCE()/WRITE_ONCE() where it is needed.

Also SO_SNDTIMEO_OLD and SO_SNDTIMEO_NEW can call sock_set_timeout()
without holding the socket lock.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20250620155536.335520-2-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agoMerge branch 'net-replace-sock_i_uid-with-sk_uid'
Jakub Kicinski [Tue, 24 Jun 2025 00:04:06 +0000 (17:04 -0700)] 
Merge branch 'net-replace-sock_i_uid-with-sk_uid'

Eric Dumazet says:

====================
net: replace sock_i_uid() with sk_uid()

First patch annotates sk->sk_uid accesses and adds sk_uid() helper.

Second patch removes sock_i_uid() in favor of the new helper.
====================

Link: https://patch.msgid.link/20250620133001.4090592-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agonet: remove sock_i_uid()
Eric Dumazet [Fri, 20 Jun 2025 13:30:01 +0000 (13:30 +0000)] 
net: remove sock_i_uid()

Difference between sock_i_uid() and sk_uid() is that
after sock_orphan(), sock_i_uid() returns GLOBAL_ROOT_UID
while sk_uid() returns the last cached sk->sk_uid value.

None of sock_i_uid() callers care about this.

Use sk_uid() which is much faster and inlined.

Note that diag/dump users are calling sock_i_ino() and
can not see the full benefit yet.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Lorenzo Colitti <lorenzo@google.com>
Reviewed-by: Maciej Żenczykowski <maze@google.com>
Link: https://patch.msgid.link/20250620133001.4090592-3-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agonet: annotate races around sk->sk_uid
Eric Dumazet [Fri, 20 Jun 2025 13:30:00 +0000 (13:30 +0000)] 
net: annotate races around sk->sk_uid

sk->sk_uid can be read while another thread changes its
value in sockfs_setattr().

Add sk_uid(const struct sock *sk) helper to factorize the needed
READ_ONCE() annotations, and add corresponding WRITE_ONCE()
where needed.

Fixes: 86741ec25462 ("net: core: Add a UID field to struct sock.")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Lorenzo Colitti <lorenzo@google.com>
Reviewed-by: Maciej Żenczykowski <maze@google.com>
Link: https://patch.msgid.link/20250620133001.4090592-2-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agocaif: reduce stack size, again
Arnd Bergmann [Fri, 20 Jun 2025 11:22:39 +0000 (13:22 +0200)] 
caif: reduce stack size, again

I tried to fix the stack usage in this function a couple of years ago,
but there is still a problem with the latest gcc versions in some
configurations:

net/caif/cfctrl.c:553:1: error: the frame size of 1296 bytes is larger than 1280 bytes [-Werror=frame-larger-than=]

Reduce this once again, with a separate cfctrl_link_setup() function that
holds the bulk of all the local variables. It also turns out that the
param[] array that takes up a large portion of the stack is write-only
and can be left out here.

Fixes: ce6289661b14 ("caif: reduce stack size with KASAN")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20250620112244.3425554-1-arnd@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agolib: test_objagg: split test_hints_case() into two functions
Arnd Bergmann [Fri, 20 Jun 2025 11:19:04 +0000 (13:19 +0200)] 
lib: test_objagg: split test_hints_case() into two functions

With sanitizers enabled, this function uses a lot of stack, causing
a harmless warning:

lib/test_objagg.c: In function 'test_hints_case.constprop':
lib/test_objagg.c:994:1: error: the frame size of 1440 bytes is larger than 1408 bytes [-Werror=frame-larger-than=]

Most of this is from the two 'struct world' structures. Since most of
the work in this function is duplicated for the two, split it up into
separate functions that each use one of them.

The combined stack usage is still the same here, but there is no warning
any more, and the code is still safe because of the known call chain.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20250620111907.3395296-1-arnd@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agonet/sched: replace strncpy with strscpy
Pranav Tyagi [Fri, 20 Jun 2025 10:36:53 +0000 (16:06 +0530)] 
net/sched: replace strncpy with strscpy

Replace the deprecated strncpy() with the two-argument version of
strscpy() as the destination is an array
and buffer should be NUL-terminated.

Signed-off-by: Pranav Tyagi <pranav.tyagi03@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250620103653.6957-1-pranav.tyagi03@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agonet/smc: replace strncpy with strscpy
Pranav Tyagi [Fri, 20 Jun 2025 10:25:59 +0000 (15:55 +0530)] 
net/smc: replace strncpy with strscpy

Replace the deprecated strncpy() with two-argument version of
strscpy() as the destination is an array
and should be NUL-terminated.

Signed-off-by: Pranav Tyagi <pranav.tyagi03@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250620102559.6365-1-pranav.tyagi03@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agodt-bindings: net: convert qca,qca7000.txt yaml format
Frank Li [Wed, 18 Jun 2025 18:44:16 +0000 (14:44 -0400)] 
dt-bindings: net: convert qca,qca7000.txt yaml format

Convert qca,qca7000.txt yaml format.

Additional changes:
- add refs: spi-peripheral-props.yaml, serial-peripheral-props.yaml and
  ethernet-controller.yaml.
- simple spi and uart node name.
- use low case for mac address in examples.
- add check reg choose spi-peripheral-props.yaml or
  spi-peripheral-props.yaml.

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20250618184417.2169745-1-Frank.Li@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agoethtool: pse-pd: Add missing linux/export.h include
Kory Maincent [Thu, 19 Jun 2025 16:25:47 +0000 (18:25 +0200)] 
ethtool: pse-pd: Add missing linux/export.h include

Fix missing linux/export.h header include in net/ethtool/pse-pd.c to resolve
build warning reported by the kernel test robot.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202506200024.T3O0FWeR-lkp@intel.com/
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Link: https://patch.msgid.link/20250619162547.1989468-1-kory.maincent@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agoselftests: drv-net: import things in lib one by one
Jakub Kicinski [Sat, 21 Jun 2025 17:19:43 +0000 (10:19 -0700)] 
selftests: drv-net: import things in lib one by one

pylint doesn't understand our path hacks, and it generates a lot
of warnings for driver tests. Import what we use one by one, this
is hopefully not too tedious and it makes pylint happy.

Link: https://patch.msgid.link/20250621171944.2619249-9-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agonet: stmmac: lpc18xx: use plat_dat->phy_interface
Russell King (Oracle) [Thu, 19 Jun 2025 09:47:26 +0000 (10:47 +0100)] 
net: stmmac: lpc18xx: use plat_dat->phy_interface

lpc18xx uses plat_dat->mac_interface, despite wanting to validate the
PHY interface. Checking the DT files (arch/arm/boot/dts/nxp/lpc/), none
of them specify mac-mode which means mac_interface and phy_interface
will be identical.

mac_interface is only used when there is some kind of MII converter
between the DesignWare MAC and PHY, and describes the interface mode
that the DW MAC needs to use, whereas phy_interface describes the
interface mode that the PHY uses.

Noting that lpc18xx only supports MII and RMII interface modes, switch
this glue driver to use plat_dat->phy_interface, and to mark that the
mac_interface is not used, explicitly set it to PHY_INTERFACE_MODE_NA.
The latter is safe as the only user of mac_interface for this platform
would be in stmmac_check_pcs_mode(), which only checks for RGMII or
SGMII.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Yanteng Si <siyanteng@cqsoftware.com.cn>
Link: https://patch.msgid.link/E1uSBri-004fL5-FI@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agoMerge branch 'add-support-for-the-ipq5018-internal-ge-phy'
Jakub Kicinski [Mon, 23 Jun 2025 18:14:07 +0000 (11:14 -0700)] 
Merge branch 'add-support-for-the-ipq5018-internal-ge-phy'

George Moussalem says:

====================
Add support for the IPQ5018 Internal GE PHY

The IPQ5018 SoC contains an internal Gigabit Ethernet PHY with its
output pins that provide an MDI interface to either an external switch
in a PHY to PHY link architecture or directly to an attached RJ45
connector.

The PHY supports 10BASE-T/100BASE-TX/1000BASE-T link modes in SGMII
interface mode, CDT, auto-negotiation and 802.3az EEE.

The LDO controller found in the IPQ5018 SoC needs to be enabled to drive
power to the CMN Ethernet Block (CMN BLK) which the GE PHY depends on.
The LDO must be enabled in TCSR by writing to a specific register.

In a phy to phy architecture, DAC values need to be set to accommodate
for the short cable length.
====================

Link: https://patch.msgid.link/20250613-ipq5018-ge-phy-v5-0-9af06e34ea6b@outlook.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agonet: phy: qcom: at803x: Add Qualcomm IPQ5018 Internal PHY support
George Moussalem [Fri, 13 Jun 2025 01:55:08 +0000 (05:55 +0400)] 
net: phy: qcom: at803x: Add Qualcomm IPQ5018 Internal PHY support

The IPQ5018 SoC contains a single internal Gigabit Ethernet PHY which
provides an MDI interface directly to an RJ45 connector or an external
switch over a PHY to PHY link.

The PHY supports 10BASE-T/100BASE-TX/1000BASE-T link modes in SGMII
interface mode, CDT, auto-negotiation and 802.3az EEE.

Let's add support for this PHY in the at803x driver as it falls within
the Qualcomm Atheros OUI.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://patch.msgid.link/20250613-ipq5018-ge-phy-v5-2-9af06e34ea6b@outlook.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agodt-bindings: net: qca,ar803x: Add IPQ5018 Internal GE PHY support
George Moussalem [Fri, 13 Jun 2025 01:55:07 +0000 (05:55 +0400)] 
dt-bindings: net: qca,ar803x: Add IPQ5018 Internal GE PHY support

Document the IPQ5018 Internal Gigabit Ethernet PHY found in the IPQ5018
SoC. Its output pins provide an MDI interface to either an external
switch in a PHY to PHY link scenario or is directly attached to an RJ45
connector.

The PHY supports 10/100/1000 mbps link modes, CDT, auto-negotiation and
802.3az EEE.

For operation, the LDO controller found in the IPQ5018 SoC for which
there is provision in the mdio-4019 driver.

Two common archictures across IPQ5018 boards are:
1. IPQ5018 PHY --> MDI --> RJ45 connector
2. IPQ5018 PHY --> MDI --> External PHY
In a phy to phy architecture, the DAC needs to be configured to
accommodate for the short cable length. As such, add an optional boolean
property so the driver sets preset DAC register values accordingly.

Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250613-ipq5018-ge-phy-v5-1-9af06e34ea6b@outlook.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
6 weeks agotestptp: add option to enable external timestamping edges
Miroslav Lichvar [Thu, 19 Jun 2025 13:53:42 +0000 (15:53 +0200)] 
testptp: add option to enable external timestamping edges

Some drivers (e.g. ice) don't enable any edges by default when external
timestamping is requested by the PTP_EXTTS_REQUEST ioctl, which makes
testptp -e unusable for testing hardware supported by these drivers.

Add -E option to specify if the rising, falling, or both edges should
be enabled by the ioctl.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 weeks agonetdevsim: fix UaF when counting Tx stats
Jakub Kicinski [Fri, 20 Jun 2025 17:40:07 +0000 (10:40 -0700)] 
netdevsim: fix UaF when counting Tx stats

skb may be freed as soon as we put it on the rx queue.
Use the len variable like the code did prior to the conversion.

Fixes: f9e2511d80c2 ("netdevsim: migrate to dstats stats collection")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: David S. Miller <davem@davemloft.net>
Reviewed-by: Breno Leitao <leitao@debian.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 weeks agoselftest: add selftest for anycast notifications
Yuyang Huang [Thu, 19 Jun 2025 03:51:16 +0000 (12:51 +0900)] 
selftest: add selftest for anycast notifications

This commit adds a new kernel selftest to verify RTNLGRP_IPV6_ACADDR
notifications. The test works by adding/removing a dummy interface,
enabling packet forwarding, and then confirming that user space can
correctly receive anycast notifications.

The test relies on the iproute2 version to be 6.13+.

Tested by the following command:
$ vng -v --user root --cpus 16 -- \
make -C tools/testing/selftests TARGETS=net
TEST_PROGS=rtnetlink_notification.sh \
TEST_GEN_PROGS="" run_tests

Cc: Maciej Żenczykowski <maze@google.com>
Cc: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: Yuyang Huang <yuyanghuang@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 weeks agonet/smc: remove unused function smc_lo_supports_v2
Wang Liang [Thu, 19 Jun 2025 03:08:54 +0000 (11:08 +0800)] 
net/smc: remove unused function smc_lo_supports_v2

The smcd_ops->supports_v2 is only called in smcd_register_dev(), which
calls function smcd_supports_v2 for ism. For loopback-ism, function
smc_lo_supports_v2 is unused, remove it.

Signed-off-by: Wang Liang <wangliang74@huawei.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250619030854.1536676-1-wangliang74@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoMerge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next...
Jakub Kicinski [Sat, 21 Jun 2025 15:16:06 +0000 (08:16 -0700)] 
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue

Tony Nguyen says:

====================
ice: Separate TSPLL from PTP and clean up [part]

Jake Keller says:

Separate TSPLL related functions and definitions from all PTP-related
files and clean up the code by implementing multiple helpers.

* '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue:
  ice: add TSPLL log config helper
  ice: use designated initializers for TSPLL consts
  ice: remove ice_tspll_params_e825 definitions
  ice: fix E825-C TSPLL register definitions
  ice: rename TSPLL and CGU functions and definitions
  ice: move TSPLL functions to a separate file
====================

Link: https://patch.msgid.link/20250618174231.3100231-1-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agonet: pse-pd: Fix ethnl_pse_send_ntf() stub parameter type
Kory Maincent [Fri, 20 Jun 2025 09:16:41 +0000 (11:16 +0200)] 
net: pse-pd: Fix ethnl_pse_send_ntf() stub parameter type

The ethnl_pse_send_ntf() stub function has incorrect parameter type when
CONFIG_ETHTOOL_NETLINK is disabled. The function should take a net_device
pointer instead of phy_device pointer to match the actual implementation.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202506200355.TqFiYUbN-lkp@intel.com/
Fixes: fc0e6db30941 ("net: pse-pd: Add support for reporting events")
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250620091641.2098028-1-kory.maincent@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoMerge branch 'eth-finish-migration-to-the-new-rxfh-callbacks'
Jakub Kicinski [Sat, 21 Jun 2025 14:55:00 +0000 (07:55 -0700)] 
Merge branch 'eth-finish-migration-to-the-new-rxfh-callbacks'

Jakub Kicinski says:

====================
eth: finish migration to the new RXFH callbacks

Finish drivers conversions to callbacks added by
commit 9bb00786fc61 ("net: ethtool: add dedicated callbacks for
getting and setting rxfh fields"). Remove the conditional calling
in the core, rxnfc callbacks are no longer used for RXFH.
====================

Link: https://patch.msgid.link/20250618203823.1336156-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agonet: ethtool: don't mux RXFH via rxnfc callbacks
Jakub Kicinski [Wed, 18 Jun 2025 20:38:23 +0000 (13:38 -0700)] 
net: ethtool: don't mux RXFH via rxnfc callbacks

All drivers have been converted. Stop using the rxnfc fallbacks
for Rx Flow Hashing configuration.

Joe pointed out in earlier review that in ethtool_set_rxfh()
we need both .get_rxnfc and .get_rxfh_fields, because we need
both the ring count and flow hashing (because we call
ethtool_check_flow_types()). IOW the existing check added
for transitioning drivers was buggy.

Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250618203823.1336156-11-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoeth: hns3: migrate to new RXFH callbacks
Jakub Kicinski [Wed, 18 Jun 2025 20:38:22 +0000 (13:38 -0700)] 
eth: hns3: migrate to new RXFH callbacks

Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").

Reviewed-by: Jijie Shao<shaojijie@huawei.com>
Link: https://patch.msgid.link/20250618203823.1336156-10-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoeth: hinic: migrate to new RXFH callbacks
Jakub Kicinski [Wed, 18 Jun 2025 20:38:21 +0000 (13:38 -0700)] 
eth: hinic: migrate to new RXFH callbacks

Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").

Zeroing data on SET is not necessary, the argument is not copied
back to user space. The driver has no other RXNFC functionality
so the SET callback can be now removed.

Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250618203823.1336156-9-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoeth: nfp: migrate to new RXFH callbacks
Jakub Kicinski [Wed, 18 Jun 2025 20:38:20 +0000 (13:38 -0700)] 
eth: nfp: migrate to new RXFH callbacks

Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").

Acked-by: Louis Peens <louis.peens@corigine.com>
Link: https://patch.msgid.link/20250618203823.1336156-8-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoeth: mlx5: migrate to new RXFH callbacks
Jakub Kicinski [Wed, 18 Jun 2025 20:38:19 +0000 (13:38 -0700)] 
eth: mlx5: migrate to new RXFH callbacks

Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").

Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Link: https://patch.msgid.link/20250618203823.1336156-7-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoeth: qede: migrate to new RXFH callbacks
Jakub Kicinski [Wed, 18 Jun 2025 20:38:18 +0000 (13:38 -0700)] 
eth: qede: migrate to new RXFH callbacks

Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").

Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250618203823.1336156-6-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoeth: benet: migrate to new RXFH callbacks
Jakub Kicinski [Wed, 18 Jun 2025 20:38:17 +0000 (13:38 -0700)] 
eth: benet: migrate to new RXFH callbacks

Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").

The driver has no other RXNFC functionality so the SET callback can
be now removed.

Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250618203823.1336156-5-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoeth: sfc: migrate to new RXFH callbacks
Jakub Kicinski [Wed, 18 Jun 2025 20:38:16 +0000 (13:38 -0700)] 
eth: sfc: migrate to new RXFH callbacks

Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").

This driver's RXFH config is read only / fixed so the conversion
is purely factoring out the handling into a helper. One thing of
note that this is one of the two drivers which pays attention to
rss_context.

Reviewed-by: Edward Cree <ecree.xilinx@gmail.com>
Link: https://patch.msgid.link/20250618203823.1336156-4-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoeth: sfc: siena: migrate to new RXFH callbacks
Jakub Kicinski [Wed, 18 Jun 2025 20:38:15 +0000 (13:38 -0700)] 
eth: sfc: siena: migrate to new RXFH callbacks

Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").
This driver's RXFH config is read only / fixed so the conversion
is purely factoring out the handling into a helper.

Reviewed-by: Edward Cree <ecree.xilinx@gmail.com>
Link: https://patch.msgid.link/20250618203823.1336156-3-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoeth: sfc: falcon: migrate to new RXFH callbacks
Jakub Kicinski [Wed, 18 Jun 2025 20:38:14 +0000 (13:38 -0700)] 
eth: sfc: falcon: migrate to new RXFH callbacks

Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").
This driver's RXFH config is read only / fixed so the conversion
is purely factoring out the handling into a helper.

Reviewed-by: Edward Cree <ecree.xilinx@gmail.com>
Link: https://patch.msgid.link/20250618203823.1336156-2-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoeth: bnxt: add netmem TX support
Taehee Yoo [Thu, 19 Jun 2025 14:40:58 +0000 (14:40 +0000)] 
eth: bnxt: add netmem TX support

Use netmem_dma_*() helpers and declare netmem_tx to support netmem TX.
By this change, all bnxt devices will support the netmem TX.

Unreadable skbs are not going to be handled by the TX push logic.
So, it checks whether a skb is readable or not before the TX push logic.

netmem TX can be tested with ncdevmem.c

Acked-by: Mina Almasry <almasrymina@google.com>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Link: https://patch.msgid.link/20250619144058.147051-1-ap420073@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agocan: rcar_canfd: Describe channel-specific FD registers using C struct
Geert Uytterhoeven [Thu, 19 Jun 2025 10:13:17 +0000 (12:13 +0200)] 
can: rcar_canfd: Describe channel-specific FD registers using C struct

The rcar_canfd_f_*() inline functions to obtain channel-specific CAN-FD
register offsets really describe a memory layout.  Hence replace them by
a C structure, to simplify the code, and reduce kernel size.

This also gets rid of warnings about unused rcar_canfd_f_*() inline
functions, which are reported by recent versions of clang.

Suggested-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Reported-by: Jakub Kicinski <kuba@kernel.org>
Closes: https://lore.kernel.org/20250618183827.5bebca8f@kernel.org
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Link: https://patch.msgid.link/292b75b3bc8dd95f805f0223f606737071c8cf86.1750327217.git.geert+renesas@glider.be
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoMerge branch 'rds-minor-updates-for-spelling-and-endian'
Jakub Kicinski [Sat, 21 Jun 2025 14:35:42 +0000 (07:35 -0700)] 
Merge branch 'rds-minor-updates-for-spelling-and-endian'

Simon Horman says:

====================
rds: Minor updates for spelling and endian

This short series addressses some cosmetic issues in rds.

1. Some spelling errors, as flagged by spellcheck
2. Some endianness annotation errors, which are not bugs,
   flagged by Sparse
====================

Link: https://patch.msgid.link/20250619-rds-minor-v1-0-86d2ee3a98b9@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agords: Correct spelling
Simon Horman [Thu, 19 Jun 2025 13:58:33 +0000 (14:58 +0100)] 
rds: Correct spelling

Correct spelling as flagged by codespell.
With these changes in place codespell only flags false positives
in net/rds.

Signed-off-by: Simon Horman <horms@kernel.org>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Link: https://patch.msgid.link/20250619-rds-minor-v1-2-86d2ee3a98b9@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agords: Correct endian annotation of port and addr assignments
Simon Horman [Thu, 19 Jun 2025 13:58:32 +0000 (14:58 +0100)] 
rds: Correct endian annotation of port and addr assignments

Correct the endianness annotation of port assignments:

  A host byte order value (RDS_TCP_PORT) is correctly converted to
  network byte order (big endian) using htons. But it is then cast back to
  host byte order before assigning to a variable that expects a big endian
  value.  Address this by dropping the cast.

  This is not a bug because, while the endian annotation is changed by
  this patch, the assigned value is unchanged.

Also correct the endianness of address assignment.

  A host byte order value (INADDR_ANY) is incorrectly assigned as-is to
  a variable that expects a big endian value. Address this by converting
  the value to network byte order (big endian).

  This is not a bug because INADDR_ANY is 0, which is isomorphic
  with regards to endian conversions. IOW, while the endian annotation
  is changed by this patch, the assigned value is unchanged.

Incorrect endian annotations appear to date back to IPv4-only code added
by commit 70041088e3b9 ("RDS: Add TCP transport to RDS").

Flagged by Sparse.

Signed-off-by: Simon Horman <horms@kernel.org>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Link: https://patch.msgid.link/20250619-rds-minor-v1-1-86d2ee3a98b9@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agonetmem: fix skb_frag_address_safe with unreadable skbs
Mina Almasry [Thu, 19 Jun 2025 17:52:38 +0000 (17:52 +0000)] 
netmem: fix skb_frag_address_safe with unreadable skbs

skb_frag_address_safe() needs a check that the
skb_frag_page exists check similar to skb_frag_address().

Cc: ap420073@gmail.com
Signed-off-by: Mina Almasry <almasrymina@google.com>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20250619175239.3039329-1-almasrymina@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoMerge branch 'gve-xdp-tx-redirect' into main
David S. Miller [Sat, 21 Jun 2025 13:26:25 +0000 (14:26 +0100)] 
Merge branch 'gve-xdp-tx-redirect' into main

Joshua Washington says:

====================
gve: XDP TX and redirect support for DQ RDA

A previous patch series[1] introduced the ability to process XDP buffers
to the DQ RDA queue format. This is a follow-up patch series to
introduce XDP_TX and XDP_REDIRECT support and expose XDP support to the
kernel.

Link: https://git.kernel.org/netdev/net-next/c/e2ac75a8a967
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
7 weeks agogve: add XDP_TX and XDP_REDIRECT support for DQ RDA
Joshua Washington [Wed, 18 Jun 2025 20:56:13 +0000 (20:56 +0000)] 
gve: add XDP_TX and XDP_REDIRECT support for DQ RDA

This patch adds support for XDP_TX and XDP_REDIRECT for the DQ RDA
queue format. To appropriately support transmission of XDP frames, a
new pending packet type GVE_TX_PENDING_PACKET_DQO_XDP_FRAME is
introduced for completion handling, as there was a previous assumption
that completed packets would be SKBs.

XDP_TX handling completes the basic XDP actions, so the feature is
recorded accordingly. This patch also enables the ndo_xdp_xmit callback
allowing DQ to handle XDP_REDIRECT packets originating from another
interface.

The XDP spinlock is moved to common TX ring fields so that it can be
used in both GQ and DQ. Originally, it was in a section which was
mutually exclusive for GQ and DQ.

In summary, 3 XDP features are exposed for the DQ RDA queue format:
1) NETDEV_XDP_ACT_BASIC
2) NETDEV_XDP_ACT_NDO_XMIT
3) NETDEV_XDP_ACT_REDIRECT

Note that XDP and header-data split are mutually exclusive for the time
being due to lack of multi-buffer XDP support.

This patch does not add support for the DQ QPL format. That is to come
in a future patch series.

Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Praveen Kaligineedi <pkaligineedi@google.com>
Signed-off-by: Joshua Washington <joshwash@google.com>
Signed-off-by: Harshitha Ramamurthy <hramamurthy@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 weeks agogve: refactor DQO TX methods to be more generic for XDP
Joshua Washington [Wed, 18 Jun 2025 20:56:12 +0000 (20:56 +0000)] 
gve: refactor DQO TX methods to be more generic for XDP

This patch performs various minor DQO TX datapath refactors in
preparation for adding XDP_TX and XDP_REDIRECT support. The following
refactors are performed:

1) gve_tx_fill_pkt_desc_dqo() relies on a SKB pointer to
   get whether checksum offloading should be enabled. This won't work
   for the XDP case, which does not have a SKB. This patch updates the
   method to use a boolean representing whether checksum offloading
   should be enabled directly.

2) gve_maybe_stop_dqo() contains some synchronization between the true
   TX head and the cached value, a synchronization which is common for
   XDP queues and normal netdev queues. However, that method is reserved
   for netdev TX queues. To avoid duplicate code, this logic is factored
   out into a new method, gve_has_tx_slots_available().

3) gve_tx_update_tail() is added to update the TX tail, a functionality
   that will be common between normal TX and XDP TX codepaths.

Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Joshua Washington <joshwash@google.com>
Signed-off-by: Praveen Kaligineedi <pkaligineedi@google.com>
Signed-off-by: Harshitha Ramamurthy <hramamurthy@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 weeks agogve: rename gve_xdp_xmit to gve_xdp_xmit_gqi
Joshua Washington [Wed, 18 Jun 2025 20:56:11 +0000 (20:56 +0000)] 
gve: rename gve_xdp_xmit to gve_xdp_xmit_gqi

In preparation for XDP DQ support, the gve_xdp_xmit callback needs to
be generalized for all queue formats. This patch renames the GQ-specific
function to gve_xdp_xmit_gqi, and introduces a new gve_xdp_xmit callback
which branches on queue format.

Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Joshua Washington <joshwash@google.com>
Signed-off-by: Harshitha Ramamurthy <hramamurthy@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 weeks agoocteontx2-af: Fix rvu_mbox_init return path
Subbaraya Sundeep [Wed, 18 Jun 2025 13:57:16 +0000 (19:27 +0530)] 
octeontx2-af: Fix rvu_mbox_init return path

rvu_mbox_init function makes use of error path for
freeing memory which are local to the function in
both success and failure conditions. This is unusual hence
fix it by returning zero on success. With new cn20k code this
is freeing valid memory in success case also.

Fixes: e53ee4acb220 ("octeontx2-af: CN20k basic mbox operations and structures")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 weeks agonet: ti: icssg-prueth: Add prp offload support to ICSSG driver
Himanshu Mittal [Wed, 18 Jun 2025 17:55:36 +0000 (23:25 +0530)] 
net: ti: icssg-prueth: Add prp offload support to ICSSG driver

Add support for ICSSG PRP mode which supports offloading of:
 - Packet duplication and PRP trailer insertion
 - Packet duplicate discard and PRP trailer removal

Signed-off-by: Himanshu Mittal <h-mittal1@ti.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250618175536.430568-1-h-mittal1@ti.com
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoMerge branch 'ref_tracker-add-ability-to-register-a-debugfs-file-for-a-ref_tracker_dir'
Jakub Kicinski [Fri, 20 Jun 2025 00:02:06 +0000 (17:02 -0700)] 
Merge branch 'ref_tracker-add-ability-to-register-a-debugfs-file-for-a-ref_tracker_dir'

Jeff Layton says:

====================
ref_tracker: add ability to register a debugfs file for a ref_tracker_dir

For those just joining in, this series adds a new top-level
"ref_tracker" debugfs directory, and has each ref_tracker_dir register a
file in there as part of its initialization. It also adds the ability to
register a symlink with a more human-usable name that points to the
file, and does some general cleanup of how the ref_tracker object names
are handled.

v14: https://lore.kernel.org/20250610-reftrack-dbgfs-v14-0-efb532861428@kernel.org
v13: https://lore.kernel.org/20250603-reftrack-dbgfs-v13-0-7b2a425019d8@kernel.org
v12: https://lore.kernel.org/20250529-reftrack-dbgfs-v12-0-11b93c0c0b6e@kernel.org
v11: https://lore.kernel.org/20250528-reftrack-dbgfs-v11-0-94ae0b165841@kernel.org
v10: https://lore.kernel.org/20250527-reftrack-dbgfs-v10-0-dc55f7705691@kernel.org
v9: https://lore.kernel.org/20250509-reftrack-dbgfs-v9-0-8ab888a4524d@kernel.org
v8: https://lore.kernel.org/20250507-reftrack-dbgfs-v8-0-607717d3bb98@kernel.org
v7: https://lore.kernel.org/20250505-reftrack-dbgfs-v7-0-f78c5d97bcca@kernel.org
v6: https://lore.kernel.org/20250430-reftrack-dbgfs-v6-0-867c29aff03a@kernel.org
v5: https://lore.kernel.org/20250428-reftrack-dbgfs-v5-0-1cbbdf2038bd@kernel.org
v4: https://lore.kernel.org/20250418-reftrack-dbgfs-v4-0-5ca5c7899544@kernel.org
v3: https://lore.kernel.org/20250417-reftrack-dbgfs-v3-0-c3159428c8fb@kernel.org
v2: https://lore.kernel.org/20250415-reftrack-dbgfs-v2-0-b18c4abd122f@kernel.org
v1: https://lore.kernel.org/20250414-reftrack-dbgfs-v1-0-f03585832203@kernel.org
====================

Link: https://patch.msgid.link/20250618-reftrack-dbgfs-v15-0-24fc37ead144@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoref_tracker: eliminate the ref_tracker_dir name field
Jeff Layton [Wed, 18 Jun 2025 14:24:22 +0000 (10:24 -0400)] 
ref_tracker: eliminate the ref_tracker_dir name field

Now that we have dentries and the ability to create meaningful symlinks
to them, don't keep a name string in each tracker. Switch the output
format to print "class@address", and drop the name field.

Also, add a kerneldoc header for ref_tracker_dir_init().

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20250618-reftrack-dbgfs-v15-9-24fc37ead144@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agonet: add symlinks to ref_tracker_dir for netns
Jeff Layton [Wed, 18 Jun 2025 14:24:21 +0000 (10:24 -0400)] 
net: add symlinks to ref_tracker_dir for netns

After assigning the inode number to the namespace, use it to create a
unique name for each netns refcount tracker with the ns.inum and
net_cookie values in it, and register a symlink to the debugfs file for
it.

init_net is registered before the ref_tracker dir is created, so add a
late_initcall() to register its files and symlinks.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20250618-reftrack-dbgfs-v15-8-24fc37ead144@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoref_tracker: add a way to create a symlink to the ref_tracker_dir debugfs file
Jeff Layton [Wed, 18 Jun 2025 14:24:20 +0000 (10:24 -0400)] 
ref_tracker: add a way to create a symlink to the ref_tracker_dir debugfs file

Add the ability for a subsystem to add a user-friendly symlink that
points to a ref_tracker_dir's debugfs file. Add a separate
debugfs_symlinks xarray and use that to track symlinks. The reaper
workqueue job will remove symlinks before their corresponding dentries.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20250618-reftrack-dbgfs-v15-7-24fc37ead144@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoref_tracker: automatically register a file in debugfs for a ref_tracker_dir
Jeff Layton [Wed, 18 Jun 2025 14:24:19 +0000 (10:24 -0400)] 
ref_tracker: automatically register a file in debugfs for a ref_tracker_dir

Currently, there is no convenient way to see the info that the
ref_tracking infrastructure collects. Attempt to create a file in
debugfs when called from ref_tracker_dir_init().

The file is given the name "class@%px", as having the unmodified address
is helpful for debugging. This should be safe since this directory is only
accessible by root

While ref_tracker_dir_init() is generally called from a context where
sleeping is OK, ref_tracker_dir_exit() can be called from anywhere.
Thus, dentry cleanup must be handled asynchronously.

Add a new global xarray that has entries with the ref_tracker_dir
pointer as the index and the corresponding debugfs dentry pointer as the
value. Instead of removing the debugfs dentry, have
ref_tracker_dir_exit() set a mark on the xarray entry and schedule a
workqueue job. The workqueue job then walks the xarray looking for
marked entries, and removes their xarray entries and the debugfs
dentries.

Because of this, the debugfs dentry can outlive the corresponding
ref_tracker_dir. Have ref_tracker_debugfs_show() take extra care to
ensure that it's safe to dereference the dir pointer before using it.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20250618-reftrack-dbgfs-v15-6-24fc37ead144@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoref_tracker: allow pr_ostream() to print directly to a seq_file
Jeff Layton [Wed, 18 Jun 2025 14:24:18 +0000 (10:24 -0400)] 
ref_tracker: allow pr_ostream() to print directly to a seq_file

Allow pr_ostream to also output directly to a seq_file without an
intermediate buffer. The first caller of +ref_tracker_dir_seq_print()
will come in a later patch, so mark that __maybe_unused for now. That
designation will be removed once it is used.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20250618-reftrack-dbgfs-v15-5-24fc37ead144@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoref_tracker: add a static classname string to each ref_tracker_dir
Jeff Layton [Wed, 18 Jun 2025 14:24:17 +0000 (10:24 -0400)] 
ref_tracker: add a static classname string to each ref_tracker_dir

A later patch in the series will be adding debugfs files for each
ref_tracker that get created in ref_tracker_dir_init(). The format will
be "class@%px". The current "name" string can vary between
ref_tracker_dir objects of the same type, so it's not suitable for this
purpose.

Add a new "class" string to the ref_tracker dir that describes the
the type of object (sans any individual info for that object).

Also, in the i915 driver, gate the creation of debugfs files on whether
the dentry pointer is still set to NULL. CI has shown that the
ref_tracker_dir can be initialized more than once.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20250618-reftrack-dbgfs-v15-4-24fc37ead144@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoref_tracker: have callers pass output function to pr_ostream()
Jeff Layton [Wed, 18 Jun 2025 14:24:16 +0000 (10:24 -0400)] 
ref_tracker: have callers pass output function to pr_ostream()

In a later patch, we'll be adding a 3rd mechanism for outputting
ref_tracker info via seq_file. Instead of a conditional, have the caller
set a pointer to an output function in struct ostream. As part of this,
the log prefix must be explicitly passed in, as it's too late for the
pr_fmt macro.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20250618-reftrack-dbgfs-v15-3-24fc37ead144@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoref_tracker: add a top level debugfs directory for ref_tracker
Jeff Layton [Wed, 18 Jun 2025 14:24:15 +0000 (10:24 -0400)] 
ref_tracker: add a top level debugfs directory for ref_tracker

Add a new "ref_tracker" directory in debugfs. Each individual refcount
tracker can register files under there to display info about
currently-held references.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20250618-reftrack-dbgfs-v15-2-24fc37ead144@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoref_tracker: don't use %pK in pr_ostream() output
Jeff Layton [Wed, 18 Jun 2025 14:24:14 +0000 (10:24 -0400)] 
ref_tracker: don't use %pK in pr_ostream() output

As Thomas Weißschuh points out [1], it is now preferable to use %p
instead of hashed pointers with printk(), since raw pointers should no
longer be leaked into the kernel log. Change the ref_tracker
infrastructure to use %p instead of %pK in its formats.

[1]: https://lore.kernel.org/netdev/20250414-restricted-pointers-net-v1-0-12af0ce46cdd@linutronix.de/

Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20250618-reftrack-dbgfs-v15-1-24fc37ead144@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoMerge branch 'netpoll-code-organization-improvements'
Jakub Kicinski [Thu, 19 Jun 2025 23:02:47 +0000 (16:02 -0700)] 
Merge branch 'netpoll-code-organization-improvements'

Breno Leitao says:

====================
netpoll: Code organization improvements

The netpoll_setup() function has grown complex over time, mixing
different error handling and concerns like carrier waiting, IPv4 address
retrieval, and IPv6 address retrieval all within a single function,
which is huge (127 LoC).

This patch series refactors the netpoll_setup() function to improve code
organization and readability by extracting logical blocks into dedicated
helper functions. netpoll_setup() length is reduced to 72 LoC.

This series breaks down these responsibilities into focused helper
functions.

The changes are purely structural with no functional modifications.

This changes were tested with the netconsole tests and the netpoll
selftest (WIP)[1]

Link: https://lore.kernel.org/20250612-netpoll_test-v1-1-4774fd95933f@debian.org
====================

Link: https://patch.msgid.link/20250618-netpoll_ip_ref-v1-0-c2ac00fe558f@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoMerge branch 'netdevsim-implement-rx-statistics-using-netdev_pcpu_stat_dstats'
Jakub Kicinski [Thu, 19 Jun 2025 22:59:00 +0000 (15:59 -0700)] 
Merge branch 'netdevsim-implement-rx-statistics-using-netdev_pcpu_stat_dstats'

Breno Leitao says:

====================
netdevsim: implement RX statistics using NETDEV_PCPU_STAT_DSTATS

The netdevsim driver previously lacked RX statistics support, which
prevented its use with the GenerateTraffic() test framework, as this
framework verifies traffic flow by checking RX byte counts.

This patch migrates netdevsim from its custom statistics collection to
the NETDEV_PCPU_STAT_DSTATS framework, as suggested by Jakub. This
change not only standardizes the statistics handling but also adds the
necessary RX statistics support required by the test framework.

v3: https://lore.kernel.org/20250617-netdevsim_stat-v3-0-afe4bdcbf237@debian.org
v2: https://lore.kernel.org/20250613-netdevsim_stat-v2-0-98fa38836c48@debian.org
v1: https://lore.kernel.org/20250611-netdevsim_stat-v1-0-c11b657d96bf@debian.org
====================

Link: https://patch.msgid.link/20250618-netdevsim_stat-v4-0-19fe0d35e28e@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agonetpoll: Extract IPv6 address retrieval function
Breno Leitao [Wed, 18 Jun 2025 09:32:47 +0000 (02:32 -0700)] 
netpoll: Extract IPv6 address retrieval function

Extract the IPv6 address retrieval logic from netpoll_setup() into
a dedicated helper function netpoll_take_ipv6() to improve code
organization and readability.

The function handles obtaining the local IPv6 address from the
network device, including proper address type matching between
local and remote addresses (link-local vs global), and includes
appropriate error handling when IPv6 is not supported or no
suitable address is available.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250618-netpoll_ip_ref-v1-3-c2ac00fe558f@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agonetpoll: extract IPv4 address retrieval into helper function
Breno Leitao [Wed, 18 Jun 2025 09:32:46 +0000 (02:32 -0700)] 
netpoll: extract IPv4 address retrieval into helper function

Move the IPv4 address retrieval logic from netpoll_setup() into a
separate netpoll_take_ipv4() function to improve code organization
and readability. This change consolidates the IPv4-specific logic
and error handling into a dedicated function while maintaining
the same functionality.

No functional changes.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250618-netpoll_ip_ref-v1-2-c2ac00fe558f@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agonetpoll: Extract carrier wait function
Breno Leitao [Wed, 18 Jun 2025 09:32:45 +0000 (02:32 -0700)] 
netpoll: Extract carrier wait function

Extract the carrier waiting logic into a dedicated helper function
netpoll_wait_carrier() to improve code readability and reduce
duplication in netpoll_setup().

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250618-netpoll_ip_ref-v1-1-c2ac00fe558f@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agonet/smc: remove unused input parameters in smc_buf_get_slot
Wang Liang [Wed, 18 Jun 2025 10:33:42 +0000 (18:33 +0800)] 
net/smc: remove unused input parameters in smc_buf_get_slot

The input parameter "compressed_bufsize" of smc_buf_get_slot is unused,
remove it.

Signed-off-by: Wang Liang <wangliang74@huawei.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250618103342.1423913-1-wangliang74@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agonetdevsim: account dropped packet length in stats on queue free
Breno Leitao [Wed, 18 Jun 2025 08:32:45 +0000 (01:32 -0700)] 
netdevsim: account dropped packet length in stats on queue free

Add a call to dev_dstats_rx_dropped_add() in nsim_queue_free() to
account for the number of packets dropped when purging the skb queue.
This improves the accuracy of RX drop statistics reported by netdevsim.

local_bh_{disable, enable}() protection is used to disable preemption,
which is necessary given that dev_dstats_rx_dropped_add() access
this_cpu_ptr(). See discussion in [1].

Link: https://lore.kernel.org/all/20250617055934.3fd9d322@kernel.org/
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20250618-netdevsim_stat-v4-4-19fe0d35e28e@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agotcp: tcp_time_to_recover() cleanup
Eric Dumazet [Wed, 18 Jun 2025 09:12:46 +0000 (09:12 +0000)] 
tcp: tcp_time_to_recover() cleanup

tcp_time_to_recover() does not need the @flag argument.

Its first parameter can be marked const, and of tcp_sock type.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250618091246.1260322-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agonet: add dev_dstats_rx_dropped_add() helper
Breno Leitao [Wed, 18 Jun 2025 08:32:44 +0000 (01:32 -0700)] 
net: add dev_dstats_rx_dropped_add() helper

Introduce the dev_dstats_rx_dropped_add() helper to allow incrementing
the rx_drops per-CPU statistic by an arbitrary value, rather than just
one. This is useful for drivers or code paths that need to account for
multiple dropped packets at once, such as when dropping entire queues.

Reviewed-by: Joe Damato <joe@dama.to>
Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20250618-netdevsim_stat-v4-3-19fe0d35e28e@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoneighbour: add support for NUD_PERMANENT proxy entries
Nicolas Escande [Tue, 17 Jun 2025 14:13:34 +0000 (16:13 +0200)] 
neighbour: add support for NUD_PERMANENT proxy entries

As discussesd before in [0] proxy entries (which are more configuration
than runtime data) should stay when the link (carrier) goes does down.
This is what happens for regular neighbour entries.

So lets fix this by:
  - storing in proxy entries the fact that it was added as NUD_PERMANENT
  - not removing NUD_PERMANENT proxy entries when the carrier goes down
    (same as how it's done in neigh_flush_dev() for regular neigh entries)

[0]: https://lore.kernel.org/netdev/c584ef7e-6897-01f3-5b80-12b53f7b4bf4@kernel.org/

Signed-off-by: Nicolas Escande <nico.escande@gmail.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20250617141334.3724863-1-nico.escande@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agonetdevsim: collect statistics at RX side
Breno Leitao [Wed, 18 Jun 2025 08:32:43 +0000 (01:32 -0700)] 
netdevsim: collect statistics at RX side

When the RX side of netdevsim was added, the RX statistics were missing,
making the driver unusable for GenerateTraffic() test framework.

This patch adds proper statistics tracking on RX side, complementing the
TX path.

Reviewed-by: Joe Damato <joe@dama.to>
Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20250618-netdevsim_stat-v4-2-19fe0d35e28e@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agonetdevsim: migrate to dstats stats collection
Breno Leitao [Wed, 18 Jun 2025 08:32:42 +0000 (01:32 -0700)] 
netdevsim: migrate to dstats stats collection

Replace custom statistics tracking with the kernel's dstats infrastructure
to simplify code and improve consistency with other network drivers.

This change:
- Sets dev->pcpu_stat_type = NETDEV_PCPU_STAT_DSTATS for automatic
  automatic allocation and deallocation.
- Removes manual stats fields and their update
- Replaces custom nsim_get_stats64() with dev_get_stats()
- Uses dev_dstats_tx_add() and dev_dstats_tx_dropped() helpers
- Eliminates the need for manual synchronization primitives

The dstats framework provides the same functionality with less code.

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Joe Damato <joe@dama.to>
Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20250618-netdevsim_stat-v4-1-19fe0d35e28e@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agonet: mana: Set tx_packets to post gso processing packet count
Shradha Gupta [Tue, 17 Jun 2025 11:33:41 +0000 (04:33 -0700)] 
net: mana: Set tx_packets to post gso processing packet count

Allow tx_packets and tx_bytes counter in the driver to represent
the packets transmitted post GSO processing.

Currently they are populated as bigger pre-GSO packets and bytes

Signed-off-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 weeks agonet: sfp: add quirk for Potron SFP+ XGSPON ONU Stick
Chris Morgan [Tue, 17 Jun 2025 18:03:24 +0000 (13:03 -0500)] 
net: sfp: add quirk for Potron SFP+ XGSPON ONU Stick

Add quirk for Potron SFP+ XGSPON ONU Stick (YV SFP+ONT-XGSPON).

This device uses pins 2 and 7 for UART communication, so disable
TX_FAULT and LOS. Additionally as it is an embedded system in an
SFP+ form factor provide it enough time to fully boot before we
attempt to use it.

https://www.potrontec.com/index/index/list/cat_id/2.html#11-83
https://pon.wiki/xgs-pon/ont/potron-technology/x-onu-sfpp/

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Link: https://patch.msgid.link/20250617180324.229487-1-macroalpha82@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agonet: usb: Convert tasklet API to new bottom half workqueue mechanism
Jun Miao [Wed, 18 Jun 2025 17:39:23 +0000 (13:39 -0400)] 
net: usb: Convert tasklet API to new bottom half workqueue mechanism

Migrate tasklet APIs to the new bottom half workqueue mechanism. It
replaces all occurrences of tasklet usage with the appropriate workqueue
APIs throughout the usbnet driver. This transition ensures compatibility
with the latest design and enhances performance.

Signed-off-by: Jun Miao <jun.miao@intel.com>
Link: https://patch.msgid.link/20250618173923.950510-1-jun.miao@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoigc: Make the const read-only array supported_sizes static
Colin Ian King [Wed, 18 Jun 2025 13:54:08 +0000 (14:54 +0100)] 
igc: Make the const read-only array supported_sizes static

Don't populate the const read-only array supported_sizes on the
stack at run time, instead make it static.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Vitaly Lifshits <vitaly.lifshits@intel.com>>
Link: https://patch.msgid.link/20250618135408.1784120-1-colin.i.king@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agoMerge branch 'convert-lan78xx-driver-to-the-phylink'
Jakub Kicinski [Thu, 19 Jun 2025 22:37:08 +0000 (15:37 -0700)] 
Merge branch 'convert-lan78xx-driver-to-the-phylink'

Oleksij Rempel says:

====================
convert lan78xx driver to the PHYLINK

This series converts the lan78xx driver to use the PHYLINK framework,
which enhances PHY and MAC management. The changes also streamline the
driver by removing unused elements and improving link status reporting.

This is the final part of the previously split conversion series:
https://lore.kernel.org/all/20250428130542.3879769-1-o.rempel@pengutronix.de/

Tested on EVB_LAN7850.
====================

Link: https://patch.msgid.link/20250618122602.3156678-1-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agonet: usb: lan78xx: remove unused struct members
Oleksij Rempel [Wed, 18 Jun 2025 12:26:02 +0000 (14:26 +0200)] 
net: usb: lan78xx: remove unused struct members

Remove unused members from struct lan78xx_net, including:

    driver_priv
    suspend_count
    mdix_ctrl

These fields are no longer used in the driver and can be safely removed
as part of a cleanup.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/20250618122602.3156678-7-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agonet: usb: lan78xx: Integrate EEE support with phylink LPI API
Oleksij Rempel [Wed, 18 Jun 2025 12:26:01 +0000 (14:26 +0200)] 
net: usb: lan78xx: Integrate EEE support with phylink LPI API

Refactor Energy-Efficient Ethernet (EEE) support in the LAN78xx driver to
fully integrate with the phylink Low Power Idle (LPI) API. This includes:

- Replacing direct calls to `phy_ethtool_get_eee` and `phy_ethtool_set_eee`
  with `phylink_ethtool_get_eee` and `phylink_ethtool_set_eee`.
- Implementing `.mac_enable_tx_lpi` and `.mac_disable_tx_lpi` to control
  LPI transitions via phylink.
- Configuring `lpi_timer_default` to align with recommended values from
  LAN7800 documentation.
- ensure EEE is disabled on controller reset

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/20250618122602.3156678-6-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 weeks agonet: usb: lan78xx: port link settings to phylink API
Oleksij Rempel [Wed, 18 Jun 2025 12:26:00 +0000 (14:26 +0200)] 
net: usb: lan78xx: port link settings to phylink API

Refactor lan78xx_get_link_ksettings and lan78xx_set_link_ksettings to
use the phylink API (phylink_ethtool_ksettings_get and
phylink_ethtool_ksettings_set) instead of directly interfacing with the
PHY. This change simplifies the code and ensures better integration with
the phylink framework for link management.

Additionally, the explicit calls to usb_autopm_get_interface() and
usb_autopm_put_interface() have been removed. These were originally
needed to manage USB power management during register accesses. However,
lan78xx_mdiobus_read() and lan78xx_mdiobus_write() already handle USB
auto power management internally, ensuring that the interface remains
active when necessary. Since there are no other direct register accesses
in these functions that require explicit power management handling, the
extra calls have become redundant and are no longer needed.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/20250618122602.3156678-5-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>