1. 17 Oct, 2023 6 commits
    • Jeremy Kerr's avatar
      i3c: Add support for bus enumeration & notification · 0ac6486e
      Jeremy Kerr authored
      This allows other drivers to be notified when new i3c busses are
      attached, referring to a whole i3c bus as opposed to individual
      devices.
      Signed-off-by: default avatarJeremy Kerr <jk@codeconstruct.com.au>
      Signed-off-by: default avatarMatt Johnston <matt@codeconstruct.com.au>
      Acked-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      0ac6486e
    • Matt Johnston's avatar
      dt-bindings: i3c: Add mctp-controller property · ee71d6d5
      Matt Johnston authored
      This property is used to describe a I3C bus with attached MCTP I3C
      target devices.
      Signed-off-by: default avatarMatt Johnston <matt@codeconstruct.com.au>
      Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
      Acked-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      ee71d6d5
    • Florian Westphal's avatar
      net: gso_test: release each segment individually · 1b2d3b45
      Florian Westphal authored
      consume_skb() doesn't walk the segment list, so segments other than
      the first are leaked.
      
      Move this skb_consume call into the loop.
      
      Cc: Willem de Bruijn <willemb@google.com>
      Fixes: b3098d32 ("net: add skb_segment kunit test")
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1b2d3b45
    • Jakub Kicinski's avatar
      Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next · a3c2dd96
      Jakub Kicinski authored
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf-next 2023-10-16
      
      We've added 90 non-merge commits during the last 25 day(s) which contain
      a total of 120 files changed, 3519 insertions(+), 895 deletions(-).
      
      The main changes are:
      
      1) Add missed stats for kprobes to retrieve the number of missed kprobe
         executions and subsequent executions of BPF programs, from Jiri Olsa.
      
      2) Add cgroup BPF sockaddr hooks for unix sockets. The use case is
         for systemd to reimplement the LogNamespace feature which allows
         running multiple instances of systemd-journald to process the logs
         of different services, from Daan De Meyer.
      
      3) Implement BPF CPUv4 support for s390x BPF JIT, from Ilya Leoshkevich.
      
      4) Improve BPF verifier log output for scalar registers to better
         disambiguate their internal state wrt defaults vs min/max values
         matching, from Andrii Nakryiko.
      
      5) Extend the BPF fib lookup helpers for IPv4/IPv6 to support retrieving
         the source IP address with a new BPF_FIB_LOOKUP_SRC flag,
         from Martynas Pumputis.
      
      6) Add support for open-coded task_vma iterator to help with symbolization
         for BPF-collected user stacks, from Dave Marchevsky.
      
      7) Add libbpf getters for accessing individual BPF ring buffers which
         is useful for polling them individually, for example, from Martin Kelly.
      
      8) Extend AF_XDP selftests to validate the SHARED_UMEM feature,
         from Tushar Vyavahare.
      
      9) Improve BPF selftests cross-building support for riscv arch,
         from Björn Töpel.
      
      10) Add the ability to pin a BPF timer to the same calling CPU,
         from David Vernet.
      
      11) Fix libbpf's bpf_tracing.h macros for riscv to use the generic
         implementation of PT_REGS_SYSCALL_REGS() to access syscall arguments,
         from Alexandre Ghiti.
      
      12) Extend libbpf to support symbol versioning for uprobes, from Hengqi Chen.
      
      13) Fix bpftool's skeleton code generation to guarantee that ELF data
          is 8 byte aligned, from Ian Rogers.
      
      14) Inherit system-wide cpu_mitigations_off() setting for Spectre v1/v4
          security mitigations in BPF verifier, from Yafang Shao.
      
      15) Annotate struct bpf_stack_map with __counted_by attribute to prepare
          BPF side for upcoming __counted_by compiler support, from Kees Cook.
      
      * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (90 commits)
        bpf: Ensure proper register state printing for cond jumps
        bpf: Disambiguate SCALAR register state output in verifier logs
        selftests/bpf: Make align selftests more robust
        selftests/bpf: Improve missed_kprobe_recursion test robustness
        selftests/bpf: Improve percpu_alloc test robustness
        selftests/bpf: Add tests for open-coded task_vma iter
        bpf: Introduce task_vma open-coded iterator kfuncs
        selftests/bpf: Rename bpf_iter_task_vma.c to bpf_iter_task_vmas.c
        bpf: Don't explicitly emit BTF for struct btf_iter_num
        bpf: Change syscall_nr type to int in struct syscall_tp_t
        net/bpf: Avoid unused "sin_addr_len" warning when CONFIG_CGROUP_BPF is not set
        bpf: Avoid unnecessary audit log for CPU security mitigations
        selftests/bpf: Add tests for cgroup unix socket address hooks
        selftests/bpf: Make sure mount directory exists
        documentation/bpf: Document cgroup unix socket address hooks
        bpftool: Add support for cgroup unix socket address hooks
        libbpf: Add support for cgroup unix socket address hooks
        bpf: Implement cgroup sockaddr hooks for unix sockets
        bpf: Add bpf_sock_addr_set_sun_path() to allow writing unix sockaddr from bpf
        bpf: Propagate modified uaddrlen from cgroup sockaddr programs
        ...
      ====================
      
      Link: https://lore.kernel.org/r/20231016204803.30153-1-daniel@iogearbox.netSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a3c2dd96
    • Yunsheng Lin's avatar
      page_pool: fragment API support for 32-bit arch with 64-bit DMA · 90de47f0
      Yunsheng Lin authored
      Currently page_pool_alloc_frag() is not supported in 32-bit
      arch with 64-bit DMA because of the overlap issue between
      pp_frag_count and dma_addr_upper in 'struct page' for those
      arches, which seems to be quite common, see [1], which means
      driver may need to handle it when using fragment API.
      
      It is assumed that the combination of the above arch with an
      address space >16TB does not exist, as all those arches have
      64b equivalent, it seems logical to use the 64b version for a
      system with a large address space. It is also assumed that dma
      address is page aligned when we are dma mapping a page aligned
      buffer, see [2].
      
      That means we're storing 12 bits of 0 at the lower end for a
      dma address, we can reuse those bits for the above arches to
      support 32b+12b, which is 16TB of memory.
      
      If we make a wrong assumption, a warning is emitted so that
      user can report to us.
      
      1. https://lore.kernel.org/all/20211117075652.58299-1-linyunsheng@huawei.com/
      2. https://lore.kernel.org/all/20230818145145.4b357c89@kernel.org/Tested-by: default avatarAlexander Lobakin <aleksander.lobakin@intel.com>
      Signed-off-by: default avatarYunsheng Lin <linyunsheng@huawei.com>
      CC: Lorenzo Bianconi <lorenzo@kernel.org>
      CC: Alexander Duyck <alexander.duyck@gmail.com>
      CC: Liang Chen <liangchen.linux@gmail.com>
      CC: Guillaume Tucker <guillaume.tucker@collabora.com>
      CC: Matthew Wilcox <willy@infradead.org>
      CC: Linux-MM <linux-mm@kvack.org>
      Link: https://lore.kernel.org/r/20231013064827.61135-2-linyunsheng@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      90de47f0
    • Jacob Keller's avatar
      net: stub tcp_gro_complete if CONFIG_INET=n · e411a8e3
      Jacob Keller authored
      A few networking drivers including bnx2x, bnxt, qede, and idpf call
      tcp_gro_complete as part of offloading TCP GRO. The function is only
      defined if CONFIG_INET is true, since its TCP specific and is meaningless
      if the kernel lacks IP networking support.
      
      The combination of trying to use the complex network drivers with
      CONFIG_NET but not CONFIG_INET is rather unlikely in practice: most use
      cases are going to need IP networking.
      
      The tcp_gro_complete function just sets some data in the socket buffer for
      use in processing the TCP packet in the event that the GRO was offloaded to
      the device. If the kernel lacks TCP support, such setup will simply go
      unused.
      
      The bnx2x, bnxt, and qede drivers wrap their TCP offload support in
      CONFIG_INET checks and skip handling on such kernels.
      
      The idpf driver did not check CONFIG_INET and thus fails to link if the
      kernel is configured  with CONFIG_NET=y, CONFIG_IDPF=(m|y), and
      CONFIG_INET=n.
      
      While checking CONFIG_INET does allow the driver to bypass significantly
      more instructions in the event that we know TCP networking isn't supported,
      the configuration is unlikely to be used widely.
      
      Rather than require driver authors to care about this, stub the
      tcp_gro_complete function when CONFIG_INET=n. This allows drivers to be
      left as-is. It does mean the idpf driver will perform slightly more work
      than strictly necessary when CONFIG_INET=n, since it will still execute
      some of the skb setup in idpf_rx_rsc. However, that work would be performed
      in the case where CONFIG_INET=y anyways.
      
      I did not change the existing drivers, since they appear to wrap a
      significant portion of code when CONFIG_INET=n. There is little benefit in
      trashing these drivers just to unwrap and remove the CONFIG_INET check.
      
      Using a stub for tcp_gro_complete is still beneficial, as it means future
      drivers no longer need to worry about this case of CONFIG_NET=y and
      CONFIG_INET=n, which should reduce noise from buildbots that check such a
      configuration.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
      Link: https://lore.kernel.org/r/20231013185502.1473541-1-jacob.e.keller@intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      e411a8e3
  2. 16 Oct, 2023 26 commits
  3. 15 Oct, 2023 8 commits
    • David S. Miller's avatar
      Merge branch 'ptp-multiple-readers' · c49bba01
      David S. Miller authored
      Xabier Marquiegui says:
      
      ====================
      ptp: Support for multiple filtered timestamp event queue readers
      
      On systems with multiple timestamp event channels, there can be scenarios
      where multiple userspace readers want to access the timestamping data for
      various purposes.
      
      One such example is wanting to use a pps out for time synchronization, and
      wanting to timestamp external events with the synchronized time base
      simultaneously.
      
      Timestmp event consumers on the other hand, are often interested in a
      subset of the available timestamp channels. linuxptp ts2phc, for example,
      is not happy if more than one timestamping channel is active on the device
      it is reading from.
      
      Linked lists are introduced to support multiple timestamp event queue
      consumers, and timestamp event channel filters through IOCTLs, as well as
      a debugfs interface to do some simple verifications.
      
      Xabier Marquiegui (6):
        posix-clock: introduce posix_clock_context concept
        ptp: Replace timestamp event queue with linked list
        ptp: support multiple timestamp event readers
        ptp: support event queue reader channel masks
        ptp: add debugfs interface to see applied channel masks
        ptp: add testptp mask test
      
       drivers/ptp/ptp_chardev.c                   | 129 ++++++++++++++++----
       drivers/ptp/ptp_clock.c                     |  45 ++++++-
       drivers/ptp/ptp_private.h                   |  28 +++--
       drivers/ptp/ptp_sysfs.c                     |  13 +-
       include/linux/posix-clock.h                 |  35 ++++--
       include/uapi/linux/ptp_clock.h              |   2 +
       kernel/time/posix-clock.c                   |  36 ++++--
       tools/testing/selftests/ptp/ptpchmaskfmt.sh |  14 +++
       tools/testing/selftests/ptp/testptp.c       |  19 ++-
       9 files changed, 261 insertions(+), 60 deletions(-)
       create mode 100644 tools/testing/selftests/ptp/ptpchmaskfmt.sh
      
      ---
      v6:
        - correct commit message
        - correct coding style
      v5: https://lore.kernel.org/netdev/cover.1696804243.git.reibax@gmail.com/
        - fix spelling on commit message
        - fix memory leak on ptp_open
      v4: https://lore.kernel.org/netdev/cover.1696511486.git.reibax@gmail.com/
        - split modifications in different patches for improved organization
        - rename posix_clock_user to posix_clock_context
        - remove unnecessary flush_users clock operation
        - remove unnecessary tests
        - simpler queue clean procedure
        - fix/clean comment lines
        - simplified release procedures
        - filter modifications exclusive to currently open instance for
          simplicity and security
        - expand mask to 2048 channels
        - make more secure and simple: mask is only applied to the testptp
          instance. Use debugfs to verify effects.
      v3: https://lore.kernel.org/netdev/20230928133544.3642650-1-reibax@gmail.com/
        - add this patchset overview file
        - fix use of safe and non safe linked lists for loops
        - introduce new posix_clock private_data and ida object ids for better
          dicrimination of timestamp consumers
        - safer resource release procedures
        - filter application by object id, aided by process id
        - friendlier testptp implementation of event queue channel filters
      v2: https://lore.kernel.org/netdev/20230912220217.2008895-1-reibax@gmail.com/
        - fix ptp_poll() return value
        - Style changes to comform to checkpatch strict suggestions
        - more coherent ptp_read error exit routines
        - fix testptp compilation error: unknown type name 'pid_t'
        - rename mask variable for easier code traceability
        - more detailed commit message with two examples
      v1: https://lore.kernel.org/netdev/20230906104754.1324412-2-reibax@gmail.com/
      ====================
      Signed-off-by: default avatarXabier Marquiegui <reibax@gmail.com>
      Suggested-by: default avatarRichard Cochran <richardcochran@gmail.com>
      Suggested-by: default avatarVinicius Costa Gomes <vinicius.gomes@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c49bba01
    • Xabier Marquiegui's avatar
      ptp: add testptp mask test · 26285e68
      Xabier Marquiegui authored
      Add option to test timestamp event queue mask manipulation in testptp.
      
      Option -F allows the user to specify a single channel that will be
      applied on the mask filter via IOCTL.
      
      The test program will maintain the file open until user input is
      received.
      
      This allows checking the effect of the IOCTL in debugfs.
      
      eg:
      
      Console 1:
      ```
      Channel 12 exclusively enabled. Check on debugfs.
      Press any key to continue
      ```
      
      Console 2:
      ```
      0x00000000 0x00000001 0x00000000 0x00000000 0x00000000 0x00000000
      0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
      0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
      0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
      0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
      0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
      0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
      0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
      0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
      0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
      0x00000000 0x00000000 0x00000000 0x00000000
      ```
      Signed-off-by: default avatarXabier Marquiegui <reibax@gmail.com>
      Suggested-by: default avatarRichard Cochran <richardcochran@gmail.com>
      Suggested-by: default avatarVinicius Costa Gomes <vinicius.gomes@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      26285e68
    • Xabier Marquiegui's avatar
      ptp: add debugfs interface to see applied channel masks · 403376dd
      Xabier Marquiegui authored
      Use debugfs to be able to view channel mask applied to every timestamp
      event queue.
      
      Every time the device is opened, a new entry is created in
      `$DEBUGFS_MOUNTPOINT/ptpN/$INSTANCE_ADDRESS/mask`.
      
      The mask value can be viewed grouped in 32bit decimal values using cat,
      or converted to hexadecimal with the included `ptpchmaskfmt.sh` script.
      32 bit values are listed from least significant to most significant.
      Signed-off-by: default avatarXabier Marquiegui <reibax@gmail.com>
      Suggested-by: default avatarVinicius Costa Gomes <vinicius.gomes@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      403376dd
    • Xabier Marquiegui's avatar
      ptp: support event queue reader channel masks · c5a445b1
      Xabier Marquiegui authored
      On systems with multiple timestamp event channels, some readers might
      want to receive only a subset of those channels.
      
      Add the necessary modifications to support timestamp event channel
      filtering, including two IOCTL operations:
      
      - Clear all channels
      - Enable one channel
      
      The mask modification operations will be applied exclusively on the
      event queue assigned to the file descriptor used on the IOCTL operation,
      so the typical procedure to have a reader receiving only a subset of the
      enabled channels would be:
      
      - Open device file
      - ioctl: clear all channels
      - ioctl: enable one channel
      - start reading
      
      Calling the enable one channel ioctl more than once will result in
      multiple enabled channels.
      Signed-off-by: default avatarXabier Marquiegui <reibax@gmail.com>
      Suggested-by: default avatarRichard Cochran <richardcochran@gmail.com>
      Suggested-by: default avatarVinicius Costa Gomes <vinicius.gomes@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c5a445b1
    • Xabier Marquiegui's avatar
      ptp: support multiple timestamp event readers · 8f5de6fb
      Xabier Marquiegui authored
      Use linked lists to create one event queue per open file. This enables
      simultaneous readers for timestamp event queues.
      Signed-off-by: default avatarXabier Marquiegui <reibax@gmail.com>
      Suggested-by: default avatarRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8f5de6fb
    • Xabier Marquiegui's avatar
      ptp: Replace timestamp event queue with linked list · d26ab5a3
      Xabier Marquiegui authored
      Introduce linked lists to access the timestamp event queue.
      Signed-off-by: default avatarXabier Marquiegui <reibax@gmail.com>
      Suggested-by: default avatarRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d26ab5a3
    • Xabier Marquiegui's avatar
      posix-clock: introduce posix_clock_context concept · 60c69466
      Xabier Marquiegui authored
      Add the necessary structure to support custom private-data per
      posix-clock user.
      
      The previous implementation of posix-clock assumed all file open
      instances need access to the same clock structure on private_data.
      
      The need for individual data structures per file open instance has been
      identified when developing support for multiple timestamp event queue
      users for ptp_clock.
      Signed-off-by: default avatarXabier Marquiegui <reibax@gmail.com>
      Suggested-by: default avatarRichard Cochran <richardcochran@gmail.com>
      Suggested-by: default avatarVinicius Costa Gomes <vinicius.gomes@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      60c69466
    • David S. Miller's avatar
      Merge branch 'dpll-phase-offset-phase-adjust' · 99620ea0
      David S. Miller authored
      Arkadiusz Kubalewski says:
      
      ====================
      dpll: add phase-offset and phase-adjust
      
      Improve monitoring and control over dpll devices.
      Allow user to receive measurement of phase difference between signals
      on pin and dpll (phase-offset).
      Allow user to receive and control adjustable value of pin's signal
      phase (phase-adjust).
      
      v4->v5:
      - rebase series on top of net-next/main, fix conflict - remove redundant
        attribute type definition in subset definition
      
      v3->v4:
      - do not increase do version of uAPI header as it is not needed (v3 did
        not have this change)
      - fix spelling around commit messages, argument descriptions and docs
      - add missing extack errors on failure set callbacks for pin phase
        adjust and frequency
      - remove ice check if value is already set, now redundant as checked in
        the dpll subsystem
      
      v2->v3:
      - do not increase do version of uAPI header as it is not needed
      
      v1->v2:
      - improve handling for error case of requesting the phase adjust set
      - align handling for error case of frequency set request with the
      approach introduced for phase adjust
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      99620ea0