Re: [PATCH net-next v2 2/2] net: dsa: Rename IFLA_DSA_MASTER to IFLA_DSA_CONDUIT

From: Stephen Hemminger
Date: Thu Oct 12 2023 - 22:31:03 EST


On Fri, 13 Oct 2023 02:13:45 +0300
Vladimir Oltean <olteanv@xxxxxxxxx> wrote:

> > I don't know if it would be acceptable in the kernel UAPI but what
> > we did in DPDK for similar situation to cause warning on use of deprecated value.
> >
> > /**
> > * Macro to mark macros and defines scheduled for removal
> > */
> > #if defined(RTE_CC_GCC) || defined(RTE_CC_CLANG)
> > #define RTE_PRAGMA(x) _Pragma(#x)
> > #define RTE_PRAGMA_WARNING(w) RTE_PRAGMA(GCC warning #w)
> > #define RTE_DEPRECATED(x) RTE_PRAGMA_WARNING(#x is deprecated)
> > #else
> > #define RTE_DEPRECATED(x)
> > #endif
> >
> > ...
> > #define RTE_DEV_WHITELISTED \
> > RTE_DEPRECATED(RTE_DEV_WHITELISTED) RTE_DEV_ALLOWED
> > #define RTE_DEV_BLACKLISTED \
> > RTE_DEPRECATED(RTE_DEV_BLACKLISTED) RTE_DEV_BLOCKED
>
> What precedent exists in terms of intentionally breaking kernel headers?
> If none, would this create one?

It would cause warning, and most applications builds don't fail because of warning.
Kernel already has __diag_warn macro which is similar, but see no usages of it.
My comment was more of a "what if", probably not practical since it would just
fuel lots of angry user feedback.