linux-2.6-microblaze.git
2 weeks agowifi: cfg80211: handle DFS per link
Aditya Kumar Singh [Fri, 6 Sep 2024 06:44:23 +0000 (12:14 +0530)]
wifi: cfg80211: handle DFS per link

Currently, during starting a radar detection, no link id information is
parsed and passed down. In order to support starting radar detection
during Multi Link Operation, it is required to pass link id as well.

Add changes to first parse and then pass link id in the start radar
detection path.

Additionally, update notification APIs to allow drivers/mac80211 to
pass the link ID.

However, everything is handled at link 0 only until all API's are ready to
handle it per link.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Link: https://patch.msgid.link/20240906064426.2101315-6-quic_adisi@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 weeks agowifi: cfg80211: move DFS related members to links[] in wireless_dev
Aditya Kumar Singh [Fri, 6 Sep 2024 06:44:22 +0000 (12:14 +0530)]
wifi: cfg80211: move DFS related members to links[] in wireless_dev

A few members related to DFS handling are currently under per wireless
device data structure. However, in order to support DFS with MLO, there is
a need to have them on a per-link manner.

Hence, as a preliminary step, move members cac_started, cac_start_time
and cac_time_ms to be on a per-link basis.

Since currently, link ID is not known at all places, use default value of
0 for now.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Link: https://patch.msgid.link/20240906064426.2101315-5-quic_adisi@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 weeks agowifi: trace: unlink rdev_end_cac trace event from wiphy_netdev_evt class
Aditya Kumar Singh [Fri, 6 Sep 2024 06:44:21 +0000 (12:14 +0530)]
wifi: trace: unlink rdev_end_cac trace event from wiphy_netdev_evt class

rdev_end_cac trace event is linked with wiphy_netdev_evt event class.
There is no option to pass link ID currently to wiphy_netdev_evt class.
A subsequent change would pass link ID to rdev_end_cac event and hence
it can no longer derive the event class from wiphy_netdev_evt.

Therefore, unlink rdev_end_cac event from wiphy_netdev_evt and define it's
own independent trace event. Link ID would be passed in subsequent change.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Link: https://patch.msgid.link/20240906064426.2101315-4-quic_adisi@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 weeks agowifi: mac80211: remove label usage in ieee80211_start_radar_detection()
Aditya Kumar Singh [Fri, 6 Sep 2024 06:44:20 +0000 (12:14 +0530)]
wifi: mac80211: remove label usage in ieee80211_start_radar_detection()

After locks rework [1], ieee80211_start_radar_detection() function is no
longer acquiring any lock as such explicitly. Hence, it is not unlocking
anything as well. However, label "out_unlock" is still used which creates
confusion. Also, now there is no need of goto label as such.

Get rid of the goto logic and use direct return statements.

[1]: https://lore.kernel.org/all/20230828135928.b1c6efffe9ad.I4aec875e25abc9ef0b5ad1e70b5747fd483fbd3c@changeid/

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Link: https://patch.msgid.link/20240906064426.2101315-3-quic_adisi@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 weeks agoRevert "wifi: mac80211: move radar detect work to sdata"
Aditya Kumar Singh [Fri, 6 Sep 2024 06:44:19 +0000 (12:14 +0530)]
Revert "wifi: mac80211: move radar detect work to sdata"

This reverts commit ce9e660ef32e ("wifi: mac80211: move radar detect work to sdata").

To enable radar detection with MLO, it’s essential to handle it on a
per-link basis. This is because when using MLO, multiple links may already
be active and beaconing. In this scenario, another link should be able to
initiate a radar detection. Also, if underlying links are associated with
different hardware devices but grouped together for MLO, they could
potentially start radar detection simultaneously. Therefore, it makes
sense to manage radar detection settings separately for each link by moving
them back to a per-link data structure.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Link: https://patch.msgid.link/20240906064426.2101315-2-quic_adisi@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 weeks agowifi: mac80211: introduce EHT rate support in AQL airtime
Ming Yen Hsieh [Wed, 4 Sep 2024 11:12:56 +0000 (19:12 +0800)]
wifi: mac80211: introduce EHT rate support in AQL airtime

Add definitions related to EHT mode and airtime calculation
according to the 802.11BE_D4.0.

Co-developed-by: Bo Jiao <Bo.Jiao@mediatek.com>
Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Quan Zhou <quan.zhou@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Link: https://patch.msgid.link/20240904111256.11734-1-mingyen.hsieh@mediatek.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 weeks agowifi: cfg80211: avoid overriding direct/MBSSID BSS with per-STA profile BSS
Veerendranath Jakkam [Wed, 4 Sep 2024 03:09:17 +0000 (08:39 +0530)]
wifi: cfg80211: avoid overriding direct/MBSSID BSS with per-STA profile BSS

Avoid overriding BSS information generated from MBSSID or direct source
with BSS information generated from per-STA profile source to avoid
losing actual signal strength and information elements such as RNR and
Basic ML elements.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
Link: https://patch.msgid.link/20240904030917.3602369-4-quic_vjakkam@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 weeks agowifi: cfg80211: skip indicating signal for per-STA profile BSSs
Veerendranath Jakkam [Wed, 4 Sep 2024 03:09:16 +0000 (08:39 +0530)]
wifi: cfg80211: skip indicating signal for per-STA profile BSSs

Currently signal of the BSS entry generated from the per-STA profile
indicated as zero, but userspace may consider it as high signal
strength since 0 dBm is a valid RSSI value.

To avoid this don't report the signal to userspace when the BSS entry
created from a per-STA profile.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
Link: https://patch.msgid.link/20240904030917.3602369-3-quic_vjakkam@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 weeks agowifi: cfg80211: make BSS source types public
Veerendranath Jakkam [Wed, 4 Sep 2024 03:09:15 +0000 (08:39 +0530)]
wifi: cfg80211: make BSS source types public

Define public enum with BSS source types in core.h. Upcoming patches
need this to store BSS source type in struct cfg80211_internal_bss.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
Link: https://patch.msgid.link/20240904030917.3602369-2-quic_vjakkam@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 weeks agowifi: iwlwifi: mvm: replace CONFIG_PM by CONFIG_PM_SLEEP
Emmanuel Grumbach [Sun, 25 Aug 2024 16:17:03 +0000 (19:17 +0300)]
wifi: iwlwifi: mvm: replace CONFIG_PM by CONFIG_PM_SLEEP

Replace the ifdef CONFIG_PM by CONFIG_PM_SLEEP. CONFIG_PM was useful
when we had CONFIG_PM_RUNTIME but that was removed long ago.
Use PM_SLEEP consistently across the driver.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20240825191257.44e47ba584de.I64f985d0405345252b76b7157291b79677abd64d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 weeks agowifi: cfg80211: Avoid RCU debug splat in __cfg80211_bss_update error paths
Veerendranath Jakkam [Wed, 4 Sep 2024 14:20:21 +0000 (19:50 +0530)]
wifi: cfg80211: Avoid RCU debug splat in __cfg80211_bss_update error paths

Replace rcu_dereference() with rcu_access_pointer() since we already
hold the lock and own the 'tmp' at this point. This is needed to avoid
suspicious rcu_dereference_check warnings in__cfg80211_bss_update error
paths.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
Link: https://patch.msgid.link/20240904142021.3887360-1-quic_vjakkam@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 weeks agowifi: cfg80211: fix UBSAN noise in cfg80211_wext_siwscan()
Dmitry Antipov [Thu, 5 Sep 2024 15:04:00 +0000 (18:04 +0300)]
wifi: cfg80211: fix UBSAN noise in cfg80211_wext_siwscan()

Looking at https://syzkaller.appspot.com/bug?extid=1a3986bbd3169c307819
and running reproducer with CONFIG_UBSAN_BOUNDS, I've noticed the
following:

[ T4985] UBSAN: array-index-out-of-bounds in net/wireless/scan.c:3479:25
[ T4985] index 164 is out of range for type 'struct ieee80211_channel *[]'
<...skipped...>
[ T4985] Call Trace:
[ T4985]  <TASK>
[ T4985]  dump_stack_lvl+0x1c2/0x2a0
[ T4985]  ? __pfx_dump_stack_lvl+0x10/0x10
[ T4985]  ? __pfx__printk+0x10/0x10
[ T4985]  __ubsan_handle_out_of_bounds+0x127/0x150
[ T4985]  cfg80211_wext_siwscan+0x11a4/0x1260
<...the rest is not too useful...>

Even if we do 'creq->n_channels = n_channels' before 'creq->ssids =
(void *)&creq->channels[n_channels]', UBSAN treats the latter as
off-by-one error. Fix this by using pointer arithmetic rather than
an expression with explicit array indexing and use convenient
'struct_size()' to simplify the math here and in 'kzalloc()' above.

Fixes: 5ba63533bbf6 ("cfg80211: fix alignment problem in scan request")
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Reviewed-by: Kees Cook <kees@kernel.org>
Link: https://patch.msgid.link/20240905150400.126386-1-dmantipov@yandex.ru
[fix coding style for multi-line calculation]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 weeks agoMerge tag 'wireless-next-2024-09-04' of git://git.kernel.org/pub/scm/linux/kernel...
Jakub Kicinski [Thu, 5 Sep 2024 00:20:14 +0000 (17:20 -0700)]
Merge tag 'wireless-next-2024-09-04' of git://git./linux/kernel/git/wireless/wireless-next

Kalle Valo says:

====================
pull-request: wireless-next-2024-09-04

here's a pull request to net-next tree, more info below. Please let me know if
there are any problems.
====================

Conflicts:

drivers/net/wireless/ath/ath12k/hw.c
  38055789d151 ("wifi: ath12k: use 128 bytes aligned iova in transmit path for WCN7850")
  8be12629b428 ("wifi: ath12k: restore ASPM for supported hardwares only")
https://lore.kernel.org/87msldyj97.fsf@kernel.org

Link: https://patch.msgid.link/20240904153205.64C11C4CEC2@smtp.kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agonet: cadence: macb: Enable software IRQ coalescing by default
Sean Anderson [Tue, 3 Sep 2024 18:49:12 +0000 (14:49 -0400)]
net: cadence: macb: Enable software IRQ coalescing by default

This NIC doesn't have hardware IRQ coalescing. Under high load,
interrupts can adversely affect performance. To mitigate this, enable
software IRQ coalescing by default. On my system this increases receive
throughput with iperf3 from 853 MBit/sec to 934 MBit/s, decreases
interrupts from 69489/sec to 2016/sec, and decreases CPU utilization
from 27% (4x Cortex-A53) to 14%. Latency is not affected (as far as I
can tell).

Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20240903184912.4151926-1-sean.anderson@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agonet: phy: Check for read errors in SIOCGMIIREG
Niklas Söderlund [Tue, 3 Sep 2024 17:15:36 +0000 (19:15 +0200)]
net: phy: Check for read errors in SIOCGMIIREG

When reading registers from the PHY using the SIOCGMIIREG IOCTL any
errors returned from either mdiobus_read() or mdiobus_c45_read() are
ignored, and parts of the returned error is passed as the register value
back to user-space.

For example, if mdiobus_c45_read() is used with a bus that do not
implement the read_c45() callback -EOPNOTSUPP is returned. This is
however directly stored in mii_data->val_out and returned as the
registers content. As val_out is a u16 the error code is truncated and
returned as a plausible register value.

Fix this by first checking the return value for errors before returning
it as the register content.

Before this patch,

    # phytool read eth0/0:1/0
    0xffa1

After this change,

    $ phytool read eth0/0:1/0
    error: phy_read (-95)

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20240903171536.628930-1-niklas.soderlund+renesas@ragnatech.se
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agopds_core: Remove redundant null pointer checks
Li Zetao [Tue, 3 Sep 2024 14:33:43 +0000 (22:33 +0800)]
pds_core: Remove redundant null pointer checks

Since the debugfs_create_dir() never returns a null pointer, checking
the return value for a null pointer is redundant, and using IS_ERR is
safe enough.

Signed-off-by: Li Zetao <lizetao1@huawei.com>
Link: https://patch.msgid.link/20240903143343.2004652-1-lizetao1@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoionic: Remove redundant null pointer checks in ionic_debugfs_add_qcq()
Li Zetao [Tue, 3 Sep 2024 14:31:49 +0000 (22:31 +0800)]
ionic: Remove redundant null pointer checks in ionic_debugfs_add_qcq()

Since the debugfs_create_dir() never returns a null pointer, checking
the return value for a null pointer is redundant, and using IS_ERR is
safe enough.

Signed-off-by: Li Zetao <lizetao1@huawei.com>
Link: https://patch.msgid.link/20240903143149.2004530-1-lizetao1@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoMerge branch 'unmask-upper-dscp-bits-part-3'
Jakub Kicinski [Wed, 4 Sep 2024 23:57:13 +0000 (16:57 -0700)]
Merge branch 'unmask-upper-dscp-bits-part-3'

Ido Schimmel says:

====================
Unmask upper DSCP bits - part 3

tl;dr - This patchset continues to unmask the upper DSCP bits in the
IPv4 flow key in preparation for allowing IPv4 FIB rules to match on
DSCP. No functional changes are expected.

The TOS field in the IPv4 flow key ('flowi4_tos') is used during FIB
lookup to match against the TOS selector in FIB rules and routes.

It is currently impossible for user space to configure FIB rules that
match on the DSCP value as the upper DSCP bits are either masked in the
various call sites that initialize the IPv4 flow key or along the path
to the FIB core.

In preparation for adding a DSCP selector to IPv4 and IPv6 FIB rules, we
need to make sure the entire DSCP value is present in the IPv4 flow key.
This patchset continues to unmask the upper DSCP bits, but this time in
the output route path, specifically in the callers of
ip_route_output_ports().

The next patchset (last) will handle the callers of
ip_route_output_key(). Split from this patchset to avoid going over the
15 patches limit.

No functional changes are expected as commit 1fa3314c14c6 ("ipv4:
Centralize TOS matching") moved the masking of the upper DSCP bits to
the core where 'flowi4_tos' is matched against the TOS selector.
====================

Link: https://patch.msgid.link/20240903135327.2810535-1-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoipv6: sit: Unmask upper DSCP bits in ipip6_tunnel_bind_dev()
Ido Schimmel [Tue, 3 Sep 2024 13:53:27 +0000 (16:53 +0300)]
ipv6: sit: Unmask upper DSCP bits in ipip6_tunnel_bind_dev()

Unmask the upper DSCP bits when calling ip_route_output_ports() so that
in the future it could perform the FIB lookup according to the full DSCP
value.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20240903135327.2810535-5-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoip6_tunnel: Unmask upper DSCP bits in ip4ip6_err()
Ido Schimmel [Tue, 3 Sep 2024 13:53:26 +0000 (16:53 +0300)]
ip6_tunnel: Unmask upper DSCP bits in ip4ip6_err()

Unmask the upper DSCP bits when calling ip_route_output_ports() so that
in the future it could perform the FIB lookup according to the full DSCP
value.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20240903135327.2810535-4-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoipv4: ipmr: Unmask upper DSCP bits in ipmr_queue_xmit()
Ido Schimmel [Tue, 3 Sep 2024 13:53:25 +0000 (16:53 +0300)]
ipv4: ipmr: Unmask upper DSCP bits in ipmr_queue_xmit()

Unmask the upper DSCP bits when calling ip_route_output_ports() so that
in the future it could perform the FIB lookup according to the full DSCP
value.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20240903135327.2810535-3-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoipv4: Unmask upper DSCP bits in __ip_queue_xmit()
Ido Schimmel [Tue, 3 Sep 2024 13:53:24 +0000 (16:53 +0300)]
ipv4: Unmask upper DSCP bits in __ip_queue_xmit()

The function is passed the full DS field in its 'tos' argument by its
two callers. It then masks the upper DSCP bits using RT_TOS() when
passing it to ip_route_output_ports().

Unmask the upper DSCP bits when passing 'tos' to ip_route_output_ports()
so that in the future it could perform the FIB lookup according to the
full DSCP value.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20240903135327.2810535-2-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoselftests: net: convert comma to semicolon
Chen Ni [Wed, 4 Sep 2024 01:44:41 +0000 (09:44 +0800)]
selftests: net: convert comma to semicolon

Replace comma between expressions with semicolons.

Using a ',' in place of a ';' can have unintended side effects.
Although that is not the case here, it is seems best to use ';'
unless ',' is intended.

Found by inspection.
No functional change intended.
Compile tested only.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20240904014441.1065753-1-nichen@iscas.ac.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoipv4: Fix user space build failure due to header change
Ido Schimmel [Tue, 3 Sep 2024 13:35:54 +0000 (16:35 +0300)]
ipv4: Fix user space build failure due to header change

RT_TOS() from include/uapi/linux/in_route.h is defined using
IPTOS_TOS_MASK from include/uapi/linux/ip.h. This is problematic for
files such as include/net/ip_fib.h that want to use RT_TOS() as without
including both header files kernel compilation fails:

In file included from ./include/net/ip_fib.h:25,
                 from ./include/net/route.h:27,
                 from ./include/net/lwtunnel.h:9,
                 from net/core/dst.c:24:
./include/net/ip_fib.h: In function ‘fib_dscp_masked_match’:
./include/uapi/linux/in_route.h:31:32: error: ‘IPTOS_TOS_MASK’ undeclared (first use in this function)
   31 | #define RT_TOS(tos)     ((tos)&IPTOS_TOS_MASK)
      |                                ^~~~~~~~~~~~~~
./include/net/ip_fib.h:440:45: note: in expansion of macro ‘RT_TOS’
  440 |         return dscp == inet_dsfield_to_dscp(RT_TOS(fl4->flowi4_tos));

Therefore, cited commit changed linux/in_route.h to include linux/ip.h.
However, as reported by David, this breaks iproute2 compilation due
overlapping definitions between linux/ip.h and
/usr/include/netinet/ip.h:

In file included from ../include/uapi/linux/in_route.h:5,
                 from iproute.c:19:
../include/uapi/linux/ip.h:25:9: warning: "IPTOS_TOS" redefined
   25 | #define IPTOS_TOS(tos)          ((tos)&IPTOS_TOS_MASK)
      |         ^~~~~~~~~
In file included from iproute.c:17:
/usr/include/netinet/ip.h:222:9: note: this is the location of the previous definition
  222 | #define IPTOS_TOS(tos)          ((tos) & IPTOS_TOS_MASK)

Fix by changing include/net/ip_fib.h to include linux/ip.h. Note that
usage of RT_TOS() should not spread further in the kernel due to recent
work in this area.

Fixes: 1fa3314c14c6 ("ipv4: Centralize TOS matching")
Reported-by: David Ahern <dsahern@kernel.org>
Closes: https://lore.kernel.org/netdev/2f5146ff-507d-4cab-a195-b28c0c9e654e@kernel.org/
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Link: https://patch.msgid.link/20240903133554.2807343-1-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agol2tp: remove unneeded null check in l2tp_v2_session_get_next
James Chapman [Tue, 3 Sep 2024 11:35:47 +0000 (12:35 +0100)]
l2tp: remove unneeded null check in l2tp_v2_session_get_next

Commit aa92c1cec92b ("l2tp: add tunnel/session get_next helpers") uses
idr_get_next APIs to iterate over l2tp session IDR lists.  Sessions in
l2tp_v2_session_idr always have a non-null session->tunnel pointer
since l2tp_session_register sets it before inserting the session into
the IDR. Therefore the null check on session->tunnel in
l2tp_v2_session_get_next is redundant and can be removed. Removing the
check avoids a warning from lkp.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/r/202408111407.HtON8jqa-lkp@intel.com/
CC: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: James Chapman <jchapman@katalix.com>
Acked-by: Tom Parkin <tparkin@katalix.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20240903113547.1261048-1-jchapman@katalix.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agonet: mana: Improve mana_set_channels() in low mem conditions
Shradha Gupta [Mon, 2 Sep 2024 03:45:34 +0000 (20:45 -0700)]
net: mana: Improve mana_set_channels() in low mem conditions

The mana_set_channels() function requires detaching the mana
driver and reattaching it with changed channel values.
During this operation if the system is low on memory, the reattach
might fail, causing the network device being down.
To avoid this we pre-allocate buffers at the beginning of set operation,
to prevent complete network loss

Signed-off-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
Reviewed-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Link: https://patch.msgid.link/1725248734-21760-1-git-send-email-shradhagupta@linux.microsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoMerge branch 'fbnic-ethtool'
David S. Miller [Wed, 4 Sep 2024 12:13:12 +0000 (13:13 +0100)]
Merge branch 'fbnic-ethtool'

Mohsin Bashir says:

====================
eth: Add basic ethtool support for fbnic

This patch series adds basic ethtool support for fbnic. Specifically,
the two patches focus on the following two features respectively:

1: Enable 'ethtool -i <dev>' to provide driver, firmware and bus information.
2: Provide mac group stats.

Changes since v2:
- Fix v1 reference link
- Fix nit

---
v2: https://lore.kernel.org/netdev/20240827205904.1944066-2-mohsin.bashr@gmail.com

v1: https://lore.kernel.org/netdev/20240822184944.3882360-1-mohsin.bashr@gmail.com
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2 weeks agoeth: fbnic: Add support to fetch group stats
Mohsin Bashir [Mon, 2 Sep 2024 17:39:07 +0000 (10:39 -0700)]
eth: fbnic: Add support to fetch group stats

Add support for group stats for mac. The fbnic_set_counter help preserve
the default values for counters which are not touched by the driver.

The 'reset' flag in 'get_eth_mac_stats' allows to choose between
resetting the counter to recent most value or fetching the aggregated
values of the counter.

The 'fbnic_stat_rd64' read 64b stats counters in an atomic fashion using
read-read-read approach. This allows to isolate cases where counter is
moving too fast making accuracy of the counter questionable.

Command: ethtool -S eth0 --groups eth-mac
Example Output:
eth-mac-FramesTransmittedOK: 421644
eth-mac-FramesReceivedOK: 3849708
eth-mac-FrameCheckSequenceErrors: 0
eth-mac-AlignmentErrors: 0
eth-mac-OctetsTransmittedOK: 64799060
eth-mac-FramesLostDueToIntMACXmitError: 0
eth-mac-OctetsReceivedOK: 5134513531
eth-mac-FramesLostDueToIntMACRcvError: 0
eth-mac-MulticastFramesXmittedOK: 568
eth-mac-BroadcastFramesXmittedOK: 454
eth-mac-MulticastFramesReceivedOK: 276106
eth-mac-BroadcastFramesReceivedOK: 26119
eth-mac-FrameTooLongErrors: 0

Signed-off-by: Mohsin Bashir <mohsin.bashr@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2 weeks agoeth: fbnic: Add ethtool support for fbnic
Mohsin Bashir [Mon, 2 Sep 2024 17:39:06 +0000 (10:39 -0700)]
eth: fbnic: Add ethtool support for fbnic

Add ethtool ops support and enable 'get_drvinfo' for fbnic. The driver
provides firmware version information while the driver name and bus
information is provided by ethtool_get_drvinfo().

Signed-off-by: Mohsin Bashir <mohsin.bashr@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2 weeks agoselftests: add selftest for UDP SO_PEEK_OFF support
Jason Xing [Mon, 2 Sep 2024 16:06:10 +0000 (00:06 +0800)]
selftests: add selftest for UDP SO_PEEK_OFF support

Add the SO_PEEK_OFF selftest for UDP. In this patch, I mainly do
three things:
1. rename tcp_so_peek_off.c
2. adjust for UDP protocol
3. add selftests into it

Suggested-by: Jon Maloy <jmaloy@redhat.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jason Xing <kernelxing@tencent.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2 weeks agoMerge branch 'sparx5-fdma-part-one'
David S. Miller [Wed, 4 Sep 2024 10:53:50 +0000 (11:53 +0100)]
Merge branch 'sparx5-fdma-part-one'

Daniel Machon says:

====================
net: microchip: add FDMA library and use it for Sparx5

This patch series is the first of a 2-part series, that adds a new
common FDMA library for Microchip switch chips Sparx5 and lan966x. These
chips share the same FDMA engine, and as such will benefit from a
common library with a common implementation.  This also has the benefit
of removing a lot open-coded bookkeeping and duplicate code for the two
drivers.

Additionally, upstreaming efforts for a third chip, lan969x, will begin
in the near future. This chip will use the new library too.

In this first series, the FDMA library is introduced and used by the
Sparx5 switch driver.

 ###################
 # Example of use: #
 ###################

- Initialize the rx and tx fdma structs with values for: number of
  DCB's, number of DB's, channel ID, DB size (data buffer size), and
  total size of the requested memory. Also provide two callbacks:
  nextptr_cb() and dataptr_cb() for getting the nextptr and dataptr.

- Allocate memory using fdma_alloc_phys() or fdma_alloc_coherent().

- Initialize the DCB's with fdma_dcb_init().

- Add new DCB's with fdma_dcb_add().

- Free memory with fdma_free_phys() or fdma_free_coherent().

 #####################
 # Patch  breakdown: #
 #####################

Patch #1:  introduces library and selects it for Sparx5.

Patch #2:  includes the fdma_api.h header and removes old symbols.

Patch #3:  replaces old rx and tx variables with equivalent ones from the
           fdma struct. Only the variables that can be changed without
           breaking traffic is changed in this patch.

Patch #4:  uses the library for allocation of rx buffers. This requires
           quite a bit of refactoring in this single patch.

Patch #5:  uses the library for adding DCB's in the rx path.

Patch #6:  uses the library for freeing rx buffers.

Patch #7:  uses the library helpers in the rx path.

Patch #8:  uses the library for allocation of tx buffers. This requires
           quite a bit of refactoring in this single patch.

Patch #9:  uses the library for adding DCB's in the tx path.

Patch #10: uses the library helpers in the tx path.

Patch #11: ditches the existing linked list for storing buffer addresses,
           and instead uses offsets into contiguous memory.

Patch #12: modifies existing rx and tx functions to be direction
           independent.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2 weeks agonet: sparx5: ditch sparx5_fdma_rx/tx_reload() functions
Daniel Machon [Mon, 2 Sep 2024 14:54:17 +0000 (16:54 +0200)]
net: sparx5: ditch sparx5_fdma_rx/tx_reload() functions

These direction specific functions can be ditched in favor of a single
function: sparx5_fdma_reload(), which retrieves the channel id from the
fdma struct instead.

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Reviewed-by: Jens Emil Schulz Østergaard <jensemil.schulzostergaard@microchip.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2 weeks agonet: sparx5: use contiguous memory for tx buffers
Daniel Machon [Mon, 2 Sep 2024 14:54:16 +0000 (16:54 +0200)]
net: sparx5: use contiguous memory for tx buffers

Currently, the driver uses a linked list for storing the tx buffer
addresses. This requires a good amount of extra bookkeeping code. Ditch
the linked list in favor of tx buffers being in the same contiguous
memory space as the DCB's and the DB's. The FDMA library has a helper
for this - so use that.

The tx buffer addresses are now retrieved as an offset into the FDMA
memory space.

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Reviewed-by: Jens Emil Schulz Østergaard <jensemil.schulzostergaard@microchip.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2 weeks agonet: sparx5: use library helper for freeing tx buffers
Daniel Machon [Mon, 2 Sep 2024 14:54:15 +0000 (16:54 +0200)]
net: sparx5: use library helper for freeing tx buffers

The library has the helper fdma_free_phys() for freeing physical FDMA
memory. Use it in the exit path.

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Reviewed-by: Jens Emil Schulz Østergaard <jensemil.schulzostergaard@microchip.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2 weeks agonet: sparx5: use FDMA library for adding DCB's in the tx path
Daniel Machon [Mon, 2 Sep 2024 14:54:14 +0000 (16:54 +0200)]
net: sparx5: use FDMA library for adding DCB's in the tx path

Use the fdma_dcb_add() function to add DCB's in the tx path. This gets
rid of the open-coding of nextptr and dataptr handling and leaves it to
the library.

Also, make sure the fdma indexes are advanced using: fdma_dcb_advance(),
so that the correct nextptr and dataptr offsets are retrieved.

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Reviewed-by: Jens Emil Schulz Østergaard <jensemil.schulzostergaard@microchip.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2 weeks agonet: sparx5: use the FDMA library for allocation of tx buffers
Daniel Machon [Mon, 2 Sep 2024 14:54:13 +0000 (16:54 +0200)]
net: sparx5: use the FDMA library for allocation of tx buffers

Use the two functions: fdma_alloc_phys() and fdma_dcb_init() for tx
buffer allocation and use the new buffers throughout.

In order to replace the old buffers with the new ones, we have to do the
following refactoring:

    - use fdma_alloc_phys() and fdma_dcb_init()

    - replace the variables: tx->dma, tx->first_entry and tx->curr_entry
      with the equivalents from the FDMA struct.

    - replace uses of sparx5_db_hw and sparx5_tx_dcb_hw with fdma_db and
      fdma_dcb.

    - add sparx5_fdma_tx_dataptr_cb callback for obtaining the dataptr.

    - Initialize FDMA struct values.

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Reviewed-by: Jens Emil Schulz Østergaard <jensemil.schulzostergaard@microchip.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2 weeks agonet: sparx5: use a few FDMA helpers in the rx path
Daniel Machon [Mon, 2 Sep 2024 14:54:12 +0000 (16:54 +0200)]
net: sparx5: use a few FDMA helpers in the rx path

The library provides helpers for a number of DCB and DB operations. Use
these in the rx path.

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Reviewed-by: Jens Emil Schulz Østergaard <jensemil.schulzostergaard@microchip.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2 weeks agonet: sparx5: use library helper for freeing rx buffers
Daniel Machon [Mon, 2 Sep 2024 14:54:11 +0000 (16:54 +0200)]
net: sparx5: use library helper for freeing rx buffers

The library has the helper fdma_free_phys() for freeing physical FDMA
memory. Use it in the exit path.

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Reviewed-by: Jens Emil Schulz Østergaard <jensemil.schulzostergaard@microchip.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2 weeks agonet: sparx5: use FDMA library for adding DCB's in the rx path
Daniel Machon [Mon, 2 Sep 2024 14:54:10 +0000 (16:54 +0200)]
net: sparx5: use FDMA library for adding DCB's in the rx path

Use the fdma_dcb_add() function to add DCB's in the rx path. This gets
rid of the open-coding of nextptr and dataptr handling and leaves it to
the library.

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Reviewed-by: Jens Emil Schulz Østergaard <jensemil.schulzostergaard@microchip.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2 weeks agonet: sparx5: use the FDMA library for allocation of rx buffers
Daniel Machon [Mon, 2 Sep 2024 14:54:09 +0000 (16:54 +0200)]
net: sparx5: use the FDMA library for allocation of rx buffers

Use the two functions: fdma_alloc_phys() and fdma_dcb_init() for rx
buffer allocation and use the new buffers throughout.

In order to replace the old buffers with the new ones, we have to do the
following refactoring:

    - use fdma_alloc_phys() and fdma_dcb_init()

    - replace the variables: rx->dma, rx->dcb_entries and rx->last_entry
      with the equivalents from the FDMA struct.

    - replace uses of sparx5_db_hw and sparx5_rx_dcb_hw with fdma_db and
      fdma_dcb.

    - add sparx5_fdma_rx_dataptr_cb callback for obtaining the dataptr.

    - Initialize FDMA struct values.

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Reviewed-by: Jens Emil Schulz Østergaard <jensemil.schulzostergaard@microchip.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2 weeks agonet: sparx5: replace a few variables with new equivalent ones
Daniel Machon [Mon, 2 Sep 2024 14:54:08 +0000 (16:54 +0200)]
net: sparx5: replace a few variables with new equivalent ones

Replace the old rx and tx variables: channel_id, FDMA_DCB_MAX,
FDMA_RX_DCB_MAX_DBS, FDMA_TX_DCB_MAX_DBS, dcb_index and db_index with
the equivalents from the FDMA rx and tx structs. These variables are not
entangled in any buffer allocation and can therefore be replaced in
advance.

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Reviewed-by: Jens Emil Schulz Østergaard <jensemil.schulzostergaard@microchip.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2 weeks agonet: sparx5: use FDMA library symbols
Daniel Machon [Mon, 2 Sep 2024 14:54:07 +0000 (16:54 +0200)]
net: sparx5: use FDMA library symbols

Include and use the new FDMA header, which now provides the required
masks and bit offsets for operating on the DCB's and DB's.

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Reviewed-by: Jens Emil Schulz Østergaard <jensemil.schulzostergaard@microchip.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2 weeks agonet: microchip: add FDMA library
Daniel Machon [Mon, 2 Sep 2024 14:54:06 +0000 (16:54 +0200)]
net: microchip: add FDMA library

Add new FDMA library for interacting with the FDMA engine on Microchip
Sparx5 and lan966x switch chips, in an effort to reduce duplicate code
and provide a common set of symbols and functions.

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Reviewed-by: Jens Emil Schulz Østergaard <jensemil.schulzostergaard@microchip.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2 weeks agobe2net: Remove unused declarations
Yue Haibing [Mon, 2 Sep 2024 11:32:38 +0000 (19:32 +0800)]
be2net: Remove unused declarations

Commit 6b7c5b947c67 ("net: Add be2net driver.") declared be_pci_fnum_get()
and be_cmd_reset() but never implemented. And commit 9fa465c0ce0d ("be2net:
remove code duplication relating to Lancer reset sequence") removed
lancer_test_and_set_rdy_state() but leave declaration.

Commit 76a9e08e33ce ("be2net: cleanup wake-on-lan code") left behind
be_is_wol_supported() declaration.
Commit baaa08d148ac ("be2net: do not call be_set/get_fw_log_level() on
Skyhawk-R") removed be_get_fw_log_level() but leave declaration.

Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20240902113238.557515-1-yuehaibing@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoqlcnic: Remove unused declarations
Yue Haibing [Mon, 2 Sep 2024 11:29:04 +0000 (19:29 +0800)]
qlcnic: Remove unused declarations

There is no caller and implementation in tree.

Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20240902112904.556577-1-yuehaibing@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agonet: alacritech: Partially revert "net: alacritech: Switch to use dev_err_probe()"
Krzysztof Kozlowski [Mon, 2 Sep 2024 16:36:10 +0000 (18:36 +0200)]
net: alacritech: Partially revert "net: alacritech: Switch to use dev_err_probe()"

This reverts commit bf4d87f884fe8a4b6b61fe4d0e05f293d08df61c because it
introduced dev_err_probe() in non-probe path, which is not desired.

In general, calling dev_err_probe() after successful probe in case of
handling -EPROBE_DEFER error, will set deferred status on the device
already probed.  This is however not a problem here now, because
dev_err_probe() in affected places is used for handling errors from
request_firmware(), which does not return -EPROBE_DEFER.  Still usage of
dev_err_probe() in such case is not correct, because request_firmware()
could once return -EPROBE_DEFER.

Fixes: bf4d87f884fe ("net: alacritech: Switch to use dev_err_probe()")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20240902163610.17028-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agonetlink: specs: nftables: allow decode of default firewalld ruleset
Florian Westphal [Mon, 2 Sep 2024 21:41:06 +0000 (23:41 +0200)]
netlink: specs: nftables: allow decode of default firewalld ruleset

This update allows listing default firewalld ruleset on Fedora 40 via
  tools/net/ynl/cli.py --spec \
     Documentation/netlink/specs/nftables.yaml --dump getrule

Default ruleset uses fib, reject and objref expressions which were
missing.

Other missing expressions can be added later.

Improve decoding while at it:
- add bitwise, ct and lookup attributes
- wire up the quota expression
- translate raw verdict codes to a human reable name, e.g.
  'code': 4294967293 becomes 'code': 'jump'.

v2: forgot fib addrtype in enum list (Donald Hunter)

Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Link: https://patch.msgid.link/20240902214112.2549-1-fw@strlen.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoMerge branch 'mptcp-mib-counters-for-mpj-tx-misc-improvements'
Jakub Kicinski [Tue, 3 Sep 2024 22:25:46 +0000 (15:25 -0700)]
Merge branch 'mptcp-mib-counters-for-mpj-tx-misc-improvements'

Matthieu Baerts says:

====================
mptcp: MIB counters for MPJ TX + misc improvements

Recently, a few issues have been discovered around the creation of
additional subflows. Without these counters, it was difficult to point
out the reason why some subflows were not created as expected.

In patch 3, all error paths from __mptcp_subflow_connect() are covered,
except the one related to the 'fully established mode', because it can
only happen with the userspace PM, which will propagate the error to the
userspace in this case (ENOTCONN).

These new counters are also verified in the MPTCP Join selftest in patch
6.

While at it, a few other patches are improving the MPTCP path-manager
code ...

 - Patch 1: 'flush' related helpers are renamed to avoid confusions
 - Patch 2: directly pass known ID and flags to create a new subflow,
            i/o getting them later by iterating over all endpoints again

... and the MPJoin selftests:

 - Patch 4: reduce the number of positional parameters
 - Patch 5: only one line for the 'join' checks, instead of 3
 - Patch 7: more explicit check names, instead of sometimes too cryptic
            ones: rtx, ptx, ftx, ctx, fclzrx, sum
 - Patch 8: specify client/server instead of 'invert' for some checks
            not suggesting one specific direction
 - Patch 9: mute errors of mptcp_connect when ran in the background
 - Patch 10: simplify checksum_tests by using a for-loop
 - Patch 11: remove 'define' re-definitions
====================

Link: https://patch.msgid.link/20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoselftests: mptcp: pm_nl_ctl: remove re-definition
Matthieu Baerts (NGI0) [Mon, 2 Sep 2024 10:46:02 +0000 (12:46 +0200)]
selftests: mptcp: pm_nl_ctl: remove re-definition

'MPTCP_PM_NAME' is defined in 'linux/mptcp_pm.h', included in
'linux/mptcp.h', no need to re-define it.

'MPTCP_PM_EVENTS' is not defined in 'linux/mptcp.h', but
'MPTCP_PM_EV_GRP_NAME' is, with the same value. We can then use the
latter, and drop the other one.

Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20240902-net-next-mptcp-mib-mpjtx-misc-v1-11-d3e0f3773b90@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoselftests: mptcp: join: simplify checksum_tests
Geliang Tang [Mon, 2 Sep 2024 10:46:01 +0000 (12:46 +0200)]
selftests: mptcp: join: simplify checksum_tests

The four checksum tests are similar, only one line is different. So
a for-loop can be used to simplify these tests.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20240902-net-next-mptcp-mib-mpjtx-misc-v1-10-d3e0f3773b90@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoselftests: mptcp: join: mute errors when ran in the background
Matthieu Baerts (NGI0) [Mon, 2 Sep 2024 10:46:00 +0000 (12:46 +0200)]
selftests: mptcp: join: mute errors when ran in the background

The test is supposed to be killed before the end, which will likely
cause "Connection reset by peer" errors. It is confusing, especially
because in case of real transfer errors, the test will not be marked as
failed. But that's OK, there are many other tests checking that.

Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20240902-net-next-mptcp-mib-mpjtx-misc-v1-9-d3e0f3773b90@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoselftests: mptcp: join: specify host being checked
Matthieu Baerts (NGI0) [Mon, 2 Sep 2024 10:45:59 +0000 (12:45 +0200)]
selftests: mptcp: join: specify host being checked

Instead of displaying 'invert' when looking at some events like MP_FAIL,
MP_FASTCLOSE, MP_RESET, RM_ADDR, which is a bit vague because they are
not traditionnaly sent from one side, the host being checked is now
printed.

For the ADD_ADDR, only display the host when it is the client sending
it, which is more unusual.

Also before, the 'invert' message was printed after a few checks, but it
was not clear which ones exactly.

Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20240902-net-next-mptcp-mib-mpjtx-misc-v1-8-d3e0f3773b90@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoselftests: mptcp: join: more explicit check name
Matthieu Baerts (NGI0) [Mon, 2 Sep 2024 10:45:58 +0000 (12:45 +0200)]
selftests: mptcp: join: more explicit check name

Before, the check names had to be very short. It is no longer the case
now that these checks are printed on a dedicated line.

Then, it looks better to have more explicit names.

Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20240902-net-next-mptcp-mib-mpjtx-misc-v1-7-d3e0f3773b90@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoselftests: mptcp: join: validate MPJ SYN TX MIB counters
Matthieu Baerts (NGI0) [Mon, 2 Sep 2024 10:45:57 +0000 (12:45 +0200)]
selftests: mptcp: join: validate MPJ SYN TX MIB counters

A few new MPJoinSynTx MIB counters have been added in a previous commit.
They are being validated here in mptcp_join.sh selftest, each time the
number of received MPJ are checked.

Most of the time, the number of sent SYN+MPJ is the same as the received
ones. But sometimes, there are more, because there are dropped, or there
are errors.

While at it, the "no MPC reuse with single endpoint" subtest has been
modified to force a bind() error.

Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20240902-net-next-mptcp-mib-mpjtx-misc-v1-6-d3e0f3773b90@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoselftests: mptcp: join: one line for join check
Matthieu Baerts (NGI0) [Mon, 2 Sep 2024 10:45:56 +0000 (12:45 +0200)]
selftests: mptcp: join: one line for join check

Most tests are checking if the expected number of SYN/SYN+ACK/ACK JOINs
have been received, each of them on one line.

More Join related tests are going to be checked soon, no need to add 5
new lines per test in case of success, just one is enough. In case of
issue, the errors will still be reported like before.

Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20240902-net-next-mptcp-mib-mpjtx-misc-v1-5-d3e0f3773b90@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoselftests: mptcp: join: reduce join_nr params
Matthieu Baerts (NGI0) [Mon, 2 Sep 2024 10:45:55 +0000 (12:45 +0200)]
selftests: mptcp: join: reduce join_nr params

chk_join_nr() currently takes 9 positional parameters, 6 of them are
optional. It makes it hard to read:

  chk_join_nr 1 1 1 1 0 1 1 0 4

Naming these vars helps to make it easier to read:

  join_csum_ns1=1 join_csum_ns2=0 \
    join_fail_nr=1 join_rst_nr=1 join_infi_nr=0 \
    join_corrupted_pkts=4 \
    chk_join_nr 1 1 1

It will then be easier to add new optional parameters.

Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20240902-net-next-mptcp-mib-mpjtx-misc-v1-4-d3e0f3773b90@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agomptcp: MIB counters for sent MP_JOIN
Matthieu Baerts (NGI0) [Mon, 2 Sep 2024 10:45:54 +0000 (12:45 +0200)]
mptcp: MIB counters for sent MP_JOIN

Recently, a few issues have been discovered around the creation of
additional subflows. Without these counters, it was difficult to point
out the reason why some subflows were not created as expected.

These counters should have been added earlier, because there is no other
simple ways to extract such information from the kernel, and understand
why subflows have not been created.

While at it, some pr_debug() have been added, just in case the errno
needs to be printed.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/509
Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20240902-net-next-mptcp-mib-mpjtx-misc-v1-3-d3e0f3773b90@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agomptcp: pm: reduce entries iterations on connect
Matthieu Baerts (NGI0) [Mon, 2 Sep 2024 10:45:53 +0000 (12:45 +0200)]
mptcp: pm: reduce entries iterations on connect

__mptcp_subflow_connect() is currently called from the path-managers,
which have all the required information to create subflows. No need to
call the PM again to re-iterate over the list of entries with RCU lock
to get more info.

Instead, it is possible to pass a mptcp_pm_addr_entry structure, instead
of a mptcp_addr_info one. The former contains the ifindex and the flags
that are required when creating the new subflow.

This is a partial revert of commit ee285257a9c1 ("mptcp: drop flags and
ifindex arguments").

While at it, the local ID can also be set if it is known and 0, to avoid
having to set it in the 'rebuild_header' hook, which will cause a new
iteration of the endpoint entries.

Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20240902-net-next-mptcp-mib-mpjtx-misc-v1-2-d3e0f3773b90@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agomptcp: pm: rename helpers linked to 'flush'
Matthieu Baerts (NGI0) [Mon, 2 Sep 2024 10:45:52 +0000 (12:45 +0200)]
mptcp: pm: rename helpers linked to 'flush'

Rename all the helpers specific to the flushing operations to make it
clear that the intention is to flush all created subflows, and remove
all announced addresses, not just a specific selection.

That way, it is easier to understand why the id_avail_bitmap and
local_addr_used are reset at the end.

Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20240902-net-next-mptcp-mib-mpjtx-misc-v1-1-d3e0f3773b90@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoMerge branch 'rx-software-timestamp-for-all'
Jakub Kicinski [Tue, 3 Sep 2024 22:18:45 +0000 (15:18 -0700)]
Merge branch 'rx-software-timestamp-for-all'

Gal Pressman says:

====================
RX software timestamp for all

All devices support SOF_TIMESTAMPING_RX_SOFTWARE by virtue of
net_timestamp_check() being called in the device independent code.
Following Willem's suggestion [1], make it so drivers do not have to
handle SOF_TIMESTAMPING_RX_SOFTWARE and SOF_TIMESTAMPING_SOFTWARE, nor
setting of the PHC index to -1.

All drivers will now report RX software timestamp as supported.
The series is limited to 15 patches, I will submit other drivers in
subsequent submissions.

[1] https://lore.kernel.org/netdev/661550e348224_23a2b2294f7@willemb.c.googlers.com.notmuch/

v1: https://lore.kernel.org/20240829144253.122215-1-gal@nvidia.com
====================

Link: https://patch.msgid.link/20240901112803.212753-1-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agonet: mvpp2: Remove setting of RX software timestamp
Gal Pressman [Sun, 1 Sep 2024 11:28:03 +0000 (14:28 +0300)]
net: mvpp2: Remove setting of RX software timestamp

The responsibility for reporting of RX software timestamp has moved to
the core layer (see __ethtool_get_ts_info()), remove usage from the
device drivers.

Reviewed-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Marcin Wojtas <marcin.s.wojtas@gmail.com>
Link: https://patch.msgid.link/20240901112803.212753-16-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoocteontx2-pf: Remove setting of RX software timestamp
Gal Pressman [Sun, 1 Sep 2024 11:28:02 +0000 (14:28 +0300)]
octeontx2-pf: Remove setting of RX software timestamp

The responsibility for reporting of RX software timestamp has moved to
the core layer (see __ethtool_get_ts_info()), remove usage from the
device drivers.

Reviewed-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Subbaraya Sundeep <sbhatta@marvell.com>
Link: https://patch.msgid.link/20240901112803.212753-15-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agogianfar: Remove setting of RX software timestamp
Gal Pressman [Sun, 1 Sep 2024 11:28:01 +0000 (14:28 +0300)]
gianfar: Remove setting of RX software timestamp

The responsibility for reporting of RX software timestamp has moved to
the core layer (see __ethtool_get_ts_info()), remove usage from the
device drivers.

Reviewed-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Link: https://patch.msgid.link/20240901112803.212753-14-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agonet: enetc: Remove setting of RX software timestamp
Gal Pressman [Sun, 1 Sep 2024 11:28:00 +0000 (14:28 +0300)]
net: enetc: Remove setting of RX software timestamp

The responsibility for reporting of RX software timestamp has moved to
the core layer (see __ethtool_get_ts_info()), remove usage from the
device drivers.

Reviewed-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Wei Fang <wei.fang@nxp.com>
Link: https://patch.msgid.link/20240901112803.212753-13-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agonet: fec: Remove setting of RX software timestamp
Gal Pressman [Sun, 1 Sep 2024 11:27:59 +0000 (14:27 +0300)]
net: fec: Remove setting of RX software timestamp

The responsibility for reporting of RX software timestamp has moved to
the core layer (see __ethtool_get_ts_info()), remove usage from the
device drivers.

Reviewed-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Wei Fang <wei.fang@nxp.com>
Link: https://patch.msgid.link/20240901112803.212753-12-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agonet: hns3: Remove setting of RX software timestamp
Gal Pressman [Sun, 1 Sep 2024 11:27:58 +0000 (14:27 +0300)]
net: hns3: Remove setting of RX software timestamp

The responsibility for reporting of RX software timestamp has moved to
the core layer (see __ethtool_get_ts_info()), remove usage from the
device drivers.

Reviewed-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Jijie Shao <shaojijie@huawei.com>
Link: https://patch.msgid.link/20240901112803.212753-11-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agonet: ethernet: rtsn: Remove setting of RX software timestamp
Gal Pressman [Sun, 1 Sep 2024 11:27:57 +0000 (14:27 +0300)]
net: ethernet: rtsn: Remove setting of RX software timestamp

The responsibility for reporting of RX software timestamp has moved to
the core layer (see __ethtool_get_ts_info()), remove usage from the
device drivers.

Reviewed-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://patch.msgid.link/20240901112803.212753-10-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agonet: renesas: rswitch: Remove setting of RX software timestamp
Gal Pressman [Sun, 1 Sep 2024 11:27:56 +0000 (14:27 +0300)]
net: renesas: rswitch: Remove setting of RX software timestamp

The responsibility for reporting of RX software timestamp has moved to
the core layer (see __ethtool_get_ts_info()), remove usage from the
device drivers.

Reviewed-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://patch.msgid.link/20240901112803.212753-9-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoravb: Remove setting of RX software timestamp
Gal Pressman [Sun, 1 Sep 2024 11:27:55 +0000 (14:27 +0300)]
ravb: Remove setting of RX software timestamp

The responsibility for reporting of RX software timestamp has moved to
the core layer (see __ethtool_get_ts_info()), remove usage from the
device drivers.

Reviewed-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Link: https://patch.msgid.link/20240901112803.212753-8-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoionic: Remove setting of RX software timestamp
Gal Pressman [Sun, 1 Sep 2024 11:27:54 +0000 (14:27 +0300)]
ionic: Remove setting of RX software timestamp

The responsibility for reporting of RX software timestamp has moved to
the core layer (see __ethtool_get_ts_info()), remove usage from the
device drivers.

Reviewed-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Shannon Nelson <shannon.nelson@amd.com>
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Link: https://patch.msgid.link/20240901112803.212753-7-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agotsnep: Remove setting of RX software timestamp
Gal Pressman [Sun, 1 Sep 2024 11:27:53 +0000 (14:27 +0300)]
tsnep: Remove setting of RX software timestamp

The responsibility for reporting of RX software timestamp has moved to
the core layer (see __ethtool_get_ts_info()), remove usage from the
device drivers.

Reviewed-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Link: https://patch.msgid.link/20240901112803.212753-6-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agocan: peak_usb: Remove setting of RX software timestamp
Gal Pressman [Sun, 1 Sep 2024 11:27:52 +0000 (14:27 +0300)]
can: peak_usb: Remove setting of RX software timestamp

The responsibility for reporting of RX software timestamp has moved to
the core layer (see __ethtool_get_ts_info()), remove usage from the
device drivers.

Reviewed-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Marc Kleine-Budde <mkl@pengutronix.de>
Link: https://patch.msgid.link/20240901112803.212753-5-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agocan: peak_canfd: Remove setting of RX software timestamp
Gal Pressman [Sun, 1 Sep 2024 11:27:51 +0000 (14:27 +0300)]
can: peak_canfd: Remove setting of RX software timestamp

The responsibility for reporting of RX software timestamp has moved to
the core layer (see __ethtool_get_ts_info()), remove usage from the
device drivers.

Reviewed-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Marc Kleine-Budde <mkl@pengutronix.de>
Link: https://patch.msgid.link/20240901112803.212753-4-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agocan: dev: Remove setting of RX software timestamp
Gal Pressman [Sun, 1 Sep 2024 11:27:50 +0000 (14:27 +0300)]
can: dev: Remove setting of RX software timestamp

The responsibility for reporting of RX software timestamp has moved to
the core layer (see __ethtool_get_ts_info()), remove usage from the
device drivers.

Reviewed-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Marc Kleine-Budde <mkl@pengutronix.de>
Link: https://patch.msgid.link/20240901112803.212753-3-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoethtool: RX software timestamp for all
Gal Pressman [Sun, 1 Sep 2024 11:27:49 +0000 (14:27 +0300)]
ethtool: RX software timestamp for all

All devices support SOF_TIMESTAMPING_RX_SOFTWARE by virtue of
net_timestamp_check() being called in the device independent code.

Move the responsibility of reporting SOF_TIMESTAMPING_RX_SOFTWARE and
SOF_TIMESTAMPING_SOFTWARE, and setting PHC index to -1 to the core.
Device drivers no longer need to use them.

Suggested-by: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Link: https://lore.kernel.org/netdev/661550e348224_23a2b2294f7@willemb.c.googlers.com.notmuch/
Co-developed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Marc Kleine-Budde <mkl@pengutronix.de>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20240901112803.212753-2-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoMerge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue
Jakub Kicinski [Tue, 3 Sep 2024 19:50:02 +0000 (12:50 -0700)]
Merge branch '1GbE' of git://git./linux/kernel/git/tnguy/next-queue

Tony Nguyen says:

====================
Intel Wired LAN Driver Updates 2024-08-30 (igc, e1000e, i40e)

This series contains updates to igc, e1000e, and i40 drivers.

Kurt Kanzenbach adds support for MQPRIO offloads and stops unintended,
excess interrupts on igc.

Sasha adds reporting of EEE (Energy Efficient Ethernet) ability and
moves a register define to a better suited file for igc.

Vitaly stops reporting errors on shutdown and suspend as they are not
fatal for e1000e.

Alex adds reporting of EEE to i40e.

* '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue:
  i40e: Add Energy Efficient Ethernet ability for X710 Base-T/KR/KX cards
  e1000e: avoid failing the system during pm_suspend
  igc: Move the MULTI GBT AN Control Register to _regs file
  igc: Add Energy Efficient Ethernet ability
  igc: Get rid of spurious interrupts
  igc: Add MQPRIO offload support
====================

Link: https://patch.msgid.link/20240830210451.2375215-1-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoMerge tag 'ieee802154-for-net-2024-09-01' of git://git.kernel.org/pub/scm/linux/kerne...
Jakub Kicinski [Tue, 3 Sep 2024 18:59:44 +0000 (11:59 -0700)]
Merge tag 'ieee802154-for-net-2024-09-01' of git://git./linux/kernel/git/wpan/wpan

Stefan Schmidt says:

====================
pull-request: ieee802154 for net 2024-09-01

Simon Horman catched two typos in our headers. No functional change.

* tag 'ieee802154-for-net-2024-09-01' of git://git.kernel.org/pub/scm/linux/kernel/git/wpan/wpan:
  ieee802154: Correct spelling in nl802154.h
  mac802154: Correct spelling in mac802154.h
====================

Link: https://patch.msgid.link/20240901184213.2303047-1-stefan@datenfreihafen.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agoioam6: improve checks on user data
Justin Iurman [Fri, 30 Aug 2024 19:19:19 +0000 (21:19 +0200)]
ioam6: improve checks on user data

This patch improves two checks on user data.

The first one prevents bit 23 from being set, as specified by RFC 9197
(Sec 4.4.1):

  Bit 23    Reserved; MUST be set to zero upon transmission and be
            ignored upon receipt.  This bit is reserved to allow for
            future extensions of the IOAM Trace-Type bit field.

The second one checks that the tunnel destination address !=
IPV6_ADDR_ANY, just like we already do for the tunnel source address.

Signed-off-by: Justin Iurman <justin.iurman@uliege.be>
Link: https://patch.msgid.link/20240830191919.51439-1-justin.iurman@uliege.be
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 weeks agowifi: mwifiex: Convert to use jiffies macro
Chen Yufan [Fri, 23 Aug 2024 07:03:19 +0000 (15:03 +0800)]
wifi: mwifiex: Convert to use jiffies macro

Use time_after macro instead of using jiffies directly to handle wraparound.
Change the type to to unsigned long to avoid unnecessary casts.

Signed-off-by: Chen Yufan <chenyufan@vivo.com>
Acked-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20240823070320.430753-1-chenyufan@vivo.com
2 weeks agowifi: wilc1000: Re-enable RTC clock on resume
Marek Vasut [Wed, 21 Aug 2024 18:36:54 +0000 (20:36 +0200)]
wifi: wilc1000: Re-enable RTC clock on resume

The wilc_sdio_suspend() does clk_disable_unprepare() on rtc_clk clock,
make sure wilc_sdio_resume() does matching clk_prepare_enable(), else
any suspend/resume cycle leads to clock disable/enable imbalance. Fix
the imbalance.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20240821183717.163235-1-marex@denx.de
2 weeks agowifi: wilc1000: Do not operate uninitialized hardware during suspend/resume
Marek Vasut [Wed, 21 Aug 2024 18:36:03 +0000 (20:36 +0200)]
wifi: wilc1000: Do not operate uninitialized hardware during suspend/resume

In case the hardware is not initialized, do not operate it during
suspend/resume cycle, the hardware is already off so there is no
reason to access it.

In fact, wilc_sdio_enable_interrupt() in the resume callback does
interfere with the same call when initializing the hardware after
resume and makes such initialization after resume fail. Fix this
by not operating uninitialized hardware during suspend/resume.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20240821183639.163187-1-marex@denx.de
2 weeks agowifi: brcmsmac: Use kvmemdup to simplify the code
Jinjie Ruan [Wed, 21 Aug 2024 07:02:57 +0000 (15:02 +0800)]
wifi: brcmsmac: Use kvmemdup to simplify the code

Use kvmemdup instead of kvmalloc() + memcpy() to simplify the code.

No functional change.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20240821070257.2298559-1-ruanjinjie@huawei.com
2 weeks agodt-bindings: net: wireless: convert marvel-8xxx.txt to yaml format
Frank Li [Tue, 20 Aug 2024 14:21:42 +0000 (10:21 -0400)]
dt-bindings: net: wireless: convert marvel-8xxx.txt to yaml format

Convert binding doc marvel-8xxx.txt to yaml format.
Additional change:
- Remove marvell,caldata_00_txpwrlimit_2g_cfg_set in example.
- Remove mmc related property in example.
- Add wakeup-source property.
- Remove vmmc-supply and mmc-pwrseq.

Fix below warning:
arch/arm64/boot/dts/freescale/imx8mp-beacon-kit.dtb: /soc@0/bus@30800000/mmc@30b40000/wifi@1:
failed to match any schema with compatible: ['marvell,sd8997']

Acked-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20240820142143.443151-1-Frank.Li@nxp.com
2 weeks agoMerge branch 'cleanup-chelsio-driver-declarations'
Paolo Abeni [Tue, 3 Sep 2024 11:07:29 +0000 (13:07 +0200)]
Merge branch 'cleanup-chelsio-driver-declarations'

Yue Haibing says:

====================
cleanup chelsio driver declarations

v2: correct patch 3 commit citation
====================

Link: https://patch.msgid.link/20240830093338.3742315-1-yuehaibing@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 weeks agocxgb: Remove unused declarations
Yue Haibing [Fri, 30 Aug 2024 09:33:38 +0000 (17:33 +0800)]
cxgb: Remove unused declarations

These functions were never implenmented since introduction in
commit 8199d3a79c22 ("[PATCH] A new 10GB Ethernet Driver by Chelsio
Communications")

Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 weeks agocxgb4: Remove unused declarations
Yue Haibing [Fri, 30 Aug 2024 09:33:37 +0000 (17:33 +0800)]
cxgb4: Remove unused declarations

Commit e2d14b42c25c ("cxgb4: Remove WOL get/set ethtool support") removed
t4_wol_magic_enable() and t4_wol_pat_enable() but leave declarations.

Commit 02d805dc5fe3 ("cxgb4: use new fw interface to get the VIN and smt
index") leave behind cxgb4_tp_smt_idx().

cxgb4_dcb_set_caps() is never implemented and used since introduction in
commit 76bcb31efc06 ("cxgb4 : Add DCBx support codebase and dcbnl_ops").

Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 weeks agocxgb3: Remove unused declarations
Yue Haibing [Fri, 30 Aug 2024 09:33:36 +0000 (17:33 +0800)]
cxgb3: Remove unused declarations

Commit 4d22de3e6cc4 ("Add support for the latest 1G/10G Chelsio adapter,
T3.") declared but never implemented these.

Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 weeks agoselftests: netfilter: nft_queue.sh: fix spurious timeout on debug kernel
Florian Westphal [Fri, 30 Aug 2024 09:22:39 +0000 (11:22 +0200)]
selftests: netfilter: nft_queue.sh: fix spurious timeout on debug kernel

The sctp selftest is very slow on debug kernels.

Its possible that the nf_queue listener program exits due to timeout
before first sctp packet is processed.

In this case socat hangs until script times out.
Fix this by removing the -t option where possible and kill the test
program once the file transfer/socat has exited.

-t sets SO_RCVTIMEO, its inteded for the 'ping' part of the selftest
where we want to make sure that packets get reinjected properly without
skipping a second queue request.

While at it, add a helper to compare the (binary) files instead of diff.
The 'diff' part was copied from a another sub-test that compares text.

Let helper dump file sizes on error so we can see the progress made.

Tested on an old 2010-ish box with a debug kernel and 100 iterations.

This is a followup to the earlier filesize reduction change.

Reported-by: Jakub Kicinski <kuba@kernel.org>
Closes: https://lore.kernel.org/netdev/20240829080109.GB30766@breakpoint.cc/
Fixes: 0a8b08c554da ("selftests: netfilter: nft_queue.sh: reduce test file size for debug build")
Signed-off-by: Florian Westphal <fw@strlen.de>
Link: https://patch.msgid.link/20240830092254.8029-1-fw@strlen.de
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 weeks agoMerge branch 'net-simplified-with-scoped-function'
Paolo Abeni [Tue, 3 Sep 2024 10:54:46 +0000 (12:54 +0200)]
Merge branch 'net-simplified-with-scoped-function'

Jinjie Ruan says:

====================
net: Simplified with scoped function

Simplify with scoped for each OF child loop, as well as dev_err_probe().

Changes in v4:
- Drop the fix patch and __free() patch.
- Rebased on the fix patch has been stripped out.
- Remove the extra parentheses.
- Ensure Signed-off-by: should always be last.
- Add Reviewed-by.
- Update the cover letter commit message.

Changes in v3:
- Sort the variables, longest first, shortest last.
- Add Reviewed-by.

Changes in v2:
- Subject prefix: next -> net-next.
- Split __free() from scoped for each OF child loop clean.
- Fix use of_node_put() instead of __free() for the 5th patch.
====================

Link: https://patch.msgid.link/20240830031325.2406672-1-ruanjinjie@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 weeks agonet: bcmasp: Simplify with scoped for each OF child loop
Jinjie Ruan [Fri, 30 Aug 2024 03:13:25 +0000 (11:13 +0800)]
net: bcmasp: Simplify with scoped for each OF child loop

Use scoped for_each_available_child_of_node_scoped() when
iterating over device nodes to make code a bit simpler.

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Justin Chen <justin.chen@broadcom.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 weeks agonet: dsa: microchip: Use scoped function to simplfy code
Jinjie Ruan [Fri, 30 Aug 2024 03:13:24 +0000 (11:13 +0800)]
net: dsa: microchip: Use scoped function to simplfy code

Avoids the need for manual cleanup of_node_put() in early exits
from the loop by using for_each_available_child_of_node_scoped().

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 weeks agonet: mv643xx_eth: Simplify with scoped for each OF child loop
Jinjie Ruan [Fri, 30 Aug 2024 03:13:23 +0000 (11:13 +0800)]
net: mv643xx_eth: Simplify with scoped for each OF child loop

Use scoped for_each_available_child_of_node_scoped() when iterating
over device nodes to make code a bit simpler.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 weeks agonet: mdio: mux-mmioreg: Simplified with dev_err_probe()
Jinjie Ruan [Fri, 30 Aug 2024 03:13:22 +0000 (11:13 +0800)]
net: mdio: mux-mmioreg: Simplified with dev_err_probe()

Use the dev_err_probe() helper to simplify code.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 weeks agonet: mdio: mux-mmioreg: Simplified with scoped function
Jinjie Ruan [Fri, 30 Aug 2024 03:13:21 +0000 (11:13 +0800)]
net: mdio: mux-mmioreg: Simplified with scoped function

Avoids the need for manual cleanup of_node_put() in early exits
from the loop by using for_each_available_child_of_node_scoped().

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 weeks agonet: phy: Use for_each_available_child_of_node_scoped()
Jinjie Ruan [Fri, 30 Aug 2024 03:13:20 +0000 (11:13 +0800)]
net: phy: Use for_each_available_child_of_node_scoped()

Avoid need to manually handle of_node_put() by using
for_each_available_child_of_node_scoped(), which can simplfy code.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 weeks agonet: dsa: realtek: Use for_each_child_of_node_scoped()
Jinjie Ruan [Fri, 30 Aug 2024 03:13:19 +0000 (11:13 +0800)]
net: dsa: realtek: Use for_each_child_of_node_scoped()

Avoid need to manually handle of_node_put() by using
for_each_child_of_node_scoped(), which can simplfy code.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 weeks agonet: stmmac: dwmac-sun8i: Use for_each_child_of_node_scoped()
Jinjie Ruan [Fri, 30 Aug 2024 03:13:18 +0000 (11:13 +0800)]
net: stmmac: dwmac-sun8i: Use for_each_child_of_node_scoped()

Avoid need to manually handle of_node_put() by using
for_each_child_of_node_scoped(), which can simplfy code.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 weeks agowifi: iwlwifi: mvm: properly set the rates in link cmd
Miri Korenblit [Sun, 1 Sep 2024 04:17:57 +0000 (07:17 +0300)]
wifi: iwlwifi: mvm: properly set the rates in link cmd

When a channel ctx is assigned to a link, we set the
LINK_CONTEXT_MODIFY_RATES_INFO to indicate that the rate fields are now
valid. But then we always take the rates of 2.4 GHz regardless of actual
used band.
This is because we are getting the band from bss_conf->chanctx_conf, but
this is assigned only after drv_assign_vif_chanctx returns, so we take
the bands of 2.4 GHz.
Fix it by taking the band from the iwl_mvm_link_info::phy_ctxt instead,
as this has already assigned in this point.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20240901071542.11c2d3609609.I8fa59e29b6bb38e5d06f3536d54dfb2c5d5bab11@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 weeks agowifi: iwlwifi: mvm: Remove unused last_sub_index from reorder buffer
Daniel Gabay [Sun, 1 Sep 2024 04:17:56 +0000 (07:17 +0300)]
wifi: iwlwifi: mvm: Remove unused last_sub_index from reorder buffer

The last_sub_index field is not used and appears to be a leftover
from a previous implementation, remove it.

Signed-off-by: Daniel Gabay <daniel.gabay@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20240901071542.da75cfef9144.I6e1fb635b2893618e6bd28501fb858042d8aa44e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 weeks agowifi: iwlwifi: mvm: remove mvm prefix from iwl_mvm_tx_resp*
Miri Korenblit [Sun, 1 Sep 2024 04:17:55 +0000 (07:17 +0300)]
wifi: iwlwifi: mvm: remove mvm prefix from iwl_mvm_tx_resp*

These are not mvm specific

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20240901071542.22e28b56da2c.Ib859a05ed133fa5a1426c5feffa8999a18bba6f2@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>