Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding vrrporch module #3315

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Adding vrrporch module #3315

wants to merge 5 commits into from

Conversation

vvbrcm
Copy link

@vvbrcm vvbrcm commented Oct 3, 2024

What I did
Adding vrrporch module
Why I did it
To listen to APPL_DB and program VRRP entities in SAI
How I verified it
UT
Details if related

@vvbrcm vvbrcm requested a review from prsunny as a code owner October 3, 2024 17:11
Copy link

linux-foundation-easycla bot commented Oct 3, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@adyeung
Copy link

adyeung commented Oct 3, 2024

@philo-micas @madhupalu please help review

@madhupalu
Copy link

madhupalu commented Oct 3, 2024 via email


bool operator== (const vrrp_key_t& rhs) const
{
if (!(ip_addr == rhs.ip_addr) || port_name != rhs.port_name)
Copy link

Choose a reason for hiding this comment

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

Shouldn't "!(ip_addr == rhs.ip_addr)" be "(ip_addr != rhs.ip_addr)" similar to other case?

Copy link
Author

Choose a reason for hiding this comment

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

IpPrefix base class has operator == and no operator !=. Hence the code is in this fashion.

@@ -186,6 +186,8 @@ bool OrchDaemon::init()
gDirectory.set(vnet_rt_orch);
VRFOrch *vrf_orch = new VRFOrch(m_applDb, APP_VRF_TABLE_NAME, m_stateDb, STATE_VRF_OBJECT_TABLE_NAME);
gDirectory.set(vrf_orch);
VrrpOrch *vrrp_orch = new VrrpOrch(m_applDb, APP_VRRP_TABLE_NAME);
Copy link

Choose a reason for hiding this comment

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

APP_VRRP_TABLE_NAME name is not defined. It needs to be defined in common/schema.h.

Copy link
Author

Choose a reason for hiding this comment

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

Will add APP_VRRP_TABLE_NAME in common/schema.h.

Copy link
Author

Choose a reason for hiding this comment

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

Copy link

Choose a reason for hiding this comment

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

Philo has already added it.
sonic-net/sonic-swss-common#813

Comment on lines +222 to +234
if (!hasSameIpAddr (request.getKeyString(0), request.getKeyIpPrefix(1)))
{
sai_status_t vip_status = sai_route_api->remove_route_entry(&unicast_route_entry);
if (vip_status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to delete Vrrp Vip on interface %s, rv:%d",
port.m_alias.c_str(), vip_status);
throw runtime_error("Failed to remove Vrrp Vip on interface");
}
}

sai_status_t vmac_status = sai_router_intfs_api->remove_router_interface (vrrp_table_[key].rifid);
if (vmac_status != SAI_STATUS_SUCCESS)

Choose a reason for hiding this comment

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

If the same address exists, the route entry will not be deleted; however, the router interface below will be deleted, which may cause the route to be bound to a VRRP router interface id that has already been deleted.

Copy link
Author

Choose a reason for hiding this comment

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

Same prefix will be present only in VRRP owner case. While adding VIP in owner case, only the RIF is added. Route entry would not be added as the same route will be added because of base interface.

Hence while deleting VIP in owner case, only the RIF will be deleted.

attr.value.s32 = SAI_PACKET_ACTION_FORWARD;
vip_attrs.push_back(attr);
attr.id = SAI_ROUTE_ENTRY_ATTR_NEXT_HOP_ID;
attr.value.oid = vrrp_rif_id;
Copy link

Choose a reason for hiding this comment

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

@venkatmahalingam @vvbrcm @philo-micas is it expected to have next hop id as it's own RIF? I am suspecting this might not be correct as in my testing I found that the VRRP master is unable to forward the packet coming from Router C to the underlying VRRP host A and B as VRRP master doesn't know it's next hop.

cc: @madhupalu

image

Copy link

Choose a reason for hiding this comment

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

@vvbrcm did you test this reverse scenario where traffic is coming from the Internet via Router C?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, reverse traffic is tested.

For VRRP the VIP route entry will have VRRP router interface as its nexthop. This is needed to punt the dest IP=VIP packets to CPU.

In your case, do you have subnet route entry? This would be needed to punt any traffic dest to host behind the VRRP master.
Once the host traffic is punted to the CPU, ARP resolution should trigger and an arp entry should be added to H/W.

@vvbrcm
Copy link
Author

vvbrcm commented Oct 29, 2024

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

Copy link

No pipelines are associated with this pull request.

@vvbrcm
Copy link
Author

vvbrcm commented Nov 6, 2024

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vvbrcm
Copy link
Author

vvbrcm commented Nov 6, 2024

/azpw run Azure.sonic-swss

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-swss

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vvbrcm
Copy link
Author

vvbrcm commented Nov 6, 2024

/azpw run Azure.sonic-swss

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-swss

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vvbrcm
Copy link
Author

vvbrcm commented Nov 6, 2024

/azpw run Azure.sonic-swss

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-swss

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vvbrcm
Copy link
Author

vvbrcm commented Nov 7, 2024

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

Copy link

No pipelines are associated with this pull request.

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.

6 participants