bpf: fix missing * in bpf.h
Subsystems (3)
PATCH 1/1 bpf: fix missing * in bpf.h
Commit 34b2021cc616 ("bpf: Add BPF-helper for MTU checking") lost a * in bpf.h. This will make bpf_helpers_doc.py stop building bpf_helper_defs.h immediately after bpf_check_mtu, which will affect future add functions.
--- include/uapi/linux/bpf.h | 2 +- tools/include/uapi/linux/bpf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
include/uapi/linux/bpf.h +1 -1
@@ -3850,7 +3850,7 @@ union bpf_attr {* * long bpf_check_mtu(void *ctx, u32 ifindex, u32 *mtu_len, s32 len_diff, u64 flags) * Description - +* * Check ctx packet size against exceeding MTU of net device (based * on *ifindex*). This helper will likely be used in combination * with helpers that adjust/change the packet size.
tools/include/uapi/linux/bpf.h +1 -1
@@ -3850,7 +3850,7 @@ union bpf_attr {* * long bpf_check_mtu(void *ctx, u32 ifindex, u32 *mtu_len, s32 len_diff, u64 flags) * Description - +* * Check ctx packet size against exceeding MTU of net device (based * on *ifindex*). This helper will likely be used in combination * with helpers that adjust/change the packet size.
Signature · 1 line
2.26.2
PATCH v2 1/1 bpf: remove blank line in bpf helper description
Commit 34b2021cc616 ("bpf: Add BPF-helper for MTU checking") added an extra blank line in bpf helper description. This will make bpf_helpers_doc.py stop building bpf_helper_defs.h immediately after bpf_check_mtu, which will affect future add functions.
---
v2: remove the blank line directly instead of adding a *
--- include/uapi/linux/bpf.h | 1 - tools/include/uapi/linux/bpf.h | 1 - 2 files changed, 2 deletions(-)
include/uapi/linux/bpf.h +0 -1
@@ -3850,7 +3850,6 @@ union bpf_attr {* * long bpf_check_mtu(void *ctx, u32 ifindex, u32 *mtu_len, s32 len_diff, u64 flags) * Description -* Check ctx packet size against exceeding MTU of net device (based * on *ifindex*). This helper will likely be used in combination * with helpers that adjust/change the packet size.
tools/include/uapi/linux/bpf.h +0 -1
@@ -3850,7 +3850,6 @@ union bpf_attr {* * long bpf_check_mtu(void *ctx, u32 ifindex, u32 *mtu_len, s32 len_diff, u64 flags) * Description -* Check ctx packet size against exceeding MTU of net device (based * on *ifindex*). This helper will likely be used in combination * with helpers that adjust/change the packet size.
Signature · 1 line
2.26.2
Re: [PATCHv2 bpf-next] bpf: remove blank line in bpf helper description
Quoted 5 lines · On Tue, 23 Feb 2021 21:14:57 +0800 Hangbin Liu <[email protected]> wrote:
Commit
34b2021cc616("bpf: Add BPF-helper for MTU checking") added an extra blank line in bpf helper description. This will makebpf_helpers_doc.pystop buildingbpf_helper_defs.himmediately afterbpf_check_mtu, which will affect future add functions.
Quoted 8 lines
Fixes 34b2021cc616 ("bpf: Add BPF-helper for MTU checking")Signed-off-by Hangbin Liu <[email protected]>---
v2: remove the blank line directly instead of adding a *--- include/uapi/linux/bpf.h | 1 - tools/include/uapi/linux/bpf.h | 1 - 2 files changed, 2 deletions(-)
Quoted 24 lines
include/uapi/linux/bpf.h +0
-1@@ -3850,7 +3850,6 @@ union bpf_attr {* * long bpf_check_mtu(void *ctx, u32 ifindex, u32 *mtu_len, s32 len_diff, u64 flags) * Description -* Check ctx packet size against exceeding MTU of net device (based * on *ifindex*). This helper will likely be used in combination * with helpers that adjust/change the packet size. tools/include/uapi/linux/bpf.h +0
-1@@ -3850,7 +3850,6 @@ union bpf_attr {* * long bpf_check_mtu(void *ctx, u32 ifindex, u32 *mtu_len, s32 len_diff, u64 flags) * Description -* Check ctx packet size against exceeding MTU of net device (based * on *ifindex*). This helper will likely be used in combination * with helpers that adjust/change the packet size.
Signature · 4 lines
Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer
Re: [PATCHv2 bpf-next] bpf: remove blank line in bpf helper description
In reply to Hangbin LiuThis patch was applied to bpf/bpf.git (refs/heads/master):
Hello:
This patch was applied to bpf/bpf.git (refs/heads/master):
Quoted 9 lines · On Tue, 23 Feb 2021 21:14:57 +0800 you wrote:
Commit
34b2021cc616("bpf: Add BPF-helper for MTU checking") added an extra blank line in bpf helper description. This will makebpf_helpers_doc.pystop buildingbpf_helper_defs.himmediately afterbpf_check_mtu, which will affect future add functions.Fixes 34b2021cc616 ("bpf: Add BPF-helper for MTU checking")Signed-off-by Hangbin Liu <[email protected]>[...]
Here is the summary with links:
- [PATCHv2,bpf-next] bpf: remove blank line in bpf helper description
https://git.kernel.org/bpf/bpf/c/a7c9c25a99bb
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Quoted 11 lines · On Tue, 23 Feb 2021 20:45:54 +0800 Hangbin Liu <[email protected]> wrote:
Commit
34b2021cc616("bpf: Add BPF-helper for MTU checking") lost a * inbpf.h. This will makebpf_helpers_doc.pystop buildingbpf_helper_defs.himmediately afterbpf_check_mtu, which will affect future add functions.Fixes 34b2021cc616 ("bpf: Add BPF-helper for MTU checking")Signed-off-by Hangbin Liu <[email protected]>--- include/uapi/linux/bpf.h | 2 +- tools/include/uapi/linux/bpf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Thanks for fixing that!
I though I had already fix that, but I must have missed or reintroduced this, when I rolling back broken ideas in V13.
I usually run this command to check the man-page (before submitting):
./scripts/bpf_helpers_doc.py | rst2man | man -l -
Quoted 26 lines
include/uapi/linux/bpf.h +1
-1@@ -3850,7 +3850,7 @@ union bpf_attr {* * long bpf_check_mtu(void *ctx, u32 ifindex, u32 *mtu_len, s32 len_diff, u64 flags) * Description - +* * Check ctx packet size against exceeding MTU of net device (based * on *ifindex*). This helper will likely be used in combination * with helpers that adjust/change the packet size. tools/include/uapi/linux/bpf.h +1
-1@@ -3850,7 +3850,7 @@ union bpf_attr {* * long bpf_check_mtu(void *ctx, u32 ifindex, u32 *mtu_len, s32 len_diff, u64 flags) * Description - +* * Check ctx packet size against exceeding MTU of net device (based * on *ifindex*). This helper will likely be used in combination * with helpers that adjust/change the packet size.
Signature · 4 lines
Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer
Daniel Borkmann
maintainerQuoted 15 lines · Jesper Dangaard Brouer
Quoted 11 lines · On Tue, 23 Feb 2021 20:45:54 +0800 Hangbin Liu <[email protected]> wrote:
Commit
34b2021cc616("bpf: Add BPF-helper for MTU checking") lost a * inbpf.h. This will makebpf_helpers_doc.pystop buildingbpf_helper_defs.himmediately afterbpf_check_mtu, which will affect future add functions.Fixes 34b2021cc616 ("bpf: Add BPF-helper for MTU checking")Signed-off-by Hangbin Liu <[email protected]>--- include/uapi/linux/bpf.h | 2 +- tools/include/uapi/linux/bpf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Quoted 3 lines
Thanks for fixing that!
Thanks guys, applied!
Quoted 6 lines
I though I had already fix that, but I must have missed or reintroduced this, when I rolling back broken ideas in V13.
I usually run this command to check the man-page (before submitting):
./scripts/bpf_helpers_doc.py| rst2man | man -l -
[+ Andrii] maybe this could be included to run as part of CI to catch such things in advance?
Quoted 29 lines
Quoted 26 lines
include/uapi/linux/bpf.h +1
-1@@ -3850,7 +3850,7 @@ union bpf_attr {* * long bpf_check_mtu(void *ctx, u32 ifindex, u32 *mtu_len, s32 len_diff, u64 flags) * Description - +* * Check ctx packet size against exceeding MTU of net device (based * on *ifindex*). This helper will likely be used in combination * with helpers that adjust/change the packet size. tools/include/uapi/linux/bpf.h +1
-1@@ -3850,7 +3850,7 @@ union bpf_attr {* * long bpf_check_mtu(void *ctx, u32 ifindex, u32 *mtu_len, s32 len_diff, u64 flags) * Description - +* * Check ctx packet size against exceeding MTU of net device (based * on *ifindex*). This helper will likely be used in combination * with helpers that adjust/change the packet size.
Quoted 26 lines · Daniel Borkmann
Quoted 15 lines · Jesper Dangaard Brouer
Quoted 11 lines · On Tue, 23 Feb 2021 20:45:54 +0800 Hangbin Liu <[email protected]> wrote:
Commit
34b2021cc616("bpf: Add BPF-helper for MTU checking") lost a * inbpf.h. This will makebpf_helpers_doc.pystop buildingbpf_helper_defs.himmediately afterbpf_check_mtu, which will affect future add functions.Fixes 34b2021cc616 ("bpf: Add BPF-helper for MTU checking")Signed-off-by Hangbin Liu <[email protected]>--- include/uapi/linux/bpf.h | 2 +- tools/include/uapi/linux/bpf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)Quoted 3 lines
Thanks for fixing that!
Thanks guys, applied!
Quoted 3 lines
I though I had already fix that, but I must have missed or reintroduced this, when I rolling back broken ideas in V13.
Quoted 6 lines
Quoted 3 lines
I usually run this command to check the man-page (before submitting):
./scripts/bpf_helpers_doc.py| rst2man | man -l -[+ Andrii] maybe this could be included to run as part of CI to catch such things in advance?
We do something like that as part of bpftool build, so there is no reason we can't add this to selftests/bpf/Makefile as well.
Quoted 31 lines
Quoted 30 lines
Quoted 27 lines
include/uapi/linux/bpf.h +1
-1@@ -3850,7 +3850,7 @@ union bpf_attr {* * long bpf_check_mtu(void *ctx, u32 ifindex, u32 *mtu_len, s32 len_diff, u64 flags) * Description - +* * Check ctx packet size against exceeding MTU of net device (based * on *ifindex*). This helper will likely be used in combination * with helpers that adjust/change the packet size. tools/include/uapi/linux/bpf.h +1
-1@@ -3850,7 +3850,7 @@ union bpf_attr {* * long bpf_check_mtu(void *ctx, u32 ifindex, u32 *mtu_len, s32 len_diff, u64 flags) * Description - +* * Check ctx packet size against exceeding MTU of net device (based * on *ifindex*). This helper will likely be used in combination * with helpers that adjust/change the packet size.
2021-02-24 10:59 UTC-0800 ~ Andrii Nakryiko <[email protected]>
Quoted 29 lines · Daniel Borkmann
Quoted 28 lines · Jesper Dangaard Brouer
Quoted 15 lines
Quoted 11 lines · On Tue, 23 Feb 2021 20:45:54 +0800 Hangbin Liu <[email protected]> wrote:
Commit
34b2021cc616("bpf: Add BPF-helper for MTU checking") lost a * inbpf.h. This will makebpf_helpers_doc.pystop buildingbpf_helper_defs.himmediately afterbpf_check_mtu, which will affect future add functions.Fixes 34b2021cc616 ("bpf: Add BPF-helper for MTU checking")Signed-off-by Hangbin Liu <[email protected]>--- include/uapi/linux/bpf.h | 2 +- tools/include/uapi/linux/bpf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)Quoted 3 lines
Thanks for fixing that!
Thanks guys, applied!
Quoted 5 lines
I though I had already fix that, but I must have missed or reintroduced this, when I rolling back broken ideas in V13.
I usually run this command to check the man-page (before submitting):
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
./scripts/bpf_helpers_doc.py| rst2man | man -l -[+ Andrii] maybe this could be included to run as part of CI to catch such things in advance?
We do something like that as part of bpftool build, so there is no reason we can't add this to selftests/bpf/Makefile as well.
Hi, pretty sure this is the case already? [0]
This helps catching RST formatting issues, for example if a description is using invalid markup, and reported by rst2man. My understanding is that in the current case, the missing star simply ends the block for the helpers documentation from the parser point of view, it's not considered an error.
I see two possible workarounds:
1) Check that the number of helpers found ("len(self.helpers)") is equal to the number of helpers in the file, but that requires knowing how many helpers we have in the first place (e.g. parsing "__BPF_FUNC_MAPPER(FN)").
2) Add some ending tag to the documentation block, and make sure we eventually reach it. This is probably a much simpler solution. I could work on this (or sync with Joe (+Cc) who is also working on these bits for documenting the bpf() syscall).
Quentin
Quoted 47 lines · Quentin Monnet
2021-02-24 10:59 UTC-0800 ~ Andrii Nakryiko <[email protected]>
Quoted 29 lines · Daniel Borkmann
Quoted 28 lines · Jesper Dangaard Brouer
Quoted 15 lines
Quoted 11 lines · On Tue, 23 Feb 2021 20:45:54 +0800 Hangbin Liu <[email protected]> wrote:
Commit
34b2021cc616("bpf: Add BPF-helper for MTU checking") lost a * inbpf.h. This will makebpf_helpers_doc.pystop buildingbpf_helper_defs.himmediately afterbpf_check_mtu, which will affect future add functions.Fixes 34b2021cc616 ("bpf: Add BPF-helper for MTU checking")Signed-off-by Hangbin Liu <[email protected]>--- include/uapi/linux/bpf.h | 2 +- tools/include/uapi/linux/bpf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)Quoted 3 lines
Thanks for fixing that!
Thanks guys, applied!
Quoted 5 lines
I though I had already fix that, but I must have missed or reintroduced this, when I rolling back broken ideas in V13.
I usually run this command to check the man-page (before submitting):
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
./scripts/bpf_helpers_doc.py| rst2man | man -l -[+ Andrii] maybe this could be included to run as part of CI to catch such things in advance?
We do something like that as part of bpftool build, so there is no reason we can't add this to selftests/bpf/Makefile as well.
Hi, pretty sure this is the case already? [0]
This helps catching RST formatting issues, for example if a description is using invalid markup, and reported by rst2man. My understanding is that in the current case, the missing star simply ends the block for the helpers documentation from the parser point of view, it's not considered an error.
Quoted 5 lines
I see two possible workarounds:
1) Check that the number of helpers found ("len(self.helpers)") is equal to the number of helpers in the file, but that requires knowing how many helpers we have in the first place (e.g. parsing "
__BPF_FUNC_MAPPER(FN)").
It's a bit hacky, but you could also just count a number of '* \tDescription' lines.
Quoted 5 lines
2) Add some ending tag to the documentation block, and make sure we eventually reach it. This is probably a much simpler solution. I could work on this (or sync with Joe (+Cc) who is also working on these bits for documenting the
bpf()syscall).
Fine by me as well.
Quoted 47 lines · Quentin Monnet
2021-02-24 10:59 UTC-0800 ~ Andrii Nakryiko <[email protected]>
Quoted 29 lines · Daniel Borkmann
Quoted 28 lines · Jesper Dangaard Brouer
Quoted 15 lines
Quoted 11 lines · On Tue, 23 Feb 2021 20:45:54 +0800 Hangbin Liu <[email protected]> wrote:
Commit
34b2021cc616("bpf: Add BPF-helper for MTU checking") lost a * inbpf.h. This will makebpf_helpers_doc.pystop buildingbpf_helper_defs.himmediately afterbpf_check_mtu, which will affect future add functions.Fixes 34b2021cc616 ("bpf: Add BPF-helper for MTU checking")Signed-off-by Hangbin Liu <[email protected]>--- include/uapi/linux/bpf.h | 2 +- tools/include/uapi/linux/bpf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)Quoted 3 lines
Thanks for fixing that!
Thanks guys, applied!
Quoted 5 lines
I though I had already fix that, but I must have missed or reintroduced this, when I rolling back broken ideas in V13.
I usually run this command to check the man-page (before submitting):
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
./scripts/bpf_helpers_doc.py| rst2man | man -l -[+ Andrii] maybe this could be included to run as part of CI to catch such things in advance?
We do something like that as part of bpftool build, so there is no reason we can't add this to selftests/bpf/Makefile as well.
Hi, pretty sure this is the case already? [0]
This helps catching RST formatting issues, for example if a description is using invalid markup, and reported by rst2man. My understanding is that in the current case, the missing star simply ends the block for the helpers documentation from the parser point of view, it's not considered an error.
Quoted 5 lines
I see two possible workarounds:
1) Check that the number of helpers found ("len(self.helpers)") is equal to the number of helpers in the file, but that requires knowing how many helpers we have in the first place (e.g. parsing "
__BPF_FUNC_MAPPER(FN)").
This is not so difficult as long as we stick to one symbol per line:
scripts/bpf_doc.py +14 -0
@@ -183,25 +183,51 @@ class HeaderParser(object): self.reader.readline() self.line = self.reader.readline() + def get_elem_count(self, target): + self.seek_to(target, 'Could not find symbol "%s"' % target) + end_re = re.compile('^$') + count = 0 + while True: + capture = end_re.match(self.line) + if capture: + break + self.line = self.reader.readline() + count += 1 + + # The last line (either '};' or '/* */' doesn't count. + return count +
I can either roll this into my docs update v2, or hold onto it for another dedicated patch fixup. Either way I'm trialing this out locally to regression-test my own docs update PR and make sure I'm not breaking one of the various output formats.
This patch was applied to bpf/bpf.git (refs/heads/master):
Hello:
This patch was applied to bpf/bpf.git (refs/heads/master):
Quoted 9 lines · On Tue, 23 Feb 2021 20:45:54 +0800 you wrote:
Commit
34b2021cc616("bpf: Add BPF-helper for MTU checking") lost a * inbpf.h. This will makebpf_helpers_doc.pystop buildingbpf_helper_defs.himmediately afterbpf_check_mtu, which will affect future add functions.Fixes 34b2021cc616 ("bpf: Add BPF-helper for MTU checking")Signed-off-by Hangbin Liu <[email protected]>[...]
Here is the summary with links:
- [bpf-next] bpf: fix missing * in bpf.h
https://git.kernel.org/bpf/bpf/c/f566aac4e053
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html