Skip to content
  1. Feb 03, 2023
  2. Feb 02, 2023
    • Bo Liu's avatar
      net: dsa: Use sysfs_emit() to instead of sprintf() · b18ea3d9
      Bo Liu authored
      
      
      Follow the advice of the Documentation/filesystems/sysfs.rst and show()
      should only use sysfs_emit() or sysfs_emit_at() when formatting the
      value to be returned to user space.
      
      Signed-off-by: default avatarBo Liu <liubo03@inspur.com>
      Link: https://lore.kernel.org/r/20230201081438.3151-1-liubo03@inspur.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      b18ea3d9
    • Paolo Abeni's avatar
      Merge branch 'amd-xgbe-add-support-for-2-5gbe-and-rx-adaptation' · 886d2278
      Paolo Abeni authored
      Raju Rangoju says:
      
      ====================
      amd-xgbe: add support for 2.5GbE and rx-adaptation
      
      This patch series adds support for 2.GbE in 10GBaseT mode and
      rx-adaptation support for Yellow Carp devices.
      
      1) Support for 2.5GbE:
         Add the necessary changes to the driver to fully recognize and enable
         2.5GbE speed in 10GBaseT mode.
      
      2) Support for rx-adaptation:
         In order to support the 10G backplane mode without Auto-negotiation
         and to support the longer-length DAC cables, it requires PHY to
         perform RX Adaptation sequence as mentioned in the Synopsys databook.
         Add the necessary changes to Yellow Carp devices to ensure seamless
         RX Adaptation for 10G-SFI (LONG DAC), and 10G-KR modes without
         Auto-Negotiation (CL72 not present)
      ====================
      
      Link: https://lore.kernel.org/r/20230201054932.212700-1-Raju.Rangoju@amd.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      886d2278
    • Raju Rangoju's avatar
      amd-xgbe: add support for rx-adaptation · 4f3b20bf
      Raju Rangoju authored
      
      
      The existing implementation for non-Autonegotiation 10G speed modes does
      not enable RX adaptation in the Driver and FW. The RX Equalization
      settings (AFE settings alone) are manually configured and the existing
      link-up sequence in the driver does not perform rx adaptation process as
      mentioned in the Synopsys databook. There's a customer request for 10G
      backplane mode without Auto-negotiation and for the DAC cables of more
      significant length that follow the non-Autonegotiation mode. These modes
      require PHY to perform RX Adaptation.
      
      The proposed logic adds the necessary changes to Yellow Carp devices to
      ensure seamless RX Adaptation for 10G-SFI (LONG DAC) and 10G-KR without
      AN (CL72 not present). The RX adaptation core algorithm is executed by
      firmware, however, to achieve that a new mailbox sub-command is required
      to be sent by the driver.
      
      Co-developed-by: default avatarShyam Sundar S K <Shyam-sundar.S-k@amd.com>
      Signed-off-by: default avatarShyam Sundar S K <Shyam-sundar.S-k@amd.com>
      Signed-off-by: default avatarRaju Rangoju <Raju.Rangoju@amd.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      4f3b20bf
    • Raju Rangoju's avatar
      amd-xgbe: add 2.5GbE support to 10G BaseT mode · 3ee217c4
      Raju Rangoju authored
      
      
      Add support to the driver to fully recognize and enable 2.5GbE speed in
      10GBaseT mode.
      
      Acked-by: default avatarShyam Sundar S K <Shyam-sundar.S-k@amd.com>
      Signed-off-by: default avatarRaju Rangoju <Raju.Rangoju@amd.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      3ee217c4
    • Andrei Gherzan's avatar
      selftests: net: udpgso_bench_tx: Cater for pending datagrams zerocopy benchmarking · 329c9cd7
      Andrei Gherzan authored
      The test tool can check that the zerocopy number of completions value is
      valid taking into consideration the number of datagram send calls. This can
      catch the system into a state where the datagrams are still in the system
      (for example in a qdisk, waiting for the network interface to return a
      completion notification, etc).
      
      This change adds a retry logic of computing the number of completions up to
      a configurable (via CLI) timeout (default: 2 seconds).
      
      Fixes: 79ebc3c2
      
       ("net/udpgso_bench_tx: options to exercise TX CMSG")
      Signed-off-by: default avatarAndrei Gherzan <andrei.gherzan@canonical.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Cc: Paolo Abeni <pabeni@redhat.com>
      Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
      Link: https://lore.kernel.org/r/20230201001612.515730-4-andrei.gherzan@canonical.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      329c9cd7
    • Andrei Gherzan's avatar
      selftests: net: udpgso_bench: Fix racing bug between the rx/tx programs · dafe93b9
      Andrei Gherzan authored
      "udpgro_bench.sh" invokes udpgso_bench_rx/udpgso_bench_tx programs
      subsequently and while doing so, there is a chance that the rx one is not
      ready to accept socket connections. This racing bug could fail the test
      with at least one of the following:
      
      ./udpgso_bench_tx: connect: Connection refused
      ./udpgso_bench_tx: sendmsg: Connection refused
      ./udpgso_bench_tx: write: Connection refused
      
      This change addresses this by making udpgro_bench.sh wait for the rx
      program to be ready before firing off the tx one - up to a 10s timeout.
      
      Fixes: 3a687bef
      
       ("selftests: udp gso benchmark")
      Signed-off-by: default avatarAndrei Gherzan <andrei.gherzan@canonical.com>
      Cc: Paolo Abeni <pabeni@redhat.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
      Link: https://lore.kernel.org/r/20230201001612.515730-3-andrei.gherzan@canonical.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      dafe93b9
    • Andrei Gherzan's avatar
      selftests: net: udpgso_bench_rx/tx: Stop when wrong CLI args are provided · db9b47ee
      Andrei Gherzan authored
      Leaving unrecognized arguments buried in the output, can easily hide a
      CLI/script typo. Avoid this by exiting when wrong arguments are provided to
      the udpgso_bench test programs.
      
      Fixes: 3a687bef
      
       ("selftests: udp gso benchmark")
      Signed-off-by: default avatarAndrei Gherzan <andrei.gherzan@canonical.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
      Link: https://lore.kernel.org/r/20230201001612.515730-2-andrei.gherzan@canonical.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      db9b47ee
    • Andrei Gherzan's avatar
      selftests: net: udpgso_bench_rx: Fix 'used uninitialized' compiler warning · c03c80e3
      Andrei Gherzan authored
      This change fixes the following compiler warning:
      
      /usr/include/x86_64-linux-gnu/bits/error.h:40:5: warning: ‘gso_size’ may
      be used uninitialized [-Wmaybe-uninitialized]
         40 |     __error_noreturn (__status, __errnum, __format,
         __va_arg_pack ());
               |
      	 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      	 udpgso_bench_rx.c: In function ‘main’:
      	 udpgso_bench_rx.c:253:23: note: ‘gso_size’ was declared here
      	   253 |         int ret, len, gso_size, budget = 256;
      
      Fixes: 3327a9c4
      
       ("selftests: add functionals test for UDP GRO")
      Signed-off-by: default avatarAndrei Gherzan <andrei.gherzan@canonical.com>
      Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
      Link: https://lore.kernel.org/r/20230201001612.515730-1-andrei.gherzan@canonical.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      c03c80e3
    • Paolo Abeni's avatar
      Merge branch 'net-sched-transition-act_pedit-to-rcu-and-percpu-stats' · 8b6f322e
      Paolo Abeni authored
      Pedro Tammela says:
      
      ====================
      net/sched: transition act_pedit to rcu and percpu stats
      
      The software pedit action didn't get the same love as some of the
      other actions and it's still using spinlocks and shared stats.
      Therefore, transition the action to rcu and percpu stats which
      improves the action's performance.
      
      We test this change with a very simple packet forwarding setup:
      
      tc filter add dev ens2f0 ingress protocol ip matchall \
         action pedit ex munge eth src set b8:ce:f6:4b:68:35 pipe \
         action pedit ex munge eth dst set ac:1f:6b:e4:ff:93 pipe \
         action mirred egress redirect dev ens2f1
      tc filter add dev ens2f1 ingress protocol ip matchall \
         action pedit ex munge eth src set b8:ce:f6:4b:68:34 pipe \
         action pedit ex munge eth dst set ac:1f:6b:e4:ff:92 pipe \
         action mirred egress redirect dev ens2f0
      
      Using TRex with a http-like profile, in our setup with a 25G NIC
      and a 26 cores Intel CPU, we observe the following in perf:
         before:
          11.59%  2.30%  [kernel]  [k] tcf_pedit_act
             2.55% tcf_pedit_act
                   8.38% _raw_spin_lock
                             6.43% native_queued_spin_lock_slowpath
         after:
          1.46%  1.46%  [kernel]  [k] tcf_pedit_act
      
      tdc results for pedit after the patch:
      1..69
      ok 1 319a - Add pedit action that mangles IP TTL
      ok 2 7e67 - Replace pedit action with invalid goto chain
      ok 3 377e - Add pedit action with RAW_OP offset u32
      ok 4 a0ca - Add pedit action with RAW_OP offset u32 (INVALID)
      ok 5 dd8a - Add pedit action with RAW_OP offset u16 u16
      ok 6 53db - Add pedit action with RAW_OP offset u16 (INVALID)
      ok 7 5c7e - Add pedit action with RAW_OP offset u8 add value
      ok 8 2893 - Add pedit action with RAW_OP offset u8 quad
      ok 9 3a07 - Add pedit action with RAW_OP offset u8-u16-u8
      ok 10 ab0f - Add pedit action with RAW_OP offset u16-u8-u8
      ok 11 9d12 - Add pedit action with RAW_OP offset u32 set u16 clear u8 invert
      ok 12 ebfa - Add pedit action with RAW_OP offset overflow u32 (INVALID)
      ok 13 f512 - Add pedit action with RAW_OP offset u16 at offmask shift set
      ok 14 c2cb - Add pedit action with RAW_OP offset u32 retain value
      ok 15 1762 - Add pedit action with RAW_OP offset u8 clear value
      ok 16 bcee - Add pedit action with RAW_OP offset u8 retain value
      ok 17 e89f - Add pedit action with RAW_OP offset u16 retain value
      ok 18 c282 - Add pedit action with RAW_OP offset u32 clear value
      ok 19 c422 - Add pedit action with RAW_OP offset u16 invert value
      ok 20 d3d3 - Add pedit action with RAW_OP offset u32 invert value
      ok 21 57e5 - Add pedit action with RAW_OP offset u8 preserve value
      ok 22 99e0 - Add pedit action with RAW_OP offset u16 preserve value
      ok 23 1892 - Add pedit action with RAW_OP offset u32 preserve value
      ok 24 4b60 - Add pedit action with RAW_OP negative offset u16/u32 set value
      ok 25 a5a7 - Add pedit action with LAYERED_OP eth set src
      ok 26 86d4 - Add pedit action with LAYERED_OP eth set src & dst
      ok 27 f8a9 - Add pedit action with LAYERED_OP eth set dst
      ok 28 c715 - Add pedit action with LAYERED_OP eth set src (INVALID)
      ok 29 8131 - Add pedit action with LAYERED_OP eth set dst (INVALID)
      ok 30 ba22 - Add pedit action with LAYERED_OP eth type set/clear sequence
      ok 31 dec4 - Add pedit action with LAYERED_OP eth set type (INVALID)
      ok 32 ab06 - Add pedit action with LAYERED_OP eth add type
      ok 33 918d - Add pedit action with LAYERED_OP eth invert src
      ok 34 a8d4 - Add pedit action with LAYERED_OP eth invert dst
      ok 35 ee13 - Add pedit action with LAYERED_OP eth invert type
      ok 36 7588 - Add pedit action with LAYERED_OP ip set src
      ok 37 0fa7 - Add pedit action with LAYERED_OP ip set dst
      ok 38 5810 - Add pedit action with LAYERED_OP ip set src & dst
      ok 39 1092 - Add pedit action with LAYERED_OP ip set ihl & dsfield
      ok 40 02d8 - Add pedit action with LAYERED_OP ip set ttl & protocol
      ok 41 3e2d - Add pedit action with LAYERED_OP ip set ttl (INVALID)
      ok 42 31ae - Add pedit action with LAYERED_OP ip ttl clear/set
      ok 43 486f - Add pedit action with LAYERED_OP ip set duplicate fields
      ok 44 e790 - Add pedit action with LAYERED_OP ip set ce, df, mf, firstfrag, nofrag fields
      ok 45 cc8a - Add pedit action with LAYERED_OP ip set tos
      ok 46 7a17 - Add pedit action with LAYERED_OP ip set precedence
      ok 47 c3b6 - Add pedit action with LAYERED_OP ip add tos
      ok 48 43d3 - Add pedit action with LAYERED_OP ip add precedence
      ok 49 438e - Add pedit action with LAYERED_OP ip clear tos
      ok 50 6b1b - Add pedit action with LAYERED_OP ip clear precedence
      ok 51 824a - Add pedit action with LAYERED_OP ip invert tos
      ok 52 106f - Add pedit action with LAYERED_OP ip invert precedence
      ok 53 6829 - Add pedit action with LAYERED_OP beyond ip set dport & sport
      ok 54 afd8 - Add pedit action with LAYERED_OP beyond ip set icmp_type & icmp_code
      ok 55 3143 - Add pedit action with LAYERED_OP beyond ip set dport (INVALID)
      ok 56 815c - Add pedit action with LAYERED_OP ip6 set src
      ok 57 4dae - Add pedit action with LAYERED_OP ip6 set dst
      ok 58 fc1f - Add pedit action with LAYERED_OP ip6 set src & dst
      ok 59 6d34 - Add pedit action with LAYERED_OP ip6 dst retain value (INVALID)
      ok 60 94bb - Add pedit action with LAYERED_OP ip6 traffic_class
      ok 61 6f5e - Add pedit action with LAYERED_OP ip6 flow_lbl
      ok 62 6795 - Add pedit action with LAYERED_OP ip6 set payload_len, nexthdr, hoplimit
      ok 63 1442 - Add pedit action with LAYERED_OP tcp set dport & sport
      ok 64 b7ac - Add pedit action with LAYERED_OP tcp sport set (INVALID)
      ok 65 cfcc - Add pedit action with LAYERED_OP tcp flags set
      ok 66 3bc4 - Add pedit action with LAYERED_OP tcp set dport, sport & flags fields
      ok 67 f1c8 - Add pedit action with LAYERED_OP udp set dport & sport
      ok 68 d784 - Add pedit action with mixed RAW/LAYERED_OP #1
      ok 69 70ca - Add pedit action with mixed RAW/LAYERED_OP #2
      ====================
      
      Link: https://lore.kernel.org/r/20230131190512.3805897-1-pctammela@mojatatu.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      8b6f322e
    • Pedro Tammela's avatar
      net/sched: simplify tcf_pedit_act · 95b06938
      Pedro Tammela authored
      
      
      Remove the check for a negative number of keys as
      this cannot ever happen
      
      Reviewed-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Signed-off-by: default avatarPedro Tammela <pctammela@mojatatu.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      95b06938
    • Pedro Tammela's avatar
      net/sched: transition act_pedit to rcu and percpu stats · 52cf89f7
      Pedro Tammela authored
      
      
      The software pedit action didn't get the same love as some of the
      other actions and it's still using spinlocks and shared stats in the
      datapath.
      Transition the action to rcu and percpu stats as this improves the
      action's performance dramatically on multiple cpu deployments.
      
      Reviewed-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarPedro Tammela <pctammela@mojatatu.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      52cf89f7
    • Paolo Abeni's avatar
      Merge tag 'rxrpc-next-20230131' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs · a8248fc4
      Paolo Abeni authored
      David Howells says:
      
      ====================
      Here's the fifth part of patches in the process of moving rxrpc from doing
      a lot of its stuff in softirq context to doing it in an I/O thread in
      process context and thereby making it easier to support a larger SACK
      table.
      
      The full description is in the description for the first part[1] which is
      now upstream.  The second and third parts are also upstream[2].  A subset
      of the original fourth part[3] got applied as a fix for a race[4].
      
      The fifth part includes some cleanups:
      
       (1) Miscellaneous trace header cleanups: fix a trace string, display the
           security index in rx_packet rather than displaying the type twice,
           remove some whitespace to make checkpatch happier and remove some
           excess tabulation.
      
       (2) Convert ->recvmsg_lock to a spinlock as it's only ever locked
           exclusively.
      
       (3) Make ->ackr_window and ->ackr_nr_unacked non-atomic as they're only
           used in the I/O thread.
      
       (4) Don't use call->tx_lock to access ->tx_buffer as that is only accessed
           inside the I/O thread.  sendmsg() loads onto ->tx_sendmsg and the I/O
           thread decants from that to the buffer.
      
       (5) Remove local->defrag_sem as DATA packets are transmitted serially by
           the I/O thread.
      
       (6) Remove the service connection bundle is it was only used for its
           channel_lock - which has now gone.
      
      And some more significant changes:
      
       (7) Add a debugging option to allow a delay to be injected into packet
           reception to help investigate the behaviour over longer links than
           just a few cm.
      
       (8) Generate occasional PING ACKs to probe for RTT information during a
           receive heavy call.
      
       (9) Simplify the SACK table maintenance and ACK generation.  Now that both
           parts are done in the same thread, there's no possibility of a race
           and no need to try and be cunning to avoid taking a BH spinlock whilst
           copying the SACK table (which in the future will be up to 2K) and no
           need to rotate the copy to fit the ACK packet table.
      
      (10) Use SKB_CONSUMED when freeing received DATA packets (stop dropwatch
           complaining).
      
      * tag 'rxrpc-next-20230131' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
        rxrpc: Kill service bundle
        rxrpc: Change rx_packet tracepoint to display securityIndex not type twice
        rxrpc: Show consumed and freed packets as non-dropped in dropwatch
        rxrpc: Remove local->defrag_sem
        rxrpc: Don't lock call->tx_lock to access call->tx_buffer
        rxrpc: Simplify ACK handling
        rxrpc: De-atomic call->ackr_window and call->ackr_nr_unacked
        rxrpc: Generate extra pings for RTT during heavy-receive call
        rxrpc: Allow a delay to be injected into packet reception
        rxrpc: Convert call->recvmsg_lock to a spinlock
        rxrpc: Shrink the tabulation in the rxrpc trace header a bit
        rxrpc: Remove whitespace before ')' in trace header
        rxrpc: Fix trace string
      ====================
      
      Link: https://lore.kernel.org/all/20230131171227.3912130-1-dhowells@redhat.com/
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      a8248fc4
    • Hans de Goede's avatar
      platform/x86: touchscreen_dmi: Add Chuwi Vi8 (CWI501) DMI match · eecf2acd
      Hans de Goede authored
      
      
      Add a DMI match for the CWI501 version of the Chuwi Vi8 tablet,
      pointing to the same chuwi_vi8_data as the existing CWI506 version
      DMI match.
      
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20230202103413.331459-1-hdegoede@redhat.com
      eecf2acd
    • Marc Kleine-Budde's avatar
      can: mcp251xfd: mcp251xfd_ring_set_ringparam(): assign missing tx_obj_num_coalesce_irq · 1613fff7
      Marc Kleine-Budde authored
      If the a new ring layout is set, the max coalesced frames for RX and
      TX are re-calculated, too. Add the missing assignment of the newly
      calculated TX max coalesced frames.
      
      Fixes: 656fc12d ("can: mcp251xfd: add TX IRQ coalescing ethtool support")
      Link: https://lore.kernel.org/all/20230130154334.1578518-1-mkl@pengutronix.de
      
      
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      1613fff7
    • Oliver Hartkopp's avatar
      can: isotp: split tx timer into transmission and timeout · 4f027cba
      Oliver Hartkopp authored
      The timer for the transmission of isotp PDUs formerly had two functions:
      1. send two consecutive frames with a given time gap
      2. monitor the timeouts for flow control frames and the echo frames
      
      This led to larger txstate checks and potentially to a problem discovered
      by syzbot which enabled the panic_on_warn feature while testing.
      
      The former 'txtimer' function is split into 'txfrtimer' and 'txtimer'
      to handle the two above functionalities with separate timer callbacks.
      
      The two simplified timers now run in one-shot mode and make the state
      transitions (especially with isotp_rcv_echo) better understandable.
      
      Fixes: 86633786
      
       ("can: isotp: fix tx state handling for echo tx processing")
      Reported-by: default avatar <syzbot+5aed6c3aaba661f5b917@syzkaller.appspotmail.com>
      Cc: stable@vger.kernel.org # >= v6.0
      Signed-off-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      Link: https://lore.kernel.org/all/20230104145701.2422-1-socketcan@hartkopp.net
      
      
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      4f027cba