From patchwork Mon Nov 7 11:16:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 81039 Delivered-To: patch@linaro.org Received: by 10.182.113.165 with SMTP id iz5csp1052372obb; Mon, 7 Nov 2016 03:16:46 -0800 (PST) X-Received: by 10.55.189.132 with SMTP id n126mr6435119qkf.275.1478517406150; Mon, 07 Nov 2016 03:16:46 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id u78si15722150qku.191.2016.11.07.03.16.45; Mon, 07 Nov 2016 03:16:46 -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 71F2A60D37; Mon, 7 Nov 2016 11:16:45 +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_H3, RCVD_IN_MSPIKE_WL 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 2535E60D10; Mon, 7 Nov 2016 11:16:37 +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 EDC5960D16; Mon, 7 Nov 2016 11:16:34 +0000 (UTC) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com [209.85.214.43]) by lists.linaro.org (Postfix) with ESMTPS id E965060A4F for ; Mon, 7 Nov 2016 11:16:33 +0000 (UTC) Received: by mail-it0-f43.google.com with SMTP id q124so16021377itd.1 for ; Mon, 07 Nov 2016 03:16:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=IhCOqKBY3ba4enq87eMXKYz+GBKsnvorUzd3R0XtbFk=; b=OSN1n0BxVnNHdiv68ntRIlFEStTG2tddBdn8KgAoEOMsDVXsRmY7Fpun3Zvs2PJOk2 gcJ7MrpvssRJus3pa5DzwUhkot1CFV3AjjnsNKsM6vO3GOpslkAGdFBoauhJVuM5p17v 69EdrRNxMK+aCuj99xND8kPjd2BLkWD/g2ENYFNZqnasNtlKY9muO/Hbf784ahHuG+Vs j/oJjwYnHb7jRZaEpAeRGvbIvEReqzm4zdzu3RRNUCBy0Xma/XkK1zer1pXPILBBeh8l BosaehHNBjvviiolL8OpmP1CG/UQfd/PEVP2G5igYmOFdJiJTTHBUaa0QYxs+ukR9YBK Iy2A== X-Gm-Message-State: ABUngvd7BpzlLT3RjWWYr4w4S6A+ldvZmfKDuosq/dAt5NRiTN+n5CmpFd/WFXbsUh0fXGmDnbyFw3RJVL82JfpdLZ8= X-Received: by 10.107.46.25 with SMTP id i25mr6634441ioo.145.1478517392783; Mon, 07 Nov 2016 03:16:32 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.23.105 with HTTP; Mon, 7 Nov 2016 03:16:12 -0800 (PST) From: Bala Manoharan Date: Mon, 7 Nov 2016 16:46:12 +0530 Message-ID: To: lng-odp-forward X-Topics: Classification Subject: [lng-odp] Classification Queue Group 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" Hi, This mail thread discusses the design of classification queue group RFC. The same can be found in the google doc whose link is given below. Users can provide their comments either in this mail thread or in the google doc as per their convenience. https://docs.google.com/document/d/1fOoG9WDR0lMpVjgMAsx8QsMr0YFK9slR93LZ8VXqM2o/edit?usp=sharing The basic issues with queues as being a single target for a CoS are two fold: Queues must be created and deleted individually. This imposes a significant burden when queues are used to represent individual flows since the application may need to process thousands (or millions) of flows. A single PMR can only match a packet to a single queue associated with a target CoS. This prohibits efficient capture of subfield classification. To solve these issues, Tiger Moth introduces the concept of a queue group. A queue group is an extension to the existing queue specification in a Class of Service. Queue groups solve the classification issues associated with individual queues in three ways: * The odp_queue_group_create() API can create a large number of related queues with a single call. * A single PMR can spread traffic to many queues associated with the same CoS by assigning packets matching the PMR to a queue group rather than a queue. * A hashed PMR subfield is used to distribute individual queues within a queue group for scheduling purposes. diff --git a/include/odp/api/spec/classification.h b/include/odp/api/spec/classification.h index 6eca9ab..cf56852 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 { /** A Boolean to denote support of PMR range */ odp_bool_t pmr_range_supported; + + /** A Boolean to denote support of queue group */ + odp_bool_t queue_group_supported; + + /** A Boolean to denote support of queue */ + odp_bool_t queue_supported; } odp_cls_capability_t; /** @@ -162,7 +168,18 @@ typedef enum { * Used to communicate class of service creation options */ typedef struct odp_cls_cos_param { - odp_queue_t queue; /**< Queue associated with CoS */ + /** If type is ODP_QUEUE_T, odp_queue_t is linked with CoS, + * if type is ODP_QUEUE_GROUP_T, odp_queue_group_t is linked with CoS. + */ + odp_queue_type_e type; + + typedef union { + /** Queue associated with CoS */ + odp_queue_t queue; + + /** Queue Group associated with CoS */ + odp_queue_group_t queue_group; + }; odp_pool_t pool; /**< Pool associated with CoS */ odp_cls_drop_t drop_policy; /**< Drop policy associated with CoS */ } odp_cls_cos_param_t; diff --git a/include/odp/api/spec/queue.h b/include/odp/api/spec/queue.h index 51d94a2..7dde060 100644 --- a/include/odp/api/spec/queue.h +++ b/include/odp/api/spec/queue.h @@ -158,6 +158,87 @@ typedef struct odp_queue_param_t { odp_queue_t odp_queue_create(const char *name, const odp_queue_param_t *param); +/** + * Queue group capability + * This capability structure defines system Queue Group capability + */ +typedef struct odp_queue_group_capability_t { + /** Number of queues supported per queue group */ + unsigned supported_queues; + /** Supported protocol fields for hashing*/ + odp_pktin_hash_proto_t supported; +} + +/** + * ODP Queue Group parameters + * Queue group supports only schedule queues + */ +typedef struct odp_queue_group_param_t { + /** Number of queue to be created for this queue group + * implementation may round up the value to nearest power of 2 + * and value should be less than the number of queues + * supported per queue group + */ + unsigned num_queue; + + /** Protocol field selection for queue group distribution + * Multiple fields can be selected in combination + */ + odp_queue_group_hash_proto_t hash; + +} odp_queue_group_param_t; + +/** + * Initialize queue group params + * + * Initialize an odp_queue_group_param_t to its default values for all fields. + * + * @param param Address of the odp_queue_group_param_t to be initialized + */ +void odp_queue_group_param_init(odp_queue_group_param_t *param); + +/** + * Queue Group create + * + * Create a queue group according to the queue group parameters. + * The individual queues belonging to a queue group are created by the + * implementation and the distribution of packets into those queues are + * decided based on the odp_queue_group_hash_proto_t parameters. + * The individual queues within a queue group are both created and deleted + * by the implementation. + * + * @param name Queue Group name + * @param param Queue Group parameters. + * + * @return Queue group handle + * @retval ODP_QUEUE_GROUP_INVALID on failure + */ +odp_queue_group_t odp_queue_group_create(const char *name, + const odp_queue_group_param_t *param); Regards, Bala