Skip to content

Commit

Permalink
[dash]: Set SAI_DIRECTION_LOOKUP_ENTRY_ATTR_DASH_ENI_MAC_OVERRIDE_TYP…
Browse files Browse the repository at this point in the history
…E to dst mac (sonic-net#3423)

What I did
Set SAI_DIRECTION_LOOKUP_ENTRY_ATTR_DASH_ENI_MAC_OVERRIDE_TYPE to SAI_DASH_ENI_MAC_OVERRIDE_TYPE_DST_MACby default.
This can be changed to be configurable once other vnet scenarios are onboarded on smartswitch.
Why I did it
For direction lookup to work properly for PL scenarios on smartswitch, ENI mac needs to match dst MAC.
  • Loading branch information
prabhataravind authored Dec 18, 2024
1 parent 8465c1d commit fef1543
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion orchagent/dash/dashorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,19 @@ bool DashOrch::addApplianceEntry(const string& appliance_id, const dash::applian
}

sai_direction_lookup_entry_t direction_lookup_entry;
vector<sai_attribute_t> direction_lookup_attrs;
direction_lookup_entry.switch_id = gSwitchId;
direction_lookup_entry.vni = entry.vm_vni();
appliance_attr.id = SAI_DIRECTION_LOOKUP_ENTRY_ATTR_ACTION;
appliance_attr.value.u32 = SAI_DIRECTION_LOOKUP_ENTRY_ACTION_SET_OUTBOUND_DIRECTION;
status = sai_dash_direction_lookup_api->create_direction_lookup_entry(&direction_lookup_entry, attr_count, &appliance_attr);
direction_lookup_attrs.push_back(appliance_attr);

appliance_attr.id = SAI_DIRECTION_LOOKUP_ENTRY_ATTR_DASH_ENI_MAC_OVERRIDE_TYPE;
appliance_attr.value.u32 = SAI_DASH_ENI_MAC_OVERRIDE_TYPE_DST_MAC;
direction_lookup_attrs.push_back(appliance_attr);

status = sai_dash_direction_lookup_api->create_direction_lookup_entry(&direction_lookup_entry,
(uint32_t)direction_lookup_attrs.size(), direction_lookup_attrs.data());
if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to create direction lookup entry for %s", appliance_id.c_str());
Expand Down
1 change: 1 addition & 0 deletions tests/dash/test_dash_vnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def test_appliance(self, dash_db: DashDB):
direction_keys = dash_db.wait_for_asic_db_keys(ASIC_DIRECTION_LOOKUP_TABLE)
dl_attrs = dash_db.get_asic_db_entry(ASIC_DIRECTION_LOOKUP_TABLE, direction_keys[0])
assert_sai_attribute_exists("SAI_DIRECTION_LOOKUP_ENTRY_ATTR_ACTION", dl_attrs, "SAI_DIRECTION_LOOKUP_ENTRY_ACTION_SET_OUTBOUND_DIRECTION")
assert_sai_attribute_exists("SAI_DIRECTION_LOOKUP_ENTRY_ATTR_DASH_ENI_MAC_OVERRIDE_TYPE", dl_attrs, "SAI_DASH_ENI_MAC_OVERRIDE_TYPE_DST_MAC")

vip_keys = dash_db.wait_for_asic_db_keys(ASIC_VIP_TABLE)
vip_attrs = dash_db.get_asic_db_entry(ASIC_VIP_TABLE, vip_keys[0])
Expand Down

0 comments on commit fef1543

Please sign in to comment.