From c6b1463e17883eacdf81846284c57cf6a2e9151b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 25 Mar 2019 13:02:09 +0100 Subject: [PATCH] Debug missing checksum, introduce new field --- doc/plan.org | 6 +++++- p4src/checksums.p4 | 4 ++-- p4src/headers.p4 | 1 + p4src/static-mapping.p4 | 4 ++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/doc/plan.org b/doc/plan.org index 0e75bf6..0ce8e37 100644 --- a/doc/plan.org +++ b/doc/plan.org @@ -415,7 +415,11 @@ DEBUG:main:reassambled= probably not updated. +request -> probably not updated. After inserting marker: it's clear +that the checksum code DOES NOT work on the task field! + +Problem: task field might be overriden for controller use in different +table -> need different task field! *** TODO Get p4 VM / vagrant running **** DONE install libvirtd-daemon diff --git a/p4src/checksums.p4 b/p4src/checksums.p4 index 9e05953..1f38867 100644 --- a/p4src/checksums.p4 +++ b/p4src/checksums.p4 @@ -21,7 +21,7 @@ control MyVerifyChecksum(inout headers hdr, inout metadata meta) { control MyComputeChecksum(inout headers hdr, inout metadata meta) { apply { - update_checksum_with_payload(meta.task == TASK_CHECKSUM_ICMP6, + update_checksum_with_payload(meta.switch_task == TASK_CHECKSUM_ICMP6, { hdr.ipv6.src_addr, /* 128 */ hdr.ipv6.dst_addr, /* 128 */ @@ -36,7 +36,7 @@ control MyComputeChecksum(inout headers hdr, inout metadata meta) { ); /* checksumming for icmp6_na_ns_option */ - update_checksum_with_payload(meta.task == TASK_CHECKSUM_ICMP6_NA, + update_checksum_with_payload(meta.switch_task == TASK_CHECKSUM_ICMP6_NA, { hdr.ipv6.src_addr, /* 128 */ hdr.ipv6.dst_addr, /* 128 */ diff --git a/p4src/headers.p4 b/p4src/headers.p4 index a60ceb0..9fbcf96 100644 --- a/p4src/headers.p4 +++ b/p4src/headers.p4 @@ -166,6 +166,7 @@ struct headers { struct metadata { port_t ingress_port; task_t task; + task_t switch_task; bit<16> tcp_length; bit<32> cast_length; } diff --git a/p4src/static-mapping.p4 b/p4src/static-mapping.p4 index 7f91a7e..70b5bb3 100644 --- a/p4src/static-mapping.p4 +++ b/p4src/static-mapping.p4 @@ -197,7 +197,7 @@ control MyIngress(inout headers hdr, */ /* checksum trigger / content */ - meta.task = TASK_CHECKSUM_ICMP6_NA; + meta.switch_task = TASK_CHECKSUM_ICMP6_NA; meta.cast_length = (bit<32>) hdr.ipv6.payload_length; } @@ -212,7 +212,7 @@ control MyIngress(inout headers hdr, hdr.icmp6.type = ICMP6_ECHO_REPLY; - meta.task = TASK_CHECKSUM_ICMP6; + meta.switch_task = TASK_CHECKSUM_ICMP6; meta.cast_length = (bit<32>) hdr.ipv6.payload_length; }