From patchwork Tue Aug 11 12:10:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 52309 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by patches.linaro.org (Postfix) with ESMTPS id 1405322FEC for ; Tue, 11 Aug 2015 12:18:24 +0000 (UTC) Received: by labth1 with SMTP id th1sf72035825lab.2 for ; Tue, 11 Aug 2015 05:18:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=xoTruqRCXSDnybgqfE5F6LXFuaSqwpTk/teCWTVF69g=; b=WHFfsH94HYpYdewf0dAHpmMiAANyqG8c6/OoXkVd4arJs+n6rG0CKWATUfXUAZZ8q8 CBzlWzdE26S5yKevJHdtjMulHnlBu6koQ+xU6MxWOua3EsIOOAjRkxyW2rkWsWG5pdsc G9cdrztalegPq/Ccu7i6uygzJmM5UvHxYIjUqgwwwclVdGECW+ISw7TRGLAM2fLiG0Ci B3GFKDvE9Y0IUsuRfvqrFfgTmqv34EWm+/omP1lC69OQnHlr/7uirw1OCC1JdQK9EqI2 EQeOFcq7UCIvgpTHLjOrnJ9TQ9zwv2JDl6oO/kJ6rBQspoPWhIbX3eLvAmlafgSVke61 xlPg== X-Gm-Message-State: ALoCoQlRauR2N5dCcdnteCxZHvOzGlb0bnUSS6Ro+bbCnODo7ts/QK5l3gXAtYvB5ZnvQPdMTQ+o X-Received: by 10.112.173.230 with SMTP id bn6mr7890976lbc.15.1439295503013; Tue, 11 Aug 2015 05:18:23 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.205.33 with SMTP id ld1ls309949lac.6.gmail; Tue, 11 Aug 2015 05:18:22 -0700 (PDT) X-Received: by 10.152.1.195 with SMTP id 3mr13896082lao.79.1439295502859; Tue, 11 Aug 2015 05:18:22 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id gm7si1222253lbc.173.2015.08.11.05.18.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Aug 2015 05:18:22 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by lbbpu9 with SMTP id pu9so84666397lbb.3 for ; Tue, 11 Aug 2015 05:18:22 -0700 (PDT) X-Received: by 10.152.29.132 with SMTP id k4mr5974246lah.88.1439295502728; Tue, 11 Aug 2015 05:18:22 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp2491583lba; Tue, 11 Aug 2015 05:18:21 -0700 (PDT) X-Received: by 10.50.80.19 with SMTP id n19mr15908504igx.30.1439295501510; Tue, 11 Aug 2015 05:18:21 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id rv3si1465410igb.22.2015.08.11.05.18.20; Tue, 11 Aug 2015 05:18:21 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id 7D29361B5F; Tue, 11 Aug 2015 12:18:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 767F061D5F; Tue, 11 Aug 2015 12:16:42 +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 6D1CE61CE3; Tue, 11 Aug 2015 12:16:33 +0000 (UTC) Received: from mail-pa0-f48.google.com (mail-pa0-f48.google.com [209.85.220.48]) by lists.linaro.org (Postfix) with ESMTPS id 54BBB61C68 for ; Tue, 11 Aug 2015 12:11:03 +0000 (UTC) Received: by pacrr5 with SMTP id rr5so126677431pac.3 for ; Tue, 11 Aug 2015 05:11:02 -0700 (PDT) X-Received: by 10.69.12.229 with SMTP id et5mr55468213pbd.107.1439295062718; Tue, 11 Aug 2015 05:11:02 -0700 (PDT) Received: from localhost.localdomain ([122.166.219.57]) by smtp.gmail.com with ESMTPSA id oc2sm2469846pdb.45.2015.08.11.05.11.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Aug 2015 05:11:02 -0700 (PDT) From: Balasubramanian Manoharan To: lng-odp@lists.linaro.org Date: Tue, 11 Aug 2015 17:40:41 +0530 Message-Id: <1439295042-24381-4-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439295042-24381-1-git-send-email-bala.manoharan@linaro.org> References: <1439295042-24381-1-git-send-email-bala.manoharan@linaro.org> X-Topics: Classification patch Subject: [lng-odp] [API-NEXT PATCHv2 3/4] linux-generic: classification: queue and drop policy API name change X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: bala.manoharan@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 linux-generic implementation support for API name change from odp_cos_set_queue() to odp_cos_queue_set() and odp_cos_set_drop() to odp_cos_drop_set(). Adds queue handle to cos internal structure to support odp_cos_queue() and odp_cos_drop() getter function. Fixes: https://bugs.linaro.org/show_bug.cgi?id=1711 Signed-off-by: Balasubramanian Manoharan --- .../include/odp_classification_datamodel.h | 1 + platform/linux-generic/odp_classification.c | 33 ++++++++++++++++++++-- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/platform/linux-generic/include/odp_classification_datamodel.h b/platform/linux-generic/include/odp_classification_datamodel.h index 9da54c7..cb970f1 100644 --- a/platform/linux-generic/include/odp_classification_datamodel.h +++ b/platform/linux-generic/include/odp_classification_datamodel.h @@ -70,6 +70,7 @@ struct cos_s { uint32_t valid; /* validity Flag */ odp_drop_e drop_policy; /* Associated Drop Policy */ odp_queue_group_t queue_group; /* Associated Queue Group */ + odp_queue_t queue_id; /* Associated Queue handle */ odp_cos_flow_set_t flow_set; /* Assigned Flow Set */ char name[ODP_COS_NAME_LEN]; /* name */ size_t headroom; /* Headroom for this CoS */ diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index fdb544d..17c123a 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -265,7 +265,7 @@ int odp_cos_destroy(odp_cos_t cos_id) return 0; } -int odp_cos_set_queue(odp_cos_t cos_id, odp_queue_t queue_id) +int odp_cos_queue_set(odp_cos_t cos_id, odp_queue_t queue_id) { cos_t *cos = get_cos_entry(cos_id); if (cos == NULL) { @@ -275,13 +275,27 @@ int odp_cos_set_queue(odp_cos_t cos_id, odp_queue_t queue_id) /* Locking is not required as intermittent stale data during CoS modification is acceptable*/ cos->s.queue = queue_to_qentry(queue_id); + cos->s.queue_id = queue_id; return 0; } -int odp_cos_set_drop(odp_cos_t cos_id, odp_drop_e drop_policy) +odp_queue_t odp_cos_queue(odp_cos_t cos_id) { cos_t *cos = get_cos_entry(cos_id); - if (cos == NULL) { + + if (!cos) { + ODP_ERR("Invalid odp_cos_t handle"); + return ODP_QUEUE_INVALID; + } + + return cos->s.queue_id; +} + +int odp_cos_drop_set(odp_cos_t cos_id, odp_drop_e drop_policy) +{ + cos_t *cos = get_cos_entry(cos_id); + + if (!cos) { ODP_ERR("Invalid odp_cos_t handle"); return -1; } @@ -291,10 +305,23 @@ int odp_cos_set_drop(odp_cos_t cos_id, odp_drop_e drop_policy) return 0; } +odp_drop_e odp_cos_drop(odp_cos_t cos_id) +{ + cos_t *cos = get_cos_entry(cos_id); + + if (!cos) { + ODP_ERR("Invalid odp_cos_t handle"); + return -1; + } + + return cos->s.drop_policy; +} + int odp_pktio_default_cos_set(odp_pktio_t pktio_in, odp_cos_t default_cos) { pktio_entry_t *entry; cos_t *cos; + entry = get_pktio_entry(pktio_in); if (entry == NULL) { ODP_ERR("Invalid odp_pktio_t handle");