From patchwork Mon Aug 10 12:41:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 52234 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by patches.linaro.org (Postfix) with ESMTPS id 08E572152A for ; Mon, 10 Aug 2015 12:43:44 +0000 (UTC) Received: by lagz9 with SMTP id z9sf41961758lag.3 for ; Mon, 10 Aug 2015 05:43:43 -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=aWHCA+hf+nyhbYeGL/ltwJdfbX25DoxvHuUIep5rkes=; b=BI7Moy10LEn4w8m2nv2063N9BFTKkZMLdNCV6P5TzxqasEq5cBY7+atDrmrXmxjBXG FYIiCOY8eakQhcC2RaXJ42HiNgarfyE4d6DDVad8jCVe/qxW2u3faHDWWsNEFOR6zj7P c5g4rFOrZ3SNa0kbSt/7PShu256ed4RJKKK+5ab0oT+KloX58YNdVZtrBq3DPu5DkqOo lIzWKmzpY7KOVQd3z5vMV09l8qLzOF2lj0dZixO8jMdqKncEfGhmRukldysQgLjZj99Z LhwOe6gm5vxgm1J82qhGPUoXbHbMZ1o6nhQKj2a6HXjTlNDHYFpSXl4cyM/2XP4UX50o RkbA== X-Gm-Message-State: ALoCoQlTt1Phr1/nEcjA508U3V4EG3xHYBdg7xdYQ5tVLOJpvuJnRg0oY1uIPMhIA2LgxmWwQF16 X-Received: by 10.112.189.105 with SMTP id gh9mr1046141lbc.16.1439210622981; Mon, 10 Aug 2015 05:43:42 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.39 with SMTP id b7ls684042lae.85.gmail; Mon, 10 Aug 2015 05:43:42 -0700 (PDT) X-Received: by 10.152.204.196 with SMTP id la4mr20106800lac.124.1439210622830; Mon, 10 Aug 2015 05:43:42 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id xg1si13975838lac.41.2015.08.10.05.43.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 05:43:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbbpu9 with SMTP id pu9so66840107lbb.3 for ; Mon, 10 Aug 2015 05:43:42 -0700 (PDT) X-Received: by 10.152.170.230 with SMTP id ap6mr3350668lac.73.1439210622648; Mon, 10 Aug 2015 05:43:42 -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 l6csp1911285lba; Mon, 10 Aug 2015 05:43:41 -0700 (PDT) X-Received: by 10.140.135.197 with SMTP id 188mr39544020qhh.89.1439210621248; Mon, 10 Aug 2015 05:43:41 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 107si33249280qge.122.2015.08.10.05.43.39; Mon, 10 Aug 2015 05:43:41 -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 1E04B61D87; Mon, 10 Aug 2015 12:43:39 +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 A1E4461E1B; Mon, 10 Aug 2015 12:42:09 +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 3E1FA61D80; Mon, 10 Aug 2015 12:42:02 +0000 (UTC) Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by lists.linaro.org (Postfix) with ESMTPS id 388E161DC9 for ; Mon, 10 Aug 2015 12:41:44 +0000 (UTC) Received: by pdco4 with SMTP id o4so71322249pdc.3 for ; Mon, 10 Aug 2015 05:41:43 -0700 (PDT) X-Received: by 10.70.100.65 with SMTP id ew1mr24505519pdb.110.1439210503533; Mon, 10 Aug 2015 05:41:43 -0700 (PDT) Received: from localhost.localdomain ([122.166.219.57]) by smtp.gmail.com with ESMTPSA id hx7sm19806936pbc.84.2015.08.10.05.41.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Aug 2015 05:41:43 -0700 (PDT) From: Balasubramanian Manoharan To: lng-odp@lists.linaro.org Date: Mon, 10 Aug 2015 18:11:11 +0530 Message-Id: <1439210472-15839-4-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439210472-15839-1-git-send-email-bala.manoharan@linaro.org> References: <1439210472-15839-1-git-send-email-bala.manoharan@linaro.org> X-Topics: Classification patch Subject: [lng-odp] [API-NEXT PATCHv1 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.172 as permitted sender) smtp.mail=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. 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");