From patchwork Thu Jan 25 06: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: 125770 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp890594ljf; Wed, 24 Jan 2018 22:00:52 -0800 (PST) X-Google-Smtp-Source: AH8x227CiSLYGojAoQKHZ+k6QX9GedTBU+caSQtT8V0OKrR3ttgU7aHZmSyjaUZHTBzZnZcNSFAL X-Received: by 10.55.176.195 with SMTP id z186mr12458327qke.140.1516860052290; Wed, 24 Jan 2018 22:00:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516860052; cv=none; d=google.com; s=arc-20160816; b=wazLAgFfoV1OJgUFlRzFrh4CF/q2gAkgLvGYN/RFf6w/P+aZr4l4381j1bdhsl7EXJ pIGvmwHe1P9e5ujSQ32Trldj5BnipVmvdeKkUw2fvmuKxr6S4iBYZwK7edSHSToTiRGe BI+WHSg3oXg6fMkxwiL5o2eup+hL4JfKyUrp9M7jCszq0b/D0JV/PxIDsMtDmZ527Z5H R0nMCcmnFxoLFInrIxTAUkwDywnx558gKHB+1VrNUyZbBWlwAV9u55GAZ4UXrwH5Vl5Z wrlNQ5GDSSFhSIxebTcjcG4o3z85gjqiuqSZKx/Tei5gLYH6k+8aulyFXS308hMt/Va2 1oGQ== 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=CDvs3oZF3YvSwpjMmsJNvAg/Vb7h71WMXpscR6gcP4A=; b=ofaE9N7ojuBjdBDAnEt7ANAo7za8TZSyEjdUWpwnoFsOnGuefZH1+ISirXrRtG0Vji v8b5QdO7X55Rk5nN7KBH/FbEIturMgsLbB2Ho63xafmjS1vIwwgO3r4CoBP7t0dQYNBR ztjD6SxSKbnJCHW0J1cRAd5GxkOG8tfuszlYgwh5qrlQK5RdN8zs0Xqz0yxLDkzxfRGx NWugAF1nikJ/uZfH0zeybf3yhZVExkD+7upqV6QN7mo7brJ01SfO8A/G85Y1ZtYesHKt Gb229pxzxM2zYpiieZtHFg8+IX3PprncUKYj+tdA4oO3N9GFxphMKioQBnQVWD2oNBmL sYEQ== 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 n29si1705759qtn.365.2018.01.24.22.00.52; Wed, 24 Jan 2018 22:00:52 -0800 (PST) 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 E800B617B5; Thu, 25 Jan 2018 06:00:51 +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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 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 94FC8617A6; Thu, 25 Jan 2018 06:00:23 +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 DD494616E4; Thu, 25 Jan 2018 06:00:16 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id 1D9216096B for ; Thu, 25 Jan 2018 06:00:15 +0000 (UTC) Received: from mxback19j.mail.yandex.net (mxback19j.mail.yandex.net [IPv6:2a02:6b8:0:1619::95]) by forward103p.mail.yandex.net (Yandex) with ESMTP id CA1A72182789 for ; Thu, 25 Jan 2018 09:00:12 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback19j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id GddogiFx03-0CGe08en; Thu, 25 Jan 2018 09:00:12 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ku59U5G53d-0CBmbTFp; Thu, 25 Jan 2018 09: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, 25 Jan 2018 09:00:10 +0300 Message-Id: <1516860010-16805-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516860010-16805-1-git-send-email-odpbot@yandex.ru> References: <1516860010-16805-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 417 Subject: [lng-odp] [PATCH v3 1/1] linux-gen: cls: fix: requested number of queues ignored during hash 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: Balasubramanian Manoharan hash queues are created based on application configuration Fixes: https://bugs.linaro.org/show_bug.cgi?id=3578 Signed-off-by: Balasubramanian Manoharan --- /** Email created from pull request 417 (bala-manoharan:BUG3578) ** https://github.com/Linaro/odp/pull/417 ** Patch: https://github.com/Linaro/odp/pull/417.patch ** Base sha: 984686b0763495c6dd97d2094f292fc7e01937d0 ** Merge commit sha: 53e499743be4ea7803ed86b78eb3e8b35b1f87d1 **/ platform/linux-generic/odp_classification.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index 668b41eb1..e924a9c61 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -221,7 +221,7 @@ static inline void _cls_queue_unwind(uint32_t tbl_index, uint32_t j) odp_cos_t odp_cls_cos_create(const char *name, odp_cls_cos_param_t *param) { - int i, j; + uint32_t i, j; odp_queue_t queue; odp_cls_drop_t drop_policy; cos_t *cos; @@ -258,7 +258,7 @@ odp_cos_t odp_cls_cos_create(const char *name, odp_cls_cos_param_t *param) _odp_cls_update_hash_proto(cos, param->hash_proto); tbl_index = i * CLS_COS_QUEUE_MAX; - for (j = 0; j < CLS_COS_QUEUE_MAX; j++) { + for (j = 0; j < param->num_queue; j++) { queue = odp_queue_create(NULL, &cos->s. queue_param); if (queue == ODP_QUEUE_INVALID) { @@ -1003,7 +1003,8 @@ int cls_classify_packet(pktio_entry_t *entry, const uint8_t *base, hash = packet_rss_hash(pkt_hdr, cos->s.hash_proto, base); /* CLS_COS_QUEUE_MAX is a power of 2 */ hash = hash & (CLS_COS_QUEUE_MAX - 1); - tbl_index = (cos->s.index * CLS_COS_QUEUE_MAX) + hash; + tbl_index = (cos->s.index * CLS_COS_QUEUE_MAX) + (hash % + cos->s.num_queue); pkt_hdr->dst_queue = queue_fn->from_ext(queue_grp_tbl-> s.queue[tbl_index]); return 0;