Re: [PATCH net-next v6 0/4] net/sched: retpoline wrappers for tc

From: Rudi Heitbaum
Date: Tue Dec 27 2022 - 08:47:28 EST


On Tue, Dec 27, 2022 at 09:24:22AM -0300, Pedro Tammela wrote:
> On 27/12/2022 05:33, Rudi Heitbaum wrote:
> > Hi Pedro,
> >
> > Compiling kernel 6.2-rc1 fails on x86_64 when CONFIG_NET_CLS or
> > CONFIG_NET_CLS_ACT is not set, when CONFIG_RETPOLINE=y is set.

...

> Hi Rudi,
>
> Thanks for the report.
> Could you try the following patch?
>
> diff --git a/include/net/tc_wrapper.h b/include/net/tc_wrapper.h
> index ceed2fc089ff..d323fffb839a 100644
> --- a/include/net/tc_wrapper.h
> +++ b/include/net/tc_wrapper.h
> @@ -216,6 +216,8 @@ static inline int tc_classify(struct sk_buff *skb, const
> struct tcf_proto *tp,
> return tp->classify(skb, tp, res);
> }
>
> +#endif /* CONFIG_NET_CLS */
> +
> static inline void tc_wrapper_init(void)
> {
> #ifdef CONFIG_X86
> @@ -224,8 +226,6 @@ static inline void tc_wrapper_init(void)
> #endif
> }
>
> -#endif /* CONFIG_NET_CLS */
> -
> #else
>
> #define TC_INDIRECT_SCOPE static

Hi Pedro,

I had to adjust it slightly to apply cleanly.
But works correctly with my .config now.

Thanks
Rudi

Tested-by: Rudi Heitbaum <rudi@xxxxxxxxxxxx>

diff --git a/include/net/tc_wrapper.h b/include/net/tc_wrapper.h
index ceed2fc089ff..d323fffb839a 100644
--- a/include/net/tc_wrapper.h
+++ b/include/net/tc_wrapper.h
@@ -216,6 +216,8 @@
return tp->classify(skb, tp, res);
}

+#endif /* CONFIG_NET_CLS */
+
static inline void tc_wrapper_init(void)
{
#ifdef CONFIG_X86
@@ -224,8 +226,6 @@
#endif
}

-#endif /* CONFIG_NET_CLS */
-
#else

#define TC_INDIRECT_SCOPE static