Skip to content

Couple of BPF refcount fixes for mlx5

Daniel Borkmann netdev 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 4 repliesIn review
  2. v24 patches 10 repliesSuperseded
  3. v13 patches 8 repliesSuperseded

Changes in v3 from the cover letter

- Just reworked patch 2/4 so we don't need bpf_prog_sub().
- Rebased, rest as is.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4bpf, mlx5: fix mlx5e_create_rq taking reference on progdrivers/net/ethernet/mellanox/mlx5/core/en_main.c kernel/bpf/syscall.c+10 -41 reply
2/4bpf, mlx5: fix various refcount issues in mlx5e_xdp_setdrivers/net/ethernet/mellanox/mlx5/core/en_main.c+13 -41 reply
3/4bpf, mlx5: drop priv->xdp_prog reference on netdev cleanupdrivers/net/ethernet/mellanox/mlx5/core/en_main.c+3 -01 reply
4/4bpf: add __must_check attributes to refcount manipulating helpersinclude/linux/bpf.h+7 -50 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchAlexei StarovoitovSaeed Mahameed
1/4A-b
2/4A-b
3/4A-b
4/4A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH net-next v3 0/4] Couple of BPF refcount fixes for mlx5

Various mlx5 bugs on eBPF refcount handling found during review. Last patch in series adds a __must_check to BPF helpers to make sure we won't run into it again w/o compiler complaining first.

v2 -> v3:

- Just reworked patch 2/4 so we don't need bpf_prog_sub().
- Rebased, rest as is.

v1 -> v2:

- After discussion with Alexei, we agreed upon rebasing the patches against net-next.
- Since net-next, I've also added the __must_check to enforce future users to check for errors.
- Fixed up commit message #2.
- Simplify assignment from patch #1 based on Saeed's feedback on previous set.

Thanks a lot!

Daniel Borkmann (4):
bpf, mlx5: fix mlx5e_create_rq taking reference on prog bpf, mlx5: fix various refcount issues in mlx5e_xdp_set bpf, mlx5: drop priv->xdp_prog reference on netdev cleanup
bpf: add __must_check attributes to refcount manipulating helpers

 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 33 +++++++++++++++++------
 include/linux/bpf.h                               | 12 +++++----
 kernel/bpf/syscall.c                              |  1 +
 3 files changed, 33 insertions(+), 13 deletions(-)
Signature · 1 line
1.9.3