From patchwork Mon Apr 25 12:31:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 66573 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1009636qge; Mon, 25 Apr 2016 05:32:53 -0700 (PDT) X-Received: by 10.107.4.67 with SMTP id 64mr19017466ioe.22.1461587572769; Mon, 25 Apr 2016 05:32:52 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id k185si23352731iof.134.2016.04.25.05.32.52; Mon, 25 Apr 2016 05:32:52 -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 26AE3618F6; Mon, 25 Apr 2016 12:32:52 +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 3A51E61864; Mon, 25 Apr 2016 12:32:28 +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 40DF261902; Mon, 25 Apr 2016 12:32:23 +0000 (UTC) Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) by lists.linaro.org (Postfix) with ESMTPS id 4978961863 for ; Mon, 25 Apr 2016 12:32:17 +0000 (UTC) Received: by mail-pa0-f51.google.com with SMTP id r5so57950378pag.1 for ; Mon, 25 Apr 2016 05:32:17 -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:in-reply-to :references; bh=OftFUwbP4VKBGRTL6n4lxXjlDYLEI1M2kCdydtxmczM=; b=GZiN8Xz0bybjYjVRFnMu1fo1rKIlUNs/DNuVij22e8bDJEUuhRNbUGW6im7xsFssgK R0FM68qGWVSUAMIlJtzB+7NHCYnsNn7uTBmDUaumS13LO9QoXdLan9910l/O9o5HARy/ 0kd8lS3VgrIOgTIfeS0/oDITjhulQKUIMrngOngpaXuzc/tk9N5mV+Sfc2w2AqXw1bXd gUS/e97I/9WW2i0Nw/PCbbamAuas3DkoTyGKK3A7A4QKyiGR15cx44D+1pTx47MCcq3k /6KijprZEmzt89pX9ZYH7YmE1ejRsusZ66V7IRMb7IodU/RCFquipDgbs6M9GKzKWLgj mCVg== X-Gm-Message-State: AOPr4FWxGrT/fWkegON/fNWmmbJLsCQzBpYtO2LbxikKEIhjv1BXBYrMp2reF6evpPGlsrnto3c= X-Received: by 10.66.1.99 with SMTP id 3mr47319521pal.26.1461587536616; Mon, 25 Apr 2016 05:32:16 -0700 (PDT) Received: from localhost.localdomain ([122.166.219.57]) by smtp.gmail.com with ESMTPSA id xd14sm10535762pac.6.2016.04.25.05.32.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Apr 2016 05:32:15 -0700 (PDT) From: Balasubramanian Manoharan To: lng-odp@lists.linaro.org Date: Mon, 25 Apr 2016 18:01:56 +0530 Message-Id: <1461587516-22980-2-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461587516-22980-1-git-send-email-bala.manoharan@linaro.org> References: <1461587516-22980-1-git-send-email-bala.manoharan@linaro.org> Subject: [lng-odp] [RFC 2/2] api: queue: add queue group creation 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" Adds queue group creation parameter Signed-off-by: Balasubramanian Manoharan --- include/odp/api/spec/queue.h | 81 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) 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 hash protocols + * The list of protocol header fields, which are included in queue + * distribution within a queue group. + */ +typedef union odp_queue_group_hash_proto_t { + /** Protocol header fields for queue group hashing */ + struct { + /** TCP or UDP source port number*/ + uint32_t tcp_udp_src_port : 1; + /** TCP or UDP destination port numbers */ + uint32_t tcp_udp_dst_port : 1; + /** IPv4 or IPv6 source addresses */ + uint32_t ip_src_addr : 1; + /** IPv4 or IPv6 destination address */ + uint32_t ip_dst_addr : 1; + } bit; + + /** All bits of the bit field structure */ + uint32_t all_bits; +} odp_queue_group_hash_proto_t; + +/** + * Queue group capability + * This capability structure defines system Queue Group capability + */ +typedef struct odp_queue_group_capability_t { + /** Maximum number of queues supported per queue group */ + unsigned max_queues; + /** A bit mask of one bit for each supported queue group + hash proto fields */ + odp_queue_group_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 maximum 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); + +/** * Destroy ODP queue * * Destroys ODP queue. The queue must be empty and detached from other