From patchwork Thu Aug 17 21:00:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 110345 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp33071qge; Thu, 17 Aug 2017 14:02:35 -0700 (PDT) X-Received: by 10.55.25.9 with SMTP id k9mr10042323qkh.293.1503003755434; Thu, 17 Aug 2017 14:02:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503003755; cv=none; d=google.com; s=arc-20160816; b=YWf68YWmTeKxxaKiiUkVN/YLCGZlvOLuNexLwZnaCdATxIi1czXO2FqPYjhDtAc7S4 C0ofi8M7t7Mq/ikDHXq4qEpKN4j+vqFMXBK8O0EHRGQ114DRuy1+irHR5jb3DOWXoyvI ybfWFYu4IpBGpRgmm4RTFypijhs7XNyiIPAZ9zDSPQNxc3Jri3Z3qpzuIBhwglXHyNmg 0w0FEErFkBTbaPOVm+oKrP/mPmtRou4a5FRNK74h7RqBWzr+y6AobzDfNt9t/YJByTUH 0hTqLKGbJ6/N0NM2s3ziqYqMwWJN3haxzNGKgd9fJtT8hZbu++Qv+9ZKlnXFdzHVQIaN WpZA== 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=hzGPFxOcUXEuFoN46nahFdeM9rO5MrfnXlMdIUpA1ss=; b=SzWANsKBmr9fkYkSsu/9pveFvoenFXSOWdBUNr960AD0xNaK9cE5yac218Aknupnqh 8fjDVQPlOgm602R4bvhNTAi/dbj5SH0R3NXsOQ7Xy5tO++pd9xb4UmgyklYo30hJ/h3n fdxe3o2tJu6A+EJNDvQja4x9YQ1MBxChyVZdK+DV4XpjPRqXFiXKAqb8p3ryMwKCQO36 DoS2AgHuveN0XPTtMR9mbMO3yVjBlr42OcVw+jR8iePaQyalmtSdFNSCFCQC76/WZMwk qYw6JOFb6KCMwjbQv4Ow+zqygojdmc9TYin2OXMw6s1Bx0jTLhVho9bjK0Yl6pKvPB7f ZLNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 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 (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id c65si224708qkh.382.2017.08.17.14.02.35; Thu, 17 Aug 2017 14:02:35 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 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 1BF31609E0; Thu, 17 Aug 2017 21:02:35 +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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED 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 D355A60C47; Thu, 17 Aug 2017 21:01: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 B1CDD6089D; Thu, 17 Aug 2017 21:01:14 +0000 (UTC) Received: from forward100o.mail.yandex.net (forward100o.mail.yandex.net [37.140.190.180]) by lists.linaro.org (Postfix) with ESMTPS id 2361D659D2 for ; Thu, 17 Aug 2017 21:00:47 +0000 (UTC) Received: from mxback2o.mail.yandex.net (mxback2o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1c]) by forward100o.mail.yandex.net (Yandex) with ESMTP id C2A5B2A24201 for ; Fri, 18 Aug 2017 00:00:45 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback2o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id CxpFKPpopu-0jSSQw9L; Fri, 18 Aug 2017 00:00:45 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id RsEpBHFVjr-0jxeGiMT; Fri, 18 Aug 2017 00:00:45 +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: Fri, 18 Aug 2017 00:00:06 +0300 Message-Id: <1503003607-14013-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1503003607-14013-1-git-send-email-odpbot@yandex.ru> References: <1503003607-14013-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 131 Subject: [lng-odp] [PATCH v1 3/4] test: classifier: fix double free 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: Maxim Uvarov looks like merge conflict was resolved wrongly and test has double free. Signed-off-by: Maxim Uvarov --- /** Email created from pull request 131 (muvarov:master_loop_cls_fix) ** https://github.com/Linaro/odp/pull/131 ** Patch: https://github.com/Linaro/odp/pull/131.patch ** Base sha: 90d4ce1b3b25ca18446131906007571cc0ed0191 ** Merge commit sha: 30f51ee13b0bf800873a9be2c9a15b6a0c1db14d **/ .../validation/api/classification/odp_classification_test_pmr.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/common_plat/validation/api/classification/odp_classification_test_pmr.c b/test/common_plat/validation/api/classification/odp_classification_test_pmr.c index e6b496a1..0acf2cf7 100644 --- a/test/common_plat/validation/api/classification/odp_classification_test_pmr.c +++ b/test/common_plat/validation/api/classification/odp_classification_test_pmr.c @@ -171,8 +171,6 @@ void classification_test_pktin_classifier_flag(void) CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); odp_packet_free(pkt); - - odp_packet_free(pkt); odp_cos_destroy(cos); odp_cos_destroy(default_cos); odp_cls_pmr_destroy(pmr); From patchwork Thu Aug 17 21:00:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 110346 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp33779qge; Thu, 17 Aug 2017 14:03:12 -0700 (PDT) X-Received: by 10.200.39.81 with SMTP id h17mr9253119qth.162.1503003792004; Thu, 17 Aug 2017 14:03:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503003791; cv=none; d=google.com; s=arc-20160816; b=XGliNjvMAvT20bdpYeA9nbQpcAwsGxLjHeVMI5hwTy8BD9FlVGQbblhtCc/VkGSfGR RzRJ/GeZF++hqMm3EZKFZMDL7tnQIwvukMDaYiaO9LL37aI3/CfbgSe62JiuTZXACPla 2EGxbWjke2YNFVCz/Z5gFPnTpbw49XqWVoVHyEZuC2wGLelVZXxkUheDzDYXZhlwKy7e CN5wGjyQSamkCnmCy/2qwW0zK+8bxPx1PnQrP/qdo0fQjgnc4LdGBTz9rWAJ24IV88xT 2QaItvVnd3uxhYFYBKIJUm/TiU0QWtwlr01bqsg2xmcMch06kkij0ViJ4MFiYADL6Uog a+pw== 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=KTjdmWLS6vac9N+wsGwld2rCbOb/PnxaSuaFolDcu0E=; b=MXwAjgC11mtrpsbGHZoB0X5geW+S84Jh/pcWBqGryrNXA+52PAFQtPl7clKu8br0ej LoDPbxhfciWilGRQu+eWJeH6SOYHCeppHSY9NSTqRYD0j73pwdCrpDzxC3xhVmZq+1Cu dZ960XZjHsHWfIldu/7heugf5xUF9QkaWjav6qcEfh6k9vJ81B8h47rDlMseeS1pcPAn l6EsiUvS9CUmr6+TBRaOzZEbV8U8SF0UbG2tJC+qwoJ8hd+M5WD7EWVjHyCFiKR18MCc AiSdE7IYfznf8Vjo667ykmC3+w3culqozBHD9uesSc1TPZdk1DJeTzJrtutC5EbiURCX /diA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 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 (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id b68si3700642qkf.160.2017.08.17.14.03.11; Thu, 17 Aug 2017 14:03:11 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 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 83D9760D68; Thu, 17 Aug 2017 21:03:11 +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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,URIBL_BLOCKED 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 5476C644C2; Thu, 17 Aug 2017 21:01:26 +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 E3DA66093A; Thu, 17 Aug 2017 21:01:14 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id 03830644BA for ; Thu, 17 Aug 2017 21:00:48 +0000 (UTC) Received: from mxback7g.mail.yandex.net (mxback7g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:168]) by forward101p.mail.yandex.net (Yandex) with ESMTP id AA0A56A833DF for ; Fri, 18 Aug 2017 00:00:46 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback7g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id agiBsReb3R-0kE87fS3; Fri, 18 Aug 2017 00:00:46 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id RsEpBHFVjr-0kxGwi00; Fri, 18 Aug 2017 00:00:46 +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: Fri, 18 Aug 2017 00:00:07 +0300 Message-Id: <1503003607-14013-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1503003607-14013-1-git-send-email-odpbot@yandex.ru> References: <1503003607-14013-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 131 Subject: [lng-odp] [PATCH v1 4/4] linux-gen: pktio: loop: fix recv if classier bit is enabled 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: Maxim Uvarov Do not use fake header and just classify recived patched from loop ring. Signed-off-by: Maxim Uvarov --- /** Email created from pull request 131 (muvarov:master_loop_cls_fix) ** https://github.com/Linaro/odp/pull/131 ** Patch: https://github.com/Linaro/odp/pull/131.patch ** Base sha: 90d4ce1b3b25ca18446131906007571cc0ed0191 ** Merge commit sha: 30f51ee13b0bf800873a9be2c9a15b6a0c1db14d **/ platform/linux-generic/pktio/loop.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c index c825393a..68abb6d8 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -58,7 +58,6 @@ static int loopback_recv(pktio_entry_t *pktio_entry, int index ODP_UNUSED, odp_buffer_hdr_t *hdr_tbl[QUEUE_MULTI_MAX]; queue_t queue; odp_packet_hdr_t *pkt_hdr; - odp_packet_hdr_t parsed_hdr; odp_packet_t pkt; odp_time_t ts_val; odp_time_t *ts = NULL; @@ -84,7 +83,7 @@ static int loopback_recv(pktio_entry_t *pktio_entry, int index ODP_UNUSED, pkt = packet_from_buf_hdr(hdr_tbl[i]); pkt_len = odp_packet_len(pkt); - + pkt_hdr = odp_packet_hdr(pkt); if (pktio_cls_enabled(pktio_entry)) { odp_packet_t new_pkt; @@ -106,14 +105,16 @@ static int loopback_recv(pktio_entry_t *pktio_entry, int index ODP_UNUSED, } else { pkt_addr = odp_packet_data(pkt); } + ret = cls_classify_packet(pktio_entry, pkt_addr, pkt_len, seg_len, - &new_pool, &parsed_hdr); + &new_pool, pkt_hdr); if (ret) { failed++; odp_packet_free(pkt); continue; } + if (new_pool != odp_packet_pool(pkt)) { new_pkt = odp_packet_copy(pkt, new_pool); @@ -125,21 +126,14 @@ static int loopback_recv(pktio_entry_t *pktio_entry, int index ODP_UNUSED, } pkt = new_pkt; } - } - pkt_hdr = odp_packet_hdr(pkt); - - pkt_hdr->input = pktio_entry->s.handle; - - if (pktio_cls_enabled(pktio_entry)) - copy_packet_cls_metadata(&parsed_hdr, pkt_hdr); - else + } else { packet_parse_layer(pkt_hdr, pktio_entry->s.config.parser.layer); + } packet_set_ts(pkt_hdr, ts); - + pkt_hdr->input = pktio_entry->s.handle; pktio_entry->s.stats.in_octets += pkt_len; - pkts[num_rx++] = pkt; }