From patchwork Tue Dec 8 10:21:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 57839 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp1698441lbb; Tue, 8 Dec 2015 02:22:13 -0800 (PST) X-Received: by 10.140.150.81 with SMTP id 78mr3559346qhw.14.1449570133784; Tue, 08 Dec 2015 02:22:13 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id l89si2770683qgf.73.2015.12.08.02.22.13; Tue, 08 Dec 2015 02:22:13 -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 39D0661CE8; Tue, 8 Dec 2015 10:22:13 +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_H2,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 C448161CC5; Tue, 8 Dec 2015 10:22:08 +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 9AD9661CC8; Tue, 8 Dec 2015 10:22:06 +0000 (UTC) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by lists.linaro.org (Postfix) with ESMTPS id B361961CC4 for ; Tue, 8 Dec 2015 10:22:05 +0000 (UTC) Received: by pabur14 with SMTP id ur14so10168758pab.0 for ; Tue, 08 Dec 2015 02:22:05 -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=0ly2m16PKpPYZoRFpfw5MqZYpTolVFTBrWGj4ivcLT4=; b=qy9XRDI9z/oEqzmHhT7Drrvze0RsjtjQS0nJs4jEmkyfgo0pSCGvC8CyXvu1JkLrq0 5/DEf1f+qjv+OEHomLA8NGwrFPuQreLPOY6IlGOBYIQRpYWJuunpAp8+cbtczvy8d8r8 3uUM2U/XdJ8CEVE4T1HC3NyYi5YEVWnPgoODqwYg3xoxcUpU3Gf3Ym2pvoBKgtZ5XX94 HoGVPjb2fJoxb2Ca8jWiBTjAgG8vL4CkNXVAAvlJk2IIKDqS8Wv07ZUZX+RH2zYlPG+1 79DJC6AxYZSapiTnVmBNAauGMQjbbQVXIo4B8As7V8ev/0Q8fY7ShhobGoYPalc1819+ SXLg== 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=0ly2m16PKpPYZoRFpfw5MqZYpTolVFTBrWGj4ivcLT4=; b=hgpUjj0yQKmaA+u8ZcTJ+7Hwc9oDBr+Tgwv91I1RCU3BY/0VNvDxvz6I4oE1JkLIcf rEWxYcHzpCLDfR0FwKMDIxbKkQrjDk1kXBcs1lKoyMRy3MQ4DpdEaVj3CLjxselz/r9D lFIUY7xbTI9GVW3Nbcy9kK4MNjYOm0blVkGfjoyu3xv74hJHTOhg3fFTKV5HrWvbQFf+ 2ezzFPKE/8COxlKyiDWmwuDz2rs/GVro+QfYYizNZiNpYcliPcAwaII1zDwBAIqLOnEr c0V1vErUxmcecoenoQRgXMP314zim63JaeHpjjRsWt6vlMS/DtwaoiVAPfi3cCsJklCy ML3Q== X-Gm-Message-State: ALoCoQm1jnH06k310cxkp3uuDfiJC0P8czsxf6fBzQKf/BirIScc2n1wvzAn/D6vTCsfc6lzfXvhFVpK6eKYOrCzbDH1cpXkJw== X-Received: by 10.66.118.168 with SMTP id kn8mr3739070pab.122.1449570125034; Tue, 08 Dec 2015 02:22:05 -0800 (PST) Received: from localhost.localdomain ([122.166.219.57]) by smtp.gmail.com with ESMTPSA id ah10sm3802119pad.23.2015.12.08.02.22.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Dec 2015 02:22:04 -0800 (PST) From: Balasubramanian Manoharan To: lng-odp@lists.linaro.org Date: Tue, 8 Dec 2015 15:51:49 +0530 Message-Id: <1449570112-5486-1-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: Classification patch Cc: petri.savolainen@nokia.com Subject: [lng-odp] [API-NEXT/PATCHv1 1/4] api: classification: add class of serivce create 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" class of service create function now takes pool, queue, drop policy and name as input parameters. Adds class of service parameter structure odp_cls_cos_param_t and initialization function odp_cls_cos_param_init() Signed-off-by: Balasubramanian Manoharan --- include/odp/api/classification.h | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/include/odp/api/classification.h b/include/odp/api/classification.h index 725e1ab..18572ad 100644 --- a/include/odp/api/classification.h +++ b/include/odp/api/classification.h @@ -37,7 +37,7 @@ extern "C" { /** * @def ODP_COS_INVALID - * This value is returned from odp_cos_create() on failure, + * This value is returned from odp_cls_cos_create() on failure, * May also be used as a sink class of service that * results in packets being discarded. */ @@ -60,9 +60,9 @@ extern "C" { */ /** - * Class-of-service packet drop policies + * class of service packet drop policies */ -typedef enum odp_cos_drop { +typedef enum odp_cls_drop { ODP_COS_DROP_POOL, /**< Follow buffer pool drop policy */ ODP_COS_DROP_NEVER, /**< Never drop, ignoring buffer pool policy */ } odp_drop_e; @@ -89,14 +89,35 @@ typedef enum odp_cos_hdr_flow_fields { } odp_cos_hdr_flow_fields_e; /** + * Class of service parameters + * Used to communicate class of service creation options + */ +typedef struct odp_cls_cos_param { + odp_queue_t queue; /**< Queue associated with CoS */ + odp_pool_t pool; /**< Pool associated with CoS */ + odp_drop_e drop_policy; /**< Drop policy associated with CoS */ +} odp_cls_cos_param_t; + +/** + * Initialize class of service parameters + * + * Initialize an odp_cls_cos_param_t to its default value for all fields + * + * @param param Address of the odp_cls_cos_param_t to be initialized + */ +void odp_cls_cos_param_init(odp_cls_cos_param_t *param); + +/** * Create a class-of-service * * @param[in] name String intended for debugging purposes. * - * @return Class of service instance identifier + * @param[in] param class of service parameters + * + * @retval class of service handle * @retval ODP_COS_INVALID on failure. */ -odp_cos_t odp_cos_create(const char *name); +odp_cos_t odp_cls_cos_create(const char *name, odp_cls_cos_param_t *param); /** * Discard a class-of-service along with all its associated resources