From patchwork Thu Dec 3 10:46:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 57631 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp3415687lbb; Thu, 3 Dec 2015 02:46:25 -0800 (PST) X-Received: by 10.55.77.9 with SMTP id a9mr9730830qkb.38.1449139585423; Thu, 03 Dec 2015 02:46:25 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id g205si477203qkb.9.2015.12.03.02.46.25; Thu, 03 Dec 2015 02:46: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 E96DC62C73; Thu, 3 Dec 2015 10:46: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 6C75962C0E; Thu, 3 Dec 2015 10:46:20 +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 75DCD62C48; Thu, 3 Dec 2015 10:46:18 +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 AA74962BF3 for ; Thu, 3 Dec 2015 10:46:17 +0000 (UTC) Received: by pacej9 with SMTP id ej9so67248754pac.2 for ; Thu, 03 Dec 2015 02:46: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=zD0RfsdGqXl04sGfVrd5g0a27cR43zGLuP0WqM2VoGs=; b=jVTLr2u+MAxPP28qadqIsZDn9EJwtOVKVx6erzlQcwOQei1zkZU1dEKuimiZW50oVl wkk9nU3MNiOADSsIf5wKh9D9G/n4CipoUQvSCh5QnFd7B9SZKZ5FQL2zVh3YCHCiQ6Gr 3GJ2ybT9qIvnol9q/KxnJNfiu6DNF9a9t7qGr8Jc1d5nwkiJrVM+5N6P8pbElkR1fVZH PH0ecXHO4LX7x9o+xNHTGiwqpIS5Ovkd0FgM0M2bCzQCaE6iE3rJ8rm4c2tG9QXO4y0r 8koLUW+/jRm/SlhRDxfTiY12rzMKxUuwF42C0u4B34ZqeEWd8OPWmcC1l1LlyiElh7N2 K09w== 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=zD0RfsdGqXl04sGfVrd5g0a27cR43zGLuP0WqM2VoGs=; b=UljJ0Dbk4ES8iIXpDPOku8rtMXu7zj8R80BdYssb4ym+MrZmrKoY35pJl1ToNxzluk HKWDxNdgKb//UHWGSYsqIwSLcMLYB5kq1XmfOsgeYzT2q6aL85drbTHKtmM7fSkp1tPo nc4tls85ltTdZArI5L1mwPUKlQND6ewJ0TcbO5MmVxM9509qfVrSvGLqxHLou195qX1S q5DIzAUWWwQPE3MDojAuAVR0xXpuiWYU08cL3KMkYmOGnbzTq3Yz862X1aOrQk0ayKxk N7trNIo44wsJAB9TWDL+NfM8jSIokr9zf3QQH/3C7RaOFHTozw7Gk+grQ4KmuIrQHMMw ovcg== X-Gm-Message-State: ALoCoQm1mu0bs7hJvgOALtWxt//D2FZR71zN1242RXTv+GJNpa3dVJ3xdBzAbN0D2I9HjtJoaPTu X-Received: by 10.67.5.2 with SMTP id ci2mr11970590pad.47.1449139577017; Thu, 03 Dec 2015 02:46:17 -0800 (PST) Received: from bala-Vostro-2520.caveonetworks.com ([111.93.218.67]) by smtp.gmail.com with ESMTPSA id 68sm9908068pfq.37.2015.12.03.02.46.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Dec 2015 02:46:16 -0800 (PST) From: Balasubramanian Manoharan To: lng-odp@lists.linaro.org Date: Thu, 3 Dec 2015 16:16:03 +0530 Message-Id: <1449139566-1196-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/PATCHv4 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 --- v4: Adds detailed api description v3: Test Cases added to test pools associated with CoS v2: Incorporates review comments from Stuart include/odp/api/classification.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/include/odp/api/classification.h b/include/odp/api/classification.h index 380d91b..5db7661 100644 --- a/include/odp/api/classification.h +++ b/include/odp/api/classification.h @@ -379,6 +379,33 @@ 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 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. +* The packet pool associated with class of service will supersede the +* packet pool associated with the pktio interface. +* +* @param cos_id class of service handle +* @param pool_id Packet buffer pool handle +* +* @retval 0 on success +* @retval <0 on failure +*/ +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_POOL_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