You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently API create will set all attributes to action parameters of each action of p4 table. If one p4 table has multiple actions and their parameters have overlap, API create may have unexpected behavior.
To check table routing as an example:
@SaiTable[name = "outbound_routing", api = "dash_outbound_routing"]
tablerouting {
key = {
meta.eni_data.outbound_routing_group_data.outbound_routing_group_id : exact @SaiVal[type="sai_object_id_t"];
meta.is_overlay_ip_v6 : exact @SaiVal[name = "destination_is_v6"];
meta.dst_ip_addr : lpm @SaiVal[name = "destination"];
}
actions = {
route_vnet(hdr, meta); /* for expressroute - ecmp of overlay */route_vnet_direct(hdr, meta);
route_direct(hdr, meta);
route_service_tunnel(hdr, meta);
drop(meta);
}
size = TABLE_ROUTING_SIZE;
constdefault_action = drop(meta);
ATTACH_TABLE_COUNTER(routing_counter)
}
// Routing Type - vnet:// - Continue to look up in VNET mapping stage with the destination VNET ID.// - No routing action will be populated in this routing type.actionroute_vnet(
inoutheaders_thdr,
inoutmetadata_tmeta,
@SaiVal[type="sai_object_id_t"] bit<16> dst_vnet_id,
@SaiVal[type="sai_object_id_t"] bit<16> dash_tunnel_id,
bit<32> meter_class_or,
@SaiVal[default_value="4294967295"] bit<32> meter_class_and,
dash_routing_actions_trouting_actions_disabled_in_flow_resimulation)
{
meta.dash_tunnel_id = dash_tunnel_id;
meta.target_stage = dash_pipeline_stage_t.OUTBOUND_MAPPING;
meta.dst_vnet_id = dst_vnet_id;
set_meter_attrs(meta, meter_class_or, meter_class_and);
}
// Routing Type - vnet_direct:// - Forward with overrided destination overlay IP.// - No routing action will be populated in this routing type.actionroute_vnet_direct(
inoutheaders_thdr,
inoutmetadata_tmeta,
bit<16> dst_vnet_id,
@SaiVal[type="sai_object_id_t"] bit<16> dash_tunnel_id,
bit<1> overlay_ip_is_v6,
@SaiVal[type="sai_ip_address_t"]
IPv4ORv6Addressoverlay_ip,
bit<32> meter_class_or,
@SaiVal[default_value="4294967295"] bit<32> meter_class_and,
dash_routing_actions_trouting_actions_disabled_in_flow_resimulation)
{
meta.dash_tunnel_id = dash_tunnel_id;
meta.target_stage = dash_pipeline_stage_t.OUTBOUND_MAPPING;
meta.dst_vnet_id = dst_vnet_id;
meta.lkup_dst_ip_addr = overlay_ip;
meta.is_lkup_dst_ip_v6 = overlay_ip_is_v6;
set_meter_attrs(meta, meter_class_or, meter_class_and);
}
Check the generated code of API dash_sai_create_outbound_routing_entry:
for (uint32_t i = 0; i < attr_count; i++)
{
auto *md = sai_metadata_get_attr_metadata((sai_object_type_t)SAI_OBJECT_TYPE_OUTBOUND_ROUTING_ENTRY, attr_list[i].id);
constchar* attrName = md ? md->attridname : "unknown";
switch(attr_list[i].id)
{
case SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID:
{
auto param = action->add_params();
param->set_param_id(1);
u16SetVal(attr_list[i].value, param, 16);
//matchedParams++;break;
}
case SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DASH_TUNNEL_ID:
{
auto param = action->add_params();
param->set_param_id(2);
u16SetVal(attr_list[i].value, param, 16);
//matchedParams++;break;
}
case SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS_OR:
{
auto param = action->add_params();
param->set_param_id(3);
u32SetVal(attr_list[i].value, param, 32);
//matchedParams++;break;
}
case SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS_AND:
{
auto param = action->add_params();
param->set_param_id(4);
u32SetVal(attr_list[i].value, param, 32);
//matchedParams++;break;
}
case SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ROUTING_ACTIONS_DISABLED_IN_FLOW_RESIMULATION:
{
auto param = action->add_params();
param->set_param_id(5);
u32SetVal(attr_list[i].value, param, 32);
//matchedParams++;break;
}
case SAI_OUTBOUND_ROUTING_ENTRY_ATTR_OVERLAY_IP:
{
auto param = action->add_params();
param->set_param_id(4);
ipaddrSetVal(attr_list[i].value, param, 128);
//matchedParams++;
{
// set ip_is_v6_field_id fieldauto param2 = action->add_params();
param2->set_param_id(3);
booldataSetVal((attr_list[i].value.ipaddr.addr_family == SAI_IP_ADDR_FAMILY_IPV4) ? 0 : 1, param2, 1);
//matchedParams++;
}
break;
}
The attr METER_CLASS_AND and OVERLAY_IP both apply to one parameter (position id 4). It's a bug. Need to set per-action parameter.
The text was updated successfully, but these errors were encountered:
Currently API
create
will set all attributes to action parameters of each action of p4 table. If one p4 table has multiple actions and their parameters have overlap, APIcreate
may have unexpected behavior.To check table
routing
as an example:Check the generated code of API
dash_sai_create_outbound_routing_entry
:The attr METER_CLASS_AND and OVERLAY_IP both apply to one parameter (position id 4). It's a bug. Need to set per-action parameter.
The text was updated successfully, but these errors were encountered: