From patchwork Tue Aug 21 16:59:57 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: 144751 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp5515749ljj; Tue, 21 Aug 2018 10:01:54 -0700 (PDT) X-Google-Smtp-Source: AA+uWPynQFRlzyrxxJzcnlO5xze/JLv4L4UbmLEPyXpTahDPJhd81PM+MLJNc/kVRXxOCqGGnI0+ X-Received: by 2002:ac8:585:: with SMTP id a5-v6mr13978230qth.3.1534870914656; Tue, 21 Aug 2018 10:01:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534870914; cv=none; d=google.com; s=arc-20160816; b=nUgOpQ0mVOSBXHqgFKAyvHZWZAbGV0vaS1dkh24wvAVvhckz15mBNuOrWr9jqK5kGE uqjtMvkCclOvD1vJeslkX0VI6zoX/aVzY6qbBtKqzUb2j/U2raaXe4kfpD9dCYrSzyZ/ DV7pTHQInzby980jwckBK6rNiQRnet0D2cUeKLWFOJzx6hRjsxH+XTXYDIwcA7SvXzSx TmdRvavn++OICfU+u4uOugl7wQtpGjntLijNCnF1+rD1jEytle6NRL3sQWC0V7GgvviU bTHl2afFK/VaYuEBZoA4FKxr9JGf/op0yu103XHxapdRCL1CLkXafhZ9Z8xUBEP94QsK ZCQw== 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=reUxwUV1GsDxBifJ9dBYSW5voyL+8w0nGis0bq/urxY=; b=n7zm/TTrHEUC0AlCOcFy2AyEG+WwfgoPpugbgqcGBB4R0S7bsazrFK8q1I9Qo1cyj1 nCFNEspKHDt9XRGnH0Ao0AJBozpxevCHalkcSY+IBdqpaPRa5PnYX7BxpaXY8dYBq6e2 A23fUqyF/aYevv7TigoFt3cxwbxx2NtWj0j9NZxm/WkICzzUbPXN3b02DxGVpJ0H7oh0 HrrXp5BzJWm49MSp1vSAKsB58l17YBDvE1wTstR0i2f+lhfhJfZV0Rj/QgisrRaMwRMC FRw3aD+7sHdMbOe/Lgddf4otyv9UZIs1mDv5uua10PUJtTnkpy07jsyAvHGVX+Yi4p+n kuxw== 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 n30-v6si785668qte.228.2018.08.21.10.01.54; Tue, 21 Aug 2018 10:01:54 -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 4B594609AA; Tue, 21 Aug 2018 17:01:54 +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 E13F560981; Tue, 21 Aug 2018 17:01:33 +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 71EB460F5B; Tue, 21 Aug 2018 17:01:27 +0000 (UTC) Received: from forward103o.mail.yandex.net (forward103o.mail.yandex.net [37.140.190.177]) by lists.linaro.org (Postfix) with ESMTPS id 7968661720 for ; Tue, 21 Aug 2018 17:00:19 +0000 (UTC) Received: from mxback1g.mail.yandex.net (mxback1g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:162]) by forward103o.mail.yandex.net (Yandex) with ESMTP id 80BF15883746 for ; Tue, 21 Aug 2018 20:00:17 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback1g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 65vWhAtLUF-0BNGvNDu; Tue, 21 Aug 2018 20:00:11 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id PfJmBMqdLe-0AVCdDVj; Tue, 21 Aug 2018 20:00:10 +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 16:59:57 +0000 Message-Id: <1534870807-18456-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534870807-18456-1-git-send-email-odpbot@yandex.ru> References: <1534870807-18456-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 674 Subject: [lng-odp] [PATCH v6 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: f6c423a7d29e2c7d6d890cbc098a398d0d7e1288 ** Merge commit sha: d4f772b36da26684194cb0452a01b8da1ba7e3e1 **/ 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)