From patchwork Thu Dec 3 08:17:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 57619 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp3357011lbb; Thu, 3 Dec 2015 00:17:25 -0800 (PST) X-Received: by 10.140.32.162 with SMTP id h31mr9077344qgh.93.1449130645247; Thu, 03 Dec 2015 00:17:25 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id c62si4680529qga.124.2015.12.03.00.17.24; Thu, 03 Dec 2015 00:17:25 -0800 (PST) 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; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com Received: by lists.linaro.org (Postfix, from userid 109) id BC51D62C6E; Thu, 3 Dec 2015 08:17:24 +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.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, URIBL_BLOCKED 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 300E462BF8; Thu, 3 Dec 2015 08:17:21 +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 38B4462C0E; Thu, 3 Dec 2015 08:17:19 +0000 (UTC) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by lists.linaro.org (Postfix) with ESMTPS id 52B4062BF4 for ; Thu, 3 Dec 2015 08:17:18 +0000 (UTC) Received: by padhx2 with SMTP id hx2so64539333pad.1 for ; Thu, 03 Dec 2015 00:17:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=DriW4j/ERQqx35Npg6fjxC1sPY0oniRyDVso87Unk6I=; b=kjM2UrQ9f6c2KnnAD7p/EQuRVzmpyVGx4ErqPZo4c9xCFrmIgypx206Nzbq1HHHuY6 XPI2T0cLTF2BFK9wtp6x9zMkUY4w3eLTP5O+fW+XGb23OjBvb6RdL9uDtOJU98k2eEbv lgLQ1KlQMmNbmEMmqd2i0bFFOFd0KSywX8HaWe1JRM5KvfMsuesIIC1YGDJEjeIwH7BH 54n3rsivdYzJFKdZQ+XI0gGJUyyWMSmVr6aEYj8YtIXvNWwqRTo6fmRurYBiAMEYsh2v /uNBoWROAKOUjPXKG3lLzspsGTL37B4hc/JGZ2Rl1GaeGiC/1vHFmLwvqPRQyBDiPGEt uqjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=DriW4j/ERQqx35Npg6fjxC1sPY0oniRyDVso87Unk6I=; b=ZDdskn2f5MQ0k9iPBM8KTqILVnZYp/c+vDQTtuRGdxjkQnOjJg6AosyPNpmy/imPWZ He1D5wuj+wPdq8dPASaUcnAEJViFj1nca+kKGDy1ZokzjRPzwrr28B89zXCfzGFEIbVa Q1mcKMcU6Fmwjq844iLR0WtMVhwK0VONHhUFFfKuwH6+NetjD6h7oo4J4AV8fquJ7akA cE2Y+hNTL1+NRDE7mfk9EMB9mETlmrbXO2fXmP8nbCRUFrybaKqrmk63oY87FKU1EKcp ayoGTAnwfBtCoQFnwaT6A058x0osLng6mzkCfhebzWQmSPpE64+O2V4Bj38utzoMvoHe zhgA== X-Gm-Message-State: ALoCoQmuPMJLKJyx6E5gD5X4eHQWJqoxNmhPJJY9EzetevPsXjDWQ8cVi8LPN4Z56FS/UsXo8T/8 X-Received: by 10.66.65.234 with SMTP id a10mr11269815pat.129.1449130637570; Thu, 03 Dec 2015 00:17:17 -0800 (PST) Received: from bala-Vostro-2520.caveonetworks.com ([111.93.218.67]) by smtp.gmail.com with ESMTPSA id ry1sm8880683pab.30.2015.12.03.00.17.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Dec 2015 00:17:16 -0800 (PST) From: Balasubramanian Manoharan To: lng-odp@lists.linaro.org Date: Thu, 3 Dec 2015 13:47:04 +0530 Message-Id: <1449130627-1234-1-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: Classification patch Subject: [lng-odp] [API-NEXT/PATCHv3 1/4] api: classification: add odp_cls_cos_pool_set() api 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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" odp_cls_cos_pool_set() api is used to configure packet pool to CoS. The packets arriving at the CoS is allocated from the configured pool Signed-off-by: Balasubramanian Manoharan --- v3: Test Cases added to test pools associated with CoS v2: Incorporates review comments from Stuart include/odp/api/classification.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/include/odp/api/classification.h b/include/odp/api/classification.h index 380d91b..137ac21 100644 --- a/include/odp/api/classification.h +++ b/include/odp/api/classification.h @@ -379,6 +379,34 @@ int odp_pktio_pmr_match_set_cos(odp_pmr_set_t pmr_set_id, odp_pktio_t src_pktio, odp_cos_t dst_cos); /** +* Assigns a packet buffer pool for a specific Class of service. +* All the packets belonging to the given class of service will +* be allocated from the assigned packet pool. +* +* @param cos_id class-of-service handle +* @param pool_id Packet buffer pool handle +* +* @return 0 on success +* @return <0 on failure +* +* @note The packet pool associated with CoS will supersede +* the packet pool associated with the pktio interface +*/ +int odp_cls_cos_pool_set(odp_cos_t cos_id, odp_pool_t pool_id); + +/** +* Get the pool associated with the given class of service +* +* @param cos_id class-of-service handle +* +* @retval pool handle of the associated pool +* @retval ODP_POO_INVALID if no associated pool found or + incase of an error +* +*/ +odp_pool_t odp_cls_cos_pool(odp_cos_t cos_id); + +/** * Get printable value for an odp_cos_t * * @param hdl odp_cos_t handle to be printed