Skip to content

[EVPN-MH] Add L2 nexthop group table and raw netlink message handling support#1155

Open
bdfriedman wants to merge 2 commits intosonic-net:masterfrom
bdfriedman:evpn_mh
Open

[EVPN-MH] Add L2 nexthop group table and raw netlink message handling support#1155
bdfriedman wants to merge 2 commits intosonic-net:masterfrom
bdfriedman:evpn_mh

Conversation

@bdfriedman
Copy link

Why I did it

This PR adds infrastructure support in sonic-swss-common for EVPN Multi-Homing (EVPN-MH) feature. EVPN-MH requires:

  1. A new L2 nexthop group table to manage L2 nexthop groups in APPL_DB
  2. Raw netlink message handling capability to process EVPN-MH specific netlink attributes that cannot be fully parsed by libnl's generic object parsing
Work item tracking
  • Microsoft ADO (number only):

How I did it

  1. Added new APPL_DB table: APP_L2_NEXTHOP_GROUP_TABLE_NAME for managing L2 nexthop groups
  2. Implemented raw netlink message handler infrastructure in NetDispatcher:
    • Added registerRawMessageHandler() to register callbacks for raw netlink messages
    • Added unregisterRawMessageHandler() to unregister raw message handlers
    • Added onNetlinkMessageRaw() to handle raw netlink messages (as nlmsghdr*)
    • Added onMsgRaw() virtual method in NetMsg class for derived classes to implement raw message processing
    • Added m_rawhandlers map to store raw message handlers
  3. Modified message flow: When a netlink message is not handled by the regular (parsed) handlers, it falls back to raw message handlers

This allows components to choose between:

  • Parsed netlink messages (existing behavior via onMsg() with nl_object*)
  • Raw netlink messages (new capability via onMsgRaw() with nlmsghdr*)

How to verify it

  1. Build sonic-swss-common with these changes
  2. Verify that existing netlink message handling continues to work (backward compatibility)
  3. Test EVPN-MH feature components that register raw message handlers
  4. Verify L2_NEXTHOP_GROUP_TABLE can be accessed from APPL_DB

Description for the changelog

Add support for L2 nexthop group table and raw netlink message handling for EVPN-MH feature

Link to config_db schema for YANG module changes

N/A - This PR only adds APPL_DB table definition, no CONFIG_DB schema changes


Key Changes:

  • Files modified: netdispatcher.cpp, netdispatcher.h, netmsg.h, schema.h
  • Total changes: +60 lines, -1 line
  • This is infrastructure preparation for EVPN Multi-Homing support in sonic-swss

And support to register and de-register raw netlink msg

Signed-off-by: Kishore Kunal <[email protected]>
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