Skip to content

stpmgr: Unify IPC with sonic-stp and replace ebtables with nftables - #4790

Open
rdhegde wants to merge 7 commits into
sonic-net:masterfrom
rdhegde:rdhegde-pvst-swss
Open

stpmgr: Unify IPC with sonic-stp and replace ebtables with nftables#4790
rdhegde wants to merge 7 commits into
sonic-net:masterfrom
rdhegde:rdhegde-pvst-swss

Conversation

@rdhegde

@rdhegde rdhegde commented Jul 25, 2026

Copy link
Copy Markdown

Summary

  • Use shared STP IPC definitions from stp_ipc.h in STPMGR; remove duplicate
    structures from stpmgr.h.
  • Clean up duplicated logic and invalid parameter re-initialization in STPMGR.
  • Replace ebtables filters with nftables (ebtables no longer supported in
    kernel for required STP functionality).

Motivation

PVST configuration fails when STPMGR uses IPC layouts that don’t match the STP
daemon, or when packet filtering still relies on ebtables. This PR aligns
STPMGR with the sonic-stp IPC changes and updates filtering to nftables.

Part of PVST fix series for #28624.

Changes

  • IPC
    • Include stp_ipc.h in stpmgr.h
    • Remove duplicate IPC structure definitions from STPMGR
  • STPMGR logic
    • Remove code duplication
    • Fix invalid parameter re-initialization
  • Packet filtering
    • Replace ebtables filters with nftables equivalents

Related PRs

Repo PR
sonic-stp sonic-net/sonic-stp#97
sonic-buildimage sonic-net/sonic-buildimage#...
sonic-utilities sonic-net/sonic-utilities#4716

Verification

  • 3-node PVST on GNS3 (sonic-vs): config reached STP daemon, PVST
    converged
  • Marvell Prestera switches: same validation

@rdhegde
rdhegde requested a review from prsunny as a code owner July 25, 2026 13:23
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

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

rdhegde added 6 commits July 25, 2026 19:31
The STP IPC structures exchanged between stpmgr-daemon and stp-daemon
were duplicated. Once defined in sonic-swss/cfgmgr/stpmgr.h and again
in sonic-stp/include/stp_ipc.h. The definition in the first file has
been removed and stp_ipc.h is included in stpmgr.h

Signed-off-by: Ram Hegde <rhegde@marvell.com>
In sendMsgStpd(), STP_IPC_MSG message is created and sent to the STP
daemon. Here "proto_mode" in the IPC message is not populated. Due
to this the message in STP daemon is ignored since the proto_mode check
fails.

Signed-off-by: Ram Hegde <rhegde@marvell.com>
* In doVlanMemUpdateTask(), prevented reinitlization of priority
  and path_cost of STP_VLAN_MEM_CONFIG_MSG message instance

* In doTask() prevented duplicate call to doStpPortTask()

* In doStpMstInstTask(), moved call to updateVlanInstanceMap()
  outside the for-loop which fetches the attributes.

Signed-off-by: Ram Hegde <rhegde@marvell.com>
on completion instead of failure ( -1 ).

Signed-off-by: Ram Hegde <rhegde@marvell.com>
ebtables filtering is not supported in kernel so replace the same with
nft.

Signed-off-by: Ram Hegde <rhegde@marvell.com>
* cfgmgr/stpmgr.cpp
* cfgmgr/stpmgrd.cpp
Which involved using the proper debug level and format specifier

Removed the macro STPD_SOCK_NAME from cfgmgr/stpmgr.h as it is already
defined in stp_ipc.h

Signed-off-by: Ram Hegde <rhegde@marvell.com>
@rdhegde
rdhegde force-pushed the rdhegde-pvst-swss branch from 6ed47ed to 4371ebf Compare July 25, 2026 14:01
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

@rdhegde rdhegde changed the title PVST bug fixes stpmgr: Unify IPC with sonic-stp and replace ebtables with nftables Jul 28, 2026
Signed-off-by: Ram Hegde <rhegde@marvell.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

@rdhegde

rdhegde commented Aug 4, 2026

Copy link
Copy Markdown
Author

@yxieca @prsunny my CI is failing since with this PR sonic-swss/cfgmgr/stpngr.cpp would need definitions from sonic-stp/include/stp_ipc.h
Could you please guide me how I could resolve this dependency and get moving with this PR.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants