Do not compile with IPv6 support in fabric.p4 by default
Change-Id: I5194ccb0ab78ec4388106cea14c96884f5d16b0f
diff --git a/pipelines/fabric/src/main/resources/include/control/forwarding.p4 b/pipelines/fabric/src/main/resources/include/control/forwarding.p4
index 2993191..de46115 100644
--- a/pipelines/fabric/src/main/resources/include/control/forwarding.p4
+++ b/pipelines/fabric/src/main/resources/include/control/forwarding.p4
@@ -31,8 +31,6 @@
direct_counter(CounterType.packets_and_bytes) mpls_counter;
direct_counter(CounterType.packets_and_bytes) unicast_v4_counter;
direct_counter(CounterType.packets_and_bytes) multicast_v4_counter;
- direct_counter(CounterType.packets_and_bytes) unicast_v6_counter;
- direct_counter(CounterType.packets_and_bytes) multicast_v6_counter;
direct_counter(CounterType.packets_and_bytes) acl_counter;
action drop() {
@@ -98,6 +96,10 @@
counters = multicast_v4_counter;
}
+#ifdef WITH_IPV6
+ direct_counter(CounterType.packets_and_bytes) unicast_v6_counter;
+ direct_counter(CounterType.packets_and_bytes) multicast_v6_counter;
+
table unicast_v6 {
key = {
hdr.ipv6.dst_addr: lpm;
@@ -120,6 +122,7 @@
}
counters = multicast_v6_counter;
}
+#endif // WITH_IPV6
table acl {
key = {
@@ -161,8 +164,10 @@
}
else if (fabric_metadata.fwd_type == FWD_IPV4_UNICAST) unicast_v4.apply();
else if (fabric_metadata.fwd_type == FWD_IPV4_MULTICAST) multicast_v4.apply();
+#ifdef WITH_IPV6
else if (fabric_metadata.fwd_type == FWD_IPV6_UNICAST) unicast_v6.apply();
else if (fabric_metadata.fwd_type == FWD_IPV6_MULTICAST) multicast_v6.apply();
+#endif // WITH_IPV6
acl.apply();
}
}
diff --git a/pipelines/fabric/src/main/resources/include/control/next.p4 b/pipelines/fabric/src/main/resources/include/control/next.p4
index 2fbb866..e0ebbe8 100644
--- a/pipelines/fabric/src/main/resources/include/control/next.p4
+++ b/pipelines/fabric/src/main/resources/include/control/next.p4
@@ -139,9 +139,11 @@
if(hdr.ipv4.isValid()) {
hdr.ipv4.ttl = hdr.ipv4.ttl - 1;
}
+#ifdef WITH_IPV6
else if (hdr.ipv6.isValid()) {
hdr.ipv6.hop_limit = hdr.ipv6.hop_limit - 1;
}
+#endif // WITH_IPV6
}
}
hashed.apply();