From patchwork Thu Aug 16 09:59:58 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: 144338 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1867898ljj; Thu, 16 Aug 2018 03:01:28 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxZ20s6+I7KOluYSe8R3RGBZCN21b5M6FVOQREqwz0Kumgfs7sZ9Rh7einbOloGw98+3VVh X-Received: by 2002:ac8:230b:: with SMTP id a11-v6mr29715332qta.123.1534413687999; Thu, 16 Aug 2018 03:01:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534413687; cv=none; d=google.com; s=arc-20160816; b=Ra3eulnDdwucVizTZcxE2aBVPG1I/0pX/o3DwXW+fkPAb+GDjzrtna4vgycpaumbqq WUhl46ZnBOsx1iBr4NmGO0ho11l+aiNzVursAWZacG7M3N+4JGK7QgyVBDU4OiqdfeKP TuxRDlw9qVJKKF4lemReUtXGFR2sV9HnxO9YKgi+NlnlVxynydklnVourpT8wFxmTUWF ioSkDxLSoaPs1k2YHaJf4wQGbYbMnPxFP0CkDKq1o3fynFGHBLm6yfZ4cHyCfH+eW743 NygBIQbg5+mY6v50yUpLHGj+dmaMVJUdlRu9DcB3QLFck8RE1OSVvhOTuhHX+1gWUiTA XepA== 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=dTLzuNVi3qe7ZFrWvaDYaq09/4A8wYl09JQgH9XEOZg=; b=vXpOsAXPYRVoDnEWw4gnsFNEWZKoCWWheCUTW6hJ2BGzStjHQynpszelxoN8iy42zK Y1w+IvQwO3qcqxBXs/+4kIpRJif41MD7/XuZGhoLNqkDrPXs2thMldReTWwPBaFkrxOZ s7SXIDXxuTPblo2Xf8XgSTrTKAzzCrFH91saBR+9Gwg+jGbRyuIW/25Z2xNBTYTxnhu8 c/2OQiAD0voHw74Qdxh9464ZwGEjHqEYAtK1eYG/u0fyLlW1LTeseoTU6VXNG90yLLBQ egVW8Sq6iRd6qsTb3cspFM0XlWJyVvKNw0YywoGmr3LvId5zrwDrQ6GiqoH2xFv+smjI pd3g== 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 k12-v6si1251175qti.3.2018.08.16.03.01.27; Thu, 16 Aug 2018 03:01: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 A44056861E; Thu, 16 Aug 2018 10:01: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 B792E68620; Thu, 16 Aug 2018 10:00:20 +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 70BB0607F1; Thu, 16 Aug 2018 10:00:14 +0000 (UTC) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) by lists.linaro.org (Postfix) with ESMTPS id 82DF768617 for ; Thu, 16 Aug 2018 10:00:12 +0000 (UTC) Received: from mxback19j.mail.yandex.net (mxback19j.mail.yandex.net [IPv6:2a02:6b8:0:1619::95]) by forward102o.mail.yandex.net (Yandex) with ESMTP id A9A9F5A05278 for ; Thu, 16 Aug 2018 13:00:10 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback19j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 6B9nkR0w33-0AsGJw9M; Thu, 16 Aug 2018 13:00:10 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LpjbZWHmdB-09r4g2UP; Thu, 16 Aug 2018 13: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: Thu, 16 Aug 2018 09:59:58 +0000 Message-Id: <1534413607-8630-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534413607-8630-1-git-send-email-odpbot@yandex.ru> References: <1534413607-8630-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 674 Subject: [lng-odp] [PATCH v2 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: 44d3d4f3c02fc6f3ee9811bc4dc5f01561e519a4 **/ 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)