From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0069.outbound.protection.outlook.com [104.47.42.69]) by dpdk.org (Postfix) with ESMTP id 7D07F1B300 for ; Tue, 3 Oct 2017 11:09:48 +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=rlFyrlB1ce82fayoe0nl6Cnhqz7N8Rs63f6NVa0Aqbo=; b=CsiumNmKyZzvoWpIIzjw8v4KY9/oC4jEDnLixfyuY8CZdA9e0R6al9gdwy6JEaFkEYn6EGABwl1miDbJgAfv6trOSf79Ka8LfCUYUHz2FmHVcwJU9s5eG0/7c1602vaAXjWk+X9F5t/4Xk0oYjcrnRgegJ1ADckaBOfFQpGzu/U= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from PBHAGAVATULA-LT (111.93.218.67) by DM5PR07MB3465.namprd07.prod.outlook.com (10.164.153.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Tue, 3 Oct 2017 09:09:44 +0000 Date: Tue, 3 Oct 2017 14:39:31 +0530 From: Pavan Nikhilesh Bhagavatula To: "Rao, Nikhil" Cc: dev@dpdk.org Message-ID: <20171003090930.GA24594@PBHAGAVATULA-LT> References: <1506028634-22998-1-git-send-email-nikhil.rao@intel.com> <1506028634-22998-4-git-send-email-nikhil.rao@intel.com> <20170921154352.GA5744@PBHAGAVATULA-LT> <0327e0b4-d632-a542-1b63-d48174401e29@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0327e0b4-d632-a542-1b63-d48174401e29@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MWHPR1701CA0007.namprd17.prod.outlook.com (10.172.58.17) To DM5PR07MB3465.namprd07.prod.outlook.com (10.164.153.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 38ae3558-6c77-4c92-11ec-08d50a3e7e10 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM5PR07MB3465; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3465; 3:e+PsDFmXIfxjOAv/BTyTB9QYtbPjmIFMUZMKzsLJcuF7I2hqR3fy0AwmKgrwp1RgGgSfvI3aIc+uPs5WN4wlkcrx4tJtS3Afmjp5LiiS0OyILZD4KyJKvCrhAGk39W/h8po85u7foYrFZlpMcmfQRTAPKofbhZrK8Blam0uQlLfv93nWcbO0VIK1sKfDhMXlJ0zN1E4Yjq6x49bbPds8Xjob3t6Sm7DJGUvSoIZiDplCFap3IRRl88OZqRGFZ7Jm; 25:XgIrKV4J9ZdLD8Hs6C5V+oabiFNOjRPF+Xol37uibL6qkwL4vS8DDH1ztNB2GpoEN6Eus4FCZdVSpEQTCKqtPnicqWOtW3VxjJ7eJoeFCNXtK4lWvL5CwVfSFgCLM2LRM7aHaseaQD0HtWESWk0vCu0hhlU+j5KIMBSU+oP9kTnQG220iPegwX9MQv+DbP6k8kLH06OazXamNlBZ7EHL/ueO/NFumhwiU/0K1aJ+H/3eV6LtjZ9fjLaTnuZ2aaXRW+M0lrdK9LCKF3T+DYUT9bB/HJIFgd+5Ab4Fh481Kf2Uz/H31ZBzAIuEJXpnTbW3eHPY5ETBatsEKeAcTO9eXg==; 31:NTYOHOYF7nOxmnVYWqF5GkCi1ClLFaNrrtzEQIpzRLZBuJI5WcsSUi9IvDobYzjaB+Z4fk8uQXZOkHJzqGnGbsQ4ZMS8fBStW/yOd9qjf9Emc5kUDNjfRIqca1lkxUzRyZmHlm/zXVF4hAUK9Wou6AxPlGDHMpu7NwX0wONXz+eRR5voNHdfGYhrZuvyDXCoBauFP1rDJ05GWUgvnGvLHJCkSiArRG2hFY1U6qhlLQ8= X-MS-TrafficTypeDiagnostic: DM5PR07MB3465: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3465; 20:iwRc8E9Kj5lEvDihPNsXI5lFOxpr9K9wGg1GIzjpedW00ATCLwsqjYhCEShkRMuH/1YpQZrQyo5C3Z88x8UmXijoxTA/J7TNxWrPgFE29m6Xr7UbBpmcZhaSqzAcfXPj6RE7fUsEWY5XMVYlsIjMxVu9mthY3ybpC9wIgfk2vCydOEM9rQ+Wn+kzPhrNgKYbmoD8eHLWfIIxQmdOnoDzdGIokw2zD4jJL4akLuN4Dp4euhnwKeSvf/1xS70UDXABpcTNdvxrJnbnjHRfnhumXVQZBn6ZUMJRApYKM6UPMHywg6dNbk8/3g2LL8tTQVS8qZryt0gAIrJoQKf2Hq/y6UosyT8YSGrT8nZU/bLd37PdnkBwfWB/4lWWjWnMcnw4g9dg+JTz1KLnllRc9QHIiB4vhoOB0ztjyNn5iMEjpmq6iu3oN3FFI0LJn4o41rKoYMtgrcZskbxVMEHOn98lMdM9ykUjwMfigG+QlSodBzJA0YV0knauROXAPyHRz2HXC+QEnpHP3743UHGAVok1PC69uQ4tnbaWEs9myk61RyIyNYKUkTKsHTC2t3au2OEgJFRZoRxDEr5zn5rXb2pV42rfiHhBtMnmESF4zn1Hy2s=; 4:OhpUQuyQf0CyW9rvgFRKvkrOsRbhHBlJLZatxV0TcClEwfcmr9p9CkSEael6ILddnDrcl/mHGDAJn1myEkDwZuRHQh+G982G7Lb3XNFeNsY3VEQJqDTlPigDSHFAc+Sqp+NBe7VYmTWWUPOnDc68Bv6dW6QgLyaPAk/YmT4EaJWIAmlR40qqZi/k8sGruyiv/MLRlhUc7dWAD1CkeSMDflMZqOsvCnwd8X3FklQlguMDqnyqkpi8DeWFdPfJxJPp X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(100000703101)(100105400095)(93006095)(3002001)(6041248)(20161123558100)(20161123564025)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR07MB3465; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR07MB3465; X-Forefront-PRVS: 044968D9E1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(6009001)(346002)(376002)(199003)(24454002)(189002)(377454003)(97736004)(93886005)(8676002)(478600001)(50466002)(53546010)(25786009)(189998001)(72206003)(55016002)(9686003)(6666003)(81156014)(81166006)(42882006)(6916009)(2950100002)(316002)(58126008)(16586007)(7736002)(305945005)(16526017)(83506001)(5660300001)(8936002)(106356001)(5009440100003)(54356999)(47776003)(50986999)(33716001)(3846002)(76176999)(105586002)(229853002)(6116002)(23726003)(4326008)(101416001)(1076002)(33656002)(53936002)(66066001)(6246003)(6496005)(2906002)(68736007)(18370500001)(107986001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3465; H:PBHAGAVATULA-LT; 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; DM5PR07MB3465; 23:I1Gn8KKUQKLSn2moEO4F1RC2p3guzqdWhOOiTv/Fz?= =?us-ascii?Q?+MhbItKE/U1B9EC7rk5vrbxDvRl4zH2VlEDdwl1tqk9K9sR9njmKWaVCVcok?= =?us-ascii?Q?snvTumT5BTfYNov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hvAbdhgFo65d1GLLZw==; 24:5TWzaKEvKh98pqJuUvPZztXO8G0flp7BYc4su/a9JLnSwHygbUwkCrC1mCznVRUI93axL7ogE7PJ1jESHmpkhb+njKFqAwBwdUU/3gVFH14=; 7:2gPGqDVkDfdG6WgtuQBHSEpebA98I0TWkWXvJWNWqLh1g4Zcue8+nGwWZ4vDAE0ehi36B30S+ktHDrQBBXg0+UVjH5QMrbtxVhLzrolsMEZlpp6buLuIWrRn84/HTUdZGl0+ncc5w482IynvOjgOvr1mkeE0hCHSn/xEi4T0AsWDLo0nL09K4/fgKpKOVY32tShmyrK3eHJjrmqwq2uD6DCHDpZD3HAKzlKUMuqSfhE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2017 09:09:44.9369 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3465 Subject: Re: [dpdk-dev] [PATCH v4 3/4] eventdev: Add eventdev ethernet Rx adapter 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: Tue, 03 Oct 2017 09:09:49 -0000 On Sat, Sep 23, 2017 at 05:05:21PM +0530, Rao, Nikhil wrote: Hi Nikhil, > On 9/21/2017 9:13 PM, Pavan Nikhilesh Bhagavatula wrote: > >Hi Nikhil, > > > >Few comments Inline > > > > > > + * - 0: Success, statistics reset successfully. > > > >Invalid description. > > Thanks Pavan, for catching these, will fix. > > > > >>+ * - <0: Error code on failure, if the adapter doesn't use a rte_service > >>+ * function, this function returns -ESRCH. > >>+ */ > >>+int rte_event_eth_rx_adapter_service_id_get(uint8_t id, uint32_t *service_id); > >>+ > >>+#ifdef __cplusplus > >>+} > >>+#endif > >>+#endif /* _RTE_EVENT_ETH_RX_ADAPTER_ */ > >>diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c b/lib/librte_eventdev/rte_event_eth_rx_adapter.c > >>new file mode 100644 > >>index 000000000..d5b655dae > >>--- /dev/null > >>+++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c > >>@@ -0,0 +1,1238 @@ > > > >>+ > >>+static int > >>+rx_adapter_ctrl(uint8_t id, int start) > >>+{ > >>+ struct rte_event_eth_rx_adapter *rx_adapter; > >>+ struct rte_eventdev *dev; > >>+ struct eth_device_info *dev_info; > >>+ uint32_t i; > >>+ int use_service = 0; > >>+ int stop = !start; > >>+ > >>+ RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); > >>+ rx_adapter = id_to_rx_adapter(id); > >>+ if (!rx_adapter) > >>+ return -EINVAL; > >>+ > >>+ dev = &rte_eventdevs[rx_adapter->eventdev_id]; > >>+ > >>+ for (i = 0; i < rte_eth_dev_count(); i++) { > >>+ dev_info = &rx_adapter->eth_devices[i]; > >>+ /* if start check for num dev queues */ > >>+ if (start && !dev_info->nb_dev_queues) > >>+ continue; > >>+ /* if stop check if dev has been started */ > >>+ if (stop && !dev_info->dev_rx_started) > >>+ continue;:1 > >>+ use_service |= !dev_info->internal_event_port; > >>+ dev_info->dev_rx_started = start; > >>+ if (!dev_info->internal_event_port) > >>+ continue; > >>+ start ? (*dev->dev_ops->eth_rx_adapter_start)(dev, > >>+ &rte_eth_devices[i]) : > >>+ (*dev->dev_ops->eth_rx_adapter_stop)(dev, > >>+ &rte_eth_devices[i]); > >>+ } > >>+ > >>+ if (use_service) > > > >Here setting the service run state is not sufficient we need to enable the > >service on a service core calling rte_service_start_with_defaults() should be > >sufficient. > > > > Yes it is necessary but insufficient. > > IMO, > If the application is controlling core masks, the application flow at > startup looks like: > > rte_event_eth_rx_adapter_create(id,..) > ... > rte_event_eth_rx_adapter_start(id) > if (!rte_event_eth_rx_adapter_service_id_get(id, &service_id)) { > rte_service_lcore_add(rx_lcore_id); > rte_service_map_lcore_set(service_id, rx_lcore_id, 1); > rte_service_lcore_start(rx_lcore_id) > } > > Since rte_service_start_with_defaults() is invoked before the adapter is > created, how would it get assigned a core etc ? > I might have caused a bit of confusion, I meant to say that If we call rte_service_start_with_defaults() when "use_service" is set while starting the RX adapter it will assign the polling function to a service core (default 1:1 mapping). But this might destroy the user configured service core mappings. I think adding the above mentioned code snippet in the programmers guide is self sufficient. > > Nikhil Thanks, Pavan > >>+ rte_service_runstate_set(rx_adapter->service_id, start); > >>+ > >>+ return 0; > >>+} > >>+ > > > > > >Regards, > >Pavan > > >