From patchwork Tue Jan 16 15:00:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 124726 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp1042290lje; Tue, 16 Jan 2018 07:01:44 -0800 (PST) X-Google-Smtp-Source: ACJfBouwhZ+lX3JJo5Wrtcv8hauxTtYArqP7k4znFRtHRLfWnzcLoXY5/S239wJOgGJmGG4SZD3N X-Received: by 10.129.86.139 with SMTP id k133mr26458255ywb.253.1516114904616; Tue, 16 Jan 2018 07:01:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516114904; cv=none; d=google.com; s=arc-20160816; b=wK0OY3zQml1GBkIqiMNGVPegsabzgQGJnXpBYo5wvX44l4+usTaxuw2uXLzd+kXJiW kmSgVb6iblYPejH0OPJ2Qv7qB502EqykTlhPl40Q2GsPDU0CoWIEE6wnklzh3K0nLZoG hYbCgvs2103VUMV4j7APyJogRomH8bKKTgZKPvtj5X5JbdjSlvM4lYZBk6mnD7URmHaR IvtGHtEI8XtQXbAl+6GiCEQWIrrxyaG7T9hY+cZSvyn1cZgHRzD5B3iXQRCHJO6lEMsx K81S1tC8lX+eSl9YZUZv0sMGRT+ymNMKj3KhzolyzW0PWPFr243WrAHRE3u4scO+s0Zf SCPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=dE4F5Yk+fVqLn0O0uO+dcDGIZV8Qd28gaMQ/gLcWQQo=; b=DJ0LFn1bUaC9eqB6sGei3uHZEcEbuDZP08e91V77BJbC4u4ROvp+Xs4N4kDPMJU5q/ Ie2ziTzDiTYkqn7kY7kld5pXni3AOzNZKA4QUctvVPx0c4h1Hi+m2DvKSRfUULOQaK8T zUV5Rqvp9ZqkydjpT9lOWXo0oxVfDPLkfAe6rzzcSblIZAzwUAhbijtyt5MVx3+jTtJw ZzwstpRmnY47vPV/t2b3Ut7aSfc+6N4y5NH5ZENs0UN7Xi4Hrk3MxBuqwfD2w7R0b83z pMZz5C2PqV7WcIdLsHFxrudZGsGtuoax90FTZHxyAdH1uk0BCL0B01tADsXoUCjdBfWG E40A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id n184si2302604qkd.18.2018.01.16.07.01.39; Tue, 16 Jan 2018 07:01:44 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 6560761803; Tue, 16 Jan 2018 15:01:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 8C843617DE; Tue, 16 Jan 2018 15:00:37 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 74C9B617DD; Tue, 16 Jan 2018 15:00:26 +0000 (UTC) Received: from forward104p.mail.yandex.net (forward104p.mail.yandex.net [77.88.28.107]) by lists.linaro.org (Postfix) with ESMTPS id 42B92617CF for ; Tue, 16 Jan 2018 15:00:16 +0000 (UTC) Received: from mxback4g.mail.yandex.net (mxback4g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:165]) by forward104p.mail.yandex.net (Yandex) with ESMTP id 05720181ECE for ; Tue, 16 Jan 2018 18:00:15 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback4g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id xJDUupLMzG-0EJ8SeMi; Tue, 16 Jan 2018 18:00:15 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ZDREQxZDaS-0EmGZTEo; Tue, 16 Jan 2018 18:00:14 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 16 Jan 2018 18:00:12 +0300 Message-Id: <1516114812-5443-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516114812-5443-1-git-send-email-odpbot@yandex.ru> References: <1516114812-5443-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 396 Subject: [lng-odp] [PATCH v1 1/1] validation: packet: minimal chksum status test X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen There was no references into chksum status functions in validation test suite. Add minimal test to see at least that functions exist. Parse function should be updated with a checksum implementation, before actual checksum checking can be tested. Signed-off-by: Petri Savolainen --- /** Email created from pull request 396 (psavol:master-test-chksum-status) ** https://github.com/Linaro/odp/pull/396 ** Patch: https://github.com/Linaro/odp/pull/396.patch ** Base sha: 520c170d758f2d37554631bf1467ec50e027cd3e ** Merge commit sha: 80f318dcc6f7dbed3d7d5f15f85a4cf525315598 **/ test/validation/api/packet/packet.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet/packet.c index 75e50d531..78ccbeaef 100644 --- a/test/validation/api/packet/packet.c +++ b/test/validation/api/packet/packet.c @@ -2466,6 +2466,8 @@ void packet_test_parse(void) odp_packet_parse_param_t parse; int ret, num_test_pkt, i; uint32_t len, max_len; + odp_packet_chksum_status_t chksum_status; + odp_proto_chksums_t all_chksums; int num_pkt = 10; odp_packet_t pkt[num_pkt]; uint32_t offset[num_pkt]; @@ -2480,6 +2482,12 @@ void packet_test_parse(void) sizeof(test_packet_ipv6_udp), sizeof(test_packet_vlan_ipv6_udp) }; + all_chksums.all_chksum = 0; + all_chksums.chksum.ipv4 = 1; + all_chksums.chksum.udp = 1; + all_chksums.chksum.tcp = 1; + all_chksums.chksum.sctp = 1; + num_test_pkt = sizeof(test_pkt_len) / sizeof(uint32_t); max_len = 0; @@ -2509,11 +2517,16 @@ void packet_test_parse(void) CU_ASSERT(ret == 0); offset[i] = 0; + + chksum_status = odp_packet_l3_chksum_status(pkt[i]); + CU_ASSERT(chksum_status == ODP_PACKET_CHKSUM_UNKNOWN); + chksum_status = odp_packet_l4_chksum_status(pkt[i]); + CU_ASSERT(chksum_status == ODP_PACKET_CHKSUM_UNKNOWN); } parse.proto = ODP_PROTO_ETH; parse.last_layer = ODP_PROTO_LAYER_ALL; - parse.chksums.all_chksum = 0; + parse.chksums = all_chksums; CU_ASSERT(odp_packet_parse(pkt[0], offset[0], &parse) == 0); CU_ASSERT(odp_packet_parse_multi(&pkt[1], &offset[1],