Commit graph

1,464,075 commits

Author SHA1 Message Date
Breno Leitao
cf6de67ba4 netconsole: move egress_dev() as netcons_egress_dev()
move egress_dev() from netpoll to netconsole, and append netcons_
prefix.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Gustavo Luiz Duarte <gustavold@gmail.com>
Link: https://patch.msgid.link/20260724-netconsole_move_more_final-v1-7-a5f7691db81c@debian.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-30 12:14:39 +02:00
Breno Leitao
80fcfc3538 netconsole: move netpoll_take_ipv6() as netcons_take_ipv6()
Move netpoll_take_ipv6() to netconsole, and add netcons_ prefix.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Gustavo Luiz Duarte <gustavold@gmail.com>
Link: https://patch.msgid.link/20260724-netconsole_move_more_final-v1-6-a5f7691db81c@debian.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-30 12:14:39 +02:00
Breno Leitao
3aa9ff037b netconsole: move netpoll_take_ipv4() as netcons_take_ipv4()
Move netpoll_take_ipv4() to netconsole, which is the only user. Rename
it to netcons_take_ipv4() for the netcons_ prefix. The body is
unchanged.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Gustavo Luiz Duarte <gustavold@gmail.com>
Link: https://patch.msgid.link/20260724-netconsole_move_more_final-v1-5-a5f7691db81c@debian.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-30 12:14:39 +02:00
Breno Leitao
6a55e81d41 netconsole: move netpoll_local_ip_unset() as netcons_local_ip_unset()
Move netpoll_local_ip_unset() from netpoll to netconsole and rename it
to netcons_local_ip_unset();

The body is otherwise unchanged, only the comment's setup-function
reference is updated.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Gustavo Luiz Duarte <gustavold@gmail.com>
Link: https://patch.msgid.link/20260724-netconsole_move_more_final-v1-4-a5f7691db81c@debian.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-30 12:14:39 +02:00
Breno Leitao
672ecd3bb1 netconsole: take over netpoll_setup() from netpoll
netpoll_setup() is only used by netconsole. All the other users use
__netpoll_setup().

Move netpoll_setup() to netconsole, and rename it to
netcons_netpoll_setup().

Pure code motion: the body is unchanged.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Gustavo Luiz Duarte <gustavold@gmail.com>
Link: https://patch.msgid.link/20260724-netconsole_move_more_final-v1-3-a5f7691db81c@debian.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-30 12:14:39 +02:00
Breno Leitao
bb996303ef netpoll: export the netpoll_setup() helpers for netconsole
Temporarily export leaf functions that will be moved to netconsole.

The upcoming patch will move the setup function to netconsole, and
continue to call these leaf functions here in netpoll, then other
patches will move these exports functions to netconsole (and make them
statics).

In summary, these exports are temporary in order to make the patchset
digestible.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Gustavo Luiz Duarte <gustavold@gmail.com>
Link: https://patch.msgid.link/20260724-netconsole_move_more_final-v1-2-a5f7691db81c@debian.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-30 12:14:39 +02:00
Breno Leitao
d93608b0a2 netpoll: export carrier_timeout via netpoll_get_carrier_timeout()
netpoll_wait_carrier() is only used in netconsole, and it will move to
netconsole.

The carrier_timeout module parameter has to stay in netpoll so the
existing netpoll.carrier_timeout kernel parameter keeps working for
current users, and we don't break user compatibility.

Add a netpoll_get_carrier_timeout() accessor and export it so netconsole
can read the value once the carrier wait lives there. Drop the now
redundant timeout argument from netpoll_wait_carrier() (its only caller
passed carrier_timeout) and read the parameter directly while the helper
still lives here.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Gustavo Luiz Duarte <gustavold@gmail.com>
Link: https://patch.msgid.link/20260724-netconsole_move_more_final-v1-1-a5f7691db81c@debian.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-30 12:14:39 +02:00
Paolo Abeni
dcdd4035c9 Merge branch 'airoha-add-the-capability-to-configure-gdm3-gdm4-as-wan-lan-on-demand'
Lorenzo Bianconi says:

====================
airoha: add the capability to configure GDM3/GDM4 as WAN/LAN on demand

Add the capability to configure GDM3/GDM4 as WAN/LAN on demand when QoS
offload is created or destroyed.
Make dev->qdma an RCU pointer so the TX path can safely dereference it
without holding RTNL.
Introduce airoha_qdma_start() and airoha_qdma_stop() helpers.
====================

Link: https://patch.msgid.link/20260725-airoha-ethtool-priv_flags-v12-0-5136a30b2157@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-30 11:36:48 +02:00
Lorenzo Bianconi
78a35725e5 net: airoha: defer GDM3/GDM4 WAN mode and GDM2 loopback to QoS offload
GDM3 and GDM4 ports require GDM2 loopback to be enabled for hardware
QoS offload to function. Without it, HTB and ETS offload on these ports
do not work.
Previously, GDM3/GDM4 ports were automatically configured as WAN with
GDM2 loopback enabled during ndo_init().
Add the capability to configure GDM3/GDM4 as WAN/LAN on demand when QoS
offload is created or destroyed.
Hook airoha_enable_qos_for_gdm34() into TC_HTB_CREATE so that requesting
HTB offload on a GDM3/GDM4 LAN port switches it to WAN mode and enables
GDM2 loopback.
Introduce the AIROHA_DEV_F_TX_QOS flag to track whether a device has an
active TX HTB qdisc; set it in airoha_tc_setup_qdisc_htb() on successful
TC_HTB_CREATE and clear it on TC_HTB_DESTROY. The device keeps its WAN
role after qdisc teardown so that its configuration is preserved until
another device explicitly needs the WAN role for QoS offload.
If another GDM3/GDM4 device already holds the WAN role without an active
TX qdisc, demote it to LAN before promoting the requesting device. Skip
the demotion when the requesting device is itself already the WAN device.
Since airoha_dev_set_qdma() can now be called on a running device to
migrate between QDMA blocks, make dev->qdma an RCU pointer so the TX path
can safely dereference it without holding RTNL.
When migrating between QDMA blocks, stop TX queues, swap the pointer via
rcu_assign_pointer(), then synchronize_rcu() to ensure no in-flight
ndo_start_xmit holds the old pointer.
Serialize netdev_tx_completed_queue() calls via per-TX-queue spinlocks
txq_lock[] so that both the old and new QDMA NAPI instances can complete
packets concurrently on the same netdev TX queues without racing on
dql_completed().
Hold flow_offload_mutex in airoha_enable_qos_for_gdm34() and
airoha_disable_qos_for_gdm34() around the dev->flags update,
airoha_dev_set_qdma() and GDM2 loopback configuration, serializing
against concurrent airoha_ppe_hw_init() in the TC_SETUP_CLSFLOWER
offload path.
Introduce airoha_qdma_deref() helper that wraps rcu_dereference_protected()
with a lockdep condition accepting either rtnl_lock or flow_offload_mutex,
and use it across all control-path dereferences of the RCU-protected
dev->qdma pointer.
Add airoha_disable_gdm2_loopback() to disable GDM2 hw loopback.

Tested-by: Madhur Agarwal <madhur.agrawal@airoha.com>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260725-airoha-ethtool-priv_flags-v12-3-5136a30b2157@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-30 11:36:46 +02:00
Lorenzo Bianconi
8b9a508819 net: airoha: fix ETS QoS stats counter underflow and cross-channel corruption
airoha_qdma_get_tx_ets_stats() has two bugs:
- The hardware counters read via airoha_qdma_rr() are 32-bit values
  but are stored in u64 locals and subtracted from u64 baselines. When
  a 32-bit hardware counter wraps around, the subtraction produces a
  large underflow value passed to _bstats_update().
- The baseline counters (cpu_tx_packets, fwd_tx_packets) are stored as
  single per-device fields, but airoha_qdma_get_tx_ets_stats() is
  called with different channel values (0-3). Each call reads a
  different channel's hardware counter but overwrites the same
  baseline, corrupting the delta computation for other channels.

Fix both by:
- Narrowing the counter locals and baselines to u32 so that 32-bit
  unsigned subtraction handles wrap-around naturally.
- Grouping the baselines into a per-channel qos_stats array so each
  channel tracks its own previous counter value independently.
- Splitting the delta addition into two statements so the first u32
  delta is widened to u64 on assignment and the second is added in
  u64 arithmetic, preventing overflow when both deltas are large.

Fixes: 20bf7d07c9 ("net: airoha: Add sched ETS offload support")
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260725-airoha-ethtool-priv_flags-v12-2-5136a30b2157@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-30 11:36:46 +02:00
Lorenzo Bianconi
0040ff44cd net: airoha: rename airoha_priv_flags to airoha_dev_flags
Rename the airoha_priv_flags enum to airoha_dev_flags and the
AIROHA_PRIV_F_WAN flag to AIROHA_DEV_F_WAN. The "priv_flags" naming
dates back to an earlier design that used ethtool private flags; since
this series switched to tc qdisc offload for LAN/WAN configuration,
align the naming to reflect that these are per-device flags rather than
ethtool private flags.

While at it, switch to test_bit()/set_bit()/clear_bit() APIs and
convert the flags field from u32 to unsigned long to make flags
manipulation atomic.

Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260725-airoha-ethtool-priv_flags-v12-1-5136a30b2157@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-30 11:36:46 +02:00
Fernando Fernandez Mancera
ac84c85518 ipv6: remove unnecessary reset of position pointer
The position pointer is only advanced if the return value of the proc
handler is positive at new_sync_write(). Therefore no need to manually
reset it when doing error handling.

Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
Link: https://patch.msgid.link/20260727091834.6645-2-fmancera@suse.de
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-30 11:16:29 +02:00
Fernando Fernandez Mancera
ea771e17e9 ipv4: remove unnecessary reset of position pointer
The position pointer is only advanced if the return value of the proc
handler is positive at new_sync_write(). Therefore no need to manually
reset it when doing error handling.

Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
Link: https://patch.msgid.link/20260727091834.6645-1-fmancera@suse.de
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-30 11:16:29 +02:00
Paolo Abeni
49b5123182 Merge branch 'improve-wwan-qcdm-compatibility-with-user-space-tools'
Daniele Palmas says:

====================
Improve wwan qcdm compatibility with user-space tools

Historically, Qualcomm diagnostic port was a serial device, so user-space
tools were developed using tty specific features. One of the most common
tool is, for example, ModemManager libqcdm, available at
https://gitlab.freedesktop.org/mobile-broadband/ModemManager
which requires tcgetattr/tcsetattr and the possibility to get exclusive
device access to properly work.

The wwan qcdm is not really a tty device, but, besides the lack of tty
functions, it behaves as a standard serial Qualcomm diagnostic port, so,
as c230035c2f ("net: wwan: core: implement terminal ioctls for AT port"),
this series add support for terminal ioctls also for qcdm ports and
implement the exclusive open mode feature to improve compatibility with
user-space tools.

This is an incremental change which should not affect the existing tools
using wwan which do not rely on the implemented features.
====================

Link: https://patch.msgid.link/20260724142909.3270824-1-dnlplm@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-30 11:05:23 +02:00
Daniele Palmas
1a87048a4c net: wwan: add exclusive open mode capability to AT and QCDM ports
Add exclusive open mode capability to AT and QCDM ports to improve
compatibility with user-space tools using the Qualcomm diagnostic
device (e.g. libqcdm).

Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
Reviewed-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Link: https://patch.msgid.link/20260724142909.3270824-3-dnlplm@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-30 11:05:14 +02:00
Daniele Palmas
4762f405d0 net: wwan: add minimalistic IOCTls support also to QCDM port
Upstream libqcdm requires IOCTLs support to work, so add the current
AT minimalistic support also to the QCDM port.

Reviewed-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
Link: https://patch.msgid.link/20260724142909.3270824-2-dnlplm@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-30 11:05:14 +02:00
Paolo Abeni
bc03e08039 Merge branch 'net-lan743x-add-rmii-support-for-pci11x1x'
Thangaraj Samynathan says:

====================
net: lan743x: add RMII support for PCI11x1x

From: Thangaraj Samynathan <thangaraj.s@microchip.com>

This series adds RMII interface support for the Microchip PCI11x1x
Ethernet controller.

The PCI11x1x device supports RMII as an alternative MAC-PHY interface,
selected via the STRAP_READ software strap register. Patch 1 reads the
RMII strap bits from this register and sets the is_rmii_en flag. Patch 2
uses this flag to configure the PHY interface mode, phylink supported
interfaces, and enables RMII in hardware via the RMII_CTL register.
====================

Link: https://patch.msgid.link/20260723050827.694832-1-Thangaraj.S@microchip.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-30 10:19:31 +02:00
Thangaraj Samynathan
c2e2921d7a net: lan743x: add support for RMII interface
Enable RMII interface in the lan743x driver for PHY and MAC
configuration.

- Select RMII interface in lan743x_phy_interface_select().
- Update phylink supported_interfaces and MAC capabilities.
- Enable RMII via RMII_CTL in lan743x_hardware_init().
- Define RMII_CTL register and enable bit in lan743x_main.h.

EEE is not supported with RMII on PCI11x1x: the hardware does not
implement LPI signaling over RMII. Clear RMII from lpi_interfaces to
prevent phylink from enabling EEE on this interface.

Signed-off-by: Thangaraj Samynathan <thangaraj.s@microchip.com>
Link: https://patch.msgid.link/20260723050827.694832-3-Thangaraj.S@microchip.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-30 10:19:29 +02:00
Thangaraj Samynathan
fc2b13acef net: lan743x: add RMII strap status detection for PCI11x1x
Extend pci11x1x_strap_get_status() to read the RMII strap bits from
the STRAP_READ register. The is_rmii_en flag is initialized to
false and updated based on the hardware strap only if SGMII is not
already enabled. This ensures correct interface identification during
adapter initialization.

Update the netif_dbg() to report the selected interface as SGMII,
RMII, or RGMII.

Signed-off-by: Thangaraj Samynathan <thangaraj.s@microchip.com>
Link: https://patch.msgid.link/20260723050827.694832-2-Thangaraj.S@microchip.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-30 10:19:29 +02:00
Xiang-Bin Shi
ec83512ba3 atm: remove unused exported helpers
Commit 6deb535950 ("net: remove unused ATM protocols and legacy
ATM device drivers") removed the remaining in-tree users of
atm_alloc_charge(), atm_pcr_goal(), sonet_copy_stats() and
sonet_subtract_stats().

Remove these unused exported helpers and their declarations. The
removal of the SONET statistics helpers also leaves
include/linux/sonet.h without users, so remove the internal header and
its MAINTAINERS entry.

Signed-off-by: Xiang-Bin Shi <eric91102091@gmail.com>
Link: https://patch.msgid.link/20260727054538.196437-1-eric91102091@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-29 17:54:58 -07:00
Jakub Kicinski
9e84f2ac8c Merge branch 'add-packet_ignore_outgoing-selftest-for-packet-sockets'
Joe Damato says:

====================
Add PACKET_IGNORE_OUTGOING selftest for packet sockets

Greetings:

Following up on my previous series [1] and further extending the selftests
for packet sockets to test PACKET_IGNORE_OUTGOING.

I re-ran the tests and the existing and new tests all pass.
====================

Link: https://patch.msgid.link/20260728160935.4128982-1-joe@dama.to
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-29 16:59:50 -07:00
Joe Damato
b75609e42b selftests/net: test PACKET_IGNORE_OUTGOING
Test that setsockopt PACKET_IGNORE_OUTGOING:

 - works with valid values (0 and 1),
 - rejects values outside of that range, and

When enabled for a loopback sniffer, it only produces 1 copy of the
packet (rx) instead of two copies (tx and rx). Use sll_pkttype to check
the direction of the packet to ensure the correct packet is sniffed.

Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Joe Damato <joe@dama.to>
Link: https://patch.msgid.link/20260728160935.4128982-6-joe@dama.to
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-29 16:59:45 -07:00
Joe Damato
f5a445d2a2 selftests/net: psock_snd: Verify sll_pkttype
Extend do_rx() to take an expected packet type. Existing callers pass -1
to skip the check.

Signed-off-by: Joe Damato <joe@dama.to>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20260728160935.4128982-5-joe@dama.to
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-29 16:59:39 -07:00
Joe Damato
2544d30c11 selftests/net: psock_snd: unify on recvmsg()
Don't maintain two RX paths in do_rx(). Unify on recvmsg() and pass aux
data only when needed.

No functional change.

Signed-off-by: Joe Damato <joe@dama.to>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20260728160935.4128982-4-joe@dama.to
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-29 16:59:12 -07:00
Joe Damato
9404fe514e selftests/net: psock: Generalize stats check
Generalize stats check code so that callers can specify the expected
packets.

Signed-off-by: Joe Damato <joe@dama.to>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20260728160935.4128982-3-joe@dama.to
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-29 16:59:11 -07:00
Joe Damato
0982666c1b selftests/net: psock: Generalize psock bind
Generalize packet socket binding so that types other than ETH_P_IP can
be used.

Signed-off-by: Joe Damato <joe@dama.to>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20260728160935.4128982-2-joe@dama.to
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-29 16:59:11 -07:00
Shaikh Kamaluddin
bb3fed50cb netlink: specs: nl80211: fix TOOD -> TODO
Fix spelling error reported by codespell in description strings:
TOOD -> TODO. Attribute names are untouched. No functional change.

Signed-off-by: Shaikh Kamaluddin <shaikhkamal2012@gmail.com>
Reviewed-by: Joe Damato <joe@dama.to>
Link: https://patch.msgid.link/20260728154142.12133-1-shaikhkamal2012@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-29 16:57:45 -07:00
Qing Luo
9ae7ed101c sctp: auth: discard auth_chunk when skb_clone fails
When processing AUTH + COOKIE-ECHO packets, if skb_clone() fails
due to memory pressure, chunk->auth_chunk is NULL. The original
code still sets chunk->auth = 1 and continues, leaving the
COOKIE-ECHO to be processed without a valid auth_chunk for
deferred verification.

Discard the AUTH chunk early via pdiscard when skb_clone() fails,
so that the receive loop can continue processing remaining chunks
in the inqueue instead of stalling the entire packet.

Signed-off-by: Qing Luo <luoqing@kylinos.cn>
Acked-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/20260723061107.384106-1-l1138897701@163.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-29 16:36:20 -07:00
Qingfang Deng
2bb54b49e9 ppp: convert chan_sem to a mutex
chan_sem's read-side lock is taken under another mutex, so there is no
benefit in keeping it as an rwsem. Replace the rwsem with a mutex.

Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev>
Link: https://patch.msgid.link/20260727032802.4090-1-qingfang.deng@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-28 19:13:51 -07:00
Jakub Kicinski
11291f1230 Merge branch 'net_shaper-clarify-kernel-api-docs'
Jakub Kicinski says:

====================
net_shaper: clarify kernel API docs

A handful of improvements to struct net_shaper_ops kdoc.
Today driver authors have to dig thru the shaper.c code
to understand the behavior. I'm covering things I wish
were explained already during recent reviews (within Meta).
There may be more things that need to be explained, incrementally.
====================

Link: https://patch.msgid.link/20260724210756.1553565-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-28 18:27:49 -07:00
Jakub Kicinski
ff6461c148 net_shaper: add some notes on re-parenting
Clarify the re-parenting expectations. Specifically that @delete
on a queue removes it from the hierarchy which is a bit unusual
in the overall API structure.

IIRC the implicit delete behavior was introduced because otherwise
it would not be possible to remove a queue from the hierarchy
without changing at least one handle of the shapers. Normally
"removal" is done by "adding" to the new parent, but "outside
the hierarchy" does not have a parent we can point at.

Link: https://patch.msgid.link/20260724210756.1553565-4-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-28 18:27:47 -07:00
Jakub Kicinski
26bc4cfb17 net_shaper: clarify the kernel API / comments
The shaper API takes some getting used to. Try to improve
the doc on struct net_shaper_ops to help driver developers.

Link: https://patch.msgid.link/20260724210756.1553565-3-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-28 18:27:47 -07:00
Jakub Kicinski
16812d9674 net_shaper: remove incorrect comment about group leaves
It is true that the user-facing group() operation can only
be invoked with queues as leaves (see net_shaper_parse_leaf()),
but the driver facing op is also called when we delete a node.
When we delete a node we conceptually call

    group(parent, node.list_of_leaves)

to add node's leaves to the parent. Node deletion "mid-hierarchy"
is supported so some of the leaves may themselves be nodes.
Therefore the driver facing group() may be called with nodes.

Remove the incorrect comment, and add a comment about differences
between the Netlink API and driver facing API.

Link: https://patch.msgid.link/20260724210756.1553565-2-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-28 18:27:46 -07:00
Lorenzo Bianconi
b515dc5479 net: ip6_tunnel: use tunnel parameters for fill_forward_path route lookup
Reuse the flowi6 template t->fl.u.ip6 built by ip6_tnl_link_config() in
ip6_tnl_fill_forward_path(), aligning the fast-path route lookup with
the slow path in ipxip6_tnl_xmit(). This automatically inherits the
correct conditional FLOWLABEL masking based on the
IP6_TNL_F_USE_ORIG_FLOWLABEL flag.

Return -EOPNOTSUPP when IP6_TNL_F_USE_ORIG_TCLASS,
IP6_TNL_F_USE_ORIG_FLOWLABEL or IP6_TNL_F_USE_ORIG_FWMARK is set,
or for collect_md tunnels, since fill_forward_path has no access to
the original skb and cannot recover the per-packet traffic class,
flowlabel, mark or tunnel destination needed for the route lookup.

Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260724-ip6ip6-route-lookup-fill_forward_path-v3-1-7b7991538614@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-28 15:58:05 +02:00
Paolo Abeni
af2e7bf983 Merge branch 'xdp-metadata-support-for-dq-rda'
Joshua Washington says:

====================
XDP metadata support for DQ RDA

This small series enables XDP metadata support in DQ RDA mode. While
space is reserved in the headroom for metadata and the DQ queue format
supports the xmo_rx_timestamp metadata operation, support for adjusting
the metadata and passing metadata along to SKBs was not actually
implemented.

v2: https://lore.kernel.org/netdev/20260318192450.3400774-1-joshwash@google.com/
v1: https://lore.kernel.org/netdev/20260316230434.1398828-1-joshwash@google.com/
====================

Link: https://patch.msgid.link/20260722221634.186886-1-joshwash@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-28 15:35:14 +02:00
Joshua Washington
871657dc69 gve: add XDP metadata support for DQ RDA
Commit 1b42e07af1 ("gve: Add Rx HWTS metadata to AF_XDP ZC mode")
exposes support for the XDP RX timestamping metadata operation in the DQ
RDA mode. While the operation works on its own, the intent was to enable
XDP metadata support for the queue format as a whole along with it.
Currently bpf_xdp_adjust_meta fails because meta_valid is set to false.
This change updates xdp_buff preparation to set meta_valid to true, so
metadata can be fully used by XDP programs.

Reviewed-by: Harshitha Ramamurthy <hramamurthy@google.com>
Reviewed-by: Jordan Rhee <jordanrhee@google.com>
Signed-off-by: Joshua Washington <joshwash@google.com>
Link: https://patch.msgid.link/20260722221634.186886-3-joshwash@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-28 15:35:13 +02:00
Joshua Washington
1149287234 gve: use xdp_build_skb methods for XDP_PASS case
Newer common methods have been introduced to construct SKBs in the
event of XDP_PASS because many drivers replicated very similar
functionality. Update GVE to use these common methods for copy mode and
zero-copy mode.

Reviewed-by: Harshitha Ramamurthy <hramamurthy@google.com>
Reviewed-by: Jordan Rhee <jordanrhee@google.com>
Signed-off-by: Joshua Washington <joshwash@google.com>
Reviewed-by: Larysa Zaremba <larysa.zaremba@intel.com>
Link: https://patch.msgid.link/20260722221634.186886-2-joshwash@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-28 15:35:13 +02:00
Hariprasad Kelam
72207e1b15 octeontx2-af: npc: Warn on NPC_IPSEC_SPI key overlap
When scanning the MKEX profile to determine supported NPC features, warn
if the SPI extraction field overlaps with other key fields. AH and ESP
may legitimately use the same key offset for SPI, so continue to
advertise NPC_IPSEC_SPI via npc_is_field_present() instead of treating
the overlap as a hard failure.

Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
Link: https://patch.msgid.link/20260721070303.986740-1-rkannoth@marvell.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-28 10:53:35 +02:00
Paulo Alcantara
a50eba1e77 net: dns_resolver: allow shorter names in dns_query()
Customer reported a problem with mounting CIFS shares where the server
hostname was 2 chars long.  Turned out that the CIFS client wasn't
able to resolve NetBIOS names shorter than 3 chars.

Fix this by allowing a minimum of one character per hostname in
dns_query().

Reproducer with samba server:

  # 'ab' and 'srv' hotnames resolve to same ip address
  $ ssh srv ln -s 'msdfs:\\ab\\share' /home/shares/dfs/link1
  $ mount.cifs //srv/dfs/link1 /mnt -o ... [EINVAL]

Reported-by: Pierguido Lambri <plambri@redhat.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Acked-by: David Howells <dhowells@redhat.com>
Acked-by: Frank Sorenson <sorenson@redhat.com>
Link: https://patch.msgid.link/20260722-net-dns_resolver-v1-1-c3385898ccf9@manguebit.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27 18:25:36 -07:00
Yael Chemla
0b7763e3a0 net/mlx5: E-Switch, defer fwd2vport egress ACL allocation
On every VF/SF vport enable, esw_acl_egress_ofld_setup() allocates an
egress ACL flow table and a fwd_grp whenever the device supports
egress_acl_forward_to_vport. The only consumer of that group is the
active/passive fwd2vport rule installed when two representor netdevs
are bonded - a path that almost never fires. As a result, hosts with
many VFs/SFs pay a per-vport flow table and flow group cost for a
feature most ports never use.

Defer the flow table and fwd_grp creation to the moment they are
actually needed, when mlx5e_rep_esw_bond_netevent() drives
mlx5_esw_acl_egress_vport_bond() for the passive vport:

- esw_acl_egress_ofld_setup() now returns early unless
  prio_tag_required is set. When prio_tag_required is set the
  flow table is still allocated eagerly for the VLAN pop rule, and
  its size is grown by one when fwd2vport is supported so the lazy
  fwd_grp can later be added without re-creating the table. Only
  the VLAN group is built up-front.

- A new helper, esw_acl_egress_ofld_fwd2vport_setup(), allocates
  the egress ACL flow table (size 1) and the fwd_grp on demand,
  and rolls back the flow table if group creation fails and the
  helper had just allocated it. Existing cleanup paths
  (esw_acl_egress_ofld_cleanup() -> *_groups_destroy() /
  *_table_destroy()) already tolerate NULL fields, so vport
  disable continues to free everything that was actually
  allocated.

- mlx5_esw_acl_egress_vport_bond() calls the helper for the
  passive vport before installing the fwd2vport rule. The active
  vport does not need the flow table on its own: with a NULL
  fwd_dest, esw_acl_egress_ofld_rules_create() is a no-op unless
  prio_tag_required is set, in which case the eager path already
  built the table.

mlx5_esw_acl_egress_vport_bond() and mlx5_esw_acl_egress_vport_unbond()
now take esw->state_lock for the duration of the operation, because
they may mutate vport->egress.acl, which is also written by the vport
enable/disable path under the same lock.

Signed-off-by: Yael Chemla <ychemla@nvidia.com>
Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260723070427.1861502-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27 18:22:18 -07:00
Dragos Tatulea
defbb6534f net/mlx5e: SHAMPO, Remove dead CWR handling in GRO header update
mlx5e_shampo_update_ipv{4,6}_tcp_hdr() runs only from the
gro_count > 1 path in mlx5e_shampo_flush_skb(). HW-GRO flushes the
current session on a CWR packet and delivers it as a single-segment
skb via napi_gro_receive(), so the aggregated (gro_count > 1) skb
never carries a CWR-set TCP header.

This patch drops the unreachable branch. Discussion context:
https://lore.kernel.org/all/8b610e49-ff64-497e-8712-588b2228df02@nvidia.com/

Suggested-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
Cc: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260723072829.1864366-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27 18:20:55 -07:00
Gal Pressman
e4213520e9 net/mlx5e: Remove _once from PCI heuristic debug print
The _once rate-limiting in slow_pci_heuristic() is unnecessary because
this function only runs during probe.

Worse, it interacts poorly with dynamic debug: if the first probe
happens before dynamic debug is enabled for this callsite, the _once
flag is permanently consumed and the message becomes unreachable without
reloading the module.
Additionally, only the first probed device values were printable in case
of multiple devices.

Replace with mlx5_core_dbg() which allows enabling the print via dynamic
debug at any time and observing it on the next probe.

Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Alex Lazar <alazar@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260723081743.1868357-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27 18:20:33 -07:00
Tariq Toukan
41ff498d33 net/mlx5e: Fix indentation in mlx5e_free_mpwqe_rq_drop_page()
Remove a stray leading space before __free_pages() call.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202607142323.qm25Crps-lkp@intel.com/
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
Link: https://patch.msgid.link/20260723094452.1888786-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27 18:19:30 -07:00
Alice Mikityanska
8fe79aa2f1 selftests: net: Add a missing config option
Commit 5cb53743e1 ("selftests: net: Add a test for BIG TCP in UDP
tunnels") used iptables match comment, which was missed from the CI
kernel config. Add the missing config option.

Signed-off-by: Alice Mikityanska <alice@isovalent.com>
Reviewed-by: Matthieu Baerts <matttbe@kernel.org>
Link: https://patch.msgid.link/20260723140241.132120-1-alice.kernel@fastmail.im
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27 18:04:44 -07:00
Jakub Kicinski
fdd9ed67e5 Merge branch 'docs-netdev-a-couple-of-updates'
Paolo Abeni says:

====================
docs: netdev: a couple of updates

Explicitly covers a couple of relevant spots currently left out in the
dark. Likely the first one was too obvious to ever spell out loud and
the latter too new.

Both cases are increasingly relevant, at least to me.

Keep the update in the netdev subsystem, as others may have slightly
different preferences.
====================

Link: https://patch.msgid.link/cover.1784884817.git.pabeni@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27 18:03:27 -07:00
Paolo Abeni
c82ff94592 docs: netdev: clarify expected interactions with LLMs
The official documentation has not captured yet the current impact of
AI-generated reviews on the patch process.

Explicitly state the status quo and expectations.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/83360de7addb13a3b5f4d5e722148f248fdb2ae0.1784884817.git.pabeni@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27 18:03:26 -07:00
Paolo Abeni
7d394ab234 docs: netdev: clarify handling of idle patches
Off-list pings are very bad, but unfortunately too common. Explicitly
state that, so that at least LLMs could learn it.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/38b75373f813354ad0ee8bfde12ae5a42e9a11b6.1784884817.git.pabeni@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27 18:03:25 -07:00
Jakub Kicinski
e019f2198d netfilter pull request 26-07-24
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEjF9xRqF1emXiQiqU1w0aZmrPKyEFAmpjQRYACgkQ1w0aZmrP
 KyGqXQ//UZtajUv4Lbd1rddf5T4sFuLPiYk1ujL7jFw/ltyJWa712U/Jy8kLI7ft
 KMW4DSGxZ3fM+xgcT18AQwEj+7vItshNCM2RF7HSDXixYDOctkURhML3m+CVGDPv
 ykZDGvGa1cwmE23vvrLAmuqh+OBs+4Q7pQsyR+SuLSxEvZeGi5OfXcxAnM8KWq0A
 ddZAWe3DiX04vG7fmPFDw0JYw3m0JktKwJxj9Wn0Q83EffUDQCD/DtQKaMQp1oEM
 +3L9M/XHoGAW9/YlpYOE5DZORT+jHiLsYHpkOBBJ3JVzHzjLK9GDI0Vi/bZJUG5h
 bIJZdnj0nIHRIR3wgr1hicDWlgfcSh62i6HDLlXmzPvVa/Yk4Tgxof5LzfM+1KxL
 nHJ4D3Dp7C0Slm7nEkBea6euc2z4csQ4PNEpF0WIKu04eWxUjBqVnISPaeHJfeB+
 23F/7J9at682vOuxxQgCCRmuU84fCOBm7kGNY9cte/iN433D36JeFbQfcK24w2Ce
 OfihBFBbA7nfZM0w8speaUa/BDH88gL2Y0DjA8RkIhjZJKrjUkqVoJJv07eMz8b1
 IwpJGVWracSjDUot8RUIFuG4wcHE63SvZGdcbdeGfW7EnZe5alK/EgrMZLpwE1em
 fmRVGfwrQpJZ+BJVlFX2WoE5BPcxzUaa1E9lfHzG+TbXhEFmbyM=
 =m6TK
 -----END PGP SIGNATURE-----

Merge tag 'nf-next-26-07-24' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next

Pablo Neira Ayuso says:

====================
Netfilter/IPVS updates for net-next

The following patchset contains Netfilter/IPVS updates for net-next,
just a small batch with accumulated pending updates:

1) In IPVS, use system_dfl_long_wq instead of system_long_wq, from
   Ismael Luceno.

2) Add missing .checkentry in xt_tcpmss for IPv6, this is a follow up
   to a recent harderning, from Florian Westphal.

3) Address a sashiko report in the NAT SIP helper, from Florian Westphal.

4) Tear down flow entries with stale routes using the GC, this is to
   detect route updates when hardware offload is enabled.

5) Pass master conntrack as parameter to functions instead of using
   exp->master as preparation work to turn exp->master into a cookie.

6) Move expectation event_mask to the nf_conntrack_expect object,
   again as preparation work to turn exp->master into a cookie.

7) In IPVS, use kzalloc_obj{s}() typesafe allocations, from Subasri S.

* tag 'nf-next-26-07-24' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next:
  ipvs: use type-safe allocation helpers in ip_vs_rht_alloc
  netfilter: nf_conntrack_expect: store event cache in expectation
  netfilter: conntrack_helper: pass master conntrack to helper functions
  netfilter: flowtable: tear down flow entries with stale dst from GC
  netfilter: nf_nat_sip: rewind offset when NAT shrinks the packet
  netfilter: xt_tcpmss: extend checkentry to ipv6
  ipvs: Move defense_work and est_reload_work to system_dfl_long_wq
====================

Link: https://patch.msgid.link/20260724104932.437729-1-pablo@netfilter.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27 18:00:07 -07:00
Jakub Kicinski
d5990d2a86 Merge branch 'net-hsr-prp-redbox-prp-san-support'
Xin Xie says:

====================
net: hsr: PRP RedBox (PRP-SAN) support

This series adds PRP RedBox support to the hsr driver: a PRP node that
proxies one or more SANs sitting behind an interlink port (IEC 62439-3,
PRP-SAN). HSR-SAN has been supported since commit 5055cccfc2 ("net: hsr:
Provide RedBox support (HSR-SAN)"); this extends the equivalent capability
to PRP, reusing the existing protocol-neutral proxy machinery
(proxy_node_db, hsr_proxy_announce(), hsr_prune_proxy_nodes()).

A SAN behind the interlink does bidirectional unicast with peers on the PRP
network, its source MAC is preserved on the wire, the PRP RCT is correct,
and the RedBox announces each proxied SAN with the RedBox-MAC TLV (Type 30)
in its supervision frames.

The series is bisect-safe: the datapath, duplicate discard and supervision
support are added first; the rtnetlink rejection of "type hsr ... interlink
<dev> proto 1" is removed only in patch 3, once the feature is complete.

Design notes:

 - prp_drop_frame() does not walk the node tables. The destination
   classification (PRP-network node vs proxied SAN) is resolved once per
   frame in fill_frame_info() and cached in struct hsr_frame_info, so the
   per egress-port drop decision is O(1) in the softIRQ path. The
   classification is gated on PRP RedBox devices (prot_version == PRP_V1 &&
   hsr->redbox), so HSR RedBox traffic is not affected.

 - The LAN A/B duplicate test is factored into prp_is_lan_dup() so the new
   PRP interlink rules in prp_drop_frame() do not change hsr_drop_frame()
   behaviour, including the NETIF_F_HW_HSR_FWD path. This is software PRP
   RedBox only; it adds no new hardware-offload contract.

 - The supervision emitter uses pre-reserved tailroom (hsr_init_skb() +
   skb_put()) on the existing GFP_ATOMIC path; no skb_linearize() or
   pskb_expand_head(). The RedBox-MAC TLV is followed by an explicit EOT
   (Type 0, Length 0); padding via skb_put_padto(ETH_ZLEN) and the 6-byte
   PRP RCT remain at the absolute tail of the egress frame.

 - The hsr_get_node() hsr_ethhdr length guard is relaxed only for PRP
   supervision frames (prot_version == PRP_V1 && ETH_P_PRP && is_sup), which
   are untagged with mac_len == ETH_HLEN. HSR (ETH_P_HSR) supervision is
   front-tagged and keeps the original length requirement, so HSR
   malformed-frame filtering is unchanged.
====================

Link: https://patch.msgid.link/20260717201457.54-1-xiexinet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27 17:46:47 -07:00
Xin Xie
6d548d0fc1 selftests: net: hsr: add PRP RedBox test
Add a kselftest that builds a PRP RedBox (interlink) with a SAN behind the
interlink and a peer DANP, and checks bidirectional unicast across the
interlink, preservation of the SAN source MAC on the PRP network, and that
the proxy-announce supervision frame carries the RedBox-MAC TLV (Type 30)
terminated by an EOT marker. It reuses the hsr_common.sh / lib.sh helpers
and skips cleanly on a kernel or iproute2 without PRP interlink support.

The background ping is killed by its exact PID: ip netns exec does not
isolate the PID namespace, so a pattern-based pkill could hit unrelated
processes on the host.

Signed-off-by: Xin Xie <xiexinet@gmail.com>
Link: https://patch.msgid.link/20260717201457.54-5-xiexinet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27 17:46:41 -07:00