From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0049.outbound.protection.outlook.com [104.47.36.49]) by dpdk.org (Postfix) with ESMTP id 9AAB514EC for ; Mon, 6 Feb 2017 10:25:30 +0100 (CET) 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=As1wYNLZK5VwlGRkImwYbFJMGHInCURCapOpBzlQwgo=; b=Z1QYLg68EBa6DnfvyubXRaKR7xjin+UhNKddZxKuXEQYFWkFcCpueXz9ovhsR5Q33an+D5R5epA57SKoogNGmH6VQMQhTsD/Dkzurb7cgz2Hx6zUDIHHUvz68VFt8XwDRuhFfMgi3odqmj1YW9Noo+ga9FbOBBvC5GThKLJ62Ig= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain (122.171.53.66) by BLUPR0701MB1713.namprd07.prod.outlook.com (10.163.85.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Mon, 6 Feb 2017 09:25:27 +0000 Date: Mon, 6 Feb 2017 14:55:10 +0530 From: Jerin Jacob To: Harry van Haaren CC: , Bruce Richardson Message-ID: <20170206092509.GF25242@localhost.localdomain> References: <1484580885-148524-1-git-send-email-harry.van.haaren@intel.com> <1485879273-86228-1-git-send-email-harry.van.haaren@intel.com> <1485879273-86228-8-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: <1485879273-86228-8-git-send-email-harry.van.haaren@intel.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Originating-IP: [122.171.53.66] X-ClientProxiedBy: BM1PR01CA0015.INDPRD01.PROD.OUTLOOK.COM (10.163.198.150) To BLUPR0701MB1713.namprd07.prod.outlook.com (10.163.85.14) X-MS-Office365-Filtering-Correlation-Id: 9fb8a6a8-1f0b-44b8-fb08-08d44e721713 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR0701MB1713; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 3:m4eNL6HIe1ZxNcv39fKv4p34HXwidgFzNQ7GRBjIqiBWLY53+g7PbVcA3aDTpIbIlVRw2mwuZAUKz61GY+4uQbWMEElBqzo9MLiWArj9ByQF8PpVYvgn5rT3vNz3ewfrFuImUyrO5ul93LYcA/grVjyExmqMubcS2EGUKeZuI98Jei0ZAvAqjg5iHgmVjDSoMq5eV0HBo2PjfFnCax5DqCCzCYettYUcxhnipbpQ0GiuYbtTOTshv++No+2DIb4/yCTTqtu/22Ub1OsTc00O+Q==; 25:jJWSEzMo4LCV1DicIXznwzE8JZp/3iZ/SEciR6GyyxoAa7qaxYUolNFNF/bxvZKMna6Rm2OlFY2TuRs3guV5todS+s9zgNm/QopVYQTO2rO29egyXEsiL+DwNNK/xSnpvuDpE1iq4hhyw5sokh1RDXaVMUsyAeH5jXRZoJZOMtV9T/niN1Nj8c3m42vzJC6bEldnq+suAv6CqWV/u1ySLS4dnCgWgoKsgZLOUZzvWKC6fmngrnzI8QVcU3FcO+tcygPitNYosJ8hWaXwXijYaFF2ZdFy5AzKXDjd/ekueIFgz1/5gTWCgYpmLa3JyY+vQUgKZML3p9D46Q4YHt30UnfatUyw/wXlKQfHyrvWxYbv5pcLlhdThkxa8GOEjOpwL4oJYKxrsHXWXRU6xE0JjdvX3i6jkzA/T83r+w6R9bSChfr/P3/N3W9DcDcNXTI6YKTgqhlB66iFY8OfqVG8fQ== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 31:MxKE2eAd6pDp+BEuDPKqUC6svTmzc9TvXvJEaPBsgtrd8Nzj/28JmZj1GG2YJQNsRNSVJJcrtqXC6h+OP++i/A/LB9I3aMIMOtlezxJpf0gvsq+bwGSbRomcmk5Wu7xDlQ789uep/ZxPUnVBWhnnRS4gHBZ3yW2uFCGk+23+BECG6zzi+YtCUXmsi+0vt1CorpqMDfgdG7ALvciTQArI4mmFeq5ZvbWLxXjbb3aPD5zYLXmkBeWYlP3S20hkFzmxDRoIK93esuXWu3FKm0DLEA==; 20:PwTiyhR22AiZsv6Otcv5Ql87pd+40jq4NUgYjQpKtuY+Kd+rtWwlgY2c18Ye5o25ney114hGx322l4ilVxSRS6ok5Q6jmfckucinRdKe8AB7Ymth5Ixw93cDXF9jQJ5atkZQhknVHUqbJYh7gkUvCHTXiN/XFYBPucOvA9HeRKshPcH3g0fxG1QzqZRja+IQXi4+uVo3mxIco42UsndMM3CEM8aIkpZTZrvEuXhaTr4OpxnUCvHbi/Drk6TqJUNKRFR58CfSR4ockmex8zGBs9f85U3yqyUsXrtr4xp7RC6ZfgQfX0e5O2Lonk+K3Y6nDEPiCYrmYBpUOCj3s+y+NmYtX50u76Ni0WVYQIaxEjdb5F+K7/ONPpoYQasQek2oIqIMLZH4NEY6rzaSDoscVgw2FlX6k9jJe8gRHxA5p0htd1TBxAkr6syS1XqlezgMjL2bSLmq7RfMNJiDQbYnX0sRXxapxzdV45/Z6tkIHlJc3N9Xj7BSrGNXOLixv6czcZL2mJmPiUJypG8M94+0wbFjxDegqf7Bz0LqczCs0aEvmVCdN9PMpgoLLLJVjKzkqVl5hXDGiz9ljrQIqsen/GZzXHEGjNPfNJRWDkx9JhM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(20170203043)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123555025)(20161123558025)(20161123560025)(20161123564025)(20161123562025)(6072148); SRVR:BLUPR0701MB1713; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1713; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 4:R/iNtAY7hPJoUTWMGKE5zEXdvaRmY8tDKHWfeZhUVGpebVQafoMBWP4xFSVYv4hyJzJ0FLaDXxdpqQYvuzsDFkDZbvBGvhlC4diW1D1WM443hbhrULz2c2HZ/Wugk8sLmtmsNMXz/avH2h8JKpkY1PzHENmP3D86jf4W0RccMD2HvFH4eDzb7lGr9IcABHGognxuVHV1yZE7jbHj9x0t3t1d8B7YD4R4kYM3YjNZELTwDGDO+O6UmSLcL/t/ajGYcpH/2VbYIqb5KVPhKfCBh4lxz5/UBU1Rq2zbVxYgvB/vo2AK69kyBLT6lN+UEN9W/dYGXEFFM7Ojog2YYCfqqX3dnMfY3YVjMIfdDd8QmutK9LPptKYHDa3buoFLGN3HCdXxi0xd+Pr6N4i5tndKNsfanRm742gzCyaG63L6LnjAwIbn6khIDf6zy1Lwgn8LkhOmTcrEIucLCqmsMczutJURtXETIrT2amoneXI3pFtS7iKpMn0dS7T/BT6JFTsc1JR9B17hYvmX8a2xgrk6buUVJwR95Zt2npPSdxRlQGdGt+W7gZr+pZZFSZzYKlEJHYC/qekpr9LyuYzzDq/j/7FUqzCXDxL+HXH6gVze6OFX4acmJyhNd6kNXAfxIOcDZQJIam/g/Gt2v3/AdEaaVQe7gfP2XyjtjWrCDgo5+faWzCwZJVA3Y37lNZCL5isf X-Forefront-PRVS: 0210479ED8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(199003)(24454002)(189002)(92566002)(68736007)(61506002)(6246003)(53936002)(66066001)(229853002)(2950100002)(42882006)(6916009)(6666003)(83506001)(38730400001)(55016002)(81156014)(81166006)(8676002)(54906002)(9686003)(97756001)(25786008)(6506006)(7736002)(47776003)(105586002)(106356001)(42186005)(110136003)(97736004)(4001350100001)(101416001)(33656002)(54356999)(76176999)(50986999)(1076002)(4326007)(2906002)(46406003)(50466002)(5660300001)(305945005)(6116002)(189998001)(23726003)(3846002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1713; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1713; 23:Riak/g5pyWuR2plCsrgXjFK8O2jnbFpgFf0bMzs?= =?us-ascii?Q?pnKgP+b5D14csrAsE7sRGgG20DIdVe9nLvDwfFnfBTBMP6R5pEIkgY2C2xkD?= =?us-ascii?Q?FWWjfM+Cdk3RdqAMllYcgBo48tTcAjUSAFk/E4fo3nC6nM4+M0rx2RE7yaH4?= =?us-ascii?Q?46PcxUZNUI/m6Clu+zoaSQfZ8iALLIoQTESaqbBjZA5VM4vfA0a/y16i5Mi5?= =?us-ascii?Q?GgcY5PUXegLkYshvthp85VFDPZrIL805kt4T+T1I0BFoRNnwD8+n5wUFmTQU?= =?us-ascii?Q?ERh9uKL26/HAjF3fRR/gFflWRnjrEAXRe/u+wgf95ndz/9L6nREgHpZ7WxWY?= =?us-ascii?Q?5U7kVkSnkfcPj/LYSh+el0/X81RnDekITI0Ds1CmhOWgkFVcYU2JzucaR+qi?= =?us-ascii?Q?kHnQIVFAt+Wx9wUI5FeO8uvps4hgR88Z/ZFe8bxRpUJBsnsFHTJeuFctDwQr?= =?us-ascii?Q?U2IiXxHDMzMT1JPN4Xi8PWq/7k/R0XeeGFSlETKrdOHoT/QAA9NNl8bgmyEj?= =?us-ascii?Q?e+y8cMH9+czwZK9t7IKLbHuSezKObxl/IZ3L63KHEOmu3AGX4x503UPxZDu0?= =?us-ascii?Q?9//ecBbT5PRj+YkOH9gz91mjWNorM/K29s2rhz8LaMdWC8gHFzGw880Bf1zH?= =?us-ascii?Q?YBubuDfttPWKuM9PARNmq/VwpK1rNYL9Us+oGfzocPvmICduxQzrD/u4IuRZ?= =?us-ascii?Q?RdyKiLCLpfTqVp1y9DTqKQPDpCiESUfrZbxOpoiByibT1oD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By+9od6XKfN/mHpIsJs3dha9/FA9khiiuojWV1FLfeqIBLwGgSf940xdR3QSr8QpOqTiu7z5XMg6bAC7v9vGStl/XzpJWQ==; 5:6JQ/EmI3woGgZpz2CMJlE/mo6QhmSJ55EIdrUBXdstRSn3aHgRfVsH3KYPYHtZmekQbj5sc5bbDUr1PZ51HhCeaziC5EgiBKTEjo2r3lmE53BZgo5Ynfwn7JjgOmdfAsCimfBowe8790lvZUyQQZNSFhEBfO2k+lZ4CYdrq5nxE=; 24:jkvT65ri4Kq5OkHWvn6/cyP2QHuidH+ObUy7T9KfhMxQGM0TjRkSzQkUORTqBS1SmRHTSTo0u7E99itkC8gE0HaUblRO4vR5jBsGSe1d4ak= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 7:xs5YEBPFQNcamDpzro+h7sFbtqEOiuCIQjHl7+dVbexNMgTNgAAqfLFRS1uMbYsxjRD+MVgsmCwyq8w4LD/9kp+IJWNeJso/mhU/HYJzV2+8QzxDE8E64ImT6QLV49vc6ilbmWTqZJhZN/GLZH+YdLBeTPMddDPKggClCtUlOgTBmDidnkELN/jzxngwwhQesGqRPSNkedQANjO2C+WYcVMYcJ/rMGIMJ3xw8My7RKKZ9xtkusZ99eCwYwSO5tvAOO54PX2JFom5rWHhw27suOlNBwv3qAUlUNUXkMPmgi/HfPeKVmAnt8frr+CcOv3sYsRKdp3AGxLXLrhUDw6bXgY7re2tiaxwbZaa/OMfdn1w12zcTWUCsG78o1uQN2v2x6gd6yAAa5iTgVtmZDTVgBDzCMe0r5cberLdl8JlO5nbpwN5h0uxRgyYBbZzuOn2vwWiYMXrtwFV6VUTwYrxVv+I6/n5M5TKBSeVm+f5h2G3XL7U7EaJYIM2jbtcobBvq//WZSFPi6ycO7IA7JTaTg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2017 09:25:27.0772 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1713 Subject: Re: [dpdk-dev] [PATCH v2 07/15] 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, 06 Feb 2017 09:25:31 -0000 On Tue, Jan 31, 2017 at 04:14:25PM +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 | 158 +++++++++++++++++++++++++++++++++++++++ > drivers/event/sw/sw_evdev.h | 75 +++++++++++++++++++ > 3 files changed, 409 insertions(+) > create mode 100644 drivers/event/sw/iq_ring.h > > + */ > + > +/* > + * Ring structure definitions used for the internal ring buffers of the > + * SW eventdev implementation. These are designed for single-core use only. > + */ If I understand it correctly, IQ and QE rings are single producer and single consumer rings. By the specification, multiple producers through multiple ports can enqueue to the event queues at a time.Does SW implementation support that? or am I missing something here? > +#ifndef _IQ_RING_ > +#define _IQ_RING_ > + > +#include > + > +#include > +#include > +#include > +#include > + > +#define IQ_RING_NAMESIZE 12 > +#define QID_IQ_DEPTH 512 > +#define QID_IQ_MASK (uint16_t)(QID_IQ_DEPTH - 1) > + > +struct iq_ring { > + char name[IQ_RING_NAMESIZE] __rte_cache_aligned; > + uint16_t write_idx; > + uint16_t read_idx; > + > + struct rte_event ring[QID_IQ_DEPTH]; > +}; > + > +#ifndef force_inline > +#define force_inline inline __attribute__((always_inline)) > +#endif > + > +static inline struct iq_ring * > +iq_ring_create(const char *name, unsigned int socket_id) > +{ > + struct iq_ring *retval; > + > + retval = rte_malloc_socket(NULL, sizeof(*retval), 0, socket_id); > + if (retval == NULL) > + goto end; > + > + snprintf(retval->name, sizeof(retval->name), "%s", name); > + retval->write_idx = retval->read_idx = 0; > +end: > + return retval; > +} > + > +static inline void > +iq_ring_destroy(struct iq_ring *r) > +{ > + rte_free(r); > +} > + > +static force_inline uint16_t > +iq_ring_count(const struct iq_ring *r) > +{ > + return r->write_idx - r->read_idx; > +} > + > +static force_inline uint16_t > +iq_ring_free_count(const struct iq_ring *r) > +{ > + return QID_IQ_MASK - iq_ring_count(r); > +} > + > +static force_inline uint16_t > +iq_ring_enqueue_burst(struct iq_ring *r, struct rte_event *qes, uint16_t nb_qes) > +{ > + const uint16_t read = r->read_idx; > + uint16_t write = r->write_idx; > + const uint16_t space = read + QID_IQ_MASK - write; > + uint16_t i; > + > + if (space < nb_qes) > + nb_qes = space; > + > + for (i = 0; i < nb_qes; i++, write++) > + r->ring[write & QID_IQ_MASK] = qes[i]; > + > + r->write_idx = write; > + > + return nb_qes; > +} > + > diff --git a/drivers/event/sw/sw_evdev.h b/drivers/event/sw/sw_evdev.h > index 65f00e4..aaa8056 100644 > --- a/drivers/event/sw/sw_evdev.h > +++ b/drivers/event/sw/sw_evdev.h > @@ -49,6 +49,78 @@ > #define SW_INFLIGHT_EVENTS_TOTAL 4096 > /* allow for lots of over-provisioning */ > #define MAX_SW_PROD_Q_DEPTH 4096 > +#define SW_FRAGMENTS_MAX 16 > + > +/* have a new scheduling type for 1:1 queue to port links */ > +#define RTE_SCHED_TYPE_DIRECT (RTE_SCHED_TYPE_PARALLEL + 1) IMO, better to use SW_ for internal sched types > + > +#ifdef RTE_LIBRTE_PMD_EVDEV_SW_DEBUG > +#define SW_LOG_INFO(fmt, args...) \ > + RTE_LOG(INFO, PMD, "[%s] %s() line %u: " fmt "\n", \ > + PMD_NAME, \ > + __func__, __LINE__, ## args) > + > +#define SW_LOG_DBG(fmt, args...) \ > + RTE_LOG(DEBUG, PMD, "[%s] %s() line %u: " fmt "\n", \