From 1c54bfa8ed3b8c6eb86140ff96ba8c751a519d0a Mon Sep 17 00:00:00 2001 From: Nicolas PLANEL Date: Thu, 6 Mar 2025 19:04:29 +0100 Subject: [PATCH 1/6] index: add VPP repository FD.io's Vector Packet Processor (VPP) is a fast, scalable layer 2-4 multi-platform network stack. It runs in Linux Userspace on multiple architectures including x86, ARM, and Power architectures. VPP's high performance network stack is quickly becoming the network stack of choice for applications around the world. Signed-off-by: Nicolas PLANEL Signed-off-by: Nicolas PLANEL --- utils/index | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/index b/utils/index index 8bd4312f..3298a873 100755 --- a/utils/index +++ b/utils/index @@ -142,6 +142,7 @@ add_default_remotes $1 $# $2 xen https://xenbits.xen.org/git-http/xen.git add_default_remotes $1 $# $2 freebsd https://git.freebsd.org/src.git add_default_remotes $1 $# $2 opensbi https://github.com/riscv-software-src/opensbi add_default_remotes $1 $# $2 iproute2 https://git.kernel.org/pub/scm/network/iproute2/iproute2.git +add_default_remotes $1 $# $2 vpp https://gerrit.fd.io/r/vpp # Index a single project if test "x$2" != "x--all"; then From e6e2b86f5b761fe2e2aabe850f4b10d42625ce52 Mon Sep 17 00:00:00 2001 From: Nicolas PLANEL Date: Mon, 17 Mar 2025 17:35:31 +0100 Subject: [PATCH 2/6] filter: introduce prefix_path parameter --- elixir/filters/cpppathinc.py | 2 +- elixir/filters/projects.py | 5 +++++ elixir/filters/utils.py | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/elixir/filters/cpppathinc.py b/elixir/filters/cpppathinc.py index 6d3c48c2..6049e6e0 100755 --- a/elixir/filters/cpppathinc.py +++ b/elixir/filters/cpppathinc.py @@ -35,7 +35,7 @@ def keep_cpppathinc(m): def untransform_formatted_code(self, ctx: FilterContext, html: str) -> str: def replace_cpppathinc(m): w = self.cpppathinc[decode_number(m.group(1)) - 1] - path = f'/include/{ w }' + path = f'/%s/{ w }' % self.prefix_path return f'{ w }' return re.sub('__KEEPCPPPATHINC__([A-J]+)', replace_cpppathinc, html, flags=re.MULTILINE) diff --git a/elixir/filters/projects.py b/elixir/filters/projects.py index f3a48d21..a490b9f9 100755 --- a/elixir/filters/projects.py +++ b/elixir/filters/projects.py @@ -110,6 +110,11 @@ *default_filters, ConfigInFilter, ], + 'vpp': [ + *default_filters, + (CppPathIncFilter, {"prefix_path": 'src'}), + MakefileFileFilter, + ], 'zephyr': [ *default_filters, DtsiFilter, diff --git a/elixir/filters/utils.py b/elixir/filters/utils.py index e0d74398..9b5b949c 100755 --- a/elixir/filters/utils.py +++ b/elixir/filters/utils.py @@ -28,9 +28,11 @@ class FilterContext: # up to the filter, but it's important to be careful to not break formatting. # The second part runs on HTML, replacing markings left by the first part with HTML code. # path_exceptions: list of regexes, disables filter if path of the filtered file matches a regex from the list +# prefix_path: will be used to replace the prefix path during the untransform_formatted_code step class Filter: - def __init__(self, path_exceptions: List[str] = []): + def __init__(self, path_exceptions: List[str] = [], prefix_path: str = "include"): self.path_exceptions = path_exceptions + self.prefix_path = prefix_path # Return True if filter can be applied to file with path def check_if_applies(self, ctx: FilterContext) -> bool: From d17b2493947bd2e6a9c8793a0a086f1086e16d6e Mon Sep 17 00:00:00 2001 From: Nicolas PLANEL Date: Mon, 17 Mar 2025 20:05:03 +0100 Subject: [PATCH 3/6] cpppathinc: prefix_path as a list of prefix path --- elixir/filters/cpppathinc.py | 7 +++++-- elixir/filters/projects.py | 2 +- elixir/filters/utils.py | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/elixir/filters/cpppathinc.py b/elixir/filters/cpppathinc.py index 6049e6e0..9c21fc73 100755 --- a/elixir/filters/cpppathinc.py +++ b/elixir/filters/cpppathinc.py @@ -35,8 +35,11 @@ def keep_cpppathinc(m): def untransform_formatted_code(self, ctx: FilterContext, html: str) -> str: def replace_cpppathinc(m): w = self.cpppathinc[decode_number(m.group(1)) - 1] - path = f'/%s/{ w }' % self.prefix_path - return f'{ w }' + for p in self.prefix_path: + path = f'/%s/{ w }' % p + if ctx.query.query('exist', ctx.tag, path): + return f'{ w }' + return w return re.sub('__KEEPCPPPATHINC__([A-J]+)', replace_cpppathinc, html, flags=re.MULTILINE) diff --git a/elixir/filters/projects.py b/elixir/filters/projects.py index a490b9f9..c48e573a 100755 --- a/elixir/filters/projects.py +++ b/elixir/filters/projects.py @@ -112,7 +112,7 @@ ], 'vpp': [ *default_filters, - (CppPathIncFilter, {"prefix_path": 'src'}), + (CppPathIncFilter, {"prefix_path": ['src', 'src/plugins']}), MakefileFileFilter, ], 'zephyr': [ diff --git a/elixir/filters/utils.py b/elixir/filters/utils.py index 9b5b949c..fe2d3e4f 100755 --- a/elixir/filters/utils.py +++ b/elixir/filters/utils.py @@ -28,9 +28,9 @@ class FilterContext: # up to the filter, but it's important to be careful to not break formatting. # The second part runs on HTML, replacing markings left by the first part with HTML code. # path_exceptions: list of regexes, disables filter if path of the filtered file matches a regex from the list -# prefix_path: will be used to replace the prefix path during the untransform_formatted_code step +# prefix_path: a list of paths, will be used to replace the prefix path during the untransform_formatted_code step class Filter: - def __init__(self, path_exceptions: List[str] = [], prefix_path: str = "include"): + def __init__(self, path_exceptions: List[str] = [], prefix_path: List[str] = ["include"]): self.path_exceptions = path_exceptions self.prefix_path = prefix_path From 787ac461b8d4830b79a45a65319ba4e5272ffe3f Mon Sep 17 00:00:00 2001 From: Nicolas PLANEL Date: Mon, 17 Mar 2025 20:24:35 +0100 Subject: [PATCH 4/6] add more search include path --- elixir/filters/projects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elixir/filters/projects.py b/elixir/filters/projects.py index c48e573a..7b1f34d6 100755 --- a/elixir/filters/projects.py +++ b/elixir/filters/projects.py @@ -112,7 +112,7 @@ ], 'vpp': [ *default_filters, - (CppPathIncFilter, {"prefix_path": ['src', 'src/plugins']}), + (CppPathIncFilter, {"prefix_path": ['src', 'src/plugins', 'src/vpp-api', 'src/vpp-api/vapi']}), MakefileFileFilter, ], 'zephyr': [ From 08fd4bb634008108eef75929fc1a61d3166e7221 Mon Sep 17 00:00:00 2001 From: Nicolas PLANEL Date: Mon, 28 Apr 2025 14:28:36 +0200 Subject: [PATCH 5/6] move prefix_path arg to CppPathIncFilter --- elixir/filters/cpppathinc.py | 5 ++++- elixir/filters/utils.py | 4 +--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/elixir/filters/cpppathinc.py b/elixir/filters/cpppathinc.py index 9c21fc73..0915fcfa 100755 --- a/elixir/filters/cpppathinc.py +++ b/elixir/filters/cpppathinc.py @@ -1,4 +1,5 @@ import re +from typing import List from .utils import Filter, FilterContext, encode_number, decode_number, extension_matches # Filters for cpp includes like these: @@ -8,8 +9,10 @@ # If we make references to other projects, we could # end up with links to headers which are outside the project # Example: u-boot/v2023.10/source/env/embedded.c#L16 +# prefix_path: a list of paths, will be used to replace the prefix path during the untransform_formatted_code step class CppPathIncFilter(Filter): - def __init__(self, *args, **kwargs): + def __init__(self, prefix_path: List[str] = ["include"], *args, **kwargs): + self.prefix_path = prefix_path super().__init__(*args, **kwargs) self.cpppathinc = [] diff --git a/elixir/filters/utils.py b/elixir/filters/utils.py index fe2d3e4f..e0d74398 100755 --- a/elixir/filters/utils.py +++ b/elixir/filters/utils.py @@ -28,11 +28,9 @@ class FilterContext: # up to the filter, but it's important to be careful to not break formatting. # The second part runs on HTML, replacing markings left by the first part with HTML code. # path_exceptions: list of regexes, disables filter if path of the filtered file matches a regex from the list -# prefix_path: a list of paths, will be used to replace the prefix path during the untransform_formatted_code step class Filter: - def __init__(self, path_exceptions: List[str] = [], prefix_path: List[str] = ["include"]): + def __init__(self, path_exceptions: List[str] = []): self.path_exceptions = path_exceptions - self.prefix_path = prefix_path # Return True if filter can be applied to file with path def check_if_applies(self, ctx: FilterContext) -> bool: From 7c4fb1148b9dda4f89018590da86c46b0e11d5f4 Mon Sep 17 00:00:00 2001 From: Nicolas PLANEL Date: Mon, 28 Apr 2025 17:38:00 +0200 Subject: [PATCH 6/6] use Query.file_exists() --- elixir/filters/cpppathinc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elixir/filters/cpppathinc.py b/elixir/filters/cpppathinc.py index 0915fcfa..d37875a5 100755 --- a/elixir/filters/cpppathinc.py +++ b/elixir/filters/cpppathinc.py @@ -40,7 +40,7 @@ def replace_cpppathinc(m): w = self.cpppathinc[decode_number(m.group(1)) - 1] for p in self.prefix_path: path = f'/%s/{ w }' % p - if ctx.query.query('exist', ctx.tag, path): + if ctx.query.file_exists(ctx.tag, path): return f'{ w }' return w