1. 07 9月, 2022 12 次提交
    • F
      netlink: introduce NLA_POLICY_MAX_BE · 08724ef6
      Florian Westphal 提交于
      netlink allows to specify allowed ranges for integer types.
      Unfortunately, nfnetlink passes integers in big endian, so the existing
      NLA_POLICY_MAX() cannot be used.
      
      At the moment, nfnetlink users, such as nf_tables, need to resort to
      programmatic checking via helpers such as nft_parse_u32_check().
      
      This is both cumbersome and error prone.  This adds NLA_POLICY_MAX_BE
      which adds range check support for BE16, BE32 and BE64 integers.
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      08724ef6
    • D
      Merge branch 'sfc-ptp' · 98ba8108
      David S. Miller 提交于
      Edward Cree says:
      
      ====================
      sfc: add support for PTP over IPv6 and 802.3
      Most recent cards (8000 series and newer) had enough hardware support
      for this, but it was not enabled in the driver. The transmission of PTP
      packets over these protocols was already added in commit bd4a2697
      ("sfc: use hardware tx timestamps for more than PTP"), but receiving
      them was already unsupported so synchronization didn't happen.
      
      These patches add support for timestamping received packets over
      IPv6/UPD and IEEE802.3.
      
      v2: fixed weird indentation in efx_ptp_init_filter
      v3: fixed bug caused by usage of htons in PTP_EVENT_PORT definition.
          It was used in more places, where htons was used too, so using it
          2 times leave it again in host order. I didn't detected it in my
          tests because it only affected if timestamping through the MC, but
          the model I used do it through the MAC. Detected by kernel test
          robot <lkp@intel.com>
      v4: removed `inline` specifiers from 2 local functions
      v5: restored deleted comment with useful explanation about packets
          reordering. Deleted useless whitespaces.
      ====================
      Reviewed-by: NEdward Cree <ecree.xilinx@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      98ba8108
    • Í
      sfc: support PTP over Ethernet · e4616f64
      Íñigo Huguet 提交于
      The previous patch add support for PTP over IPv6/UDP (only for 8000
      series and newer) and this one add support for PTP over 802.3.
      
      Tested: sync as master and as slave is correct with ptp4l. PTP over IPv4
      and IPv6 still works fine.
      Suggested-by: NEdward Cree <ecree.xilinx@gmail.com>
      Signed-off-by: NÍñigo Huguet <ihuguet@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e4616f64
    • Í
      sfc: support PTP over IPv6/UDP · 621918c4
      Íñigo Huguet 提交于
      commit bd4a2697 ("sfc: use hardware tx timestamps for more than
      PTP") added support for hardware timestamping on TX for cards of the
      8000 series and newer, in an effort to provide support for other
      transports other than IPv4/UDP.
      
      However, timestamping was still not working on RX for these other
      transports. This patch add support for PTP over IPv6/UDP.
      
      Tested: sync as master and as slave is correct using ptp4l from linuxptp
      package, both with IPv4 and IPv6.
      Suggested-by: NEdward Cree <ecree.xilinx@gmail.com>
      Signed-off-by: NÍñigo Huguet <ihuguet@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      621918c4
    • Í
      sfc: allow more flexible way of adding filters for PTP · 313aa13a
      Íñigo Huguet 提交于
      In preparation for the support of PTP over IPv6/UDP and Ethernet in next
      patches, allow a more flexible way of adding and removing RX filters for
      PTP. Right now, only 2 filters are allowed, which are the ones needed
      for PTP over IPv4/UDP.
      Signed-off-by: NÍñigo Huguet <ihuguet@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      313aa13a
    • J
      net: dsa: LAN9303: Add basic support for LAN9354 · 13248b97
      Jerry Ray 提交于
      Adding support for the LAN9354 device by allowing it to use
      the LAN9303 DSA driver.  These devices have the same underlying
      access and control methods and from a feature set point of view
      the LAN9354 is a superset of the LAN9303.
      
      The MDIO access method has been tested on a SAMA5D3-EDS board
      with a LAN9354 RMII daughter card.
      
      While the SPI access method should also be the same, it has not
      been tested and as such is not included at this time.
      Signed-off-by: NJerry Ray <jerry.ray@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      13248b97
    • J
      net: dsa: LAN9303: Add early read to sync · 732f374e
      Jerry Ray 提交于
      Add initial BYTE_ORDER read to sync the 32-bit accesses over the 16-bit
      mdio bus to improve driver robustness.
      
      The lan9303 expects two mdio read transactions back-to-back to read a
      32-bit register. The first read transaction causes the other half of the
      32-bit register to get latched.  The subsequent read returns the latched
      second half of the 32-bit read. The BYTE_ORDER register is an exception to
      this rule. As it is a constant value, there is no need to latch the second
      half. We read this register first in case there were reads during the boot
      loader process that might have occurred prior to this driver taking over
      ownership of accessing this device.
      
      This patch has been tested on the SAMA5D3-EDS with a LAN9303 RMII daughter
      card.
      Signed-off-by: NJerry Ray <jerry.ray@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      732f374e
    • R
      net: dsa: microchip: add regmap_range for KSZ9896 chip · 6674e7fd
      Romain Naour 提交于
      Add register validation for KSZ9896.
      Signed-off-by: NRomain Naour <romain.naour@skf.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6674e7fd
    • R
      net: dsa: microchip: ksz9477: remove 0x033C and 0x033D addresses from regmap_access_tables · 3a8b8ea6
      Romain Naour 提交于
      According to the KSZ9477S datasheet, there is no global register
      at 0x033C and 0x033D addresses.
      Signed-off-by: NRomain Naour <romain.naour@skf.com>
      Cc: Oleksij Rempel <o.rempel@pengutronix.de>
      Tested-by: NOleksij Rempel <o.rempel@pengutronix.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3a8b8ea6
    • R
      net: dsa: microchip: add KSZ9896 to KSZ9477 I2C driver · 13767525
      Romain Naour 提交于
      Add support for the KSZ9896 6-port Gigabit Ethernet Switch to the
      ksz9477 driver. The KSZ9896 supports both SPI (already in) and I2C.
      Signed-off-by: NRomain Naour <romain.naour@skf.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      13767525
    • R
      net: dsa: microchip: add KSZ9896 switch support · 2eb3ff3c
      Romain Naour 提交于
      Add support for the KSZ9896 6-port Gigabit Ethernet Switch to the
      ksz9477 driver.
      
      Although the KSZ9896 is already listed in the device tree binding
      documentation since a1c0ed24 (dt-bindings: net: dsa: document
      additional Microchip KSZ9477 family switches) the chip id
      (0x00989600) is not recognized by ksz_switch_detect() and rejected
      by the driver.
      
      The KSZ9896 is similar to KSZ9897 but has only one configurable
      MII/RMII/RGMII/GMII cpu port.
      Signed-off-by: NRomain Naour <romain.naour@skf.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2eb3ff3c
    • P
      Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next · 2786bcff
      Paolo Abeni 提交于
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf-next 2022-09-05
      
      The following pull-request contains BPF updates for your *net-next* tree.
      
      We've added 106 non-merge commits during the last 18 day(s) which contain
      a total of 159 files changed, 5225 insertions(+), 1358 deletions(-).
      
      There are two small merge conflicts, resolve them as follows:
      
      1) tools/testing/selftests/bpf/DENYLIST.s390x
      
        Commit 27e23836 ("selftests/bpf: Add lru_bug to s390x deny list") in
        bpf tree was needed to get BPF CI green on s390x, but it conflicted with
        newly added tests on bpf-next. Resolve by adding both hunks, result:
      
        [...]
        lru_bug                                  # prog 'printk': failed to auto-attach: -524
        setget_sockopt                           # attach unexpected error: -524                                               (trampoline)
        cb_refs                                  # expected error message unexpected error: -524                               (trampoline)
        cgroup_hierarchical_stats                # JIT does not support calling kernel function                                (kfunc)
        htab_update                              # failed to attach: ERROR: strerror_r(-524)=22                                (trampoline)
        [...]
      
      2) net/core/filter.c
      
        Commit 1227c177 ("net: Fix data-races around sysctl_[rw]mem_(max|default).")
        from net tree conflicts with commit 29003875 ("bpf: Change bpf_setsockopt(SOL_SOCKET)
        to reuse sk_setsockopt()") from bpf-next tree. Take the code as it is from
        bpf-next tree, result:
      
        [...]
      	if (getopt) {
      		if (optname == SO_BINDTODEVICE)
      			return -EINVAL;
      		return sk_getsockopt(sk, SOL_SOCKET, optname,
      				     KERNEL_SOCKPTR(optval),
      				     KERNEL_SOCKPTR(optlen));
      	}
      
      	return sk_setsockopt(sk, SOL_SOCKET, optname,
      			     KERNEL_SOCKPTR(optval), *optlen);
        [...]
      
      The main changes are:
      
      1) Add any-context BPF specific memory allocator which is useful in particular for BPF
         tracing with bonus of performance equal to full prealloc, from Alexei Starovoitov.
      
      2) Big batch to remove duplicated code from bpf_{get,set}sockopt() helpers as an effort
         to reuse the existing core socket code as much as possible, from Martin KaFai Lau.
      
      3) Extend BPF flow dissector for BPF programs to just augment the in-kernel dissector
         with custom logic. In other words, allow for partial replacement, from Shmulik Ladkani.
      
      4) Add a new cgroup iterator to BPF with different traversal options, from Hao Luo.
      
      5) Support for BPF to collect hierarchical cgroup statistics efficiently through BPF
         integration with the rstat framework, from Yosry Ahmed.
      
      6) Support bpf_{g,s}et_retval() under more BPF cgroup hooks, from Stanislav Fomichev.
      
      7) BPF hash table and local storages fixes under fully preemptible kernel, from Hou Tao.
      
      8) Add various improvements to BPF selftests and libbpf for compilation with gcc BPF
         backend, from James Hilliard.
      
      9) Fix verifier helper permissions and reference state management for synchronous
         callbacks, from Kumar Kartikeya Dwivedi.
      
      10) Add support for BPF selftest's xskxceiver to also be used against real devices that
          support MAC loopback, from Maciej Fijalkowski.
      
      11) Various fixes to the bpf-helpers(7) man page generation script, from Quentin Monnet.
      
      12) Document BPF verifier's tnum_in(tnum_range(), ...) gotchas, from Shung-Hsi Yu.
      
      13) Various minor misc improvements all over the place.
      
      * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (106 commits)
        bpf: Optimize rcu_barrier usage between hash map and bpf_mem_alloc.
        bpf: Remove usage of kmem_cache from bpf_mem_cache.
        bpf: Remove prealloc-only restriction for sleepable bpf programs.
        bpf: Prepare bpf_mem_alloc to be used by sleepable bpf programs.
        bpf: Remove tracing program restriction on map types
        bpf: Convert percpu hash map to per-cpu bpf_mem_alloc.
        bpf: Add percpu allocation support to bpf_mem_alloc.
        bpf: Batch call_rcu callbacks instead of SLAB_TYPESAFE_BY_RCU.
        bpf: Adjust low/high watermarks in bpf_mem_cache
        bpf: Optimize call_rcu in non-preallocated hash map.
        bpf: Optimize element count in non-preallocated hash map.
        bpf: Relax the requirement to use preallocated hash maps in tracing progs.
        samples/bpf: Reduce syscall overhead in map_perf_test.
        selftests/bpf: Improve test coverage of test_maps
        bpf: Convert hash map to bpf_mem_alloc.
        bpf: Introduce any context BPF specific memory allocator.
        selftest/bpf: Add test for bpf_getsockopt()
        bpf: Change bpf_getsockopt(SOL_IPV6) to reuse do_ipv6_getsockopt()
        bpf: Change bpf_getsockopt(SOL_IP) to reuse do_ip_getsockopt()
        bpf: Change bpf_getsockopt(SOL_TCP) to reuse do_tcp_getsockopt()
        ...
      ====================
      
      Link: https://lore.kernel.org/r/20220905161136.9150-1-daniel@iogearbox.netSigned-off-by: NPaolo Abeni <pabeni@redhat.com>
      2786bcff
  2. 06 9月, 2022 3 次提交
  3. 05 9月, 2022 25 次提交