Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ BitFieldColonSpacing: Both
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: MultiLine
AfterControlStatement: Never
AfterEnum: false
AfterExternBlock: false
AfterFunction: false
Expand All @@ -56,7 +56,6 @@ BreakConstructorInitializers: BeforeComma
BreakConstructorInitializersBeforeComma: false
BreakInheritanceList: BeforeColon
BreakStringLiterals: true
BracedInitializerIndentWidth: 8
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
Expand Down Expand Up @@ -174,7 +173,7 @@ SpacesInLineCommentPrefix:
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Latest
Standard: c++20
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,28 @@ jobs:
runs-on: ubuntu-latest
container: fedora:latest
steps:
- uses: actions/checkout@v4
- run: |
dnf install -y \
make gcc ninja-build meson clang-tools-extra git gcovr scdoc \
make gcc ninja-build meson git gcovr scdoc \
libasan \
libcmocka-devel \
libedit-devel \
libevent-devel \
numactl-devel \
python3-pyelftools
- uses: actions/checkout@v4
- run: make
- run: make coverage
lint:
runs-on: ubuntu-latest
steps:
- run: sudo apt-get install make clang-format git
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: make lint
# TODO: later, check commit messages here
- run: |
git config --global --add safe.directory $PWD
git log --oneline --decorate "${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}"
if: ${{ github.event.pull_request.base.sha && github.event.pull_request.head.sha }}
16 changes: 9 additions & 7 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,17 @@ $(BUILDDIR)/build.ninja:
meson setup $(BUILDDIR) $(meson_opts)

prune = -path $1 -prune -o
exclude = $(BUILDDIR) subprojects LICENSE .git README.md .lsan-suppressions main/include/stb_ds.h
c_src = `find * .* $(foreach d,$(exclude),$(call prune,$d)) -type f -name '*.[ch]' -print`
all_files = `find * .* $(foreach d,$(exclude),$(call prune,$d)) -type f -print`
exclude = $(BUILDDIR) subprojects LICENSE README.md main/include/stb_ds.h
c_src = find * $(foreach d,$(exclude),$(call prune,$d)) -type f -name '*.[ch]' -print
all_files = find * $(foreach d,$(exclude),$(call prune,$d)) -type f -print

.PHONY: lint
lint: $(BUILDDIR)/build.ninja
lint:
@echo '[clang-format]'
$Q clang-format --dry-run --Werror $(c_src)
$Q tmp=`mktemp` && trap "rm -f $$tmp" EXIT && $(c_src) > "$$tmp" && \
clang-format --files="$$tmp" --dry-run --Werror
@echo '[license-check]'
$Q ! for f in $(all_files); do \
$Q ! $(all_files) | while read -r f; do \
if ! grep -qF 'SPDX-License-Identifier: BSD-3-Clause' $$f; then \
echo $$f; \
fi; \
Expand All @@ -65,4 +66,5 @@ lint: $(BUILDDIR)/build.ninja
.PHONY: format
format:
@echo '[clang-format]'
$Q clang-format -i --verbose $(c_src)
$Q tmp=`mktemp` && trap "rm -f $$tmp" EXIT && $(c_src) > "$$tmp" && \
clang-format --files="$$tmp" -i --verbose
3 changes: 1 addition & 2 deletions modules/ip4/datapath/lookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ lookup_process(struct rte_graph *graph, struct rte_node *node, void **objs, uint

// TODO: optimize with lookup of multiple packets
if (rte_fib_lookup_bulk(fib, &dst_addr, &next_hop, 1) < 0
|| next_hop == BR_NO_ROUTE)
{
|| next_hop == BR_NO_ROUTE) {
next = NO_ROUTE;
goto next_packet;
}
Expand Down