[PATCH 0/5] bpf: Adjustments for four function implementations

Markus Elfring posted 5 patches 1 year, 12 months ago
kernel/bpf/bpf_struct_ops.c | 12 ++++++------
kernel/bpf/btf.c            |  8 +++++---
kernel/bpf/local_storage.c  |  2 +-
kernel/bpf/lpm_trie.c       | 24 +++++++++++-------------
4 files changed, 23 insertions(+), 23 deletions(-)
[PATCH 0/5] bpf: Adjustments for four function implementations
Posted by Markus Elfring 1 year, 12 months ago
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 30 Dec 2023 20:51:23 +0100

A few update suggestions were taken into account
from static source code analysis.

Markus Elfring (5):
  Improve exception handling in bpf_struct_ops_link_create()
  Move an assignment for the variable “st_map”
    in bpf_struct_ops_link_create()
  Improve exception handling in bpf_core_apply()
  Return directly after a failed bpf_map_kmalloc_node()
    in bpf_cgroup_storage_alloc()
  Improve exception handling in trie_update_elem()

 kernel/bpf/bpf_struct_ops.c | 12 ++++++------
 kernel/bpf/btf.c            |  8 +++++---
 kernel/bpf/local_storage.c  |  2 +-
 kernel/bpf/lpm_trie.c       | 24 +++++++++++-------------
 4 files changed, 23 insertions(+), 23 deletions(-)

--
2.43.0
Re: [PATCH 0/5] bpf: Adjustments for four function implementations
Posted by Alexei Starovoitov 1 year, 11 months ago
On Sat, Dec 30, 2023 at 12:04 PM Markus Elfring <Markus.Elfring@web.de> wrote:
>
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 30 Dec 2023 20:51:23 +0100
>
> A few update suggestions were taken into account
> from static source code analysis.

Auto Nack.
Pls don't send such patches. You were told multiple
times that such kfree usage is fine.
Re: [PATCH 0/5] bpf: Adjustments for four function implementations
Posted by Markus Elfring 1 year, 12 months ago
>> A few update suggestions were taken into account
>> from static source code analysis.
>
> Auto Nack.
> Pls don't send such patches. You were told multiple
> times that such kfree usage is fine.

Some implementation details are improvable.
Can you find an update step (like the following) helpful?

[PATCH 2/5] bpf: Move an assignment for the variable “st_map” in bpf_struct_ops_link_create()
https://lore.kernel.org/bpf/ed2f5323-390f-4c9d-919d-df43ba1cad2b@web.de/

Regards,
Markus
Re: [PATCH 0/5] bpf: Adjustments for four function implementations
Posted by Song Liu 1 year, 11 months ago
On Mon, Jan 1, 2024 at 1:10 AM Markus Elfring <Markus.Elfring@web.de> wrote:
>
> >> A few update suggestions were taken into account
> >> from static source code analysis.
> >
> > Auto Nack.
> > Pls don't send such patches. You were told multiple
> > times that such kfree usage is fine.
>
> Some implementation details are improvable.
> Can you find an update step (like the following) helpful?
>
> [PATCH 2/5] bpf: Move an assignment for the variable “st_map” in bpf_struct_ops_link_create()
> https://lore.kernel.org/bpf/ed2f5323-390f-4c9d-919d-df43ba1cad2b@web.de/

This change is not helpful at all. The use of "st_map" in current code as-is
doesn't cause any confusion, i.e., it is always struct bpf_struct_ops_map *.
OTOH, this patch will make it harder for folks who use git-blame. Therefore,
it adds negative value to the code base.

Thanks,
Song