diff mbox

[API-NEXT,PATCHv2] helper: chksum add ipv3 and udp fields

Message ID 1461954225-12377-1-git-send-email-maxim.uvarov@linaro.org
State Accepted
Commit 7c4704b37306827c9d7fbabd07eb9df6548357f3
Headers show

Commit Message

Maxim Uvarov April 29, 2016, 6:23 p.m. UTC
Chksum routines updated to serarch l4 and udp flags
set in the packets. Because there is syntetic allocated
packet we need also set required bits.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 helper/test/chksum.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Bill Fischofer April 29, 2016, 6:25 p.m. UTC | #1
On Fri, Apr 29, 2016 at 1:23 PM, Maxim Uvarov <maxim.uvarov@linaro.org>
wrote:

> Chksum routines updated to serarch l4 and udp flags

> set in the packets. Because there is syntetic allocated

> packet we need also set required bits.

>

> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

>


Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>



> ---

>  helper/test/chksum.c | 2 ++

>  1 file changed, 2 insertions(+)

>

> diff --git a/helper/test/chksum.c b/helper/test/chksum.c

> index f47fa64..749d495 100644

> --- a/helper/test/chksum.c

> +++ b/helper/test/chksum.c

> @@ -111,6 +111,7 @@ int main(int argc TEST_UNUSED, char *argv[]

> TEST_UNUSED)

>         ip->proto = ODPH_IPPROTO_UDP;

>         ip->id = odp_cpu_to_be_16(1);

>         ip->chksum = 0;

> +       odp_packet_has_ipv4_set(test_packet, 1);

>         odph_ipv4_csum_update(test_packet);

>

>         /* udp */

> @@ -122,6 +123,7 @@ int main(int argc TEST_UNUSED, char *argv[]

> TEST_UNUSED)

>         udp->dst_port = 0;

>         udp->length = odp_cpu_to_be_16(udat_size + ODPH_UDPHDR_LEN);

>         udp->chksum = 0;

> +       odp_packet_has_udp_set(test_packet, 1);

>         udp->chksum = odph_ipv4_udp_chksum(test_packet);

>

>         if (udp->chksum == 0)

> --

> 2.7.1.250.gff4ea60

>

> _______________________________________________

> lng-odp mailing list

> lng-odp@lists.linaro.org

> https://lists.linaro.org/mailman/listinfo/lng-odp

>
Maxim Uvarov April 29, 2016, 6:26 p.m. UTC | #2
Merged,
Maxim.

On 04/29/16 21:25, Bill Fischofer wrote:
>
>
> On Fri, Apr 29, 2016 at 1:23 PM, Maxim Uvarov <maxim.uvarov@linaro.org 
> <mailto:maxim.uvarov@linaro.org>> wrote:
>
>     Chksum routines updated to serarch l4 and udp flags
>     set in the packets. Because there is syntetic allocated
>     packet we need also set required bits.
>
>     Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org
>     <mailto:maxim.uvarov@linaro.org>>
>
>
> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org 
> <mailto:bill.fischofer@linaro.org>>
>
>     ---
>      helper/test/chksum.c | 2 ++
>      1 file changed, 2 insertions(+)
>
>     diff --git a/helper/test/chksum.c b/helper/test/chksum.c
>     index f47fa64..749d495 100644
>     --- a/helper/test/chksum.c
>     +++ b/helper/test/chksum.c
>     @@ -111,6 +111,7 @@ int main(int argc TEST_UNUSED, char *argv[]
>     TEST_UNUSED)
>             ip->proto = ODPH_IPPROTO_UDP;
>             ip->id = odp_cpu_to_be_16(1);
>             ip->chksum = 0;
>     +       odp_packet_has_ipv4_set(test_packet, 1);
>             odph_ipv4_csum_update(test_packet);
>
>             /* udp */
>     @@ -122,6 +123,7 @@ int main(int argc TEST_UNUSED, char *argv[]
>     TEST_UNUSED)
>             udp->dst_port = 0;
>             udp->length = odp_cpu_to_be_16(udat_size + ODPH_UDPHDR_LEN);
>             udp->chksum = 0;
>     +       odp_packet_has_udp_set(test_packet, 1);
>             udp->chksum = odph_ipv4_udp_chksum(test_packet);
>
>             if (udp->chksum == 0)
>     --
>     2.7.1.250.gff4ea60
>
>     _______________________________________________
>     lng-odp mailing list
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
diff mbox

Patch

diff --git a/helper/test/chksum.c b/helper/test/chksum.c
index f47fa64..749d495 100644
--- a/helper/test/chksum.c
+++ b/helper/test/chksum.c
@@ -111,6 +111,7 @@  int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED)
 	ip->proto = ODPH_IPPROTO_UDP;
 	ip->id = odp_cpu_to_be_16(1);
 	ip->chksum = 0;
+	odp_packet_has_ipv4_set(test_packet, 1);
 	odph_ipv4_csum_update(test_packet);
 
 	/* udp */
@@ -122,6 +123,7 @@  int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED)
 	udp->dst_port = 0;
 	udp->length = odp_cpu_to_be_16(udat_size + ODPH_UDPHDR_LEN);
 	udp->chksum = 0;
+	odp_packet_has_udp_set(test_packet, 1);
 	udp->chksum = odph_ipv4_udp_chksum(test_packet);
 
 	if (udp->chksum == 0)