Skip to content

Misc vlan cleanups

Gal Pressman netdev 1 version Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest3 patches 0 repliesApplied 3/3

Patches in v2 All 3 applied

#Subject and filesSizeRepliesApplied
1/3net: vlan: Make is_vlan_dev() a stub when VLAN is not configuredinclude/linux/if_vlan.h+10 -50 repliesApplied
2/3net: vlan: Replace BUG() with WARN_ON_ONCE() in vlan_dev_* stubsinclude/linux/if_vlan.h+3 -30 repliesApplied
3/3net: vlan: Use IS_ENABLED() helper for CONFIG_VLAN_8021Q guardinclude/linux/if_vlan.h+1 -10 repliesApplied

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchAlex LazarDragos Tatulea
1/3
2/3R-b R-b
3/3R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [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/[email protected]/
* 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(-)
Signature · 1 line
2.40.1