From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0079.outbound.protection.outlook.com [104.47.37.79]) by dpdk.org (Postfix) with ESMTP id 6328E1B337 for ; Sun, 22 Oct 2017 11:17:02 +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=8uqt7CJOBS6vNvG/O3+fDiRH2UtD2mDxmnB61Vgdw58=; b=XMvlzKD9boLxBBy/hsczAjBPVDsM5LRbUyQYKGfzbuwJ5yVBG7dmR70ggIHpA/kBeddn82PeeLFmEpLl4vyrKvlqOYdNAdtVuj3Xpm7oarDQtg7BuaNV8mS6iV4clEmlr7nUJWjiWLrhO/qFOQUz69wYTstg9acERa5oKkP8f1A= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (103.16.71.47) by BN6PR07MB3460.namprd07.prod.outlook.com (10.161.153.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4; Sun, 22 Oct 2017 09:16:59 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, harry.van.haaren@intel.com Cc: dev@dpdk.org, Pavan Bhagavatula Date: Sun, 22 Oct 2017 14:46:23 +0530 Message-Id: <1508663785-15288-5-git-send-email-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508663785-15288-1-git-send-email-pbhagavatula@caviumnetworks.com> References: <1507712990-13064-1-git-send-email-pbhagavatula@caviumnetworks.com> <1508663785-15288-1-git-send-email-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [103.16.71.47] X-ClientProxiedBy: HK2PR04CA0083.apcprd04.prod.outlook.com (10.170.154.155) To BN6PR07MB3460.namprd07.prod.outlook.com (10.161.153.23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d57ecca8-a3d2-4b03-97c0-08d5192da711 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199); SRVR:BN6PR07MB3460; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3460; 3:uvn4Frt7R3tfr3QFbqkdja5VVwOYVH8SZeza/8tubRq61hiOyAvuXDme27Lfppx8KRJGXwajdP3JD2PupmSK1o9PGlvRhiUT7qBLut2kJt/sORBOZO5ftQmQLk4uBADJ1vY7BL9ZO2ktPwMczRfJyYYPhwh9FFGwMsQHDbY4LonrR0QdwIwvJTKAJmhXZt82h4G2ieFIvVctH3mkKFzdHfJyeQSrrtFXbldh/OA3xCaVJkfCTQy8dlkFWBQm5VxD; 25:5ayKQbvs8URtszwyyIrOuFVgh9HDuN/3pbf7OlJxrFKaAWGAm+OIqV2Gcm/PM4xfOofHx2stocqf0LLk0Z2fPbaRjRDEs+IHz2w4kIw9q/maqYn9ASOlHfKbUYuNcSW1JCtp7udLvNtgEqb4w+e8ZGOWIrMDa44O5enS0jWkuKsci9FVHcnYR/ciChcXVgAOpLQnfOBm1bU76yRakPs+NLetNhCqKd59VBK5ZcB75iE786G1q8Pn6eg/teFB92hd3M/BkJker+zZdxpO3gTKVaM9KjuksgIR2UN09FgaVnxjh46F5JED8KKkZwnmdC0O/qeibHn3JQ7+evGYmm3nxw==; 31:B1oKkGc1HbofB1wXTRQhjZ2pYwuXnkVIZHCy8rOSc4COWWibDoftAAUNcujdYKD8G4UsgEfkB0KM9QZPj2DQlsHhS0rtl+JQ5m1VPo3LAeT+OdVrw3283hU6QhA/tSqnVE0t8LwG3c5EUjunNGFtcepk3aSsugDOPFXUFMeSU2pBCN5Bk3gy3Pj7PjP7GIOfpPeC4Mlnwo83HxMjf1l++tuhoHlbb6GZc40KICpDccI= X-MS-TrafficTypeDiagnostic: BN6PR07MB3460: X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3460; 20:CrY6rAMfWT/sCpOTRwVVBKINLc6TsWmroShHmM0jcwUlS24sERcD18KfCHwOH2JRptjNyNB5S9CI1pEew8CYXYffih1Qpl2t5hePre0cJjpXzJZ6tAkIOzK13xuI4ydjLtHZIuWwb2+vRL1qQvdoHcYueeUuEIqOaoa/tZOaRDvhKTv1ubZShgsb9Jtb11L5YetjTPU2mqduwVelReMAKUbiKmrK0X0OsOnc8A1pDK3l3x8jndMaGdlHY66W0YnP6Q2DOeNjVx4FK+dxzF8vkFEuSW7ds55KtX0i3HaWdA01vbCtIQkRG5DVdujMELknzOlVqMNETNfeCDSsbJWGjU6wrPx1CgL8tBuvrTaYx6CfMvCwf2/xHHyD4AiBupeFbDp/CnFJ0ws1i5CygEi6gEzhkTcnvFL0FEITbhIeNsovI4bf5xXqqjKr1W3goLQ/oApBXBzthfSfl/Ck7aSM8Aa0zFQBUoG2KDCxgwzf6yhjYj4mt6eurcGQHVpTDu2gwXlT8yt516ynBDC0/GyHQazVYHu5LrTZ8j2F+JdLz2cEoJ+rm5N6QHq2KLI/FFb9kTnHYcxwIXMlh1dDy+I+WSu7r8FHxqbf+G5pa7aWwU4=; 4:RzyHg19auRIlj9A7AVk0xTdsT8Xqw8P8/Onluotk0bdbitM9ehOqJf6FzqFCZfKocra61OgoLDPAQ+hXHV6eZpK35/0vX2TmREkUbMcmPOokGepRrwA3hSNU7c0lcMz8kmU7T72uGIzDTBeiDx80tECJ/xAKusg8GVhvb35MKjXTNzJgvlP8wsDY84BxqgGYoN0AGl9aOjboRUVyJAt7CFsPra6U1VnRquD/l0sIuQ4HQD7ZQnIjLnRkhy0X9tbe 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)(8121501046)(5005006)(93006095)(100000703101)(100105400095)(3002001)(10201501046)(3231020)(6041248)(20161123558100)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR07MB3460; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR07MB3460; X-Forefront-PRVS: 0468FE4A2B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(346002)(376002)(189002)(199003)(72206003)(478600001)(8936002)(3846002)(15650500001)(6116002)(6506006)(6486002)(7736002)(66066001)(50226002)(97736004)(101416001)(6666003)(2906002)(8656005)(305945005)(189998001)(8656005)(5660300001)(16526018)(76176999)(50986999)(33646002)(47776003)(105586002)(81166006)(81156014)(106356001)(2950100002)(42882006)(68736007)(4326008)(107886003)(316002)(16586007)(50466002)(48376002)(5003940100001)(25786009)(36756003)(53936002)(6512007)(8676002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3460; 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; BN6PR07MB3460; 23:9e+TaJs05WHZOWCRsvNtAxzkAbrFvCez7I5jXV3xc?= =?us-ascii?Q?VqB+V8+WrSkWEXjI87Jqu+v5oX5+8/RIsvy4Tj5k0VwcqJ+ZGs54rrHhasAv?= =?us-ascii?Q?5aKbZQ1Ji0AA9Q2dzT3nj8a4klZm2snVunVcf3hgopBBgSf7yBHztRCiIYlD?= =?us-ascii?Q?Y4DLaWWKY2YeGs17l1QwJCp/5/uWof6oBzE//8htDlxixKBirtHs0dsHmg8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9tYnPVEPx6QFkq6MWWbjFf5LayQobk?= =?us-ascii?Q?Vvy08N+VsWV3a0YiYiwgKbeoNtW4L8PUVL4Rtq50xr0UuAQep4cayQKjesD+?= =?us-ascii?Q?8CgENdBZ22AxD8=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3460; 6:N8mIGuJlpOQmilEfBJCddRQKU8CP8j7UvM3oBE6hWprsK/ATYN7hcA1wI5vyYnM5pkLXIoIPODK6QcSyUwuWt8DEcey+kELhNL3ZsV74E3zSqSHA7/tqAiRqgkL9StpBXYk8h8svBFmbsjZKdW2gQdO3W+OeiSpxQ88cK4KxW99Ls4ViaRv5SULkUxFUhMjE3bYcbcotCrkf0Gy6Og4n5mJlXVT1XUQmMR2HGZ+DisqtrEZNgdgrx7fNJ19Op5Em5C0LzXjmpdPaDS7Pm0/AH6HWo2YLvS9kn3a5Keq51q3EXO7bRkDveD2WHe6iMecabQ7yaoxom1HAs5y8CkP9IA==; 5:ahSbWTEi74bif5NRmJbENshpkAU6cY/5LyB0/PCDaF0GA45xkGADz6xnJGi8XAlOrtEByW/ab+9/hjC0QfGMcXamGjVV4YwPoqXd9wlRtlfVzheMLYUmgcyhu7oxwtQzj1gQgdYpGHZ6foFajmB4GA==; 24:MmqznfGOJJFPSo+2HmxFX4mrSDH4Kn2CFDbek7E4qIiZ85CSCXHjrWrAMuolWTgleIeubXsWCOTQ+SmImJ8GyjoAdROyO2R/P0xxM5hnGKs=; 7:TOvvAtVIfqV7zgjg/o7qqparNV3SUWiuFNsEnV60+zyo17Dner4q7inL37kJy94mbl/FxmHdaHXvmqKh/w61YPYTogy6MQFZ0agZXGEJUugD+zsu6FpG9meekFowR+0Aonya8qLsGyTufzMmsjszy9bpGGMLzOBYgrMSdhemq3eXjFdRSoOv3QKFYPhllwSh4ZL1U144sJAQgCqwCpi+n4ODCaC/z9giqQvy0gPBdQk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2017 09:16:59.0589 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d57ecca8-a3d2-4b03-97c0-08d5192da711 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3460 Subject: [dpdk-dev] [PATCH v3 5/7] examples/eventdev: update sample app to use service 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: Sun, 22 Oct 2017 09:17:03 -0000 From: Pavan Bhagavatula Update the sample app eventdev_pipeline_sw_pmd to use service cores for event scheduling in case of sw eventdev. Signed-off-by: Pavan Nikhilesh --- examples/eventdev_pipeline_sw_pmd/main.c | 51 +++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/examples/eventdev_pipeline_sw_pmd/main.c b/examples/eventdev_pipeline_sw_pmd/main.c index 09b90c3..d5068d2 100644 --- a/examples/eventdev_pipeline_sw_pmd/main.c +++ b/examples/eventdev_pipeline_sw_pmd/main.c @@ -46,6 +46,7 @@ #include #include #include +#include #define MAX_NUM_STAGES 8 #define BATCH_SIZE 16 @@ -233,7 +234,7 @@ producer(void) } static inline void -schedule_devices(uint8_t dev_id, unsigned int lcore_id) +schedule_devices(unsigned int lcore_id) { if (fdata->rx_core[lcore_id] && (fdata->rx_single || rte_atomic32_cmpset(&(fdata->rx_lock), 0, 1))) { @@ -241,16 +242,6 @@ schedule_devices(uint8_t dev_id, unsigned int lcore_id) rte_atomic32_clear((rte_atomic32_t *)&(fdata->rx_lock)); } - if (fdata->sched_core[lcore_id] && (fdata->sched_single || - rte_atomic32_cmpset(&(fdata->sched_lock), 0, 1))) { - rte_event_schedule(dev_id); - if (cdata.dump_dev_signal) { - rte_event_dev_dump(0, stdout); - cdata.dump_dev_signal = 0; - } - rte_atomic32_clear((rte_atomic32_t *)&(fdata->sched_lock)); - } - if (fdata->tx_core[lcore_id] && (fdata->tx_single || rte_atomic32_cmpset(&(fdata->tx_lock), 0, 1))) { consumer(); @@ -294,7 +285,7 @@ worker(void *arg) while (!fdata->done) { uint16_t i; - schedule_devices(dev_id, lcore_id); + schedule_devices(lcore_id); if (!fdata->worker_core[lcore_id]) { rte_pause(); @@ -661,6 +652,27 @@ struct port_link { }; static int +setup_scheduling_service(unsigned int lcore, uint8_t dev_id) +{ + int ret; + uint32_t service_id; + ret = rte_event_dev_service_id_get(dev_id, &service_id); + if (ret == -ESRCH) { + printf("Event device [%d] doesn't need scheduling service\n", + dev_id); + return 0; + } + if (!ret) { + rte_service_runstate_set(service_id, 1); + rte_service_lcore_add(lcore); + rte_service_map_lcore_set(service_id, lcore, 1); + rte_service_lcore_start(lcore); + } + + return ret; +} + +static int setup_eventdev(struct prod_data *prod_data, struct cons_data *cons_data, struct worker_data *worker_data) @@ -839,6 +851,14 @@ setup_eventdev(struct prod_data *prod_data, *cons_data = (struct cons_data){.dev_id = dev_id, .port_id = i }; + for (i = 0; i < MAX_NUM_CORE; i++) { + if (fdata->sched_core[i] + && setup_scheduling_service(i, dev_id)) { + printf("Error setting up schedulig service on %d", i); + return -1; + } + } + if (rte_event_dev_start(dev_id) < 0) { printf("Error starting eventdev\n"); return -1; @@ -944,8 +964,7 @@ main(int argc, char **argv) if (!fdata->rx_core[lcore_id] && !fdata->worker_core[lcore_id] && - !fdata->tx_core[lcore_id] && - !fdata->sched_core[lcore_id]) + !fdata->tx_core[lcore_id]) continue; if (fdata->rx_core[lcore_id]) @@ -958,10 +977,6 @@ main(int argc, char **argv) "[%s()] lcore %d executing NIC Tx, and using eventdev port %u\n", __func__, lcore_id, cons_data.port_id); - if (fdata->sched_core[lcore_id]) - printf("[%s()] lcore %d executing scheduler\n", - __func__, lcore_id); - if (fdata->worker_core[lcore_id]) printf( "[%s()] lcore %d executing worker, using eventdev port %u\n", -- 2.7.4