From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0057.outbound.protection.outlook.com [104.47.41.57]) by dpdk.org (Postfix) with ESMTP id EE8A6FA78 for ; Mon, 27 Mar 2017 13:20:50 +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=LNO+uZ9XmEs6Q0saKJlndnG3QWyFIdeVP8dBtLVlJy4=; b=NRrbv3ssdI4UJlgo4c/y8quFG9SYmx9R9jOJ98z3dJC4Os2RPI4BUlRakayyuNZAjnVXcLBDP5m+WpW7smVc1E3lkIQnVYVNoMXyfAB/Pf+WmNG5OSXyoXTtUo7Yyd2wOoo0WpL5xg3Yc3IUvNCWViS8rnK+QNgm+m8Yghwbf6Y= 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 (106.200.234.233) by BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.977.11; Mon, 27 Mar 2017 11:20:46 +0000 Date: Mon, 27 Mar 2017 16:50:30 +0530 From: Jerin Jacob To: Harry van Haaren Cc: dev@dpdk.org, Bruce Richardson Message-ID: <20170327112028.vrk5dwuvp5kvuqz7@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-9-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-9-git-send-email-harry.van.haaren@intel.com> User-Agent: NeoMutt/20170306 (1.8.0) X-Originating-IP: [106.200.234.233] X-ClientProxiedBy: MA1PR01CA0103.INDPRD01.PROD.OUTLOOK.COM (10.174.56.147) To BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) X-MS-Office365-Filtering-Correlation-Id: 564e299c-efb9-42a3-dfb5-08d4750351c5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 3:bzbNFydgaCoQ/7miqx+Lz9SnlVtiMlp0qkAj1hvSCqvpDxdCe0o5LMkv5m4bDX1dcTQf0C81vx1f1EIsRTJbRgw4DWjHfgAzLDzvnaRqZDFMjh4DZshMmDEVlnDxIpdnEh8ypgKoSW65l49tNdGASovgFQufBtIx55RbpGdJqcLgXGTjfA0MUjvmCdiIMYWq93orYoEgeWPVjmjVhvHsApPPUnlHNa/GBEcr0ZJgJaRTzxGtExaPczTIwNyfque+ieXOQL9zvQJk/75/zUDrHg==; 25:o3sO82A+RIR5pQ/6fh7ZnSj0uuFnzCpIyxi0cjZDoE+UViWa5zsmV0rcxjCOA2vlZJNO2skzH2yVI34e+T74XxGVacV3bsCOIjlSAE+Zwcw0umHCz0HdsjtcX156j8iUxXY6co4UPkf6EnlvuznUXciRluAlZU3XMeEMyUKAfEgfVcYf1jWUgcSbwH9JArZYChnWCBNrihAin4bhDbDKMt64DlG8MfCYAvF4rGZkAC3PcRRgYxFeH6jvXtYNZh8xe8g5eoHONgSAmCNJUCJEUqdbD28iRQ4cy1CbuNqoPbOUfFAMNWVEbdvWB+OlnOvkeWlO1PhD7seoVWlROglcKbtGmJRhk8L/ATLWvaQ08w+u2HxRazs7qVvoNbmMZzuUAY8SjpR6Go82iKYjMkbApUUSwlcO+lHlgxqrwQfozYo/EqI0OpRvofjLdejRMkEANV+D+718w/VmaQj4Sjiowg== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 31:yawA2RZYPVfrujJ/sNzfS9Ar/oeip2nQWk+2iF20wJDSAC2SUsy8nDTCicyCl7JsNYlfP9ZqA5Gv9/t3uQReiPMhPpvmw2h1i65tJY3eLY4elSloPtHy59yJUXpzWI5aF1neZkIDq6u3ksLRiAeC6pw61062KR5xk3VQsDR+qmE0P0skZQ6dCsJIPpLrIrDHcA73Md8/30aq0zpNPVIwnvxH0FH0PTvInM0vEHQKR42QAJgmR+TLcUgbkJKF8SW40tSZ7O2oEH6Z4/ccOjN7gFR4fAPCwUIFCE8sPOhGvVs=; 20:Kal9SWr1SDR6ddNybjLj2TTsGrq73G3PS63e77sUjbhSLIEumBIgXxMzNpkm9ZhMz0r4x1gI9yA/Ue3rjJ8CJBs3jUNiel1agenQN0l8V3eG1HbGTfdhAGwUwVwZFJwcZv8H27SrO6J0fwefj0hIMpufJG7tjQiPwK66eLPrA76RROg0Of1DrgCEGfJDPpjMxHL7l5Q1SIFsKu2TpPzfRXy4tsrEo3A6bO2D/bnZUJOhdaFmsR1svIyym0PYMooK6t0XT4VWM6t0hofNkeXgIdabe1Eui6v4zd5OqK9dq1GoSPZwMvjvIioKG7Fs/TeMOVJloKNayBXay+6AzT5UfRQA0kk1koCy+JH/xSzWUIKwtrPhJ+vv9kJ50tH/QV60mo1J6c525w1Ujy6myeNR/h2VH8TW1GuBLUIwahAsvMVlRUxt301zTVMRCoTiBesYZydZQJ7HTDbfRKjy/sjfxbie0LRSG+sNE+RlUnDr+fw51yDdzL3JENbegPkvdQ93N5r+dI5N/MjL8Pxd1NbaljrgLoOgz/O5v1oPjpkMEHk3CHg2GEBR9aV0/ORyivv3Q+J/vCATNGMdKzMhUr2GZdrsaxFMdHOkdjVDaQjjx9c= 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)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123558025)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(6072148); SRVR:BLUPR0701MB1714; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 4:Lg2yLXwcYhEv7W5eFB9DFvGBE+86hz3FMwBKBMdQTHQ7IpnBfnzZQ9DieVzlr9cf7n7mL6YJieSfLKWT9tvrk7HCTDvGJdVaGayWUFIFAv7VT7ihx7AlO/ufBa1oMc3sfL75CCkRRPU8zg6aZAG2IBIwDM8ZiCkqvChoaAxjxvxvsjkBy1Efdk0LyPoHpqqBUISMe6gzR0fbabtP3OpaTJAhv7X7Z/jSy39P12pJyqnb3ek/ULJRLTn15zAJtWVvUH0F7S158b+jEXcXMC+MGS3igpFWiz4XAqr+i6M/ETmw80QeIsUsa1/fJ+1k6XjGcnCTBxfFqM6fY8OJL09wU6dQL0nT0u/4Cthc6n6lUWMx/ozUnAMBzNmaOvOlyCzKKW/rlpM4kYMjdvc5LC2JS1jONpND1WQZ6g4o2kE9wnEm9keg0l25wqUqeVwWcdeUnm05fRkxwabQEjuh9p7pklI8RiLdxj7ZLQV7Rs+VBYuXDUooipOs/NKDYCScAQp/x6rvSwDyYSykXSVUQAO7brgLxKDZIZmFJ+GO3csZwIQCpbG3m9LGcDmGUbWTP+lTvFWT0811LvXP1De/tcjMmEV1gssdxWkCSmPWO7WeJu6Vk0U3Q6GLSThlnkxs0iuIBSb0zfNPe5VTHIv6TpTtCg== X-Forefront-PRVS: 02596AB7DA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(39840400002)(39410400002)(39450400003)(57704003)(24454002)(42186005)(6506006)(8676002)(81166006)(6306002)(1076002)(53936002)(83506001)(6116002)(3846002)(23726003)(47776003)(66066001)(55016002)(966004)(25786009)(61506002)(33646002)(4001350100001)(2906002)(53376002)(38730400002)(110136004)(7736002)(6246003)(4326008)(229853002)(54356999)(50466002)(42882006)(6916009)(76176999)(50986999)(189998001)(5660300001)(2950100002)(6666003)(305945005)(9686003); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1714; H:localhost.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1714; 23:bHAHXWJ+Gu7Zk0oTwhxdv8viYDJA7oNZ1cotaHj?= =?us-ascii?Q?JUdvpaChzj9wgwIoB+ZrLPceiA7EQukCShNuzk+w51R+/VAQNdxm3nDrBEt2?= =?us-ascii?Q?BpCjhM5VzoMW8JqPgNblvCnQGkYtJ8IJhRiqC4XBu57rl9LrPN273oFwwODb?= =?us-ascii?Q?Hn61yX0/1UEB0ptLbVD3QW73nnVZIhpH+ILbXHm9uL1xh6Ffun5+ZN7B+cLr?= =?us-ascii?Q?uiywd5/0Y8apOiDxUHC2nrgp/jWAI743Tmn6TFYrAP0KzgqnavnKMSfVsPD0?= =?us-ascii?Q?O8rDQ/eQgoShWG1nZIvcxb7wwdiHWV2FNipIrBSmrR0BKRZFmxp0QXCUyXEx?= =?us-ascii?Q?pM3UNvpBXFO8rxI6PQEHaJiApwXpNacjedTmBYls/YSTTGNMcHLIvFuGOwXA?= =?us-ascii?Q?kpVLRq1VAT9AV8Jqi1RbngP467W7kD9egWFf49mC925JHpXNWnRdUty1ADIU?= =?us-ascii?Q?uVMZUBOsjuX1Sq5CiJ3PVg+HLpDoksiQF0XTm8dLSz8DCX62TFOKwioSngxL?= =?us-ascii?Q?jSH9G5jMNlwcwkmGrtbsQvSOKeYPycHRfQ5z5qIioBYGAjkhvL9M/y1dGZEP?= =?us-ascii?Q?eGIG4Vyv8w+OOIxDNOMBgI/gqiB2rY5qizmtjT+kLQ9U4b0MFiT5Q8au/Fli?= =?us-ascii?Q?/4MnZ0aKtx8B8XBxJxKASDPCsPUXvGHh91tMZTDDyHNaanUXearTQerRY4cg?= =?us-ascii?Q?UClWK/dN4LpFXr5UYl5CCNH+TfatqB16hftNF8nSx+ev61raYWiXiGcIdAu7?= =?us-ascii?Q?pjeUfVzyPDPBG7xOZucSn3d81ytC1kGGEFTY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FxAJI4+9MMlsS6BwvW44gAEus7e87YOyyuQhOzuj7RHXOKwhkdnrulyb+3yyqQyEBvwKSm+sCxhfXmQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 7:u/X0La+c6r6GAgrReq8UxinELx8rqD9ue+ITB7af+CFcReUzredlVioIAXgsX5qaUKFO6iL4poAmAsMXHd0rDvB0IwcjH0pc4I+K+hVIcEKDcFESrnfXPYlQ2uJFf68bBRF6IEQtSUyVTpTchfwp1T5tZiIgzSttyIpi5hWpoeVYvkaR9Ox8SPjygUzLjBaUxfZG1j0hccnHgBXVdCaV6jcuB60TJj27aXBMxK2YGTCpvCWjIkMps1uuwGnazGRmcPBnLIVcXLKr6YKMFn3r/S1KaZ4OeUiQfX5X+gq0VpIoWsacCzrTBFleTXPxc0aOZej9thvSClH4OrfSGq2cpg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Mar 2017 11:20:46.5099 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1714 Subject: Re: [dpdk-dev] [PATCH v5 08/20] 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, 27 Mar 2017 11:20:51 -0000 On Fri, Mar 24, 2017 at 04:53:03PM +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 | 81 +++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 81 insertions(+) > > diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c > index 4b8370d..82ac3bd 100644 > --- a/drivers/event/sw/sw_evdev.c > +++ b/drivers/event/sw/sw_evdev.c > @@ -36,6 +36,7 @@ > #include > #include > #include > +#include > > #include "sw_evdev.h" > #include "iq_ring.h" > @@ -50,6 +51,84 @@ static void > sw_info_get(struct rte_eventdev *dev, struct rte_event_dev_info *info); > > static int > +sw_port_link(struct rte_eventdev *dev, void *port, const uint8_t queues[], > + const uint8_t priorities[], uint16_t num) > +{ > + struct sw_port *p = (void *)port; (void *) typecast is not required. > + struct sw_evdev *sw = sw_pmd_priv(dev); > + 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) Do we need to set rte_errno = -EDQUOT here too? > + break; > + > + if (q->type == SW_SCHED_TYPE_DIRECT) { > + /* check directed qids only map to one port */ > + if (p->num_qids_mapped > 0) { > + rte_errno = -EDQUOT; > + break; > + } > + /* check port only takes a directed flow */ > + if (num > 1) { > + rte_errno = -EDQUOT; > + break; > + } > + > + p->is_directed = 1; > + p->num_qids_mapped = 1; > + } else if (q->type == RTE_SCHED_TYPE_ORDERED) { Will this "else if" have similar issue shared in http://dpdk.org/ml/archives/dev/2017-March/061497.html > + 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(struct rte_eventdev *dev, void *port, uint8_t queues[], > + uint16_t nb_unlinks) > +{ > + struct sw_port *p = (void *)port; (void *) typecast is not required. > + struct sw_evdev *sw = sw_pmd_priv(dev); > + 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++; > + > + p->num_qids_mapped--; > + > + if (q->type == RTE_SCHED_TYPE_ORDERED) > + p->num_ordered_qids--; > + > + continue; > + } > + } > + } > + return unlinked; > +} > + With above suggested changes, Acked-by: Jerin Jacob