linux-2.6-microblaze.git
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 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 agoMerge branch 'netdev_features-start-cleaning-netdev_features_t-up'
Paolo Abeni [Tue, 3 Sep 2024 09:38:00 +0000 (11:38 +0200)]
Merge branch 'netdev_features-start-cleaning-netdev_features_t-up'

Alexander Lobakin says:

====================
netdev_features: start cleaning netdev_features_t up

NETDEV_FEATURE_COUNT is currently 64, which means we can't add any new
features as netdev_features_t is u64.
As per several discussions, instead of converting netdev_features_t to
a bitmap, which would mean A LOT of changes, we can try cleaning up
netdev feature bits.
There's a bunch of bits which don't really mean features, rather device
attributes/properties that can't be changed via Ethtool in any of the
drivers. Such attributes can be moved to netdev private flags without
losing any functionality.

Start converting some read-only netdev features to private flags from
the ones that are most obvious, like lockless Tx, inability to change
network namespace etc. I was able to reduce NETDEV_FEATURE_COUNT from
64 to 60, which mean 4 free slots for new features. There are obviously
more read-only features to convert, such as highDMA, "challenged VLAN",
HSR (4 bits) - this will be done in subsequent series.

Please note that currently netdev features are not uAPI/ABI by any means.
Ethtool passes their names and bits to the userspace separately and there
are no hardcoded names/bits in the userspace, so that new Ethtool could
work on older kernels and vice versa.
This, however, isn't true for Ethtools < 3.4. I haven't changed the bit
positions of the already existing features and instead replaced the freed
bits with stubs. But it's anyway theoretically possible that Ethtools
older than 2011 will break. I hope no currently supported distros supply
such an ancient version.
Shell scripts also most likely won't break since the removed bits were
always read-only, meaning nobody would try touching them from a script.
====================

Link: https://patch.msgid.link/20240829123340.789395-1-aleksander.lobakin@intel.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 weeks agonetdev_features: remove NETIF_F_ALL_FCOE
Alexander Lobakin [Thu, 29 Aug 2024 12:33:40 +0000 (14:33 +0200)]
netdev_features: remove NETIF_F_ALL_FCOE

NETIF_F_ALL_FCOE is used only in vlan_dev.c, 2 times. Now that it's only
2 bits, open-code it and remove the definition from netdev_features.h.

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 weeks agonetdev_features: convert NETIF_F_FCOE_MTU to dev->fcoe_mtu
Alexander Lobakin [Thu, 29 Aug 2024 12:33:39 +0000 (14:33 +0200)]
netdev_features: convert NETIF_F_FCOE_MTU to dev->fcoe_mtu

Ability to handle maximum FCoE frames of 2158 bytes can never be changed
and thus more of an attribute, not a toggleable feature.
Move it from netdev_features_t to "cold" priv flags (bitfield bool) and
free yet another feature bit.

Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 weeks agonetdev_features: convert NETIF_F_NETNS_LOCAL to dev->netns_local
Alexander Lobakin [Thu, 29 Aug 2024 12:33:38 +0000 (14:33 +0200)]
netdev_features: convert NETIF_F_NETNS_LOCAL to dev->netns_local

"Interface can't change network namespaces" is rather an attribute,
not a feature, and it can't be changed via Ethtool.
Make it a "cold" private flag instead of a netdev_feature and free
one more bit.

Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 weeks agonetdev_features: convert NETIF_F_LLTX to dev->lltx
Alexander Lobakin [Thu, 29 Aug 2024 12:33:37 +0000 (14:33 +0200)]
netdev_features: convert NETIF_F_LLTX to dev->lltx

NETIF_F_LLTX can't be changed via Ethtool and is not a feature,
rather an attribute, very similar to IFF_NO_QUEUE (and hot).
Free one netdev_features_t bit and make it a "hot" private flag.

Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 weeks agonetdevice: convert private flags > BIT(31) to bitfields
Alexander Lobakin [Thu, 29 Aug 2024 12:33:36 +0000 (14:33 +0200)]
netdevice: convert private flags > BIT(31) to bitfields

Make dev->priv_flags `u32` back and define bits higher than 31 as
bitfield booleans as per Jakub's suggestion. This simplifies code
which accesses these bits with no optimization loss (testb both
before/after), allows to not extend &netdev_priv_flags each time,
but also scales better as bits > 63 in the future would only add
a new u64 to the structure with no complications, comparing to
that extending ::priv_flags would require converting it to a bitmap.
Note that I picked `unsigned long :1` to not lose any potential
optimizations comparing to `bool :1` etc.

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 weeks agonet: dsa: vsc73xx: implement FDB operations
Pawel Dembicki [Tue, 27 Aug 2024 12:39:38 +0000 (14:39 +0200)]
net: dsa: vsc73xx: implement FDB operations

This commit introduces implementations of three functions:
.port_fdb_dump
.port_fdb_add
.port_fdb_del

The FDB database organization is the same as in other old Vitesse chips:
It has 2048 rows and 4 columns (buckets). The row index is calculated by
the hash function 'vsc73xx_calc_hash' and the FDB entry must be placed
exactly into row[hash]. The chip selects the bucket number by itself.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Link: https://patch.msgid.link/20240827123938.582789-1-paweldembicki@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
3 weeks agoMerge tag 'linux-can-next-for-6.12-20240830' of git://git.kernel.org/pub/scm/linux...
Jakub Kicinski [Tue, 3 Sep 2024 02:10:44 +0000 (19:10 -0700)]
Merge tag 'linux-can-next-for-6.12-20240830' of git://git./linux/kernel/git/mkl/linux-can-next

Marc Kleine-Budde says:

====================
pull-request: can-next 2024-08-30

The first patch is by Duy Nguyen and document the R-Car V4M support in
the rcar-canfd DT bindings.

Frank Li's patch converts the microchip,mcp251x.txt DT bindings
documentation to yaml.

A patch by Zhang Changzhong update a comment in the j1939 CAN
networking stack.

Stefan Mätje's patch updates the CAN configuration netlink code, so
that the bit timing calculation doesn't work on stale
can_priv::ctrlmode data.

Martin Jocic contributes a patch for the kvaser_pciefd driver to
convert some ifdefs into if (IS_ENABLED()).

The last patch is by Yan Zhen and simplifies the probe() function of
the kvaser USB driver by using dev_err_probe().

* tag 'linux-can-next-for-6.12-20240830' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next:
  can: kvaser_usb: Simplify with dev_err_probe()
  can: kvaser_pciefd: Use IS_ENABLED() instead of #ifdef
  can: netlink: avoid call to do_set_data_bittiming callback with stale can_priv::ctrlmode
  can: j1939: use correct function name in comment
  dt-bindings: can: convert microchip,mcp251x.txt to yaml
  dt-bindings: can: renesas,rcar-canfd: Document R-Car V4M support
====================

Link: https://patch.msgid.link/20240830214406.1605786-1-mkl@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
3 weeks agor8169: add support for RTL8126A rev.b
ChunHao Lin [Fri, 30 Aug 2024 02:18:10 +0000 (10:18 +0800)]
r8169: add support for RTL8126A rev.b

Add support for RTL8126A rev.b. Its XID is 0x64a. It is basically
based on the one with XID 0x649, but with different firmware file.

Signed-off-by: ChunHao Lin <hau@realtek.com>
Reviewed-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://patch.msgid.link/20240830021810.11993-1-hau@realtek.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
3 weeks agonetdev-genl: Set extack and fix error on napi-get
Joe Damato [Sat, 31 Aug 2024 12:17:04 +0000 (12:17 +0000)]
netdev-genl: Set extack and fix error on napi-get

In commit 27f91aaf49b3 ("netdev-genl: Add netlink framework functions
for napi"), when an invalid NAPI ID is specified the return value
-EINVAL is used and no extack is set.

Change the return value to -ENOENT and set the extack.

Before this commit:

$ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \
                          --do napi-get --json='{"id": 451}'
Netlink error: Invalid argument
nl_len = 36 (20) nl_flags = 0x100 nl_type = 2
error: -22

After this commit:

$ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \
                         --do napi-get --json='{"id": 451}'
Netlink error: No such file or directory
nl_len = 44 (28) nl_flags = 0x300 nl_type = 2
error: -2
extack: {'bad-attr': '.id'}

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Joe Damato <jdamato@fastly.com>
Link: https://patch.msgid.link/20240831121707.17562-1-jdamato@fastly.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
3 weeks agonet: stmmac: drop the ethtool begin() callback
Andrew Halaney [Thu, 29 Aug 2024 20:48:44 +0000 (15:48 -0500)]
net: stmmac: drop the ethtool begin() callback

This callback doesn't seem to serve much purpose, and prevents things
like:

    - systemd.link files from disabling autonegotiation
    - carrier detection in NetworkManager
    - any ethtool setting

prior to userspace bringing the link up.

The only fear I can think of is accessing unclocked resources due to
pm_runtime, but ethtool ioctls handle that as of commit
f32a21376573 ("ethtool: runtime-resume netdev parent before ethtool ioctl ops")

Reviewed-by: Dmitry Dolenko <d.dolenko@metrotek.ru>
Tested-by: Dmitry Dolenko <d.dolenko@metrotek.ru>
Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 weeks agoMerge branch 'octeontx2-af-cpt-update'
David S. Miller [Sun, 1 Sep 2024 17:17:34 +0000 (18:17 +0100)]
Merge branch 'octeontx2-af-cpt-update'

Srujana Challa says:

====================
octeontx2-af: update CPT block for CN10KB and CN10KA B0

This commit addresses two key updates for the CN10KB and CN10KA B0:

1. The number of FLT interrupt vectors has been reduced to 2 on CN10KB.
The code is updated to reflect this change across the CN10K series.
2. The maximum CPT credits that RX can use are now configurable through
a hardware CSR on CN10KA B0. This patch sets the default value to optimize
peak performance, aligning it with other chip versions.

v2:
- Addressed the review comments.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 weeks agoocteontx2-af: configure default CPT credits for CN10KA B0
Srujana Challa [Thu, 29 Aug 2024 08:09:35 +0000 (13:39 +0530)]
octeontx2-af: configure default CPT credits for CN10KA B0

The maximum CPT credits that RXC can use are now configurable on CN10KA B0
through a hardware CSR. This patch sets the default value to optimize peak
performance, aligning it with other chip versions.

Signed-off-by: Srujana Challa <schalla@marvell.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 weeks agoocteontx2-af: avoid RXC register access for CN10KB
Srujana Challa [Thu, 29 Aug 2024 08:09:34 +0000 (13:39 +0530)]
octeontx2-af: avoid RXC register access for CN10KB

This patch modifies the driver to prevent access to RXC hardware
registers on the CN10KB, as RXC is not available on this chip.

Signed-off-by: Srujana Challa <schalla@marvell.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 weeks agoocteontx2-af: use dynamic interrupt vectors for CN10K
Srujana Challa [Thu, 29 Aug 2024 08:09:33 +0000 (13:39 +0530)]
octeontx2-af: use dynamic interrupt vectors for CN10K

This patch updates the driver to use a dynamic number of vectors instead
of a hard-coded value. This change accommodates the CN10KB, which has 2
vectors, unlike the previously supported chips that have 3 vectors.

Signed-off-by: Srujana Challa <schalla@marvell.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 weeks agoMerge branch 'unmask-dscp-bits'
David S. Miller [Sat, 31 Aug 2024 16:44:52 +0000 (17:44 +0100)]
Merge branch 'unmask-dscp-bits'

Ido Schimmel says:

====================
Unmask upper DSCP bits - part 2

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. Part 1 was merged in commit
("Merge branch 'unmask-upper-dscp-bits-part-1'").

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.

Patches #1-#3 unmask the upper DSCP bits in the various places that
invoke the core output route lookup functions directly.

Patches #4-#6 do the same in three helpers that are widely used in the
output path to initialize the TOS field in the IPv4 flow key.

The rest of the patches continue to unmask these bits in call sites that
invoke the following wrappers around the core lookup functions:

Patch #7 - __ip_route_output_key()
Patches #8-#12 - ip_route_output_flow()

The next patchset will handle the callers of ip_route_output_ports() and
ip_route_output_key().

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.

Changes since v1 [1]:

* Remove IPTOS_RT_MASK in patch #7 instead of in patch #6

[1] https://lore.kernel.org/netdev/20240827111813.2115285-1-idosch@nvidia.com/
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 weeks agobpf: Unmask upper DSCP bits in __bpf_redirect_neigh_v4()
Ido Schimmel [Thu, 29 Aug 2024 06:54:59 +0000 (09:54 +0300)]
bpf: Unmask upper DSCP bits in __bpf_redirect_neigh_v4()

Unmask the upper DSCP bits when calling ip_route_output_flow() 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>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 weeks agovrf: Unmask upper DSCP bits in vrf_process_v4_outbound()
Ido Schimmel [Thu, 29 Aug 2024 06:54:58 +0000 (09:54 +0300)]
vrf: Unmask upper DSCP bits in vrf_process_v4_outbound()

Unmask the upper DSCP bits when calling ip_route_output_flow() 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>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 weeks agoipvlan: Unmask upper DSCP bits in ipvlan_process_v4_outbound()
Ido Schimmel [Thu, 29 Aug 2024 06:54:57 +0000 (09:54 +0300)]
ipvlan: Unmask upper DSCP bits in ipvlan_process_v4_outbound()

Unmask the upper DSCP bits when calling ip_route_output_flow() 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>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 weeks agoipv6: sit: Unmask upper DSCP bits in ipip6_tunnel_xmit()
Ido Schimmel [Thu, 29 Aug 2024 06:54:56 +0000 (09:54 +0300)]
ipv6: sit: Unmask upper DSCP bits in ipip6_tunnel_xmit()

The function calls flowi4_init_output() to initialize an IPv4 flow key
with which it then performs a FIB lookup using ip_route_output_flow().

The 'tos' variable with which the TOS value in the IPv4 flow key
(flowi4_tos) is initialized contains the full DS field. Unmask the upper
DSCP bits so that in the future the FIB lookup could be performed
according to the full DSCP value.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 weeks agoipv4: Unmask upper DSCP bits in ip_send_unicast_reply()
Ido Schimmel [Thu, 29 Aug 2024 06:54:55 +0000 (09:54 +0300)]
ipv4: Unmask upper DSCP bits in ip_send_unicast_reply()

The function calls flowi4_init_output() to initialize an IPv4 flow key
with which it then performs a FIB lookup using ip_route_output_flow().

'arg->tos' with which the TOS value in the IPv4 flow key (flowi4_tos) is
initialized contains the full DS field. Unmask the upper DSCP bits so
that in the future the FIB lookup could be performed according to the
full DSCP value.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 weeks agoxfrm: Unmask upper DSCP bits in xfrm_get_tos()
Ido Schimmel [Thu, 29 Aug 2024 06:54:54 +0000 (09:54 +0300)]
xfrm: Unmask upper DSCP bits in xfrm_get_tos()

The function returns a value that is used to initialize 'flowi4_tos'
before being passed to the FIB lookup API in the following call chain:

xfrm_bundle_create()
tos = xfrm_get_tos(fl, family)
xfrm_dst_lookup(..., tos, ...)
__xfrm_dst_lookup(..., tos, ...)
xfrm4_dst_lookup(..., tos, ...)
__xfrm4_dst_lookup(..., tos, ...)
fl4->flowi4_tos = tos
__ip_route_output_key(net, fl4)

Unmask the upper DSCP bits so that in the future the output route lookup
could be performed according to the full DSCP value.

Remove IPTOS_RT_MASK since it is no longer used.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 weeks agoipv4: Unmask upper DSCP bits when building flow key
Ido Schimmel [Thu, 29 Aug 2024 06:54:53 +0000 (09:54 +0300)]
ipv4: Unmask upper DSCP bits when building flow key

build_sk_flow_key() and __build_flow_key() are used to build an IPv4
flow key before calling one of the FIB lookup APIs.

Unmask the upper DSCP bits so that in the future the lookup could be
performed according to the full DSCP value.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 weeks agoipv4: Unmask upper DSCP bits in get_rttos()
Ido Schimmel [Thu, 29 Aug 2024 06:54:52 +0000 (09:54 +0300)]
ipv4: Unmask upper DSCP bits in get_rttos()

The function is used by a few socket types to retrieve the TOS value
with which to perform the FIB lookup for packets sent through the socket
(flowi4_tos). If a DS field was passed using the IP_TOS control message,
then it is used. Otherwise the one specified via the IP_TOS socket
option.

Unmask the upper DSCP bits so that in the future the lookup could be
performed according to the full DSCP value.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 weeks agoipv4: Unmask upper DSCP bits in ip_sock_rt_tos()
Ido Schimmel [Thu, 29 Aug 2024 06:54:51 +0000 (09:54 +0300)]
ipv4: Unmask upper DSCP bits in ip_sock_rt_tos()

The function is used to read the DS field that was stored in IPv4
sockets via the IP_TOS socket option so that it could be used to
initialize the flowi4_tos field before resolving an output route.

Unmask the upper DSCP bits so that in the future the output route lookup
could be performed according to the full DSCP value.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 weeks agoipv4: icmp: Unmask upper DSCP bits in icmp_route_lookup()
Ido Schimmel [Thu, 29 Aug 2024 06:54:50 +0000 (09:54 +0300)]
ipv4: icmp: Unmask upper DSCP bits in icmp_route_lookup()

The function is called to resolve a route for an ICMP message that is
sent in response to a situation. Based on the type of the generated ICMP
message, the function is either passed the DS field of the packet that
generated the ICMP message or a DS field that is derived from it.

Unmask the upper DSCP bits before resolving and output route via
ip_route_output_key_hash() so that in the future the lookup could be
performed according to the full DSCP value.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 weeks agoipv4: Unmask upper DSCP bits in ip_route_output_key_hash()
Ido Schimmel [Thu, 29 Aug 2024 06:54:49 +0000 (09:54 +0300)]
ipv4: Unmask upper DSCP bits in ip_route_output_key_hash()

Unmask the upper DSCP bits so that in the future output routes could be
looked up according to the full DSCP value.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 weeks agoipv4: Unmask upper DSCP bits in RTM_GETROUTE output route lookup
Ido Schimmel [Thu, 29 Aug 2024 06:54:48 +0000 (09:54 +0300)]
ipv4: Unmask upper DSCP bits in RTM_GETROUTE output route lookup

Unmask the upper DSCP bits when looking up an output route via the
RTM_GETROUTE netlink message so that in the future the lookup could be
performed according to the full DSCP value.

No functional changes intended since the upper DSCP bits are masked when
comparing against the TOS selectors in FIB rules and routes.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 weeks agocan: kvaser_usb: Simplify with dev_err_probe()
Yan Zhen [Fri, 30 Aug 2024 11:06:51 +0000 (19:06 +0800)]
can: kvaser_usb: Simplify with dev_err_probe()

dev_err_probe() is used to log an error message during the probe process
of a device.

It can simplify the error path and unify a message template.

Using this helper is totally fine even if err is known to never
be -EPROBE_DEFER.

The benefit compared to a normal dev_err() is the standardized format
of the error code, it being emitted symbolically and the fact that
the error code is returned which allows more compact error paths.

Signed-off-by: Yan Zhen <yanzhen@vivo.com>
Link: https://patch.msgid.link/20240830110651.519119-1-yanzhen@vivo.com
mkl: fix indention
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
3 weeks agocan: kvaser_pciefd: Use IS_ENABLED() instead of #ifdef
Martin Jocic [Thu, 22 Aug 2024 16:38:59 +0000 (18:38 +0200)]
can: kvaser_pciefd: Use IS_ENABLED() instead of #ifdef

Use the IS_ENABLED() macro to check kernel config defines instead of
ifdef. Use upper_32_bits() to avoid warnings about "right shift count
>= width of type" on systems with CONFIG_ARCH_DMA_ADDR_T_64BIT not
set. In kvaser_pciefd_write_dma_map_altera() use lower_32_bits() for
symmetry.

Signed-off-by: Martin Jocic <martin.jocic@kvaser.com>
Link: https://patch.msgid.link/20240830141038.1402217-1-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
3 weeks agocan: netlink: avoid call to do_set_data_bittiming callback with stale can_priv::ctrlmode
Stefan Mätje [Thu, 8 Aug 2024 16:42:24 +0000 (18:42 +0200)]
can: netlink: avoid call to do_set_data_bittiming callback with stale can_priv::ctrlmode

This patch moves the evaluation of data[IFLA_CAN_CTRLMODE] in function
can_changelink in front of the evaluation of data[IFLA_CAN_BITTIMING].

This avoids a call to do_set_data_bittiming providing a stale
can_priv::ctrlmode with a CAN_CTRLMODE_FD flag not matching the
requested state when switching between a CAN Classic and CAN-FD bitrate.

In the same manner the evaluation of data[IFLA_CAN_CTRLMODE] in function
can_validate is also moved in front of the evaluation of
data[IFLA_CAN_BITTIMING].

This is a preparation for patches where the nominal and data bittiming
may have interdependencies on the driver side depending on the
CAN_CTRLMODE_FD flag state.

Signed-off-by: Stefan Mätje <stefan.maetje@esd.eu>
Link: https://patch.msgid.link/20240808164224.213522-1-stefan.maetje@esd.eu
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
3 weeks agocan: j1939: use correct function name in comment
Zhang Changzhong [Thu, 29 Aug 2024 12:48:23 +0000 (20:48 +0800)]
can: j1939: use correct function name in comment

The function j1939_cancel_all_active_sessions() was renamed to
j1939_cancel_active_session() but name in comment wasn't updated.

Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
Link: https://patch.msgid.link/1724935703-44621-1-git-send-email-zhangchangzhong@huawei.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
3 weeks agodt-bindings: can: convert microchip,mcp251x.txt to yaml
Frank Li [Wed, 14 Aug 2024 16:44:06 +0000 (12:44 -0400)]
dt-bindings: can: convert microchip,mcp251x.txt to yaml

Convert binding doc microchip,mcp251x.txt to yaml.
Additional change:
- add ref to spi-peripheral-props.yaml

Fix below warning:
arch/arm64/boot/dts/freescale/imx8dx-colibri-eval-v3.dtb: /bus@5a000000/spi@5a020000/can@0:
failed to match any schema with compatible: ['microchip,mcp2515']

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://patch.msgid.link/20240814164407.4022211-1-Frank.Li@nxp.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
3 weeks agodt-bindings: can: renesas,rcar-canfd: Document R-Car V4M support
Duy Nguyen [Thu, 1 Aug 2024 14:03:17 +0000 (16:03 +0200)]
dt-bindings: can: renesas,rcar-canfd: Document R-Car V4M support

Document support for the CAN-FD Interface on the Renesas R-Car V4M
(R8A779H0) SoC, which supports up to four channels.

The CAN-FD module on R-Car V4M is very similar to the one on R-Car V4H,
but differs in some hardware parameters, as reflected by the Parameter
Status Information part of the Global IP Version Register.  However,
none of this parameterization should have any impact on the driver, as
the driver does not access any register that is impacted by the
parameterization (except for the number of channels).

Signed-off-by: Duy Nguyen <duy.nguyen.rh@renesas.com>
[geert: Clarify R-Car V4M differences]
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms@kernel.org>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/68b5f910bef89508e3455c768844ebe859d6ff1d.1722520779.git.geert+renesas@glider.be
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
3 weeks agoieee802154: Correct spelling in nl802154.h
Simon Horman [Thu, 29 Aug 2024 16:10:50 +0000 (17:10 +0100)]
ieee802154: Correct spelling in nl802154.h

Correct spelling in nl802154.h.
As reported by codespell.

Signed-off-by: Simon Horman <horms@kernel.org>
Message-ID: <20240829-wpan-spell-v1-2-799d840e02c4@kernel.org>
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
3 weeks agomac802154: Correct spelling in mac802154.h
Simon Horman [Thu, 29 Aug 2024 16:10:49 +0000 (17:10 +0100)]
mac802154: Correct spelling in mac802154.h

Correct spelling in mac802154.h.
As reported by codespell.

Signed-off-by: Simon Horman <horms@kernel.org>
Message-ID: <20240829-wpan-spell-v1-1-799d840e02c4@kernel.org>
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
3 weeks agoi40e: Add Energy Efficient Ethernet ability for X710 Base-T/KR/KX cards
Aleksandr Loktionov [Mon, 19 Aug 2024 09:27:56 +0000 (11:27 +0200)]
i40e: Add Energy Efficient Ethernet ability for X710 Base-T/KR/KX cards

Add "EEE: Enabled/Disabled" to dmesg for supported X710 Base-T/KR/KX
cards. According to the IEEE standard report the EEE ability and the
EEE Link Partner ability. Use the kernel's 'ethtool_keee' structure
and report EEE link modes.

Example:
dmesg | grep 'NIC Link is'
ethtool --show-eee <device>

Before:
NIC Link is Up, 10 Gbps Full Duplex, Flow Control: None

        Supported EEE link modes:  Not reported
        Advertised EEE link modes:  Not reported
        Link partner advertised EEE link modes:  Not reported

After:
NIC Link is Up, 10 Gbps Full Duplex, Flow Control: None, EEE: Enabled

        Supported EEE link modes:  100baseT/Full
                                   1000baseT/Full
                                   10000baseT/Full
        Advertised EEE link modes:  100baseT/Full
                                    1000baseT/Full
                                    10000baseT/Full
        Link partner advertised EEE link modes:  100baseT/Full
                                                 1000baseT/Full
                                                 10000baseT/Full

Reviewed-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>