From patchwork Tue Jan 23 16:00:26 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: 125559 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1841989ljf; Tue, 23 Jan 2018 08:02:51 -0800 (PST) X-Google-Smtp-Source: AH8x2276n702Av6E4wTtsFJwKzyRumbwBmVTjItY0hv0Dn+F+AL+ghFcOeJtu87KFNMaBvf8toFm X-Received: by 10.200.6.208 with SMTP id j16mr4055593qth.166.1516723371048; Tue, 23 Jan 2018 08:02:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516723371; cv=none; d=google.com; s=arc-20160816; b=ZbAFBG3imuXLn5ZfB8pTSxqWBdPWY7j5zwKaj9KacDmtA2UzSUn6jt3aXO6TUY8cSd BT0p1xH1k/p4Y4Rs+bmrSEQ7I7+GPUuo4+LjLvEXJnpHoCfnVVyNgG9TlCzSf34njP/f w6deVlT0+HH8649grGhLCr3qBVYra757DSTztYASZ3jt6zUC7WrylBBF9Y5yPMUi0PEW NRIo1ED0lsZZTzhPacIi/K6+CSL3Tixo1kJ9lrk884S1KMVVijF4zNCOA5cS0ERfezk/ FXhy6OutvasuVa4PaUG+DgG0al32hK7hNmC+gZFVOW93LEXohFAZJpAbuzT9RCr3km8c TgqA== 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=KeyNity2VYW5FxzEne2ellk+DmK/rmStIXux9uQvm80=; b=ocAE9TqKBxeexyanW7XG8E/HwxAqp1Tp0LEv0tNghGq22yod/KNkEm96D+P5k9URYf ALXsx5avDEvgE+gZJEHctIScLNRw6EQLMviuJe4XtzkBpBiGrHhZ7D5ZhIrswKqHBzC3 v9oNt2PDFpj1Vmn2VKiPGx8D2viFdVgvYvfoHkht26Pm0EU9dF6WO75LcT0cws53nyac UwOIHoxAmUi0UcEzJ72t+D6vjrzVlHg2kkfLaVUak8rj+4o+UFb3gnQHalyApXlv4Bkn D50k81UhdhajJ9s27A9Y2cC5zscVyu+TnHMPcpq2UdsVVADzk4dpAipVlEd1HNjvZLy1 Nq+w== 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 v123si694280qki.197.2018.01.23.08.02.50; Tue, 23 Jan 2018 08:02:51 -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 ADF84617DF; Tue, 23 Jan 2018 16:02:50 +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 3F1746178D; Tue, 23 Jan 2018 16:02:12 +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 E408A60919; Tue, 23 Jan 2018 16:01:52 +0000 (UTC) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [5.45.198.247]) by lists.linaro.org (Postfix) with ESMTPS id 3FD3C617CC for ; Tue, 23 Jan 2018 16:00:29 +0000 (UTC) Received: from mxback7g.mail.yandex.net (mxback7g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:168]) by forward104j.mail.yandex.net (Yandex) with ESMTP id AAEE1441B1 for ; Tue, 23 Jan 2018 19:00:27 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback7g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id btiIs9poKc-0R0WbUB0; Tue, 23 Jan 2018 19:00:27 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id tqvNwHQITq-0RBOBTGf; Tue, 23 Jan 2018 19:00:27 +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 19:00:26 +0300 Message-Id: <1516723226-13957-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516723226-13957-1-git-send-email-odpbot@yandex.ru> References: <1516723226-13957-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 407 Subject: [lng-odp] [PATCH v2 1/1] linux-gen: cls: fix: invalid queue handle check for hashing 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 invalid queue handle check should not be done for hash queues Fixes: https://bugs.linaro.org/show_bug.cgi?id=3577 Signed-off-by: Balasubramanian Manoharan --- /** Email created from pull request 407 (bala-manoharan:BUG3577) ** https://github.com/Linaro/odp/pull/407 ** Patch: https://github.com/Linaro/odp/pull/407.patch ** Base sha: b122176ee59494dd957f0f5ff41d4b55a1477e13 ** Merge commit sha: e8cda026ba20a27239a265ec4a16b1163051bbf1 **/ platform/linux-generic/odp_classification.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index 276430923..d97807df0 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -979,8 +979,10 @@ int cls_classify_packet(pktio_entry_t *entry, const uint8_t *base, if (cos == NULL) return -EINVAL; - if (cos->s.queue == ODP_QUEUE_INVALID || - cos->s.pool == ODP_POOL_INVALID) + if (cos->s.queue == ODP_QUEUE_INVALID && cos->s.num_queue == 1) + return -EFAULT; + + if (cos->s.pool == ODP_POOL_INVALID) return -EFAULT; *pool = cos->s.pool;