From patchwork Thu Aug 9 13:00:07 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: 143839 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2064666ljj; Thu, 9 Aug 2018 06:00:44 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyxuLxi4oiJluSfX2WhjfmP6nirncBh2vpTf5AhJKgO0YZtHFyHCmLIBt1yEL7KV4B2NgVk X-Received: by 2002:a37:c3cf:: with SMTP id r76-v6mr1709278qkl.150.1533819644231; Thu, 09 Aug 2018 06:00:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533819644; cv=none; d=google.com; s=arc-20160816; b=OVYRSueb38zlQK8FZwRpN5wImmVKNZ+MPvZdRgbnziMShplK/WG0b03ylRVVcqnTMi laQhuH5YpxJk4KMUhictebeN/3bAMWclVYTc/nsApoxS/m9tKqBRcTu3ufOP1zUQAeKs LzeyQCJ50sFi/C8yGZWJ1Yc4fNMb5lFs9KNJrRNNkqEW06l/3bgNTfZvyAvOICw7rUDb cT5iNEfZTVH0DHshUFeqcIcJa2r5/AkRnd1mrWLEYSqPVR5xVYuGijv27sRMLbWCe+O4 EhAU4oW9qaqJooxJGP76H8sHZj1u6ByIOCCubRUUDenUhAIHWoLDPe8qsLWIeHDuAH4w e6DA== 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=fg4o5gkIZvx4IdP8r24MMCz1fLR6CaMbjSE2ihbuQ8U=; b=XUGN3qoyrmuxjx60bl10OZ6XObR8vyTFuFV2wQyoTZPc0wjYtc7bAVGiGYsKPsdhNl vWLfF4zbcSxFk8zsiWG2CqDg2EUrTVQLOisHRXVz0guUAul+OuTlY2ZNJoWsDSz12sKv JOxc9zvKetqweA5VZiZcmneSWEOS+SpKpmkT1Og4kF5hTpqg0QSQ7EBmpjaAkgqn7u9b Xrhj6ERr0EZbqIVtH8XTPOEbW+mgWgkrThvNxCWqGENn9v8LhxkKaw73e86tovsTdAf1 hNpICaP39RWlYjFm5KfEhGjXdmB+xpjsBBQtgX21+CLsiYYiNR4ZDTARjGAcV6ZTSw6Z oIWw== 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 p42-v6si6879150qtf.121.2018.08.09.06.00.43; Thu, 09 Aug 2018 06:00:44 -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 B579D68625; Thu, 9 Aug 2018 13:00:43 +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 30502600CE; Thu, 9 Aug 2018 13:00:37 +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 B09BC6860D; Thu, 9 Aug 2018 13:00:29 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id BC9DC6860D for ; Thu, 9 Aug 2018 13:00:13 +0000 (UTC) Received: from mxback11j.mail.yandex.net (mxback11j.mail.yandex.net [IPv6:2a02:6b8:0:1619::84]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 46D4651051BC for ; Thu, 9 Aug 2018 16:00:12 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback11j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id FAeY4hb6MM-0C0iZxeb; Thu, 09 Aug 2018 16:00:12 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id NB1Fb3jYn0-0BJO9i7D; Thu, 09 Aug 2018 16:00:11 +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, 9 Aug 2018 13:00:07 +0000 Message-Id: <1533819610-30956-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533819610-30956-1-git-send-email-odpbot@yandex.ru> References: <1533819610-30956-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 670 Subject: [lng-odp] [PATCH v1 1/4] linux-gen: odp_tm_queue_destroy should not take care about params 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 params are set by application, we should not take care about them in implementation function. Signed-off-by: Maxim Uvarov --- /** Email created from pull request 670 (muvarov:devel/master_tm) ** https://github.com/Linaro/odp/pull/670 ** Patch: https://github.com/Linaro/odp/pull/670.patch ** Base sha: 7c87b66edc84e8c713fefc68d46464660adaf71e ** Merge commit sha: 37f8e9b0f4297cc96c5271e3e082cf0f39454538 **/ platform/linux-generic/odp_traffic_mngr.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/platform/linux-generic/odp_traffic_mngr.c b/platform/linux-generic/odp_traffic_mngr.c index af403b4b6..0d01c0ea5 100644 --- a/platform/linux-generic/odp_traffic_mngr.c +++ b/platform/linux-generic/odp_traffic_mngr.c @@ -3967,12 +3967,9 @@ odp_tm_queue_t odp_tm_queue_create(odp_tm_t odp_tm, int odp_tm_queue_destroy(odp_tm_queue_t tm_queue) { - tm_wred_params_t *wred_params; tm_shaper_obj_t *shaper_obj; tm_queue_obj_t *tm_queue_obj; - tm_wred_node_t *tm_wred_node; tm_system_t *tm_system; - uint32_t color; /* First lookup tm_queue. */ tm_queue_obj = GET_TM_QUEUE_OBJ(tm_queue); @@ -3990,23 +3987,6 @@ int odp_tm_queue_destroy(odp_tm_queue_t tm_queue) (tm_queue_obj->pkt != ODP_PACKET_INVALID)) return -1; - /* Check that there is no shaper profile, threshold profile or wred - * profile currently associated with this tm_queue. */ - if (shaper_obj->shaper_params != NULL) - return -1; - - tm_wred_node = tm_queue_obj->tm_wred_node; - if (tm_wred_node != NULL) { - if (tm_wred_node->threshold_params != NULL) - return -1; - - for (color = 0; color < ODP_NUM_PACKET_COLORS; color++) { - wred_params = tm_wred_node->wred_params[color]; - if (wred_params != NULL) - return -1; - } - } - /* Now that all of the checks are done, time to so some freeing. */ odp_ticketlock_lock(&tm_system->tm_system_lock); tm_system->queue_num_tbl[tm_queue_obj->queue_num - 1] = NULL; From patchwork Thu Aug 9 13:00:08 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: 143843 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2065733ljj; Thu, 9 Aug 2018 06:01:21 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzkneg3mzhoXiWr2lMFNho+nMmQCPIUY31xSxTpTAKsc6aVghXAWwPgIJnvGk7YxzM3+dOV X-Received: by 2002:a37:4248:: with SMTP id p69-v6mr1610885qka.238.1533819681130; Thu, 09 Aug 2018 06:01:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533819681; cv=none; d=google.com; s=arc-20160816; b=qLDXIuH0/ovaWwe7EbpBFUBLMPSfFY+6zSJGWF90uldaAGDIgCLokgHTzliBfxhJMT yBaXxU0R2s+uveLMoUZrovt5xd0aqr7gFmdpVJVQSIrLcgj7uqT7HYe9kpjAoj3zZ43q RII8C9aIGbDYr9ePfj6eXGL9mns8sYIfnAh4DHQwqhY7W5ChzlMtIRaTCcqMx190vf3b hbNKe9+hyQz4qErSc+H8rcUYgij8CsI5RulEsce+udteLPpf3wpyWzXiVvMb4mMc8UmC u9GgaCP/R/EoLywkoAhBF8374621oiwKd9R3z4WILOCMugsD76qwk8obuPO9iYm5ZYlR OHZg== 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=+jqDa8yIQCyIFjVXQ3t8so+pv20tlA9HC/8nwBF+21U=; b=esXuENgNihSRdtYhCfgK61DKXnaoQK53HmXXevYr0IPFB7Vhnm6Tzd/rY99oJKP6qD P/hzwcF8Q2DBZiN6pjZyYHHf0Oky5syhg3lI2raAj/7rCcd4g5eblP+c91C1dqQuogYn X0qyEIBVebwg97D5H8Vxf75Fnut4FTKss0a9x6CGvnS3k5MKNRjH8fyQFj1cZxTZT5nh q+xEvkjjHUt5px5CJVw6wHm25etzyCf+A3rXizQzHeJwaB3WIWH75nd5ggju586ATepF Ys3cfKurDoont3PF7dcxWZqBFT10dO4gyy7zQtyQ1ZC9BU8Ltm+ivLEJRoZ/3wRX5l32 x4/A== 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 g25-v6si2623572qkm.263.2018.08.09.06.01.20; Thu, 09 Aug 2018 06:01:21 -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 BE3F668622; Thu, 9 Aug 2018 13:01:20 +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 7CFE06860D; Thu, 9 Aug 2018 13:00:38 +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 707846860D; Thu, 9 Aug 2018 13:00:30 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id 1A90E68618 for ; Thu, 9 Aug 2018 13:00:14 +0000 (UTC) Received: from mxback12j.mail.yandex.net (mxback12j.mail.yandex.net [IPv6:2a02:6b8:0:1619::87]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 061CE5105661 for ; Thu, 9 Aug 2018 16:00:13 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback12j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 6QsB1lVPco-0CHq3KPO; Thu, 09 Aug 2018 16:00:12 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id NB1Fb3jYn0-0CJWxacI; Thu, 09 Aug 2018 16:00:12 +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, 9 Aug 2018 13:00:08 +0000 Message-Id: <1533819610-30956-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533819610-30956-1-git-send-email-odpbot@yandex.ru> References: <1533819610-30956-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 670 Subject: [lng-odp] [PATCH v1 2/4] example: tm: add tm queues destroy 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 Signed-off-by: Maxim Uvarov --- /** Email created from pull request 670 (muvarov:devel/master_tm) ** https://github.com/Linaro/odp/pull/670 ** Patch: https://github.com/Linaro/odp/pull/670.patch ** Base sha: 7c87b66edc84e8c713fefc68d46464660adaf71e ** Merge commit sha: 37f8e9b0f4297cc96c5271e3e082cf0f39454538 **/ example/traffic_mgmt/odp_traffic_mgmt.c | 57 ++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/example/traffic_mgmt/odp_traffic_mgmt.c b/example/traffic_mgmt/odp_traffic_mgmt.c index 2af106ab8..42fff66fe 100644 --- a/example/traffic_mgmt/odp_traffic_mgmt.c +++ b/example/traffic_mgmt/odp_traffic_mgmt.c @@ -743,6 +743,47 @@ static void signal_handler(int signal) abort(); } +static int destroy_tm_queues(void) +{ + int i; + int class; + int ret; + + for (i = 0; i < NUM_SVC_CLASSES; i++) + for (class = 0; class < TM_QUEUES_PER_CLASS; class++) { + odp_tm_queue_t tm_queue; + odp_tm_queue_info_t info; + + tm_queue = queue_num_tbls[i][class + 1]; + + ret = odp_tm_queue_info(tm_queue, &info); + if (ret) { + printf("Err: odp_tm_queue_info %d\n", ret); + return -1; + } + + ret = odp_tm_node_disconnect(info.next_tm_node); + if (ret) { + printf("Err: odp_tm_node_disconnect %d\n", ret); + return -1; + } + + ret = odp_tm_queue_disconnect(tm_queue); + if (ret) { + printf("odp_tm_queue_disconnect %d\n", ret); + return -1; + } + + ret = odp_tm_queue_destroy(tm_queue); + if (ret) { + printf("odp_tm_queue_destroy %d\n", ret); + return -1; + } + } + + return 0; +} + int main(int argc, char *argv[]) { struct sigaction signal_action; @@ -796,6 +837,12 @@ int main(int argc, char *argv[]) odp_tm_stats_print(odp_tm_test); + rc = destroy_tm_queues(); + if (rc != 0) { + printf("Error: destroy_tm_queues() failed, rc = %d\n", rc); + return -1; + } + rc = odp_pool_destroy(odp_pool); if (rc != 0) { printf("Error: odp_pool_destroy() failed, rc = %d\n", rc); @@ -814,11 +861,11 @@ int main(int argc, char *argv[]) return -1; } - /* Trying to keep this example as simple as possible we avoid - * clean termination of TM queues. This will error on global - * termination code - */ - (void)odp_term_global(instance); + rc = odp_term_global(instance); + if (rc != 0) { + printf("Error: odp_term_global() failed, rc = %d\n", rc); + return -1; + } return 0; } From patchwork Thu Aug 9 13:00:09 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: 143859 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2068182ljj; Thu, 9 Aug 2018 06:02:53 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyON3dyJgmofvt72P4Ox0DvqSsWWRHVFjC8ZLFNlySMZTgI6DJ1l1pDI+Sb8aBgB4D6f0cv X-Received: by 2002:aed:36a9:: with SMTP id f38-v6mr1968676qtb.64.1533819773194; Thu, 09 Aug 2018 06:02:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533819773; cv=none; d=google.com; s=arc-20160816; b=0TtfJXnB+XXVJf7AX7oOHTMb2qFMwNLTegJwLyl7cHrYbymVyCs+OSwpYlA9gJEvps Fs22vdAGSWALoKzSYWknSGG/vthdlTskQDZ8WdOJ9hs5rNackZtgp7V12RwL+Iqa6NcZ GAbSnO74fGQ7ssnIsxLC1MEnBGj2wV7FMjj+YBIwoUlRfylHbL4LnzX1EjgmDUTzICg/ m+d9JGJl+HKuzwu4NbFovJ9XtAfDYfSmhafxYklE1EMrUs/OJ8wrqGR7C1eotujyzrF2 eDdmUzxmAtNbNhVkRtmdckM47zIw2utj+6OQZwpF48soJmO8oPcitRT17/XVjbaCz5RY sNoA== 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=Zj0zdSuOwz96Neo94NtUmj44Atm1Njj2x/hkHJmiq2A=; b=sFH9VNFk5eOgFltjlfY43Bq2U/0R/2sYCy37UVxCumalTJ0511I5DWTe4FiiQYhrNm TMk0YOZC6gJAU7c+SFUSopjYsxWl7VwwgE/qrRqvoN8k/cFq35wIcdr0ELeiTNKyZg0a wtGkiCL+hATjUm9TmzQDRziYcBvJ1To+ERIz3xrz0awR2dZjr2EZyhFwvR2hcwhLUfmh 9TSvutZxYcuWQ7S20AP6/7DOq2gQJgZwd+/IXzzYwvtZjzJBlp46Qdo4mNyexIUrfY0d a3V+P4yYx+Bs/gvByy3YJQq3ZdNUoKf+oA8Na0myk7XOR4zwsL0Dbx5N03akVGF/oFQH YKJA== 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 b16-v6si6841941qkh.379.2018.08.09.06.02.52; Thu, 09 Aug 2018 06:02:53 -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 9C53B68622; Thu, 9 Aug 2018 13:02:52 +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 7D0D368626; Thu, 9 Aug 2018 13:00:55 +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 E8DD66861F; Thu, 9 Aug 2018 13:00:39 +0000 (UTC) Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [5.45.198.240]) by lists.linaro.org (Postfix) with ESMTPS id 5DE486861C for ; Thu, 9 Aug 2018 13:00:15 +0000 (UTC) Received: from mxback19j.mail.yandex.net (mxback19j.mail.yandex.net [IPv6:2a02:6b8:0:1619::95]) by forward100j.mail.yandex.net (Yandex) with ESMTP id CCD0C5D83660 for ; Thu, 9 Aug 2018 16:00:13 +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 zl8UFJuvqm-0Doa0XtV; Thu, 09 Aug 2018 16:00:13 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id NB1Fb3jYn0-0DJ0HlDo; Thu, 09 Aug 2018 16:00:13 +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, 9 Aug 2018 13:00:09 +0000 Message-Id: <1533819610-30956-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533819610-30956-1-git-send-email-odpbot@yandex.ru> References: <1533819610-30956-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 670 Subject: [lng-odp] [PATCH v1 3/4] example: tm: use 0 array index for queues 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 For some reason 0 array index was skipped and loop started from 1. Signed-off-by: Maxim Uvarov --- /** Email created from pull request 670 (muvarov:devel/master_tm) ** https://github.com/Linaro/odp/pull/670 ** Patch: https://github.com/Linaro/odp/pull/670.patch ** Base sha: 7c87b66edc84e8c713fefc68d46464660adaf71e ** Merge commit sha: 37f8e9b0f4297cc96c5271e3e082cf0f39454538 **/ example/traffic_mgmt/odp_traffic_mgmt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/example/traffic_mgmt/odp_traffic_mgmt.c b/example/traffic_mgmt/odp_traffic_mgmt.c index 42fff66fe..6a60993da 100644 --- a/example/traffic_mgmt/odp_traffic_mgmt.c +++ b/example/traffic_mgmt/odp_traffic_mgmt.c @@ -230,7 +230,7 @@ static odp_tm_t odp_tm_test; static odp_pool_t odp_pool; -static odp_tm_queue_t queue_num_tbls[NUM_SVC_CLASSES][TM_QUEUES_PER_CLASS + 1]; +static odp_tm_queue_t queue_num_tbls[NUM_SVC_CLASSES][TM_QUEUES_PER_CLASS]; static uint32_t next_queue_nums[NUM_SVC_CLASSES]; static uint8_t random_buf[RANDOM_BUF_LEN]; @@ -434,7 +434,7 @@ static int config_example_user(odp_tm_node_t cos_tm_node, return rc; svc_class_queue_num = next_queue_nums[svc_class]++; - queue_num_tbls[svc_class][svc_class_queue_num + 1] = + queue_num_tbls[svc_class][svc_class_queue_num] = tm_queue; } } @@ -633,7 +633,7 @@ static int traffic_generator(uint32_t pkts_to_send) while (pkt_cnt < pkts_to_send) { svc_class = pkt_service_class(); queue_num = random_16() & (TM_QUEUES_PER_CLASS - 1); - tm_queue = queue_num_tbls[svc_class][queue_num + 1]; + tm_queue = queue_num_tbls[svc_class][queue_num]; pkt_len = ((uint32_t)((random_8() & 0x7F) + 2)) * 32; pkt_len = MIN(pkt_len, 1500); pkt = make_odp_packet(pkt_len); @@ -754,7 +754,7 @@ static int destroy_tm_queues(void) odp_tm_queue_t tm_queue; odp_tm_queue_info_t info; - tm_queue = queue_num_tbls[i][class + 1]; + tm_queue = queue_num_tbls[i][class]; ret = odp_tm_queue_info(tm_queue, &info); if (ret) { From patchwork Thu Aug 9 13:00:10 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: 143858 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2067638ljj; Thu, 9 Aug 2018 06:02:34 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwXcEeUbizN5zhJY5K6VW6puShk5R6UKYDH8Hnlj7OdYM+j6VPcnZP5eHb5r24X+jpoo+bn X-Received: by 2002:a0d:df47:: with SMTP id i68-v6mr945930ywe.337.1533819754698; Thu, 09 Aug 2018 06:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533819754; cv=none; d=google.com; s=arc-20160816; b=fAOUnHxXXOADTlB544OdFCCWUZhXseiv8oU6iafpjzlio7tNZtCIJdeJbGW0BlB6hs WEjNL8S2RyKcpShSJWaOvoRrhWOxCjMKfBrJZ5KDnuMlk9PiaTqNrx18OLyNBTI2kySr a66jmC0S2IzMlLaFXpLXDepuJGP4O46HhkFh1IgQ1BsJdbWg4axDto+1qG4n/zbYEGew kq4WIuXs85xGyoSp7q8vxgHll452GlSvbPCXFr1g8nDFor0FGRVpz76X+9R/V+FmVSnX auR53uA8v6LGs9cf/a7Psy9oW89TFh5vvQmS0NsUSAyufPRN76IANqizkJ0nnKfr3+r9 Goew== 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=QrbgyI1TCfNb7bGbSf7Y449qfs0JlK66fRNP2BjZZqo=; b=IpX03ICAXkGFlmD7dUg7CZlTZki0B7hJFQCYvTnUGWzFn7AtURj+wZZPguNo7yMVsS zagJZWza35uRFMlgh/vuLd2gJhHfPvleHBdakFAecMHgoffqszUk7lHtN1J3sMcCVSe4 Hdifh3bRKb+pwOKqAlmaVWdHGLawkQs/UiuOnLjYDwCmfmFSws5xi5SfHd2plCwMqcJ/ ULD+IkSaSgwOBTywTRsFtxagmhWpPBfir9ZI/BCSiZfREz3/NHVNi1PDpCcvy6QF2Ue9 acBVMqtHODhH4QyL/NMw2/0WHhbBct5A83lhwZAwuRcI9XDiy6dtB6R1CD5gscs5OTkK RFSQ== 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 v16-v6si729023ybd.425.2018.08.09.06.02.34; Thu, 09 Aug 2018 06:02:34 -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 5971A6861C; Thu, 9 Aug 2018 13:02:34 +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 12838600CE; Thu, 9 Aug 2018 13:00:48 +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 52D0868608; Thu, 9 Aug 2018 13:00:33 +0000 (UTC) Received: from forward104p.mail.yandex.net (forward104p.mail.yandex.net [77.88.28.107]) by lists.linaro.org (Postfix) with ESMTPS id 13E3D6861D for ; Thu, 9 Aug 2018 13:00:16 +0000 (UTC) Received: from mxback20j.mail.yandex.net (mxback20j.mail.yandex.net [IPv6:2a02:6b8:0:1619::114]) by forward104p.mail.yandex.net (Yandex) with ESMTP id 8D0641812EF for ; Thu, 9 Aug 2018 16:00:14 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback20j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id gnoLZv0s3t-0E3qYd0j; Thu, 09 Aug 2018 16:00:14 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id NB1Fb3jYn0-0DJOVmnV; Thu, 09 Aug 2018 16:00:13 +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, 9 Aug 2018 13:00:10 +0000 Message-Id: <1533819610-30956-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533819610-30956-1-git-send-email-odpbot@yandex.ru> References: <1533819610-30956-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 670 Subject: [lng-odp] [PATCH v1 4/4] example: tm: add some message on exit 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 on clean exit it's good to add some message to see that app was not terminated in the middle. Signed-off-by: Maxim Uvarov --- /** Email created from pull request 670 (muvarov:devel/master_tm) ** https://github.com/Linaro/odp/pull/670 ** Patch: https://github.com/Linaro/odp/pull/670.patch ** Base sha: 7c87b66edc84e8c713fefc68d46464660adaf71e ** Merge commit sha: 37f8e9b0f4297cc96c5271e3e082cf0f39454538 **/ example/traffic_mgmt/odp_traffic_mgmt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/example/traffic_mgmt/odp_traffic_mgmt.c b/example/traffic_mgmt/odp_traffic_mgmt.c index 6a60993da..dbc659589 100644 --- a/example/traffic_mgmt/odp_traffic_mgmt.c +++ b/example/traffic_mgmt/odp_traffic_mgmt.c @@ -867,5 +867,6 @@ int main(int argc, char *argv[]) return -1; } + printf("Quit\n"); return 0; }