From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0076.outbound.protection.outlook.com [104.47.41.76]) by dpdk.org (Postfix) with ESMTP id 4D9B6FA31 for ; Mon, 27 Mar 2017 09:45:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=MrePu0LMLKf3j1f3gMwb+NjIohMaVMyzu8GvegGkN/4=; b=P7hA2DzcwMqsfRqTCXFetayAOkg/g0mPB5nMYKpWcQqWfyc7lqt3m0jrRy8kSp2rYt9ibO//0KxyCv5vpSzgG6Z1KJdwadHOLzK1AVRWdu/8FYSn0ocwruRAXDknEK/qtf8iR4ncWecFEeATl8WCXThZYR3RpG7MA59k+YRfXTM= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain (14.140.2.178) by BY1PR0701MB1721.namprd07.prod.outlook.com (10.162.111.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14; Mon, 27 Mar 2017 07:45:23 +0000 Date: Mon, 27 Mar 2017 13:15:06 +0530 From: Jerin Jacob To: Harry van Haaren Cc: dev@dpdk.org, Bruce Richardson Message-ID: <20170327074011.fgodyrhquabj54r2@localhost.localdomain> References: <489175012-101439-1-git-send-email-harry.van.haaren@intel.com> <1490374395-149320-1-git-send-email-harry.van.haaren@intel.com> <1490374395-149320-7-git-send-email-harry.van.haaren@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1490374395-149320-7-git-send-email-harry.van.haaren@intel.com> User-Agent: NeoMutt/20170306 (1.8.0) X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: BMXPR01CA0001.INDPRD01.PROD.OUTLOOK.COM (10.174.214.139) To BY1PR0701MB1721.namprd07.prod.outlook.com (10.162.111.140) X-MS-Office365-Filtering-Correlation-Id: aba49ee2-f6af-4cad-99dc-08d474e53b54 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY1PR0701MB1721; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1721; 3:+GmBRUATL5YryNo0tvRKliZ9Yao8zLKFyHSH0yf+eKk/ah0prsXgMBtLKegGtdtYYR9D6JqfBsI4hpNkqyRBF00xYwisRnZnLZpDXp+sEyPBRmYym7pHmAo+ZKDysz0O/srS8IMy5T2l7Aj19SxoOm1p61p2rX3K1BC/kmVMJmHhKEydvV14PXKySZfvTzXCYEj3NqBrWpPSg3Mcza/gIaKiBk4yvGBk13Jm5imOIOc6JAD3vGOI2xoQXH84EZBA3vcFT5IQeb8IKXl80/Dz5Q==; 25:IQRcQKkMVrJwwDj/DTlT+gAEWsLJA/VLr8jMKYvCAyLGAhoR+SBsc5CnhB5JKOxXL2Z/bHq4Evm4EJmXvUWK2a5KxbA6hEnwlPCbXpj5xbdnbb6sZNSSQyKQ9lFbiuy+V3FosNzJcZLEpehgNSu3JV6UmP+v0uQdAuRJOh7QBIoEP4RFoQfdksCQAA2iexGzaDiu7knm3S2Q59mvWltn1mbLx7DdU0Bxs0AOzE9TYwg+obABMmYbhEDAHOs7AwCtusmfijh5Om9U+n0yyKSkIK2fO/CLSmrH7HQJwsiJ1M/9YLHflJBuhLDjYzQdYbFJ+q/iHV6XO8PzGryqLh5EuoDjziPNd6aWkIqeAF1Ou2F2vKFfGfEK8dsWWHSXmfuEjULwxKOuflltlufYktwkhcKzpr/odCBouvdad1YKmTbqnp0xgDlMFTVU9zWONkE/b2CxJ0ufJE/GfEwL9n9DQw== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1721; 31:IIc+d32SF7ysTMN2ayQ0sj8WIC2QfGXWZ5q0YbnB617F6pRhEwJS3XaRdy0Goc2ZQfCKAHBo6W7FXxICOzNeJ4JiePOhXsB1pRotyTzR/bRb5IwEk672Fbcgg3JAvtpRYGHRal6RagGtblmsdGg5VD/ToYilQrHvtcF6eres6QQSShHMP3UA0YtWATw3t2ifOjCJmIMySNk8y/bo/MfVtokF4TKEaFAkQ03+ZPmYJ8CMsNuFTIj4MmUtn6IHG04yjmi7fWIDE+lpzCHuSx4oDg==; 20:lEHnY+dBNhgiQ+YBveP0r6kUB5d7wLnfcgwhnSjaBiqu5onUI4OcbEZaHiI4SYRfDLkF0LdF4JkRz581X1cmiAJubKMyTsbVJzFNCxlPJIl+5ea0/BNrXpjbkaEm06SVnqTNp4S7tNd9JTQheZp4tb6Sa2nYBkFkkqnKfdmOIZDCZ4b8E+51rQCRvuiGZ6uKvICiM21xTe4kydynms8WIZgzxcchz8Z8vRXLqjCsDRWgMdvGYWKQDu9pf7EFB+bK4CLWK8vqzCMaTDzezL8E8n+afACOQrDGiBLyYjKU9XjGXg+gMGaYOdIM/LTG6XySpj9iFYpwVgtu7Ilq8pB6EZ1wbqsxMRJ67EDmiX2z3ZTDaFZYEks+lej5K/+0i9rERo1kkqAbdwUxnE+rTy7UUe0upDGfdvarEGrCzYaLniKQvwcEYFoM4d8MF4ywK/xEra4iP3dSxWn7Yb+UNmO9o8hw2QQykZEjczoLydWC2xiiUtK0BQbvEHWTLnZ5RnpJOxFf9iX85DpvAKB9L3hzPvS6zeMO+Fsy8tDavxt5pH2+MsBGy2piLuZSmE+HX01p76nLwS5HPPwO3m4pYlYBlFJoKPS/c4U3XYQRtjNDesA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123555025)(20161123558025)(20161123562025)(20161123564025)(20161123560025)(6072148); SRVR:BY1PR0701MB1721; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1721; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1721; 4:7FfM51IPATrxEkkAPjy/4mZ7m/H3u3RxUfIXQvmr4YUFUgbOfYVnq62pt0OgYfu+Q2OjCuVK6apYn9jHYVXamcbYdhVlh0D7DiMMXCiEZzLNGy251boFdSPm7X8nu/F7drZHkB9RdMS4HlXJQJqdITvVv+oyKrsIsb1A/hGd4VGAM3vkkY7gcawyWK17U/cOBLEvYCfb+dWImGBRc9ZrtOwViyjhhpBuxn933qCGe8dA4NzzGte+Zmv5kQdfVU67aXW+drr4SnFEC3QCTci3+HT9md1bc3CsUHHzwM90MAhvL/dhULOX5MuMqvR+Yo2UkaY6HCeYhIs4cfrc2AgFz/a17a9i6AUVh9eWbMd4ik/3/aDf8uU2eddMPbulS8I3+TA0rbpaItsO28aw84DIIy4zK5Q6J2Auo8woSKjy6BIUWpolIPKEmFtQoxWK8IhXPxGK2giDnFLB0D0Rt9xPax325kuDPniEtpcMliI8gf8N1H0IH0/D80N/wFW7v75lANpSTz5FfeQlEffKf5A6Moj9u79NE7Z78X0g3WJFe/Xe+0bH0lrDR/gs00InEi9jlVmS43+JYD7u0iEyvz4Jo6Pz7pu/eONLa2CpLeZkcQZVYX6tQxQ6Qlt+mzj1ihEOC4vnDDAGbdCMZg+weUABlgDn4x7plBOYKsMc5Ch2P7b/ll5JM6QAf6rtDq+mvPAh X-Forefront-PRVS: 02596AB7DA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(39410400002)(39450400003)(39840400002)(24454002)(110136004)(53376002)(38730400002)(76176999)(53936002)(61506002)(54356999)(50986999)(55016002)(33646002)(9686003)(6306002)(6246003)(966004)(50466002)(6666003)(42186005)(4326008)(1076002)(42882006)(4001350100001)(6916009)(25786009)(2950100002)(66066001)(8676002)(81166006)(6506006)(6116002)(3846002)(23726003)(47776003)(2906002)(189998001)(7736002)(5660300001)(83506001)(305945005)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1721; H:localhost.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0701MB1721; 23:CLUsuqApvn/qWeNpYhsdzwl+SVnTCYRI9gD9S1e?= =?us-ascii?Q?HESvMoqAHzA003YZnOUO5+XHZUgyQYRdUAO6Uw6hGFofWyaOh5rFjCUylgj2?= =?us-ascii?Q?tUFl6/5zm45eZUdZhZDuy0VFO9fFBGyvsAKaZaCsJy/6Ru3LzV2s9TWkZlMX?= =?us-ascii?Q?hmLx26T0IghbFNvDAjpa81MnZWmqM+SaqzGX9+tVvdgSlpkRmAnBwktSFeYS?= =?us-ascii?Q?iq6ODfnJ/6QOw9UBexzFHB5QUi759CO4aLBBV6noiHZY3gvdGnEwqI5OYYAp?= =?us-ascii?Q?toOqueeInP63LWmlegAkbBugSO07uP+kgrGCrncvLXx2EW+tbd97QoOqXSbk?= =?us-ascii?Q?7V8YP8UBbbL4b0p6eYkmLCl2l5ne7GZe4oe+D7JlEVXLfgA823+hnn284PHS?= =?us-ascii?Q?e09nPmzE6s8PBB5/C0RVGwV/5y/3EmiAHfIVxRXLcNpxc1cOyKfYNJfju/Ah?= =?us-ascii?Q?PHdhGqd9/At/BLzt4heWkp94gZDg2pgOSjYUEIHeMusvbW0ya4KjFXj803sf?= =?us-ascii?Q?HMmHS0+oElCFFKrdQhDRqp+dVA6Du/TnQhqO0jlV06nhQeIhhY1Pur/YLNYz?= =?us-ascii?Q?dTsuLiJkbOwmLaVfdAN/5uyAcZb9ceiuYZrgU9y1+zQWF0P+AIZVHqrzRBZb?= =?us-ascii?Q?DQztqrn7DOJfugU+M4/jZOU48VE0pTep350J/uBAfpTGKtnfw5FB0PJIRDmU?= =?us-ascii?Q?Rtj4w2aWCUeu3H8NqFxJ3bpq7NF6GpvaHhkgsRHTT1O+F+95KECq+vS4KObN?= =?us-ascii?Q?n9HMWuW5qpG0z48j1jMswd/0G73H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NJyfEf/Ciw29iPqOx/Mej3D5gd9ycp8+B4YGb82BNf5opElqQzySq0OfYG0MwW4FevJy9+0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1721; 7:/NUc3ahosoNEzqqlpHw0PGw2rh64NsPV8ZVoICwI+R8JnyOQfqpCqO0u/LbSABSWiQUjnRvpQeORViIk6m938v0vfDvxCaVpHnFMTHbLIgOuwlDRt5UefPPMW3NYAxK2JNR7nYLP9IDEfr/qOx7iZCdhhXFjZSR3iai91DL5CRRX7Tv8gAzVwUZJs2dXmKse9JSscTk71t6rc2ad4uuW2EWFhthEdu6CcVQ57GYtjbdExm453hrnUPBZmsIBKMcMVrz2Or39auhEoQKTsH75RfhoUqIcgsRu5sjDyRGqea0HGN59ZpZntj4URqHxj6gzPzK455yxMZlbk8/JQnwtoQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Mar 2017 07:45:23.2189 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1721 Subject: Re: [dpdk-dev] [PATCH v5 06/20] event/sw: add support for event queues X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 07:45:29 -0000 On Fri, Mar 24, 2017 at 04:53:01PM +0000, Harry van Haaren wrote: > From: Bruce Richardson > > Add in the data structures for the event queues, and the eventdev > functions to create and destroy those queues. > > Signed-off-by: Bruce Richardson > Signed-off-by: Harry van Haaren > --- > drivers/event/sw/iq_ring.h | 176 ++++++++++++++++++++++++++++++++++++++++++++ > drivers/event/sw/sw_evdev.c | 166 +++++++++++++++++++++++++++++++++++++++++ > drivers/event/sw/sw_evdev.h | 5 ++ > 3 files changed, 347 insertions(+) > create mode 100644 drivers/event/sw/iq_ring.h > > diff --git a/drivers/event/sw/iq_ring.h b/drivers/event/sw/iq_ring.h > new file mode 100644 > index 0000000..d480d15 > --- /dev/null > +++ b/drivers/event/sw/iq_ring.h > @@ -0,0 +1,176 @@ > +/*- > + * BSD LICENSE > + * > + * Copyright(c) 2016-2017 Intel Corporation. All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * > + * * Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * * Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in > + * the documentation and/or other materials provided with the > + * distribution. > + * * Neither the name of Intel Corporation nor the names of its > + * contributors may be used to endorse or promote products derived > + * from this software without specific prior written permission. > + * > + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS > + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT > + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR > + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT > + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, > + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT > + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE > + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + */ > + > +/* > + * Ring structure definitions used for the internal ring buffers of the > + * SW eventdev implementation. These are designed for single-core use only. > + */ Plan is to replace this file with generic rte_ring once Bruce's ring rework[1] comes in master branch. Right ? [1] http://dpdk.org/ml/archives/dev/2017-March/061372.html > +#ifndef _IQ_RING_ > +#define _IQ_RING_ > + > +#include > + > +#include > +#include > +++ b/drivers/event/sw/sw_evdev.c > @@ -38,12 +38,176 @@ > #include > > #include "sw_evdev.h" > +#include "iq_ring.h" > > #define EVENTDEV_NAME_SW_PMD event_sw > #define NUMA_NODE_ARG "numa_node" > #define SCHED_QUANTA_ARG "sched_quanta" > #define CREDIT_QUANTA_ARG "credit_quanta" > > +static int32_t > +qid_init(struct sw_evdev *sw, unsigned int idx, int type, > + const struct rte_event_queue_conf *queue_conf) > +{ > + unsigned int i; > + int dev_id = sw->data->dev_id; > + int socket_id = sw->data->socket_id; > + char buf[IQ_RING_NAMESIZE]; > + struct sw_qid *qid = &sw->qids[idx]; > + > + for (i = 0; i < SW_IQS_MAX; i++) { Just for my understanding, Are 4(SW_IQS_MAX) iq rings created to address different priority for each enqueue operation? What is the significance of 4(SW_IQS_MAX) here? > + snprintf(buf, sizeof(buf), "q_%u_iq_%d", idx, i); > + qid->iq[i] = iq_ring_create(buf, socket_id); > + if (!qid->iq[i]) { > + SW_LOG_DBG("ring create failed"); > + goto cleanup; > + } > + } > + > + > +static int > +sw_queue_setup(struct rte_eventdev *dev, uint8_t queue_id, > + const struct rte_event_queue_conf *conf) > +{ > + int type; > + > + switch (conf->event_queue_cfg) { > + case RTE_EVENT_QUEUE_CFG_SINGLE_LINK: > + type = SW_SCHED_TYPE_DIRECT; > + break; event_queue_cfg is a bitmap. It is valid to have RTE_EVENT_QUEUE_CFG_SINGLE_LINK | RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY. i.e An atomic schedule type queue and it has only one port linked to dequeue the events. So in the above context, The switch case is not correct. i.e it goes to the default condition. Right? Is this intentional? If I understand it correctly, Based on the use case(grouped based event pipelining), you have shared in the documentation patch. RTE_EVENT_QUEUE_CFG_SINGLE_LINK used for last stage(last queue). One option is if SW PMD cannot support RTE_EVENT_QUEUE_CFG_SINGLE_LINK | RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY mode then even tough application sets the RTE_EVENT_QUEUE_CFG_SINGLE_LINK | RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY, driver can ignore RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY. But I am not sure the case where application sets RTE_EVENT_QUEUE_CFG_SINGLE_LINK in the middle of the pipeline. Thoughts? > + case RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY: > + type = RTE_SCHED_TYPE_ATOMIC; > + break; > + case RTE_EVENT_QUEUE_CFG_ORDERED_ONLY: > + type = RTE_SCHED_TYPE_ORDERED; > + break; > + case RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY: > + type = RTE_SCHED_TYPE_PARALLEL; > + break; > + case RTE_EVENT_QUEUE_CFG_ALL_TYPES: > + SW_LOG_ERR("QUEUE_CFG_ALL_TYPES not supported\n"); > + return -ENOTSUP; > + default: > + SW_LOG_ERR("Unknown queue type %d requested\n", > + conf->event_queue_cfg); > + return -EINVAL; > + } > + > + struct sw_evdev *sw = sw_pmd_priv(dev); > + return qid_init(sw, queue_id, type, conf); > +}