From patchwork Mon Jan 22 16:00:17 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: 125441 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1231668ljf; Mon, 22 Jan 2018 08:03:11 -0800 (PST) X-Google-Smtp-Source: AH8x226ZrkB1RIEqLO4m+Ut7e/aGQUDhOwMmi5TtQ7jT69I6ghnyMVTbWlUmN1B5n+QEcueX4r/N X-Received: by 10.55.77.80 with SMTP id a77mr9677633qkb.239.1516636991487; Mon, 22 Jan 2018 08:03:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516636991; cv=none; d=google.com; s=arc-20160816; b=qLztIEcLd0HNiguFWg0l67H/7exzUFOfviFW0csCOotTsKzROherQ0q/keiuAtBgrO 3BNifqNxcGabyBMhgYN/wcOrWszlTSafNou6+mcRU7ZnOaqlbgVh+eDXqitj3LsCswju YZJ6vhnWwC4QeaUnIj8duCQPeTrw9nNX5/qQXhKIfSF9w0Z7Wir/XUKUCeCG804WsINW TkDBkZbQghkmLix0xMshsoe/S7pb5cBBy9avI6oIPVfWAPAW1fQm9RAglIIN/3DX/mdq QrRPe4He2mmaEosjdVSgRO8tXSyoIO/Y5D/aGPxl7utGSh85QTwSEdQ1rmEO2E72Gkc8 mu/w== 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=tElsrOwiYDAxnAtswGAwPzoYiv6V6HV69+857dWsWOQ=; b=OCdRfFn5sk2DeE3RMCiEeaczUnlReiPIOh38zyn9dN4eLvDLqp1AR5SABY/scJng4J 2kIXNThCRDekQRf7XB+8C3xXu/Q76CDjcZXrf+9tGmLcje9K60lB/ymfv860XrgzA8yr HW07ysVF83RyXUG8+OC0pjcL2FLkiIgKi2PgbCLzRFdi3LbzzsB5ZaMdH5lxzYQDZkEb gCiVw/4k3ICbgJD8grBzTeYuYGXVIc39t3bq+opf2tKGn1tgcHoVJSlJq/h0iWJW1ks/ /jHn83WJWIss9Ls4TOrVBSoQ9mLN+chGaiumPsMpPOabp8W+DG+X87G9jQQbGtl7JcNZ GeuA== 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 h129si10906725qkf.410.2018.01.22.08.03.11; Mon, 22 Jan 2018 08:03:11 -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 170B362785; Mon, 22 Jan 2018 16: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=-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 76A9C61800; Mon, 22 Jan 2018 16:00:41 +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 77D21617EC; Mon, 22 Jan 2018 16:00:30 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id 44BB46087E for ; Mon, 22 Jan 2018 16:00:20 +0000 (UTC) Received: from mxback5j.mail.yandex.net (mxback5j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10e]) by forward102p.mail.yandex.net (Yandex) with ESMTP id 00F8E4302685 for ; Mon, 22 Jan 2018 19:00:19 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback5j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id t9pncrMsXz-0ITuRNZZ; Mon, 22 Jan 2018 19:00:18 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 9hlR6Ziqnn-0I0erIVw; Mon, 22 Jan 2018 19:00:18 +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: Mon, 22 Jan 2018 19:00:17 +0300 Message-Id: <1516636817-25024-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516636817-25024-1-git-send-email-odpbot@yandex.ru> References: <1516636817-25024-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 417 Subject: [lng-odp] [PATCH v1 1/1] fix: linux-gen: cls: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 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: 3ce9d6ab16d064b0f83508e2f0b2e476d64b15e1 ** Merge commit sha: 55477d89bb71a4393e8d1b2d518249de2cd6b12d **/ platform/linux-generic/odp_classification.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index 5aa3b84a1..6dc19635d 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -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;