From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0067.outbound.protection.outlook.com [104.47.37.67]) by dpdk.org (Postfix) with ESMTP id 94685293B for ; Mon, 6 Feb 2017 10:37:57 +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=4bcTyAk/pF7HYRy5BIGSyzqNMMC+0rR+rxMyVd9s+2E=; b=At00Df9a+r/2YMSx2vE7OqYIWn3K4LDzfntNO4B+U61lB0A9nYDBSQMcVd9Ar30yN2vmxtQeJnYaGDusb3/bP9pMXo8WLXukzaqalQaaZhXTJshbzpnvcHM3uZ8hMnh7Vl8ipStT/3VIEgMucVFQBQU0ROdiUzewDcgF2Cg4jsU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain (122.171.53.66) by BY1PR0701MB1722.namprd07.prod.outlook.com (10.162.111.141) 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:37:52 +0000 Date: Mon, 6 Feb 2017 15:07:39 +0530 From: Jerin Jacob To: Harry van Haaren CC: , Bruce Richardson Message-ID: <20170206093738.GG25242@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-10-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-10-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: BM1PR01CA0092.INDPRD01.PROD.OUTLOOK.COM (10.174.208.160) To BY1PR0701MB1722.namprd07.prod.outlook.com (10.162.111.141) X-MS-Office365-Filtering-Correlation-Id: efea0123-1930-433c-2ebb-08d44e73d3a7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY1PR0701MB1722; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1722; 3:wZzgEdYWDYj8003QcY6DcfvdrUZKLU0fCquOUYKsmQiTNHld+IryhlkhyoudsfYQzfOxc8E8Bre6Qvl8eKmtF8NWLXDWv5xBGg1UT3YfVuq6/32QULmjw04WzZysuS5Ry6gpuKXfOJB0yLwBu8eyjsWXRMm1gro5EHtw+kRksw30gcypR00YuBG2B6/YPwuNpGNliids1JDvC3/1sBcmLv98a3ezddl6zGteav3zAhCpu0GcfUzBaGFb59mvAi+bR+YT2mi7jZSXaR1X+HN45Q==; 25:wMblMRoG7sQBQoHh5p8C2QCwVQwq2tooAKJWJwSh09PSvu6vlXme3uz7vbzhv3a4fc68AWJWqGE9VHStlDjyQybPar/ToRMROlG83BE+tVdeUtk77QN5pZ8AjFUdrmv8ZHnnrzgBsD4rU9bv7WbnsLOdDEaM5x0RFcpWb0/aY6ZI+PV3CJdHpuT+wCeIREaImZj8tmHyXL/I31x4RjhN4JujEIYIwajcYeEtlyWbRksPk1VfrYGtuFXTogVEuFLPSX1IGGjEmWCmlttwkYOcv7rBzqpfG4vm9JaTX5iaik8TZvY9kSl9P7iWBGSJmdJi5D+c/cPmrB5izin9NDmtIIAuOoW4A6IQLLagsd2UA71VZcXxbYd9q/RxtoI1dla4/2uo+ESApiX/a6bEGvoRA7VZhmHdhtK4SKFbZ5VJQCdergGaRjmW/msGis0CTS7d9e3a5Cerz5WRDFHmEQqUHA== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1722; 31:M8GJl9cE7J2XMrvLSvBi4bEiDRsQNp7Bzw9JugksonZ5ChAbLTxGK1+TC2U7i6+eoiwCOVh3qLJM++7eGoZEU4Sk45xUrdEcOcy81akA3x3mBI3IXOK/FV0cjUA6u0G+rJfHvF/hlZaP01vR2os3KSey8VIEpCGyuRby2eHbBKxAAR/Igwx1xvbyTIkofbW9XEANE347VLBkeQv0DEkWqABbQisJONn9TdEPg+kQywT3qeh7v5Qz4P21/UReU9KalI4HihYVrxUXflWaRwI7OQ==; 20:cCcSDzLQ4L4xMs4KM8jIeDG4Y4Wp8dI8zRtFReE9Jcww8byLz86u7w4ayvnXnRJjhpn536nQnP/S06b/wTqa6tqB7NUAIEskV/iJyXd4/8fdY+YqZErjignnPJDR6dpc4Hw+tNz3AH5dgeTNvdEP6daxRPU4k3lixA2GKXexO5gXCnUHwj9WfLHpG2R+B/DNzuxXgjJ3dJwXkboWz6r/87teN4CKxD/72uStAnorD6DMP+xpdrp/MJJXpBEfhb8vpNiAZHjTF2lbVePp+Exjrml4JjMhWGabO7S15qPpxGBz705GBv4F7jyODPlVl58OPEDXOzvBrhA8jjDbEUeXqP1Hc3/maedwgVI54Fbw3nhzG+1WJopR2ekUAGWlJKla6eIW90A8Uuu62psnE/EMZ5LGpFrhuwx4wa1jRyFKvoA8N5PKT9BZXYlavxK/IZyNRBUTgZqWE9I9BKf0qlgjL9XzaxV1ybcrzxa/H9uumKUw+Bgn2tppAXPFiPYHf1w+pIAZkxQo4cM5pgiOcfWX4DLsjBYmnpZAQkFX2x5aFDWjM+DwCKk06qc2O0RRTXjoGanXnUhOttVIjQqgHC+MqZAdi55vHsdL2W7yIDnk+r0= 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)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(20161123558025)(6072148); SRVR:BY1PR0701MB1722; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1722; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1722; 4:4lBUuaPuXSWD+HzIrmaIikfchX2wUG7UmIK/gvqYEKMD8aAhaQ8YimZz+JoqrDxTlDw9jOicXLRvpvroqu4b1YDjxnJp/XTvRPDXuQgT0iLfa1I9LyzwsW4AtCMU8slJbNLrqFC7JPFaVPg618hyZLs5sozrT2tHGkuypqA32WMY7WWnVmKvUv7qk8Jj2AFGUpPF1iPsjZALAynvYqYDDz6IBFZcVnh2mbqAfzelDDRR4N2Wpg27OUoDRIuRZIL0GnWWnDzLGEBMAAuJBJwrupeSb41ddAl+dEyy8C7HsTSV9lkgnmwamqMcRYJJqJncnV0sdpoMBoB8Q/kkxf8xAQVjTlrp0bllOSBs9z0/ypC/PEUPs7O6WEe9CZ7Krjmj+Xog/xweHNKn8VtHNyEFPcmvq3YYdYSBaAfAnMLAhZ6qLsYF8S4i140rBLkVQdHKIApg5ZwZNeY6S5utDVdn7gtNDAeU6JEdbQwdlVJC7dBWZ2+eemRpUIBfgw1dwuBJlJ/ygB6YfsO6bpweAGqr7lQVQ5nVlN4k5w8D78I6aWVkUJd43Cjb1XXVa2/x3io25+GAUHSHeq94hnO2V/VstaTRV9GUjKEyWTlfob+JYs8kxO2ZlpgY191bOHVFs7dsuY684lNevjmElPpxCMxjZVeOmJg9BO0iuwn+TmrzG9OVI0nsFIstp+cVZ6IVUL9r X-Forefront-PRVS: 0210479ED8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(189002)(199003)(24454002)(47776003)(110136003)(66066001)(92566002)(2950100002)(46406003)(6916009)(42882006)(6666003)(6506006)(25786008)(97756001)(68736007)(38730400001)(229853002)(53936002)(6246003)(54906002)(55016002)(9686003)(305945005)(7736002)(61506002)(33656002)(106356001)(42186005)(105586002)(81156014)(81166006)(8676002)(189998001)(4001350100001)(97736004)(83506001)(76176999)(50986999)(54356999)(2906002)(101416001)(4326007)(23726003)(6116002)(3846002)(5660300001)(1076002)(50466002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1722; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; BY1PR0701MB1722; 23:ybr7FYxsS5PpcDDaL+24Em8Z+r8whbX8BVlui0E?= =?us-ascii?Q?a+7mH+SEY0qKdIg8h/6H037Bd1X13VcCzX7QRfO8w1FgTNrDskO7m0IFGH+m?= =?us-ascii?Q?16wb/smoiBNb92uxDh8kiAuSXnUiPdk8pQpy86Lcif1cwv3IYr63Dvt1zmP4?= =?us-ascii?Q?GpIhFoqJ+ftNHxmVheHxkTw5sSFhXoM6wLuogVdBxUAiwhPHpqrvhUoSMrqI?= =?us-ascii?Q?RHj5ktisoeEIvqdnfz5gM3Zc7evN0vDtI6n0Bfc0FjwYrsMZ+OK6Si9Xzypo?= =?us-ascii?Q?M4YxSL2zfTB+AY7fL8pJuMa5SYybStnTpVXdNdiLW6MtlKvG0ll6FaFrHezn?= =?us-ascii?Q?NEAb7XM+dQtxFD47EvrxCg/ISIc1PtSMt86M2WdiCwocb4P1x3NpER+Y/8sn?= =?us-ascii?Q?TOkcbSCPzo3t0SIwtP+70moREcpyGhMEKSqpm+rGL47A1m4aPbDPoSUAweP2?= =?us-ascii?Q?cOMuxW4RzksMS+EXlj954s+J3M81cKKG5eJ0WVqYNZmKGIlBgUNOhTrdYieq?= =?us-ascii?Q?br2OKAzw6dWRuFfeyN5LSEdEcDRyjfS/5JWr98b97v9qSVo7sm4UPjuQ3daF?= =?us-ascii?Q?oWjCqH/1sVvKDXithsnuHNOTPP+ohq4niQ5+niHOECCCgFLw89JtxfO0vwfS?= =?us-ascii?Q?UPE2yLG4lhAWNvBdBLWfPxVSWMtgK6GKXldVfR0TldNvonuJfBtENdTPbrw+?= =?us-ascii?Q?kbHC3m1GhQ77kOAgYFiQfjS5NNRSa/8H1s2Hwp4x4/SyZ+ryqq5sj9m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luI3RLTKqW8/2NSFiGF8IwsjyUPm8H9aF15Ktxj7F1JSPk9gHu/KKiIefBVwFESkdnf6NFurkcTLSWmg==; 5:PO8iTZmqoxjEgPSHgjRp62s877yv+cEFak4g0WhtWgzOCPudu45yhG3ztterI7C3DiHZ7YuZ6QCR5GhxeB5f+25bkwwrEwoXiYos2Eu6Xb5HIiPR/RTMHbOG9q04IOCM83V7Er4WMMxAB9vg/XGkA/Z3i9Na7RlMwRkulkPDWNg=; 24:6cxLPUxizLaV5avsEn031dR1VAT8klDzWe8mNcwz6KIdz4fQXJJ2O7uozDJOHqDJDm3bqpwUdSfu3MdlbhwdwkxUh4TzHxfPYrndbaaJZoM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1722; 7:yGYmFD8+10u5dWbZWiMimT2zQFjX2Il/Tl07mlFw4s8M7muc4JZM/lSwaBNlAWyNtFLHGPcR6GXsMcmurTvx8e4D7gkWUF+lzgIngYg4haorRkGoEuaN2q1Lh+uktz4soW0i9Z6vL+SUZWNSsc37dPo1X99SbkAnaEeZq81uAaud69MGfR7AT3+DtigEZ6EMooY3O+aLwcc42TA/9mZFZ01jriMX4KhhLgllJQN30pcyGTpI6QRRxtB/PnYEj0Wl85cQKAOJac8qVqATTo+Ihcw+FZZ2RRLT66XDbnjby5ThcvbFu6QCFlu4u94ZSmHoIPLG9DcAn/ekyv54jqurPfvfKJIKJVs5XqahAX8hBa/2B1UhLYvcpWyGlhnaEaS9hAN8G/JvBwpCpZjd7TTEaUXRz5oEkfEfAgljd6jUiBVvyePL8qzod8/4fXSXGiQYuqh2iSJuKkq3uSoGmxk+IRsFidXcHVY4TlEYKi8fO1ZFcedR83a9P3Kq8AmR/l/UlGOthpu/HaC6MRatfPQCsg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2017 09:37:52.7863 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1722 Subject: Re: [dpdk-dev] [PATCH v2 09/15] event/sw: add support for linking queues to ports 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:37:58 -0000 On Tue, Jan 31, 2017 at 04:14:27PM +0000, Harry van Haaren wrote: > From: Bruce Richardson > > Signed-off-by: Bruce Richardson > Signed-off-by: Harry van Haaren > --- > drivers/event/sw/sw_evdev.c | 68 +++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 68 insertions(+) > > diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c > index 0b26fcb..693a833 100644 > --- a/drivers/event/sw/sw_evdev.c > +++ b/drivers/event/sw/sw_evdev.c > @@ -50,6 +50,72 @@ static void > sw_info_get(struct rte_eventdev *dev, struct rte_event_dev_info *info); > > static int > +sw_port_link(void *port, const uint8_t queues[], const uint8_t priorities[], > + uint16_t num) > +{ > + struct sw_port *p = (void *)port; > + struct sw_evdev *sw = p->sw; > + int i; > + > + RTE_SET_USED(priorities); > + for (i = 0; i < num; i++) { > + struct sw_qid *q = &sw->qids[queues[i]]; > + > + /* check for qid map overflow */ > + if (q->cq_num_mapped_cqs >= RTE_DIM(q->cq_map)) > + break; > + > + if (p->is_directed && p->num_qids_mapped > 0) > + break; > + > + if (q->type == RTE_SCHED_TYPE_DIRECT) { > + /* check directed qids only map to one port */ > + if (p->num_qids_mapped > 0) > + break; > + /* check port only takes a directed flow */ > + if (num > 1) > + break; > + > + p->is_directed = 1; > + p->num_qids_mapped = 1; What is the expected behavior if queues configured with RTE_EVENT_QUEUE_CFG_SINGLE_LINK attempted to link by multiple ports? Based on the head-file, the expected behavior is following, (-EDQUOT) Quota exceeded(Application tried to link the queue configured with RTE_EVENT_QUEUE_CFG_SINGLE_LINK to more than one event ports) > + } else if (q->type == RTE_SCHED_TYPE_ORDERED) { > + p->num_ordered_qids++; > + p->num_qids_mapped++; > + } else if (q->type == RTE_SCHED_TYPE_ATOMIC) { > + p->num_qids_mapped++; > + } > + > + q->cq_map[q->cq_num_mapped_cqs] = p->id; > + rte_smp_wmb(); > + q->cq_num_mapped_cqs++; > + } > + return i; > +} > + > +static int > +sw_port_unlink(void *port, uint8_t queues[], uint16_t nb_unlinks) > +{ > + struct sw_port *p = (void *)port; > + struct sw_evdev *sw = p->sw; > + unsigned int i, j; > + > + int unlinked = 0; > + for (i = 0; i < nb_unlinks; i++) { > + struct sw_qid *q = &sw->qids[queues[i]]; > + for (j = 0; j < q->cq_num_mapped_cqs; j++) > + if (q->cq_map[j] == p->id) { > + q->cq_map[j] = > + q->cq_map[q->cq_num_mapped_cqs - 1]; > + rte_smp_wmb(); > + q->cq_num_mapped_cqs--; > + unlinked++; > + continue; > + } > + } > + return unlinked; > +} > + > +static int > sw_port_setup(struct rte_eventdev *dev, uint8_t port_id, > const struct rte_event_port_conf *conf) > { > @@ -381,6 +447,8 @@ sw_probe(const char *name, const char *params) > .port_def_conf = sw_port_def_conf, > .port_setup = sw_port_setup, > .port_release = sw_port_release, > + .port_link = sw_port_link, > + .port_unlink = sw_port_unlink, > }; > > static const char *const args[] = { > -- > 2.7.4 >