Skip to content

Commit dbb2d0f

Browse files
Update for SAI API changes
Align DASH API with newest HLD changes: sonic-net/DASH#520 and sonic-net/SONiC#1658 - Route group API changes - Metering implementation changes - PL/PL-NSG - Deprecate/rename some fields for clarity
2 parents 5809048 + 7cd1105 commit dbb2d0f

10 files changed

+99
-22
lines changed

misc/tests/utils_unittest.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,19 @@ TEST(Utils, ValidUrlConversion)
2626
{"sonic/dash.acl_rule.AclRule", "DASH_ACL_RULE_TABLE"},
2727
{"sonic/dash.appliance.Appliance", "DASH_APPLIANCE_TABLE"},
2828
{"sonic/dash.eni.Eni", "DASH_ENI_TABLE"},
29+
{"sonic/dash.eni_route.EniRoute", "DASH_ENI_ROUTE_TABLE"},
2930
{"sonic/dash.meter_policy.MeterPolicy", "DASH_METER_POLICY_TABLE"},
3031
{"sonic/dash.meter_rule.MeterRule", "DASH_METER_RULE_TABLE"},
3132
{"sonic/dash.meter.Meter", "DASH_METER_TABLE"},
33+
{"sonic/dash.pa_validation.PaValidation", "DASH_PA_VALIDATION_TABLE"},
3234
{"sonic/dash.prefix_tag.PrefixTag", "DASH_PREFIX_TAG_TABLE"},
3335
{"sonic/dash.qos.Qos", "DASH_QOS_TABLE"},
36+
{"sonic/dash.route_group.RouteGroup", "DASH_ROUTE_GROUP_TABLE"},
3437
{"sonic/dash.route_rule.RouteRule", "DASH_ROUTE_RULE_TABLE"},
3538
{"sonic/dash.route_type.RouteType", "DASH_ROUTE_TYPE_TABLE"},
3639
{"sonic/dash.route.Route", "DASH_ROUTE_TABLE"},
3740
{"sonic/dash.routing_appliance.RoutingAppliance", "DASH_ROUTING_APPLIANCE_TABLE"},
41+
{"sonic/dash.tunnel.Tunnel", "DASH_TUNNEL_TABLE"},
3842
{"sonic/dash.vnet_mapping.VnetMapping", "DASH_VNET_MAPPING_TABLE"},
3943
{"sonic/dash.vnet.Vnet", "DASH_VNET_TABLE"},
4044
};
@@ -97,7 +101,8 @@ TEST(Utils, CInterface)
97101

98102
const std::string json_str1 =
99103
"{\n"
100-
" \"action_type\": \"ROUTING_TYPE_VNET\",\n"
104+
" \"action_type\": \"ROUTING_TYPE_UNSPECIFIED\",\n"
105+
" \"routing_type\": \"ROUTING_TYPE_VNET\",\n"
101106
" \"vnet\": \"Vnet2\"\n"
102107
"}\n";
103108

proto/eni.proto

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ message Eni {
2323
string vnet = 6;
2424
// Optional
2525
// Private Link encoding for IPv6 SIP transpositions
26-
optional types.IpPrefix pl_sip_encoding = 7;
26+
optional types.IpPrefix pl_sip_encoding = 7 [deprecated = true];
2727
// Optional
2828
// Underlay SIP (ST GW VIP) to be used for all private link transformation for this ENI
2929
optional types.IpAddress pl_underlay_sip = 8;
@@ -33,6 +33,7 @@ message Eni {
3333
// Optional
3434
// IPv6 meter policy ID
3535
optional string v6_meter_policy_id = 10;
36+
optional bool disable_fast_path_icmp_flow_redirection = 11;
3637
}
3738

3839
message EniKey {

proto/eni_route.proto

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
syntax = "proto3";
2+
3+
package dash.eni_route;
4+
5+
message EniRoute {
6+
// Group ID in DASH_ROUTE_GROUP_TABLE
7+
string group_id = 1;
8+
}
9+
10+
message EniRouteKey {
11+
string eni = 1;
12+
}

proto/pa_validation.proto

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
syntax = "proto3";
2+
3+
package dash.pa_validation;
4+
5+
import "types.proto";
6+
7+
message PaValidation {
8+
repeated types.IpAddress addresses = 1;
9+
}
10+
11+
message PaValidationKey {
12+
uint32 vni = 1;
13+
}

proto/route.proto

+17-11
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,50 @@ import "types.proto";
66
import "route_type.proto";
77

88
message VnetDirect {
9-
// destination vnet name if action_type is {vnet, vnet_direct}, a vnet other than eni's vnet means vnet peering
9+
// destination vnet name if routing_type is {vnet, vnet_direct}, a vnet other than eni's vnet means vnet peering
1010
string vnet = 1;
1111
// overly_ip to lookup if routing_type is {vnet_direct}, use dst ip from packet if not specified
1212
optional types.IpAddress overlay_ip = 2;
1313
}
1414

1515
message ServiceTunnel {
1616
// overlay ipv6 src ip if routing_type is {servicetunnel}
17-
types.IpAddress overlay_sip = 1;
17+
types.IpAddress overlay_sip = 1 [deprecated = true]; // replaced by overlay_sip_prefix
1818
// overlay ipv6 dst ip if routing_type is {servicetunnel}
19-
types.IpAddress overlay_dip = 2;
19+
types.IpAddress overlay_dip = 2 [deprecated = true]; // replaced by overlay_dip_prefix
2020
// underlay ipv4 src ip if routing_type is {servicetunnel}, this is the ST GW VIP (for ST traffic) or custom VIP
2121
types.IpAddress underlay_sip = 3;
2222
// underlay ipv4 dst ip to override if routing_type is {servicetunnel}, use dst ip from packet if not specified
2323
types.IpAddress underlay_dip = 4;
24+
types.IpAddress overlay_sip_prefix = 5;
25+
types.IpAddress overlay_dip_prefix = 6;
2426
}
2527

2628
message Route {
27-
route_type.RoutingType action_type = 1;
29+
route_type.RoutingType action_type = 1 [deprecated = true]; // renamed as routing_type
2830
oneof Action {
29-
// destination vnet name if action_type is vnet,, a vnet other than eni's vnet means vnet peering
31+
// destination vnet name if routing_type is vnet,, a vnet other than eni's vnet means vnet peering
3032
string vnet = 2;
31-
// destination vnet name if action_type is vnet_direct,, a vnet other than eni's vnet means vnet peering
33+
// destination vnet name if routing_type is vnet_direct,, a vnet other than eni's vnet means vnet peering
3234
route.VnetDirect vnet_direct = 3;
33-
// appliance id if action_type is {appliance}
35+
// appliance id if routing_type is {appliance}
3436
string appliance = 4;
35-
// service tunnel if action_type is {service_tunnel}
37+
// service tunnel if routing_type is {service_tunnel}
3638
route.ServiceTunnel service_tunnel = 5;
3739
}
3840
// Metering policy lookup enable (optional), default = false
39-
optional bool metering_policy_en = 6;
41+
optional bool metering_policy_en = 6 [deprecated = true];
4042
// Metering class-id, used if metering policy lookup is not enabled
41-
optional uint64 metering_class = 7;
43+
optional uint64 metering_class = 7 [deprecated = true];
44+
optional uint32 metering_class_or = 8;
45+
optional uint32 metering_class_and = 9;
46+
route_type.RoutingType routing_type = 10;
4247
}
4348

4449
// ENI route table with CA prefix for packet Outbound
4550
message RouteKey {
46-
string eni = 1;
51+
string eni = 1 [deprecated = true]; // renamed as group_id
4752
// IP prefix string with prefix length. E.G. 10.1.0.0/16
4853
string prefix = 2;
54+
string group_id = 3;
4955
}

proto/route_group.proto

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
syntax = "proto3";
2+
3+
package dash.route_group;
4+
5+
message RouteGroup {
6+
optional string guid = 1;
7+
string version = 2;
8+
}
9+
10+
message RouteGroupKey {
11+
string group_id = 1;
12+
}

proto/route_rule.proto

+7-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import "route_type.proto";
66

77
message RouteRule {
88
// reference to routing type, action can be decap or drop
9-
route_type.RoutingType action_type = 1;
9+
route_type.RoutingType action_type = 1 [deprecated = true]; // renamed as routing_type
1010
// priority of the rule, lower the value, higher the priority
1111
uint32 priority = 2;
1212
// Optional
@@ -20,10 +20,15 @@ message RouteRule {
2020
optional bool pa_validation = 5;
2121
// Optional
2222
// Metering class-id
23-
optional uint64 metering_class = 6;
23+
optional uint64 metering_class = 6 [deprecated = true]; // replaced by metering_class_or and metering_class_and
2424
// Optional
2525
// optional region_id which the vni/prefix belongs to as a string for any vendor optimizations
2626
optional string region = 7;
27+
route_type.RoutingType routing_type = 8;
28+
// Optional
29+
// Metering class aggregate bits
30+
optional uint32 metering_class_or = 9;
31+
optional uint32 metering_class_and = 10;
2732
}
2833

2934
// ENI Inbound route table with VNI and optional SRC PA prefix

proto/route_type.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ enum RoutingType {
2828
ROUTING_TYPE_VNET_ENCAP = 4;
2929
ROUTING_TYPE_APPLIANCE = 5;
3030
ROUTING_TYPE_PRIVATELINK = 6;
31-
ROUTING_TYPE_PRIVATELINKNSG = 7;
31+
ROUTING_TYPE_PRIVATELINKNSG = 7 [deprecated = true];
3232
ROUTING_TYPE_SERVICETUNNEL = 8;
3333
ROUTING_TYPE_DROP = 9;
3434
}

proto/tunnel.proto

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
syntax = "proto3";
2+
3+
package dash.tunnel;
4+
5+
import "route_type.proto";
6+
import "types.proto";
7+
8+
message Tunnel {
9+
repeated types.IpAddress endpoints = 1;
10+
route_type.EncapType encap_type = 2;
11+
uint32 vni = 3;
12+
optional uint32 metering_class_or = 4;
13+
}
14+
15+
// ENI Inbound route table with VNI and optional SRC PA prefix
16+
message TunnelKey {
17+
string tunnel_name = 1;
18+
};

proto/vnet_mapping.proto

+11-6
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,37 @@ import "route_type.proto";
77

88
message VnetMapping {
99
// reference to routing type
10-
route_type.RoutingType action_type = 1;
10+
route_type.RoutingType action_type = 1 [deprecated = true]; // renamed as routing_type
1111
// PA address for the CA
1212
types.IpAddress underlay_ip = 2;
1313
// Optional
1414
// Inner dst mac
1515
optional bytes mac_address = 3;
1616
// Optional
1717
// metering class-id
18-
optional uint64 metering_class = 4;
18+
optional uint64 metering_class = 4 [deprecated = true];
1919
// Optional
2020
// override the metering class-id coming from the route table
21-
optional bool override_meter = 5;
21+
optional bool override_meter = 5 [deprecated = true];
2222
// Optional
2323
// if true, use the destination VNET VNI for encap. If false or not specified, use source VNET's VNI
2424
optional bool use_dst_vni = 6;
2525
// Optional
2626
optional bool use_pl_sip_eni = 7;
2727
// Optional
2828
// overlay src ip if routing_type is {privatelink}
29-
optional types.IpAddress overlay_sip = 8;
29+
optional types.IpAddress overlay_sip = 8 [deprecated = true]; // changed to overlay_sip_prefix
3030
// Optional
3131
// overlay dst ip if routing_type is {privatelink}
32-
optional types.IpAddress overlay_dip = 9;
32+
optional types.IpAddress overlay_dip = 9 [deprecated = true]; // changed to overlay_dip_prefix
3333
// Optional
3434
// ID of routing appliance if routing_type is {privatelinknsg}
35-
optional uint32 routing_appliance_id = 10;
35+
optional uint32 routing_appliance_id = 10 [deprecated = true];
36+
optional uint32 metering_class_or = 12;
37+
optional types.IpPrefix overlay_sip_prefix = 13;
38+
optional types.IpPrefix overlay_dip_prefix = 14;
39+
optional string tunnel = 15;
40+
route_type.RoutingType routing_type = 16;
3641
}
3742

3843
// CA-PA mapping table for Vnet

0 commit comments

Comments
 (0)