Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf...
authorJakub Kicinski <kuba@kernel.org>
Mon, 20 Feb 2023 23:38:41 +0000 (15:38 -0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 21 Feb 2023 00:31:14 +0000 (16:31 -0800)
Daniel Borkmann says:

====================
pull-request: bpf-next 2023-02-17

We've added 64 non-merge commits during the last 7 day(s) which contain
a total of 158 files changed, 4190 insertions(+), 988 deletions(-).

The main changes are:

1) Add a rbtree data structure following the "next-gen data structure"
   precedent set by recently-added linked-list, that is, by using
   kfunc + kptr instead of adding a new BPF map type, from Dave Marchevsky.

2) Add a new benchmark for hashmap lookups to BPF selftests,
   from Anton Protopopov.

3) Fix bpf_fib_lookup to only return valid neighbors and add an option
   to skip the neigh table lookup, from Martin KaFai Lau.

4) Add cgroup.memory=nobpf kernel parameter option to disable BPF memory
   accouting for container environments, from Yafang Shao.

5) Batch of ice multi-buffer and driver performance fixes,
   from Alexander Lobakin.

6) Fix a bug in determining whether global subprog's argument is
   PTR_TO_CTX, which is based on type names which breaks kprobe progs,
   from Andrii Nakryiko.

7) Prep work for future -mcpu=v4 LLVM option which includes usage of
   BPF_ST insn. Thus improve BPF_ST-related value tracking in verifier,
   from Eduard Zingerman.

8) More prep work for later building selftests with Memory Sanitizer
   in order to detect usages of undefined memory, from Ilya Leoshkevich.

9) Fix xsk sockets to check IFF_UP earlier to avoid a NULL pointer
   dereference via sendmsg(), from Maciej Fijalkowski.

10) Implement BPF trampoline for RV64 JIT compiler, from Pu Lehui.

11) Fix BPF memory allocator in combination with BPF hashtab where it could
    corrupt special fields e.g. used in bpf_spin_lock, from Hou Tao.

12) Fix LoongArch BPF JIT to always use 4 instructions for function
    address so that instruction sequences don't change between passes,
    from Hengqi Chen.

* tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (64 commits)
  selftests/bpf: Add bpf_fib_lookup test
  bpf: Add BPF_FIB_LOOKUP_SKIP_NEIGH for bpf_fib_lookup
  riscv, bpf: Add bpf trampoline support for RV64
  riscv, bpf: Add bpf_arch_text_poke support for RV64
  riscv, bpf: Factor out emit_call for kernel and bpf context
  riscv: Extend patch_text for multiple instructions
  Revert "bpf, test_run: fix &xdp_frame misplacement for LIVE_FRAMES"
  selftests/bpf: Add global subprog context passing tests
  selftests/bpf: Convert test_global_funcs test to test_loader framework
  bpf: Fix global subprog context argument resolution logic
  LoongArch, bpf: Use 4 instructions for function address in JIT
  bpf: bpf_fib_lookup should not return neigh in NUD_FAILED state
  bpf: Disable bh in bpf_test_run for xdp and tc prog
  xsk: check IFF_UP earlier in Tx path
  Fix typos in selftest/bpf files
  selftests/bpf: Use bpf_{btf,link,map,prog}_get_info_by_fd()
  samples/bpf: Use bpf_{btf,link,map,prog}_get_info_by_fd()
  bpftool: Use bpf_{btf,link,map,prog}_get_info_by_fd()
  libbpf: Use bpf_{btf,link,map,prog}_get_info_by_fd()
  libbpf: Introduce bpf_{btf,link,map,prog}_get_info_by_fd()
  ...
====================

Link: https://lore.kernel.org/r/20230217221737.31122-1-daniel@iogearbox.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1  2 
MAINTAINERS
arch/riscv/kernel/probes/kprobes.c
drivers/net/ethernet/intel/ice/ice_txrx.c
drivers/net/ethernet/intel/ice/ice_xsk.c
net/xdp/xsk.c

diff --cc MAINTAINERS
Simple merge
Simple merge
index b2d96ae5668c7475a4d4fee3dd28068f539fa51b,917c75e530caa8ed30a047a446e967cf8d40ce12..31565bbafa224f9cf2035f8c6439ed58f7bcd65a
@@@ -597,23 -597,8 +597,8 @@@ ice_construct_skb_zc(struct ice_rx_rin
        return skb;
  }
  
- /**
-  * ice_clean_xdp_tx_buf - Free and unmap XDP Tx buffer
-  * @xdp_ring: XDP Tx ring
-  * @tx_buf: Tx buffer to clean
-  */
- static void
- ice_clean_xdp_tx_buf(struct ice_tx_ring *xdp_ring, struct ice_tx_buf *tx_buf)
- {
-       page_frag_free(tx_buf->raw_buf);
-       xdp_ring->xdp_tx_active--;
-       dma_unmap_single(xdp_ring->dev, dma_unmap_addr(tx_buf, dma),
-                        dma_unmap_len(tx_buf, len), DMA_TO_DEVICE);
-       dma_unmap_len_set(tx_buf, len, 0);
- }
  /**
 - * ice_clean_xdp_irq_zc - AF_XDP ZC specific Tx cleaning routine
 + * ice_clean_xdp_irq_zc - produce AF_XDP descriptors to CQ
   * @xdp_ring: XDP Tx ring
   */
  static void ice_clean_xdp_irq_zc(struct ice_tx_ring *xdp_ring)
  
        last_rs = xdp_ring->next_to_use ? xdp_ring->next_to_use - 1 : cnt - 1;
        tx_desc = ICE_TX_DESC(xdp_ring, last_rs);
-       if ((tx_desc->cmd_type_offset_bsz &
-           cpu_to_le64(ICE_TX_DESC_DTYPE_DESC_DONE))) {
+       if (tx_desc->cmd_type_offset_bsz &
+           cpu_to_le64(ICE_TX_DESC_DTYPE_DESC_DONE)) {
                if (last_rs >= ntc)
 -                      xsk_frames = last_rs - ntc + 1;
 +                      completed_frames = last_rs - ntc + 1;
                else
 -                      xsk_frames = last_rs + cnt - ntc + 1;
 +                      completed_frames = last_rs + cnt - ntc + 1;
        }
  
 -      if (!xsk_frames)
 +      if (!completed_frames)
                return;
  
 -      if (likely(!xdp_ring->xdp_tx_active))
 +      if (likely(!xdp_ring->xdp_tx_active)) {
 +              xsk_frames = completed_frames;
                goto skip;
 +      }
  
        ntc = xdp_ring->next_to_clean;
 -      for (i = 0; i < xsk_frames; i++) {
 +      for (i = 0; i < completed_frames; i++) {
                tx_buf = &xdp_ring->tx_buf[ntc];
  
-               if (tx_buf->raw_buf) {
-                       ice_clean_xdp_tx_buf(xdp_ring, tx_buf);
-                       tx_buf->raw_buf = NULL;
+               if (tx_buf->type == ICE_TX_BUF_XSK_TX) {
+                       tx_buf->type = ICE_TX_BUF_EMPTY;
+                       xsk_buff_free(tx_buf->xdp);
+                       xdp_ring->xdp_tx_active--;
                } else {
                        xsk_frames++;
                }
diff --cc net/xdp/xsk.c
Simple merge