Skip to content

adding support of weights for WCMP #18

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion driver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.onosproject</groupId>
<artifactId>onos-dependencies</artifactId>
<version>2.7.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<groupId>org.onosproject.drivers</groupId>
Expand Down
2 changes: 1 addition & 1 deletion pipeliner/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.onosproject</groupId>
<artifactId>onos-dependencies</artifactId>
<version>2.7.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<groupId>org.onosproject.pipelines</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@ private SaiConstants() {
PiMatchFieldId.of("icmpv6_type");
public static final PiMatchFieldId HDR_WCMP_GROUP_ID =
PiMatchFieldId.of("wcmp_group_id");
public static final PiMatchFieldId HDR_TTL = PiMatchFieldId.of("ttl");
public static final PiMatchFieldId HDR_MIRROR_SESSION_ID =
PiMatchFieldId.of("mirror_session_id");
public static final PiMatchFieldId HDR_ICMP_TYPE =
PiMatchFieldId.of("icmp_type");
public static final PiMatchFieldId HDR_DST_IPV6 =
PiMatchFieldId.of("dst_ipv6");
public static final PiMatchFieldId HDR_IPV4_DST =
Expand All @@ -61,14 +60,12 @@ private SaiConstants() {
PiMatchFieldId.of("neighbor_id");
public static final PiMatchFieldId HDR_IN_PORT =
PiMatchFieldId.of("in_port");
public static final PiMatchFieldId HDR_ICMP_CODE =
PiMatchFieldId.of("icmp_code");
public static final PiMatchFieldId HDR_DST_MAC =
PiMatchFieldId.of("dst_mac");
public static final PiMatchFieldId HDR_IP_PROTOCOL =
PiMatchFieldId.of("ip_protocol");
public static final PiMatchFieldId HDR_L4_SRC_PORT =
PiMatchFieldId.of("l4_src_port");
public static final PiMatchFieldId HDR_ECN = PiMatchFieldId.of("ecn");
public static final PiMatchFieldId HDR_DSCP = PiMatchFieldId.of("dscp");
public static final PiMatchFieldId HDR_VRF_ID = PiMatchFieldId.of("vrf_id");
public static final PiMatchFieldId HDR_IS_IPV4 =
PiMatchFieldId.of("is_ipv4");
Expand Down Expand Up @@ -106,6 +103,7 @@ private SaiConstants() {
public static final PiCounterId INGRESS_ACL_INGRESS_ACL_INGRESS_COUNTER =
PiCounterId.of("ingress.acl_ingress.acl_ingress_counter");
// Action IDs
public static final PiActionId ACL_DROP = PiActionId.of("acl_drop");
public static final PiActionId INGRESS_HASHING_COMPUTE_ECMP_HASH_IPV6 =
PiActionId.of("ingress.hashing.compute_ecmp_hash_ipv6");
public static final PiActionId INGRESS_MIRRORING_CLONE_SET_PRE_SESSION =
Expand All @@ -118,19 +116,19 @@ private SaiConstants() {
PiActionId.of("ingress.routing.drop");
public static final PiActionId INGRESS_ROUTING_SET_NEXTHOP =
PiActionId.of("ingress.routing.set_nexthop");
public static final PiActionId INGRESS_HASHING_SELECT_EMCP_HASH_ALGORITHM =
PiActionId.of("ingress.hashing.select_emcp_hash_algorithm");
public static final PiActionId INGRESS_L3_ADMIT_ADMIT_TO_L3 =
PiActionId.of("ingress.l3_admit.admit_to_l3");
public static final PiActionId INGRESS_ACL_INGRESS_MIRROR =
PiActionId.of("ingress.acl_ingress.mirror");
public static final PiActionId NO_ACTION = PiActionId.of("NoAction");
public static final PiActionId INGRESS_ROUTING_SET_NEXTHOP_ID =
PiActionId.of("ingress.routing.set_nexthop_id");
public static final PiActionId INGRESS_ACL_INGRESS_FORWARD =
PiActionId.of("ingress.acl_ingress.forward");
public static final PiActionId INGRESS_ROUTING_SET_WCMP_GROUP_ID =
PiActionId.of("ingress.routing.set_wcmp_group_id");
public static final PiActionId INGRESS_HASHING_SELECT_ECMP_HASH_ALGORITHM =
PiActionId.of("ingress.hashing.select_ecmp_hash_algorithm");
public static final PiActionId INGRESS_ACL_INGRESS_FORWARD =
PiActionId.of("ingress.acl_ingress.forward");
public static final PiActionId INGRESS_ROUTING_SET_NEXTHOP_ID =
PiActionId.of("ingress.routing.set_nexthop_id");
public static final PiActionId INGRESS_ROUTING_SET_PORT_AND_SRC_MAC =
PiActionId.of("ingress.routing.set_port_and_src_mac");
public static final PiActionId INGRESS_ROUTING_SET_DST_MAC =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private void hashedNext(NextObjective obj,
nextHopEntries.add(buildNextHopEntry(routerInterfaceId, neighborId, nextHopId, obj));

// TODO (daniele): modify weight when WCMP is supported
wcmpBuckets.add(Pair.of(buildWcmpTableNextHopAction(nextHopId), 1));
wcmpBuckets.add(Pair.of(buildWcmpTableNextHopAction(nextHopId), t.weight()));
}

if (isGroupModifyOp(obj)) {
Expand All @@ -159,7 +159,7 @@ private void hashedNext(NextObjective obj,
// TODO (daniele): Something more meaningful than concat for nextHopId
final String nextHopId = neighborId + "@" + routerInterfaceId;
// TODO (daniele): modify weight when WCMP is supported
oldWcmpBuckets.add(Pair.of(buildWcmpTableNextHopAction(nextHopId), 1));
oldWcmpBuckets.add(Pair.of(buildWcmpTableNextHopAction(nextHopId), t.weight()));
}
switch (obj.op()) {
case ADD_TO_EXISTING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public void next(NextObjective obj) {

@Override
public void purgeAll(ApplicationId appId) {
// We just push flow rule in SAI Pipeliner
// We only push flow rule in SAI Pipeliner
flowRuleService.purgeFlowRules(deviceId, appId);
}

Expand Down
55 changes: 29 additions & 26 deletions pipeliner/src/main/resources/pins/sai_onf.p4info
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ tables {
}
const_default_action_id: 21257015
implementation_id: 299650760
size: 4096
size: 3968
}
tables {
preamble {
Expand Down Expand Up @@ -189,7 +189,7 @@ tables {
annotations: "@proto_id(3)"
}
const_default_action_id: 16777222
size: 1024
size: 32768
}
tables {
preamble {
Expand Down Expand Up @@ -226,7 +226,7 @@ tables {
annotations: "@proto_id(3)"
}
const_default_action_id: 16777222
size: 1024
size: 4096
}
tables {
preamble {
Expand Down Expand Up @@ -306,37 +306,37 @@ tables {
}
match_fields {
id: 10
name: "ip_protocol"
annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL)"
name: "ttl"
annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_TTL)"
bitwidth: 8
match_type: TERNARY
}
match_fields {
id: 11
name: "icmpv6_type"
annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ICMPV6_TYPE)"
bitwidth: 8
name: "dscp"
annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DSCP)"
bitwidth: 6
match_type: TERNARY
}
match_fields {
id: 12
name: "icmp_type"
annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ICMP_TYPE)"
bitwidth: 8
name: "ecn"
annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ECN)"
bitwidth: 2
match_type: TERNARY
}
match_fields {
id: 13
name: "icmp_code"
annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ICMP_CODE)"
name: "ip_protocol"
annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL)"
bitwidth: 8
match_type: TERNARY
}
match_fields {
id: 14
name: "l4_src_port"
annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_L4_SRC_PORT)"
bitwidth: 16
name: "icmpv6_type"
annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ICMPV6_TYPE)"
bitwidth: 8
match_type: TERNARY
}
match_fields {
Expand All @@ -346,15 +346,6 @@ tables {
bitwidth: 16
match_type: TERNARY
}
match_fields {
id: 16
name: "in_port"
annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_IN_PORT)"
match_type: OPTIONAL
type_name {
name: "port_id_t"
}
}
action_refs {
id: 16777473
annotations: "@proto_id(1)"
Expand All @@ -371,6 +362,10 @@ tables {
id: 16777476
annotations: "@proto_id(4)"
}
action_refs {
id: 16777481
annotations: "@proto_id(5)"
}
action_refs {
id: 21257015
annotations: "@defaultonly"
Expand Down Expand Up @@ -442,6 +437,14 @@ actions {
annotations: "@noWarn(\"unused\")"
}
}
actions {
preamble {
id: 16777481
name: "acl_drop"
alias: "acl_drop"
annotations: "@sai_action(SAI_PACKET_ACTION_DROP)"
}
}
actions {
preamble {
id: 16777224
Expand Down Expand Up @@ -703,7 +706,7 @@ action_profiles {
table_ids: 33554499
with_selector: true
size: 65536
max_group_size: 1024
max_group_size: 256
}
direct_counters {
preamble {
Expand Down