From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0050.outbound.protection.outlook.com [104.47.32.50]) by dpdk.org (Postfix) with ESMTP id 3E717FA70 for ; Mon, 6 Mar 2017 17:52:14 +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=9fdOu0+yDP0fUd1LY8uTTWDsz0vM8DsVxZQ/+5cJBN8=; b=LL3YhfIuVRb6EBKIwKJDuaEaQVJjrU3/a/sm0e0m7AFptwHuRNGbaN9ch+kzojjEHLN60TS/TfRFGODEpFP4m4ydBt8kzpT7y9duXyYFK5Yvx8PECCPgknx0T213qgPUFQ+BUigpd12/dojqJHXkBVRTjHdGeJ4SnmYK4BeK/eI= 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.230.99) 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.947.12; Mon, 6 Mar 2017 16:52:10 +0000 Date: Mon, 6 Mar 2017 22:21:54 +0530 From: Jerin Jacob To: "Eads, Gage" Cc: "dev@dpdk.org" , "Richardson, Bruce" , "hemant.agrawal@nxp.com" , "Van Haaren, Harry" , "nipun.gupta@nxp.com" Message-ID: <20170306165152.GA12775@localhost.localdomain> References: <1488430056-32055-1-git-send-email-gage.eads@intel.com> <20170306130625.GA4250@localhost.localdomain> <9184057F7FC11744A2107296B6B8EB1E01E6F9F5@FMSMSX108.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9184057F7FC11744A2107296B6B8EB1E01E6F9F5@FMSMSX108.amr.corp.intel.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Originating-IP: [106.200.230.99] X-ClientProxiedBy: BM1PR01CA0010.INDPRD01.PROD.OUTLOOK.COM (10.163.198.145) To BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) X-MS-Office365-Filtering-Correlation-Id: df8c61c7-f320-41d0-c70f-08d464b12317 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 3:vkhPWozSeYXdLNXk4c6w5ib6ozM7o2j5JBUOIS+pjZFZnjOH6O7oYg8LZoHJNM5PPPyem3yoo77MwmjgUCgeuuK59WZbmawv3CQ3/cnZkv7dGLAsYaONG1S7tq72CzcCWRC1hlVpwotn7mOAaiF9H91qXVpUlMizX8rAqfYrGunpyaNPgw7CODYE8sMfMkWjF+pjLd8iwqK9L9TZHyIdfS8zbBTnVUxV5LsKewRwsirSligR0MQIsiScDoEnl9rr2Me1UWle2ICbCYohEiewsg==; 25:b7T75a7Y5WWeBgMTndv6s0mas1grYgeMMWuPgHxfpJYJxVh6A6wdA8z+iuKbCDHx3S+DeQGERuyYlajlIcyZQMUX9rVWsxriWYIoUj0v/3LrL8QmZAEzjngSPtHABP0q8SgVb0a92NENKfUavAPNk4xZdS39SaD1otGue7dIw86NQ0BnPenRnxkYRdEv9tiRbvkeIWjzysZU2s4UVVk8VxPcxC7Cvp1fyZhv7t4NvVXp+htHvMZf6upL0HjSn35sucMh7zdEXY6k4A7oT2c4KXppcUFCAHJ0tjKy6Oy71DE2LqWiHR8bF8F0vLlEMr+0tXX6N8tvvBT3Mk8hIdHa9JeTuug+EGFrSHd8qf0qgkpghCvRG5eQMNdZCR1uRLX6mN27ayn7rEbdT9gTAfMMLSZeBiPJoyZyhZkbcOBTXft64jIUsHoMJ+WOoHqprSUxyP9ARwSg7CnMxaf+zES08w== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 31:8EN4t6qGb7DjEUvqo6ucY7OxVBYgdlcvjlwYtqJMRH5A8SHzvbRMi3gw0bFUb0NbMwRPWPr9lHB7Yrn+dYKvxZxmPXBy8RlgeG1xKO8/Py4DlRAH2zuwiv8QNJ01FISfCndQeSPnVgMbZF8hKZvVBwvQGnjMlYyWqRQMzPdPOwvDuvKwmhHW6NL22QMkNCMRxePkflliR7KMJb6/EVFb4BnBvNbKeY0a1AWLCsVDkcniECW2K1dJ2o6GUXGuj54v4oCX0VAVh0xs+CD9GS0zYw==; 20:vEaXBYC9rhwcR2oB+qX7I24GDGauCdFQdAZKYeGORVn/+CYMnREEmCJOLPzBMaljvP4Y+OUHMnTK81LnyurvXPIDg42zSjUZDfGuh2NqVCAJJwT2v326BXc66MOibPDHBBZwKo0af59WOBeb5svJyTMz48QryMnnYLolTcTJh+g1OlPVK3G9YdeIxBlUO23lRDQ7tcgXAXvBeQUeYaRnQQS1LaRfaXhvS3vjMajrJI/y5ZX2lQjVvvvQSNYURtyd5+wT3dw8sIRh0SJeitoXvKXcH+lZd/cSIJl7Qc0jibq45A/pzyV22B8ZK0i+j/NbThebAx+zh5S+ihwA5ZioMn1uBnJCbfaiqejTXwig76nQWz7uG1+kG5KHG//xHNTJ2p+4KrE+xGF74YiQDsJnr5tImw4vNUqAc1kgWkuasFV23yAsiy4m51kN2PSKPaVX9DJA1SwEjzrZP0iLcBjHlc9SomYGaT//AxR4h90KAKKF4BAS+/WsBbEFpt+/TsP673RFSUnoQ2KyoYZ6dKSkwaxyZnipV7rhgVWUzBQil5xWjEt6blM5QFaFpdr+UW6XIRGZyzKktg92nckCHracPnIhTedqn4CPea/71idY+b4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123555025)(20161123562025)(20161123564025)(20161123558025)(20161123560025)(6072148); SRVR:BLUPR0701MB1714; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 4:9D/ihI0LQZ6hHO0WvZf9Fq7/YPmCITRCSCV8dkMOgImteuc5j5dKRjfRlX0mx4OCdr/LsGQ9kccZwROcrKR55JgHZHgyk5ONOqbnSHGD2NPVFJ42qHj1Ckp0PtWFLdwOePiGeFntY6wfJoVkDZ2+YEnTfSF2wagMUDMVBqXqkcnQ09Ub4Dpm3hFZoA64V/91L2fEF8jg2CSZGL2oAVYtUc3K/wKj8Xl25yrGi9dFLdULHgKBTp8Qng56QKQgBm8ygiUvdi+1GfhM3cfoAFScJSojl5Hqr8C13l+Lc6H8SD+B+8uncZ+yoMUkYLeQoCTGi7FZn0LjIbNzEFjJYhD/9KukgM5VS8pM0/F5ctcgUUmU5ELHkF7Xo8GvRlKDCg29x62yP6w2C7pyI57qvR1gAUKlNFILlDFbGE18iXKGpBLec8VXnZuPdYsBQ6MtljoyGh08VUr6iZKBZe3vEQAjs3BMNqKAK/mAZMcpQmdx0aSIXZwtEl0mUP2qgMfpOKEjidARpFC+JoTrlNHqcPsGWH6klmM19UZs0XHtMon1fSdn1rJGBcce/Z7K6epJxQdyRJUSFozvV31B4yeoLJS9GeMJo9D/siQVjvwgMSI7aPY3HQVORXrX58mKw13NqdUEaamVuiTshgpgzv+VehLT7zdIb4jbBCYEnBoznxL7yRNZm5PDzXgw+LgSdOCLaHw7 X-Forefront-PRVS: 0238AEEDB0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(76104003)(377454003)(13464003)(24454002)(110136004)(5009440100003)(3846002)(6246003)(38730400002)(23726003)(6116002)(66066001)(4001350100001)(1076002)(6506006)(81166006)(8676002)(53546006)(9686003)(50986999)(76176999)(54356999)(25786008)(83506001)(55016002)(8656002)(61506002)(47776003)(54906002)(7736002)(6666003)(53936002)(33656002)(305945005)(42882006)(2950100002)(6916009)(50466002)(4326008)(2906002)(189998001)(92566002)(42186005)(5660300001)(18370500001); 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:xGSdQor4nzP9N5MmSi2KR90xVNhLJ8/G5zAPGWr?= =?us-ascii?Q?FeQz1FG7Nls63rQuQ2uL/gyn5d4SwMXxwC0oIXH7ABMzw1475oDTepN6I+c9?= =?us-ascii?Q?Q+l+SQ1DBnf8NgKN3EmfuSjcLvSXC8uit6/RA5PMa60Hfn5AXZqwmxlkBxak?= =?us-ascii?Q?h2YE7zxBfSnIoLTgQPitoD/P4hI8VxA8sta7z07rKnC/Wit04gFhNEJt788A?= =?us-ascii?Q?zRqHenzTTvJM9N1Rno4IEggbHTRH+jDlJk4zeTb8B3PjRYqjfqbuGcfUH8r9?= =?us-ascii?Q?NSYaTG8izXxaGUaHv4L+lrkjsCMxd9R2qV6U9WkiAKQMU8CmG1eO0wYyBaIb?= =?us-ascii?Q?luJmnQ2v1/NiEbaIMHLnCkfbnL2TJ27HDKsvGzPfEX5BvIVxDXxrksjH+4nw?= =?us-ascii?Q?VY9zJb5SXmmPoqTgHKKVQBGwKlVZ2LPCSaz8IbOjXwQW8C3vnw6vV3Y9k4ao?= =?us-ascii?Q?fOCNgFoeRrN986P6eDRdFj0KfGnKMGA/msy0OcyajJnm3wQD8bbtI7oqhtuO?= =?us-ascii?Q?rj9pufTvw5g9ZFD8dAUameoy1w7qDuHwIv2n1h7Ojre6ljfImj5qQK3hUAcy?= =?us-ascii?Q?pqxYUU4UkK5a2D4VejGrZJlIpptZaRXIUZgd5v59FBrNbgLmQtm6q6vatVX6?= =?us-ascii?Q?jCuigL4TD4sEING7+M63h+kLW6cEkSLTudfTBQi6FH3Q4IOrevY3XP4Or38l?= =?us-ascii?Q?JFMQRFJyRxTbxH2ZixT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sUYtuqtMOmmKHP2zH1eQ==; 5:QtAEDKy9Ca2jLdw1IzutJ0neOQOWI9hOoYaoMRgccGvAVs+6jX4viCOLsHDKRZIv1iaUXENGkO/fzVVGMV4rGtoYq7ilyMYZfX7KtmfkSdTVWQ7iWW7ATxFxffJwxnEDbBeqCh+xLmvOmflE+0lCFQ==; 24:2julQrjdL7+bdqQ/AYnX0vHc0Gucm0KxrtgOZkmV/aVx2WZI/NOIGJIJ9y34wDvDNXtr6PFU/zwEV2jZmHi/qJ6GmSB4+P8t1tSrCrpB0DQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 7:0riGKjh6qqrJkhhqK5jOCvDF92zrnaG859y55TP6ganiLXWC4IJ66IHcXzvOoJCzZdi7xB7HCgQxb+k0mHo2E6Gw+88apSMDITwxVnMkksuH5Mki1tq5lV3ATZq/Hp6BJF5iK9Ur++Im2tYr6Bnq2bg1/ryWoecZ5hvlJpVUS/AjVY+xR4zAxLwZo/BFlKAJc71b/SpUm0yfweIn2L0HAIlh434n1dDSNS+oM9CeX2izxCsdiFwTEtchw8D3zVTW4qFbmWKKtFwmjhr/mRKsykxMI2qcG5aZtE1soui/fQv8XhoXve0lsdWyAnyumNnO4NASouYZgHuaomu+31SK4A== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2017 16:52:10.2220 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1714 Subject: Re: [dpdk-dev] [PATCH] eventdev: Fix links_map initialization 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 Mar 2017 16:52:14 -0000 On Mon, Mar 06, 2017 at 02:38:05PM +0000, Eads, Gage wrote: > > -----Original Message----- > > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com] > > Sent: Monday, March 6, 2017 7:06 AM > > To: Eads, Gage > > Cc: dev@dpdk.org; Richardson, Bruce ; > > hemant.agrawal@nxp.com; Van Haaren, Harry ; > > nipun.gupta@nxp.com > > Subject: Re: [PATCH] eventdev: Fix links_map initialization > > > > On Wed, Mar 01, 2017 at 10:47:36PM -0600, Gage Eads wrote: > > > This patch initializes the links_map array entries to > > > EVENT_QUEUE_SERVICE_PRIORITY_INVALID, as expected by > > > rte_event_port_links_get(). > > > > > > Signed-off-by: Gage Eads > > > --- > > > lib/librte_eventdev/rte_eventdev.c | 17 ++++++++++++----- > > > 1 file changed, 12 insertions(+), 5 deletions(-) > > > > > > diff --git a/lib/librte_eventdev/rte_eventdev.c > > > b/lib/librte_eventdev/rte_eventdev.c > > > index 68bfc3b..b8cd92b 100644 > > > --- a/lib/librte_eventdev/rte_eventdev.c > > > +++ b/lib/librte_eventdev/rte_eventdev.c > > > @@ -190,6 +190,8 @@ rte_event_dev_queue_config(struct rte_eventdev > > *dev, uint8_t nb_queues) > > > return 0; > > > } > > > > > > +#define EVENT_QUEUE_SERVICE_PRIORITY_INVALID (0xdead) > > > + > > > static inline int > > > rte_event_dev_port_config(struct rte_eventdev *dev, uint8_t nb_ports) > > > { @@ -251,6 +253,9 @@ rte_event_dev_port_config(struct rte_eventdev > > > *dev, uint8_t nb_ports) > > > "nb_ports %u", nb_ports); > > > return -(ENOMEM); > > > } > > > + for (i = 0; i < nb_ports * RTE_EVENT_MAX_QUEUES_PER_DEV; > > i++) > > > + dev->data->links_map[i] = > > > + EVENT_QUEUE_SERVICE_PRIORITY_INVALID; > > > } else if (dev->data->ports != NULL && nb_ports != 0) {/* re-config */ > > > RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->port_release, > > -ENOTSUP); > > > > > > @@ -305,6 +310,10 @@ rte_event_dev_port_config(struct rte_eventdev > > > *dev, uint8_t nb_ports) > > > > > > if (nb_ports > old_nb_ports) { > > > uint8_t new_ps = nb_ports - old_nb_ports; > > > + unsigned int old_links_map_end = > > > + old_nb_ports * > > RTE_EVENT_MAX_QUEUES_PER_DEV; > > > + unsigned int links_map_end = > > > + nb_ports * > > RTE_EVENT_MAX_QUEUES_PER_DEV; > > > > > > memset(ports + old_nb_ports, 0, > > > sizeof(ports[0]) * new_ps); > > > @@ -312,9 +321,9 @@ rte_event_dev_port_config(struct rte_eventdev > > *dev, uint8_t nb_ports) > > > sizeof(ports_dequeue_depth[0]) * new_ps); > > > memset(ports_enqueue_depth + old_nb_ports, 0, > > > sizeof(ports_enqueue_depth[0]) * new_ps); > > > - memset(links_map + > > > - (old_nb_ports * > > RTE_EVENT_MAX_QUEUES_PER_DEV), > > > - 0, sizeof(ports_enqueue_depth[0]) * new_ps); > > > + for (i = old_links_map_end; i < links_map_end; i++) > > > + links_map[i] = > > > + > > EVENT_QUEUE_SERVICE_PRIORITY_INVALID; > > > > rte_event_port_setup() has rte_event_port_unlink() at the end of the function. > > On rte_event_port_unlink, we are doing the same operation(writing > > EVENT_QUEUE_SERVICE_PRIORITY_INVALID) and > > rte_event_port_links_get() should be called after rte_event_dev_start(), If so, > > Do you still think this duplicates writes are required? or Do you have any other > > call sequence in mind? > > Ah, I didn't realize that was a purpose of calling port_unlink at the end of > port_setup. There is, however, an issue with initializing through the port unlink > when called by rte_event_port_setup(). The for-loop in rte_event_port_unlink() to > reset the links_map runs from 0 to diag, and diag is 0 when the port is being set up > since it has no queues to unlink at that time. (This is at least true of the sw PMD, > but would be the case for others, I imagine.) I see. It was not the case for HW PMD. But if it is helping SW PMD case then we can use your original patch. > > Perhaps a simpler form of this patch is to copy that for-loop, with the bound being > dev->data->nb_queues, into rte_event_port_setup() after rte_event_port_unlink() > is called (if it is successful). What do you think? I think your original patch is fine. IMO, you can change the commit message to reflect the issue and send v2 based on your existing v1.