From patchwork Fri Jan 19 08:00:19 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: 125109 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp182461ljf; Fri, 19 Jan 2018 00:08:19 -0800 (PST) X-Google-Smtp-Source: ACJfBotIVVhBgP/IQ9l2w1oTOQOVtLqh1W8oUNoKJINNb+WhaLOvxaPDazvPBe2hSvogOfBwQG/K X-Received: by 10.200.42.18 with SMTP id k18mr10719789qtk.150.1516349298974; Fri, 19 Jan 2018 00:08:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516349298; cv=none; d=google.com; s=arc-20160816; b=tv+423SnF5mEpvD9noYWWW9wrY4Y11Xj97OMDCq0H1L1R2dFjEEokkctkA8tHruxkV gaMMR8lDqUGqbOiZ5xH/Xg1QHxhIXVCtQaR1Naj4kqmjSZAHeD21ymnFe3GSYhMxtirq e2Pf8LhX0WplIk/TENY61ut0FEdfsT/bm7IZBTql9dacJjP1j5YuW5VqaRMITK+3jxlF zCI4rsXcylpwu/qzVhRB05MDWFdPRtWivoPtBOAyP95pCJBBzdOzSL+NUrKOO20w3Yh4 jPPtXBbKmSCtLhKeVb8ruDAsc5IRx5ONAv9fWLM2gZpRguD70JaKm4jO9xtt03zOwSTu I5Vg== 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=aNaTVwEKnUUROKqhZi6eGcnvuTtFibDvji9aX3qQ5SE=; b=iZRwWcvoFZbCoUqUqH1dszpso52gisYs5jMS2Aeu+JWK3VBXmFdk6YMODvBVR0bavL o2Dzuv1reAPMQfZ35/xdQFFa/GWgMGHwoqFXoBznRY+XI+/SaeTvbw16t/JnsEZ5r4HN 9KEZZDo+PsA9cPuRdfIuUjm1m4dIxDldRO+7iQOfOh6UhNc40E2AkXVGaBptiqPoWa/4 vJXJ9/rhneBQEbcP4dbn5BkRExuhZBkJh/NWHrDTydUalrpXGggGdbtULaCXiSl3Px6Q QOCQy1G7FS4xQ2seXZ2FmWjhZaGnu3n3PCjacYYfHj/NEmr84FOOXnVaFlXBO4v06Nbd bhSw== 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 j12si4146587qke.300.2018.01.19.00.08.18; Fri, 19 Jan 2018 00:08:18 -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 A2A2262802; Fri, 19 Jan 2018 08:08:18 +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 2671E617A5; Fri, 19 Jan 2018 08:02:17 +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 1D1DD62800; Fri, 19 Jan 2018 08:01:50 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id 46959617E1 for ; Fri, 19 Jan 2018 08:00:27 +0000 (UTC) Received: from mxback4g.mail.yandex.net (mxback4g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:165]) by forward103p.mail.yandex.net (Yandex) with ESMTP id 1AE97218129D for ; Fri, 19 Jan 2018 11:00:21 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback4g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id x0pJDXklHL-0Lx8lxwf; Fri, 19 Jan 2018 11:00:21 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id wy8F3DGHUx-0K5esw5E; Fri, 19 Jan 2018 11:00:20 +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: Fri, 19 Jan 2018 11:00:19 +0300 Message-Id: <1516348819-27675-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516348819-27675-1-git-send-email-odpbot@yandex.ru> References: <1516348819-27675-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 405 Subject: [lng-odp] [PATCH v2 2/2] fix: cls: unwind cls queues on failure 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=3576 Signed-off-by: Balasubramanian Manoharan --- /** Email created from pull request 405 (bala-manoharan:bug3576) ** https://github.com/Linaro/odp/pull/405 ** Patch: https://github.com/Linaro/odp/pull/405.patch ** Base sha: 77ff03881d844a9d6a4bc773086bd8aaecace541 ** Merge commit sha: 0d984e3e700ae418eafe1fe25444d1a5508b56c0 **/ platform/linux-generic/odp_classification.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index 9b867576a..ee0427754 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -212,6 +212,12 @@ static void _odp_cls_update_hash_proto(cos_t *cos, cos->s.hash_proto.udp = 1; } +static inline void _cls_queue_unwind(uint32_t tbl_index, uint32_t j) +{ + while (j > 0) + odp_queue_destroy(queue_grp_tbl->s.queue[tbl_index + --j]); +} + odp_cos_t odp_cls_cos_create(const char *name, odp_cls_cos_param_t *param) { int i, j; @@ -255,6 +261,8 @@ odp_cos_t odp_cls_cos_create(const char *name, odp_cls_cos_param_t *param) queue = odp_queue_create(NULL, &cos->s. queue_param); if (queue == ODP_QUEUE_INVALID) { + /* unwind the queues */ + _cls_queue_unwind(tbl_index, j); UNLOCK(&cos->s.lock); return ODP_COS_INVALID; }