[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250616132626.1749331-1-gal@nvidia.com>
Date: Mon, 16 Jun 2025 16:26:23 +0300
From: Gal Pressman <gal@...dia.com>
To: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
<pabeni@...hat.com>, Andrew Lunn <andrew+netdev@...n.ch>,
<netdev@...r.kernel.org>
CC: Gal Pressman <gal@...dia.com>
Subject: [PATCH net-next v2 0/3] Misc vlan cleanups
This patch series addresses compilation issues with objtool when VLAN
support is disabled (CONFIG_VLAN_8021Q=n) and makes related improvements
to the VLAN infrastructure.
When CONFIG_VLAN_8021Q=n, CONFIG_OBJTOOL=y, and CONFIG_OBJTOOL_WERROR=y,
the following compilation error occurs:
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.o: error: objtool: parse_mirred.isra.0+0x370: mlx5e_tc_act_vlan_add_push_action() missing __noreturn in .c/.h or NORETURN() in noreturns.h
The error occurs because objtool cannot determine that unreachable BUG()
calls in VLAN code paths are actually dead code when VLAN support is
disabled.
First patch makes is_vlan_dev() a stub when VLAN is not configured,
allows compile-out of VLAN-dependent dead code paths and resolves the
objtool compilation error.
Second patch replaces BUG() calls with WARN_ON_ONCE(), as the usage of
BUG() should be avoided.
Third patch uses the "kernel" way of testing whether an option is
configured as builtin/module, instead of open-coding it.
Changelog -
v1->v2: https://lore.kernel.org/netdev/20250610072611.1647593-1-gal@nvidia.com/
* Add the first patch, alternative approach suggested by Jakub
Gal Pressman (3):
net: vlan: Make is_vlan_dev() a stub when VLAN is not configured
net: vlan: Replace BUG() with WARN_ON_ONCE() in vlan_dev_* stubs
net: vlan: Use IS_ENABLED() helper for CONFIG_VLAN_8021Q guard
include/linux/if_vlan.h | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
--
2.40.1
Powered by blists - more mailing lists