Skip to content

[Nexthop][misc] Remove dead VLAN neighbor update functions and unused includes - #1905

Closed
benoit-nexthop wants to merge 1 commit into
meta:mainfrom
nexthop-ai:neighbor-cache-dead-code
Closed

benoit-nexthop wants to merge 1 commit into
meta:mainfrom
nexthop-ai:neighbor-cache-dead-code

Conversation

@benoit-nexthop

Copy link
Copy Markdown
Contributor

Summary

NeighborCacheImpl::getUpdateFnToProgramEntryForVlan() and getUpdateFnToProgramPendingEntryForVlan() have had no callers since 8b49d2f ("Remove FLAGS_intf_nbr_tables from NeighborCacheImpl-defs.h"), which removed the VLAN-table branch of programEntry() / programPendingEntry(). Every neighbor update now goes through getUpdateFnToProgramEntry() / getUpdateFnToProgramPendingEntry(). This removes both dead functions.

It also removes the includes that clang-tidy's misc-include-cleaner reports as unused in NeighborCacheImpl.h, NeighborCacheImpl-defs.h and SwSwitchTest.cpp. NeighborCacheImpl-defs.h throws FbossError itself, so it now includes FbossError.h directly instead of getting it through NeighborCacheImpl.h.

We checked with Meta that neither function has callers in the internal code base either.

This touches the same function as #1903, which changes its lambda captures. Whichever of the two lands second needs a trivial rebase (keep the deletion).

Test Plan

The equivalent change in our internal tree passed our CI's Bazel build and its cmake build + unit test run (clang). No reference to either removed function remains in the tree.

Review Findings

No issues found above confidence threshold (fboss-review, 7 applicable reviewers).

getUpdateFnToProgramEntryForVlan() and
getUpdateFnToProgramPendingEntryForVlan() lost their last callers when
FLAGS_intf_nbr_tables was removed from NeighborCacheImpl-defs.h
(8b49d2f); every neighbor update now goes through the interface
table variants. Drop both functions.

Also drop the includes clang-tidy's misc-include-cleaner reports as
unused in NeighborCacheImpl.h, NeighborCacheImpl-defs.h and
SwSwitchTest.cpp. NeighborCacheImpl-defs.h throws FbossError itself, so
it now includes FbossError.h directly instead of through
NeighborCacheImpl.h.
@benoit-nexthop
benoit-nexthop requested a review from a team as a code owner November 3, 2026 22:47
@meta-cla meta-cla Bot added the CLA Signed label Nov 3, 2026
@github-actions github-actions Bot added nexthop project:misc FBOSS project: misc labels Nov 3, 2026
@meta-codesync

meta-codesync Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

@KevinYakar has imported this pull request. If you are a Meta employee, you can view this in D129483370.

@meta-codesync meta-codesync Bot closed this in fb69397 Nov 4, 2026
@meta-codesync meta-codesync Bot added the Merged label Nov 4, 2026
@meta-codesync

meta-codesync Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

@KevinYakar merged this pull request in fb69397.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant