Subject: Re: [PATCH v2 1/3] ynl: samples: add tc filter example

From: Jakub Kicinski <[email-masked]>
Date: Tue, 11 Nov 2025 15:54:24 -0800

On Tue, 11 Nov 2025 21:09:11 +0200 Zahari Doychev wrote:
> On Mon, Nov 10, 2025 at 05:17:39PM -0800, Jakub Kicinski wrote:
> > On Thu,  6 Nov 2025 16:15:27 +0100 Zahari Doychev wrote:  
> > > diff --git a/tools/net/ynl/Makefile.deps b/tools/net/ynl/Makefile.deps
> > > index 865fd2e8519e..96c390af060e 100644
> > > --- a/tools/net/ynl/Makefile.deps
> > > +++ b/tools/net/ynl/Makefile.deps
> > > @@ -47,4 +47,5 @@ CFLAGS_tc:= $(call get_hdr_inc,__LINUX_RTNETLINK_H,rtnetlink.h) \
> > >  	$(call get_hdr_inc,_TC_MIRRED_H,tc_act/tc_mirred.h) \
> > >  	$(call get_hdr_inc,_TC_SKBEDIT_H,tc_act/tc_skbedit.h) \
> > >  	$(call get_hdr_inc,_TC_TUNNEL_KEY_H,tc_act/tc_tunnel_key.h)
> > > +CFLAGS_tc-filter-add:=$(CFLAGS_tc)  
> > 
> > Why do we need this? This file is intended for families themselves,
> > if sample needs flags it should be specified in samples/Makefile ?  
> 
> I am getting compile errors as without the CFLAGS my system
> headers files are used and not the ones in the kernel tree.
> As samples/Makfile is passing the CFLAGS_tc-filter-add when
> compiling I thought this was the way to do this similiar to the
> other examples.
> 
> Actually the following flags are fixing my problem:
>  -D__LINUX_PKT_SCHED_H -include ../../../../include/uapi//linux/pkt_sched.h
>  -D__LINUX_PKT_CLS_H -include ../../../../include/uapi//linux/pkt_cls.h
> 
> If I need to fix this in samples/Makefile then I probably need to create
> a new target. Is this really the expectation?

I meant:

diff --git a/tools/net/ynl/samples/Makefile b/tools/net/ynl/samples/Makefile
index c9494a564da4..552356473b68 100644
--- a/tools/net/ynl/samples/Makefile
+++ b/tools/net/ynl/samples/Makefile
@@ -19,6 +19,7 @@ include $(wildcard *.d)
 all: $(BINS)
 
 CFLAGS_page-pool=$(CFLAGS_netdev)
+CFLAGS_tc-filter-add=$(CFLAGS_tc)
 
 $(BINS): ../lib/ynl.a ../generated/protos.a $(SRCS)
        @echo -e '\tCC sample $@'

I could be missing something, I have 6.17 headers installed so it 
builds for me without any extra flags :(