From patchwork Tue Jan 23 17:00:16 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: 125561 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1875444ljf; Tue, 23 Jan 2018 09:01:53 -0800 (PST) X-Google-Smtp-Source: AH8x227QpRGJxmxuzZogT25+7sozzlJac3I0bH9XUPlFcXfztzQhiQLZiFkIXRwP0AM56UQUYO4N X-Received: by 10.37.230.78 with SMTP id d75mr3028181ybh.403.1516726912732; Tue, 23 Jan 2018 09:01:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516726912; cv=none; d=google.com; s=arc-20160816; b=Q/zagajmLNctg9dnpu4kq05gyit8MwRBWRsAx6pzd9rn7BsggJecSXXCkXIwy7sDzi Prgg165/EvCsVpkXJYUt53Pn95hhu2ofAqUp8tkg/Yz8xd9XzNLj42CE22SKIfex1MRu lHHCkRzPOUya0qhsBkxQc+oZ+FYXHJk5p+uPnOIbxdG79st5b2kfRdXDRFT4YxitEd5J T6suA0+rq3ZOQrlvVBJ0RrvtZ9mwUmWAXfhfWpO37CSlONU5Xb+4Wza+To63ffkWW91d Ypex6mM518DDMu0EDOjLIQbLDBTHO9CJq3u/8Wt8sjHWDkp+tRtsLeY30/gVL877VMOn Z0uA== 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=YLjNTxVCg3sIRN28aUYxOB/lJ33OOldxVp0/nB8yV+I=; b=QTuY8ckmXuZe2xvZq6oGjKd4nG395XR+IR8TMLvZPw5fTM0TZOo5p+MbcI3ifHRUob 7VtH6izLbDjFzn2l2ejjI+8juhkTtRqJLc7sPOEl4NH7WCoUfgP/h2b/IQ/g9p6KRW4K 6W4S7l27A2MUfPxXszfEwSGBp9FU25AA0ljB6ACgnKRRlV6EPQeDyt6HT8w0+yUpsZqj Ftg3xQ2nPyeDAbEXdCCDRNyYYpsxZljM1z3ESGfBRco5FC1lxyxyO/jxZ+toREsSohzv Dc0zZB0VMdU8V3n7NFAjysLcD3x7vDBaS71yUu7AUgwFt7OQQ/YQwF7fctruZVyfedT4 RF7g== 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 j26si741083qta.60.2018.01.23.09.01.52; Tue, 23 Jan 2018 09:01: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 2EFE4617D4; Tue, 23 Jan 2018 17:01: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=-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 790EF61787; Tue, 23 Jan 2018 17:00:29 +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 D4F0161787; Tue, 23 Jan 2018 17:00:26 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id 709E0600CD for ; Tue, 23 Jan 2018 17:00:19 +0000 (UTC) Received: from mxback8o.mail.yandex.net (mxback8o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::22]) by forward102p.mail.yandex.net (Yandex) with ESMTP id 2433A430319F for ; Tue, 23 Jan 2018 20:00:18 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback8o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 0P8dfU5reo-0IA8Msk7; Tue, 23 Jan 2018 20:00:18 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id YXhYQq9bN3-0HBm2dlT; Tue, 23 Jan 2018 20:00:17 +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: Tue, 23 Jan 2018 20:00:16 +0300 Message-Id: <1516726816-17380-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516726816-17380-1-git-send-email-odpbot@yandex.ru> References: <1516726816-17380-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 417 Subject: [lng-odp] [PATCH v2 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: b122176ee59494dd957f0f5ff41d4b55a1477e13 ** Merge commit sha: 55477d89bb71a4393e8d1b2d518249de2cd6b12d **/ 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 5aa3b84a1..9b871c281 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -214,7 +214,7 @@ static void _odp_cls_update_hash_proto(cos_t *cos, 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; @@ -251,7 +251,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 = cos->s.index * 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) { @@ -994,7 +994,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;