From patchwork Mon Apr 11 07:22:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 65443 Delivered-To: patch@linaro.org Received: by 10.112.43.237 with SMTP id z13csp1310982lbl; Mon, 11 Apr 2016 00:24:13 -0700 (PDT) X-Received: by 10.50.29.73 with SMTP id i9mr16974574igh.32.1460359453023; Mon, 11 Apr 2016 00:24:13 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id k5si8164101igr.61.2016.04.11.00.24.12; Mon, 11 Apr 2016 00:24:12 -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; 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; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 3C0B161D69; Mon, 11 Apr 2016 07:24:12 +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.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 [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 4914D61D58; Mon, 11 Apr 2016 07:24: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 B884561D62; Mon, 11 Apr 2016 07:24:05 +0000 (UTC) Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by lists.linaro.org (Postfix) with ESMTPS id DBCDD61D65 for ; Mon, 11 Apr 2016 07:23:13 +0000 (UTC) Received: by mail-pa0-f43.google.com with SMTP id td3so116396275pab.2 for ; Mon, 11 Apr 2016 00:23:13 -0700 (PDT) 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=lEIoeW73g3JUf/AYlBMtIJwyDhLmTaFDcoMzmfejHTU=; b=ieEPIpVN6U/AHO2o4hvX3j0t4+IZJ8pk7tIPCJKJH+kTj/Ah9T5/RrydO3c51MNByl 8XTExFkYYIzhDoaSbOgCD22YPDgiLKYLbVwdJXdolQZE05bH7c0f5kkqeXJzoQusJU71 55TJiBtKFRHo8QLuKIHaYNZc3mAnBY6v9156sBrjTdr5oJycrx28SsckJel1H9bECxCx e/2KDrMGhkQ54EkAYP4s6HaUmKt2IMCjRuiOTNTkQSdsrJ0jlMvr7x04IOE0lY4XJel7 /IWJu4kChGWmhKP6as9bmdbfmaZNkH4QPXWnRtNhOWDsNNYjX0EVGuyffoxRjyyWO3Cf cq8g== X-Gm-Message-State: AOPr4FWa53neTk71DYxR3GFutdYK+x8CO5yCvNAu2+jOR5fQksy3S5tFRdfBHqfYSJAu82IkcZs= X-Received: by 10.66.160.168 with SMTP id xl8mr12815817pab.132.1460359393144; Mon, 11 Apr 2016 00:23:13 -0700 (PDT) Received: from bala-Vostro-2520.domain.name ([117.222.156.157]) by smtp.gmail.com with ESMTPSA id ud5sm33696273pac.11.2016.04.11.00.23.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Apr 2016 00:23:12 -0700 (PDT) From: Balasubramanian Manoharan To: lng-odp@lists.linaro.org Date: Mon, 11 Apr 2016 12:52:59 +0530 Message-Id: <1460359379-3704-1-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: Classification Cc: petri.savolainen@nokia.com Subject: [lng-odp] [RFC] api: classification capability structure 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" This RFC adds classification capability structure and PMR range functionality. The implementation patch will be posted once consensus is reached on API definition. Signed-off-by: Balasubramanian Manoharan --- include/odp/api/spec/classification.h | 61 ++++++++++++++++++++++++++--------- 1 file changed, 45 insertions(+), 16 deletions(-) diff --git a/include/odp/api/spec/classification.h b/include/odp/api/spec/classification.h index 076b3de..1fcc520 100644 --- a/include/odp/api/spec/classification.h +++ b/include/odp/api/spec/classification.h @@ -55,6 +55,24 @@ extern "C" { */ /** + * Classification capabilities + * This capability structure defines system level classfication capability + */ +typedef struct odp_cls_capability_t { + /** PMR terms supported by the classifier, + A mask one bit for each of odp_pmr_term_t */ + unsigned long long supported_pmr_terms; + /** Maximum number of PMR terms */ + unsigned max_pmr_terms; + /** Number of PMR terms available for use now */ + unsigned available_pmr_terms; + /** Maximum number of CoS supported */ + unsigned max_cos; + /* A Boolean to denote support of PMR range */ + bool pmr_range_supported; +} odp_cls_capability_t; + +/** * class of service packet drop policies */ typedef enum { @@ -103,6 +121,17 @@ typedef struct odp_cls_cos_param { void odp_cls_cos_param_init(odp_cls_cos_param_t *param); /** + * Query classification capabilities + * + * Outputs classification capabilities on success. + * + * @param[out] capability Classification capability structure for output + * @retval 0 on success + * @retval <0 on failure + */ +int odp_cls_capability(odp_cls_capability_t *capability); + +/** * Create a class-of-service * * @param name String intended for debugging purposes. @@ -272,8 +301,22 @@ typedef enum { */ typedef struct odp_pmr_match_t { odp_pmr_term_t term; /**< PMR term value to be matched */ - const void *val; /**< Value to be matched */ - const void *mask; /**< Masked set of bits to be matched */ + bool match; /**< True if the value is match and false if range */ + union { + struct { + /**< Value to be matched */ + const void *val; + /**< Masked set of bits to be matched */ + const void *mask; + } match; + struct { + /* Start and End values are included in the range */ + /**< start value of range */ + const void *val_start; + /**< End value of range */ + const void *val_end; + } range; + }; uint32_t val_sz; /**< Size of the term value */ uint32_t offset; /**< User-defined offset in packet Used if term == ODP_PMR_CUSTOM_FRAME only, @@ -323,20 +366,6 @@ odp_pmr_t odp_cls_pmr_create(const odp_pmr_match_t *terms, int num_terms, int odp_cls_pmr_destroy(odp_pmr_t pmr_id); /** - * Inquire about matching terms supported by the classifier - * - * @return A mask one bit per enumerated term, one for each of odp_pmr_term_t - */ -unsigned long long odp_pmr_terms_cap(void); - -/** - * Return the number of packet matching terms available for use - * - * @return A number of packet matcher resources available for use. - */ -unsigned odp_pmr_terms_avail(void); - -/** * 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.