From patchwork Mon Aug 20 10:59:59 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: 144596 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3825202ljj; Mon, 20 Aug 2018 04:01:39 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxcFt/32+hPT16hAgVVIsBloX+HT1ZJI1HvXP3b26tvINZtuR5EncVd25CRLBufHzi/tBEI X-Received: by 2002:a37:5d84:: with SMTP id r126-v6mr40936665qkb.155.1534762899670; Mon, 20 Aug 2018 04:01:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534762899; cv=none; d=google.com; s=arc-20160816; b=AMgg4q7wgBS1qw0DdVOYkXbA+zRSJpH2yS5cHSeBndk4tET8xU2KOSUGK9UKTf+FVE //vKRGJF04pXRcirYxtbSuDXnZu7Hjwg6gbHSo2AfkNka6p0fmdY/FcVzfDYiBs+wO/g poJm39Z0nXeqhzzG/rCg4D5Jz50mGxE7tdn+56VjpZc1iPouJ9u8/vXrv+7gcb9dpdrS F484OuCaQDQHlkA+bNtQPxgOkZnUBUtxu2MOUoZ5dl6UYTKF6lAWQCxJn0gnTRHuRsHl ZM1rC4VlbvVMa4XMO2tFW6r8SnKi06cG/ty2R5Wh/YcBsZL0V2aVjggRydSWRphkDmxN m9kQ== 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=XbM+zsruLbx6vmd8M3VAIa+mbIkftCse8WagYigEIwQ=; b=c1mohjTKWy1XQUinOgXgkr0g/pUY8DN7cLLBVlQjxZyymAnJKNf4rC3JCdRHTIm2hy 4ZIRbIqLreBG3FPR/DsnH03G1tiZz2IyTlehfv4fbbeLoHAa9XW+O4j1svzCF3yFeN1C +ZfNILyUDr7qlpqf1mjIVhI1wqXDz5qyZd+cOAZL64Cmy76WiGOllYp9lYobUJg6tizT 154akBfrANt1GScIspADopsCPtLWclEaeNTMu6P5B1pgCnDkTupU2VURnIcwsbiJh/gy T/qKv0abiK2nR8RNIhdWXLeCEhCi1wh8MrTrM57vR1jL5i/5a0XCbvIlfSgKrKzgcQuz fdlg== 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 r6-v6si8409738qte.343.2018.08.20.04.01.39; Mon, 20 Aug 2018 04:01:39 -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 51F706864C; Mon, 20 Aug 2018 11: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=-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 85AC468612; Mon, 20 Aug 2018 11:00:28 +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 8F59F609AA; Mon, 20 Aug 2018 11:00:15 +0000 (UTC) Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [37.140.190.181]) by lists.linaro.org (Postfix) with ESMTPS id 0352E609AA for ; Mon, 20 Aug 2018 11:00:13 +0000 (UTC) Received: from mxback16j.mail.yandex.net (mxback16j.mail.yandex.net [IPv6:2a02:6b8:0:1619::92]) by forward101o.mail.yandex.net (Yandex) with ESMTP id 78BE01346478 for ; Mon, 20 Aug 2018 14:00:11 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback16j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id QlQhIrGWkq-0Bl8SjG5; Mon, 20 Aug 2018 14:00:11 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id x8w3cLDY5J-0At8tqMk; Mon, 20 Aug 2018 14: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: Mon, 20 Aug 2018 10:59:59 +0000 Message-Id: <1534762808-15588-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534762808-15588-1-git-send-email-odpbot@yandex.ru> References: <1534762808-15588-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 674 Subject: [lng-odp] [PATCH v3 2/11] 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: dc28824415ea510e3ef62e47f7640bf4a8420fde ** Merge commit sha: b482f9618a6edb2a2f2491ee5a7af757eab93b24 **/ 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)