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) {