Skip to content

vslib/vpp: register hostif info for link-state updates#1870

Merged
yue-fred-gao merged 1 commit into
sonic-net:masterfrom
janpal23:janpal/vpp-hostif-registration-for-link-events
Apr 30, 2026
Merged

vslib/vpp: register hostif info for link-state updates#1870
yue-fred-gao merged 1 commit into
sonic-net:masterfrom
janpal23:janpal/vpp-hostif-registration-for-link-events

Conversation

@janpal23

Copy link
Copy Markdown
Contributor

Summary

  • register VPP hostif info during hostif creation
  • allow runtime link events to match the hostif ifindex
  • clean up hostif bookkeeping on remove

Problem

On the VPP path, hostif creation did not populate m_hostif_info_map. As a result, runtime RTM_NEWLINK events were dropped by syncOnLinkMsg() because hasIfIndex() could not match the interface, so no SAI port-state-change notification was sent and oper_status in APPL_DB could remain stale.

Fix

Call hostif_create_tap_veth_forwarding(name, tapfd, obj_id) from SwitchVpp::vs_create_hostif_tap_interface() and remove the matching hostif bookkeeping in SwitchVpp::vs_remove_hostif_tap_interface().

@linux-foundation-easycla

linux-foundation-easycla Bot commented Apr 24, 2026

Copy link
Copy Markdown

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: janpal23 / name: janpal23 (48a2d34)

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@yue-fred-gao yue-fred-gao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create a sonic-buildimage PR with sonic-sairedis submodule pointing to this PR branch. That will trigger sonic-vpp t1-lag sanity. Please share the result to make sure it doesn't break sanity

Comment thread vslib/vpp/SwitchVppHostif.cpp Outdated
return SAI_STATUS_FAILURE;
}

if (!hostif_create_tap_veth_forwarding(name, tapfd, obj_id))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hostif_create_tap_veth_forwarding does a lot of things that are not needed for vpp. What you need is only register the interface in m_hostif_info_map. Can you remove the socket related code and rename the function pertaining to registering host interface in map?

Comment thread vslib/vpp/SwitchVppHostif.cpp Outdated
// std::string vname = vpp_get_veth_name(name, info->m_portId);
if (it != m_hostif_info_map.end())
{
SWSS_LOG_NOTICE("attempting to remove host info entry for tap device: %s", name.c_str());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please lower it to INFO

Signed-off-by: janpal23 <janapal.cisco@gmail.com>
@janpal23
janpal23 force-pushed the janpal/vpp-hostif-registration-for-link-events branch from f3c80ca to 48a2d34 Compare April 30, 2026 00:58
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Collaborator

Cherry-pick PR to msft-202603: Azure/sonic-sairedis.msft#130

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.

4 participants