From patchwork Tue Aug 21 09:59:56 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: 144696 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp5058892ljj; Tue, 21 Aug 2018 03:00:28 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx2EoHZCONymdlWg1n/FT7z2B2ZjiSAEWwo5xBcTylHykYZqqXho05zS2Dm2skERPMJWVKD X-Received: by 2002:a37:6f44:: with SMTP id k65-v6mr44459726qkc.192.1534845628043; Tue, 21 Aug 2018 03:00:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534845628; cv=none; d=google.com; s=arc-20160816; b=NfSMwYL+6fT43SVrdiwmrJkQWK6iyjAlXnvx4L6SurZQqa7vkCEnliY8111M64eyPR NUHOT4/LLNEL1L07pCC0SAZe5srgODWPQ9nvZJXXq8sb1wkqkXq/FZci/GLathcde+SG Qg97RcrGWtm4wpFuBqI/4ctfS/+eHSd19V1sIuZMXIvIg2BqKbOhUPNgBN81sm9AAsbS bCUEuJJeDN2rdneQy9nhRygJxQkOn2tXa0JAYyrtL2XxnwmBa99flVsqYnNynLo5HD5m A4Ec8ocUdbfUG9LwQWY54nNBVSyfiTcCefU+BVnwpDbettzDh7kJATYb7DWK84bucg8V c8yA== 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=ruhtcaDsZP6xin7NHOQiYgz3X6qq55LfFkvYNMad+YM=; b=OfqrZSut/ag3+eDzz24x+vKiRLDIG1U303MKL/ZC9zowoAblIzxVT1PRyJttlWrZ91 unJYI3hhJVyYuBEwrOoz3ULbYsTZXpT2DGly48fv2lh9TJuSXEK3vydm5e+9rs4YCmgW h/by82gFf3BG8djsC16wka/5u99MhGyYA11Y7VeqQj60gx2+7gp80Z6gRkDiurHeAc4l CLBTz+4AkyLP4mjAsJ3KYdMKsDsP75pqYny/BwlzGqgQksGgA61ePhM+tsbecvtjpUcf 9z0Jh41x31IGRToZeiwj/VY2uTYbh+tPq/TtpuwA7z/gQ0xN+Tk9nMpXBm3AXo3oSiX2 BHcQ== 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 n57-v6si1135844qtk.212.2018.08.21.03.00.27; Tue, 21 Aug 2018 03:00:27 -0700 (PDT) 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 6322168623; Tue, 21 Aug 2018 10:00:27 +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=-3.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW 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 7D0796084A; Tue, 21 Aug 2018 10:00:21 +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 6EC9F618F6; Tue, 21 Aug 2018 10:00:14 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id 466F160833 for ; Tue, 21 Aug 2018 10:00:12 +0000 (UTC) Received: from mxback14j.mail.yandex.net (mxback14j.mail.yandex.net [IPv6:2a02:6b8:0:1619::90]) by forward103p.mail.yandex.net (Yandex) with ESMTP id 05B582183095 for ; Tue, 21 Aug 2018 13:00:11 +0300 (MSK) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback14j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id FgSSN9Fw77-0AhmFxPG; Tue, 21 Aug 2018 13:00:10 +0300 Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id eJZOyRH8Gd-09o0f3Za; Tue, 21 Aug 2018 13:00:09 +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, 21 Aug 2018 09:59:56 +0000 Message-Id: <1534845606-17334-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534845606-17334-1-git-send-email-odpbot@yandex.ru> References: <1534845606-17334-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 674 Subject: [lng-odp] [PATCH v5 2/12] validation: pktio: fix checks in pktio tests 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: Dmitry Eremin-Solenikov - cleanly close PktI/O if packet creation has failed - verify UDP checksum in UDP checksum override test Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 674 (lumag:sctp-checksum) ** https://github.com/Linaro/odp/pull/674 ** Patch: https://github.com/Linaro/odp/pull/674.patch ** Base sha: 912e026c108d7a496ac7467e953dea77dadaaa57 ** Merge commit sha: 9ab290c4f721a97e8c289b8a7992e6cc6614e7c3 **/ test/validation/api/pktio/pktio.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/validation/api/pktio/pktio.c b/test/validation/api/pktio/pktio.c index 09367d4ea..625cc325e 100644 --- a/test/validation/api/pktio/pktio.c +++ b/test/validation/api/pktio/pktio.c @@ -1958,7 +1958,14 @@ static void pktio_test_chksum(void (*config_fn)(odp_pktio_t, odp_pktio_t), ret = create_packets_cs(pkt_tbl, pkt_seq, TX_BATCH_LEN, pktio_tx, pktio_rx, false); - CU_ASSERT_FATAL(ret == TX_BATCH_LEN); + CU_ASSERT(ret == TX_BATCH_LEN); + if (ret != TX_BATCH_LEN) { + for (i = 0; i < num_ifaces; i++) { + CU_ASSERT_FATAL(odp_pktio_stop(pktio[i]) == 0); + CU_ASSERT_FATAL(odp_pktio_close(pktio[i]) == 0); + } + return; + } ret = odp_pktout_queue(pktio_tx, &pktout_queue, 1); CU_ASSERT_FATAL(ret > 0); @@ -2296,8 +2303,10 @@ static void pktio_test_chksum_out_udp_ovr_test(odp_packet_t pkt) odph_udphdr_t *udp = odp_packet_l4_ptr(pkt, NULL); CU_ASSERT(udp != NULL); - if (udp != NULL) + if (udp != NULL) { CU_ASSERT(udp->chksum != 0); + CU_ASSERT(!odph_udp_chksum_verify(pkt)); + } } static void pktio_test_chksum_out_udp_ovr(void)