From patchwork Fri Dec 9 11:54:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 87446 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp263800qgi; Fri, 9 Dec 2016 03:54:43 -0800 (PST) X-Received: by 10.200.36.125 with SMTP id d58mr66886997qtd.126.1481284483633; Fri, 09 Dec 2016 03:54:43 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 133si19827437qkf.329.2016.12.09.03.54.43; Fri, 09 Dec 2016 03:54:43 -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; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id E164F60D06; Fri, 9 Dec 2016 11:54:42 +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=-1.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, RCVD_IN_SORBS_WEB 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 259B060CBE; Fri, 9 Dec 2016 11:54:39 +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 B621C60C06; Fri, 9 Dec 2016 11:54:36 +0000 (UTC) Received: from mail-pf0-f177.google.com (mail-pf0-f177.google.com [209.85.192.177]) by lists.linaro.org (Postfix) with ESMTPS id B706E60C06 for ; Fri, 9 Dec 2016 11:54:35 +0000 (UTC) Received: by mail-pf0-f177.google.com with SMTP id c4so3668255pfb.1 for ; Fri, 09 Dec 2016 03:54:35 -0800 (PST) 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=S4tnDcKrM1plUHSYDzRr1HdnVPCWMaNRZrNfDZh/zu0=; b=QGd73idlWWI410kMkk+ziWEQJyfSCTlx/A+wySL9DiPdStPDm5YR8X4+4ejARBn7zw 2xp+yz8+QzwCGB5XTYMPdqMdrG9DhIcv4h63t/Pm71SkH/q48LggMkI3DSTvoL/nalnC VWgl9b6mtVvhGx7mxgJjVkTzV8FVh8n8TGbV0yAAMRaMEqfS2MDmbo3qfr1NB+hQUyFO lDVfCVo57cqmInZm/OhzyZx/7wMkc9MrZO3AJgtPf64k3Aqm0eP/gNQvBdMfyvW3c5Vh IKye4BmJpUZZeI23QXMC10vGniQfKSj1CzgC9ncbBKj+uglddI+lne9ufqB/nmtacZ7b 6bmA== X-Gm-Message-State: AKaTC00t1FMKX+gO7GL50RqBld/Xuu3OwLl6l0TexhLPK0aEiuBhnOYK5K6FLcfGmTChqMLymD8= X-Received: by 10.98.156.17 with SMTP id f17mr81938375pfe.63.1481284474775; Fri, 09 Dec 2016 03:54:34 -0800 (PST) Received: from bala-Vostro-2520.caveonetworks.com ([111.93.218.67]) by smtp.gmail.com with ESMTPSA id t193sm57565974pgb.4.2016.12.09.03.54.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Dec 2016 03:54:34 -0800 (PST) From: Balasubramanian Manoharan To: lng-odp@lists.linaro.org Date: Fri, 9 Dec 2016 17:24:26 +0530 Message-Id: <1481284466-20536-1-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 1.9.1 Cc: petri.savolainen@nokia.com Subject: [lng-odp] [RFC/API-NEXT 1/1] api: classification: packet hashing per class of service 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: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Adds support to spread packet from a single CoS to multiple queues by configuring hashing at CoS level. Signed-off-by: Balasubramanian Manoharan --- include/odp/api/spec/classification.h | 45 ++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) -- 1.9.1 diff --git a/include/odp/api/spec/classification.h b/include/odp/api/spec/classification.h index 0e442c7..220b029 100644 --- a/include/odp/api/spec/classification.h +++ b/include/odp/api/spec/classification.h @@ -126,6 +126,12 @@ typedef struct odp_cls_capability_t { /** Maximum number of CoS supported */ unsigned max_cos; + /** Maximun number of queue supported per CoS */ + unsigned max_queue_supported; + + /** Protocol header combination supported for Hashing */ + odp_pktin_hash_proto_t hash_supported; + /** A Boolean to denote support of PMR range */ odp_bool_t pmr_range_supported; } odp_cls_capability_t; @@ -164,9 +170,25 @@ typedef enum { * 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_cls_drop_t drop_policy; /**< Drop policy associated with CoS */ + /* Minimum number of queues to be linked to this CoS. + * If the number is greater than 1 then hashing has to be + * enabled */ + uint32_t num_queue; + /* Denotes whether hashing is enabled for queues in this CoS + * When hashing is enabled the queues are created by the implementation + * and application need not configure any queue to the class of service + */ + odp_bool_t enable_hashing; + /* Protocol header fields which are included in packet input + * hash calculation */ + odp_pktin_hash_proto_t hash; + /* If hashing is disabled, then application has to configure + * this queue and packets are delivered to this queue */ + odp_queue_t queue; + /* Pool associated with CoS */ + odp_pool_t pool; + /* Drop policy associated with CoS */ + odp_cls_drop_t drop_policy; } odp_cls_cos_param_t; /** @@ -209,6 +231,23 @@ int odp_cls_capability(odp_cls_capability_t *capability); odp_cos_t odp_cls_cos_create(const char *name, odp_cls_cos_param_t *param); /** + * Queue hash result + * Returns the queue within a CoS in which a particular packet will be enqueued + * based on the packet parameters and hash protocol field configured with the + * class of service. + * + * @param cos class of service + * @param packet Packet handle + * + * @retval Returns the queue handle on which this packet will be + * enqueued. + * @retval ODP_QUEUE_INVALID for error case + * + * @note The packet has to be updated with valid header pointers L2, L3 and L4. + */ +odp_queue_t odp_queue_hash_result(odp_cos_t cos, odp_packet_t packet); + +/** * Discard a class-of-service along with all its associated resources * * @param[in] cos_id class-of-service instance.