Skip to content

Commit

Permalink
tools: ynl: generate code for the ethtool family
Browse files Browse the repository at this point in the history
Generate the protocol code for ethtool. Skip the stats
for now, they are the only outlier in terms of complexity.
Stats are a sort-of semi-polymorphic (attr space of a nest
depends on value of another attr) or a type-value-scalar,
depending on how one wants to look at it...
A challenge for another time.

Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
kuba-moo authored and davem330 committed Jun 12, 2023
1 parent 6833571 commit 2d7be50
Show file tree
Hide file tree
Showing 3 changed files with 11,890 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tools/net/ynl/generated/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ ifeq ("$(DEBUG)","1")
CFLAGS += -g -fsanitize=address -fsanitize=leak -static-libasan
endif

YNL_GEN_ARG_ethtool:=--user-header linux/ethtool_netlink.h \
--exclude-op stats-get

TOOL:=../ynl-gen-c.py

GENS:=devlink handshake fou netdev
GENS:=ethtool devlink handshake fou netdev
SRCS=$(patsubst %,%-user.c,${GENS})
HDRS=$(patsubst %,%-user.h,${GENS})
OBJS=$(patsubst %,%-user.o,${GENS})
Expand All @@ -22,11 +25,11 @@ protos.a: $(OBJS)

%-user.h: ../../../../Documentation/netlink/specs/%.yaml $(TOOL)
@echo -e "\tGEN $@"
@$(TOOL) --mode user --header --spec $< > $@
@$(TOOL) --mode user --header --spec $< $(YNL_GEN_ARG_$*) > $@

%-user.c: ../../../../Documentation/netlink/specs/%.yaml $(TOOL)
@echo -e "\tGEN $@"
@$(TOOL) --mode user --source --spec $< > $@
@$(TOOL) --mode user --source --spec $< $(YNL_GEN_ARG_$*) > $@

%-user.o: %-user.c %-user.h
@echo -e "\tCC $@"
Expand Down
Loading

0 comments on commit 2d7be50

Please sign in to comment.