Skip to content

Commit 8180c4f

Browse files
author
Paolo Abeni
committed
Merge branch 'tools-ynl-turn-the-page-pool-sample-into-a-real-tool'
Jakub Kicinski says: ==================== tools: ynl: turn the page-pool sample into a real tool The page-pool YNL sample is quite useful. It's helps calculate recycling rate and memory consumption. Since we still haven't figured out a way to integrate with iproute2 (not for the lack of thinking how to solve it) - create a ynltool command in ynl. Add page-pool and qstats support. Most commands can use the Python YNL CLI directly but low level stats often need aggregation or some math on top to be useful. Specifically in this patch set: - page pool stats are aggregated and recycling rate computed - per-queue stats are used to compute traffic balance across queues v1: https://lore.kernel.org/[email protected] ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
2 parents 8da7bea + 9eef97a commit 8180c4f

File tree

10 files changed

+1811
-150
lines changed

10 files changed

+1811
-150
lines changed

tools/net/ynl/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ endif
1212
libdir ?= $(prefix)/$(libdir_relative)
1313
includedir ?= $(prefix)/include
1414

15-
SUBDIRS = lib generated samples
15+
SUBDIRS = lib generated samples ynltool
1616

1717
all: $(SUBDIRS) libynl.a
1818

19+
ynltool: | lib generated libynl.a
1920
samples: | lib generated
2021
libynl.a: | lib generated
2122
@echo -e "\tAR $@"

tools/net/ynl/samples/page-pool.c

Lines changed: 0 additions & 149 deletions
This file was deleted.

tools/net/ynl/ynltool/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ynltool

tools/net/ynl/ynltool/Makefile

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
3+
include ../Makefile.deps
4+
5+
INSTALL ?= install
6+
prefix ?= /usr
7+
8+
CC := gcc
9+
CFLAGS := -Wall -Wextra -Werror -O2
10+
ifeq ("$(DEBUG)","1")
11+
CFLAGS += -g -fsanitize=address -fsanitize=leak -static-libasan
12+
endif
13+
CFLAGS += -I../lib -I../generated -I../../../include/uapi/
14+
15+
SRC_VERSION := \
16+
$(shell make --no-print-directory -sC ../../../.. kernelversion || \
17+
echo "unknown")
18+
19+
CFLAGS += -DSRC_VERSION='"$(SRC_VERSION)"'
20+
21+
SRCS := $(wildcard *.c)
22+
OBJS := $(patsubst %.c,$(OUTPUT)%.o,$(SRCS))
23+
24+
YNLTOOL := $(OUTPUT)ynltool
25+
26+
include $(wildcard *.d)
27+
28+
all: $(YNLTOOL)
29+
30+
Q = @
31+
32+
$(YNLTOOL): ../libynl.a $(OBJS)
33+
$(Q)echo -e "\tLINK $@"
34+
$(Q)$(CC) $(CFLAGS) -o $@ $(OBJS) ../libynl.a -lmnl -lm
35+
36+
%.o: %.c ../libynl.a
37+
$(Q)echo -e "\tCC $@"
38+
$(Q)$(COMPILE.c) -MMD -c -o $@ $<
39+
40+
../libynl.a:
41+
$(Q)$(MAKE) -C ../
42+
43+
clean:
44+
rm -f *.o *.d *~
45+
46+
distclean: clean
47+
rm -f $(YNLTOOL)
48+
49+
bindir ?= /usr/bin
50+
51+
install: $(YNLTOOL)
52+
install -m 0755 $(YNLTOOL) $(DESTDIR)$(bindir)/$(YNLTOOL)
53+
54+
.PHONY: all clean distclean
55+
.DEFAULT_GOAL=all

0 commit comments

Comments
 (0)