From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0067.outbound.protection.outlook.com [104.47.42.67]) by dpdk.org (Postfix) with ESMTP id A8DF41B7BC for ; Fri, 13 Oct 2017 18:37:22 +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=QwWAUDHkfSLJEboFTo50nxlfhVCJw1QAvyfX9RX50yhWrKbO1IzAiYZXQ16djcNUFQ8+ZPwCpgMHEOyz7oJMr3F00OD3YmWp9h7b6Z4jJkuIUpsp9WLWBhdrdl7i+V+fC9nitQUYctLNeqVnsOyN73SixHJLTaU9kdbWiMVvRhI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from PBHAGAVATULA-LT.caveonetworks.com (111.93.218.67) by CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Fri, 13 Oct 2017 16:37:19 +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: Fri, 13 Oct 2017 22:06:48 +0530 Message-Id: <1507912610-14409-5-git-send-email-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507912610-14409-1-git-send-email-pbhagavatula@caviumnetworks.com> References: <1507712990-13064-1-git-send-email-pbhagavatula@caviumnetworks.com> <1507912610-14409-1-git-send-email-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: DM5PR05CA0054.namprd05.prod.outlook.com (10.174.188.171) To CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c04fd938-2f19-4504-b92a-08d51258acdd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:CY4PR07MB3464; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 3:itFtFgfuhKfSqi8J9vESFUdC6YlSUk3oYNep2lC9kFvH0IlPHG3PO77qtfrtISSmUG7boYXX/9CUg+aA3okfTgdp9/vLwEsbSIuQd/YeaofuBKZMXd6T8QpOcqEuT5LmIK+RWR+jKUCU2M3j00lzKpjFxFBuF8OsrJLXyOlEXTqVLJvPOBlVWs+ujBfGpKamNK67+L8iroNZR+RwqXf95ZxXUqZTox5Ulskk766UZ4azl5RcWtIXn46aLzFlCQ59; 25:ulQTt7SEcHxoa6kcJ6wbYIdrqNB0Ec/o8ErqfzqoQTVQSjsv7vCaEMLvLi8XVbeYuapyxQQ7PGoQOVbr4Fi/4dxDyOvTErvSzCBzPkDkr7Z8OWzk+JyrTkE/1rE3uo6Ogwp+YFf+0CvDzVVVbemhvbJYxv21mlOCvCK8YQhCLbV4dIdelMzAuZ491XJrPejRbQxwLrG8db6e1pn7R5rjHv1lzcWDa3tdQBGXLg+uzaVBzK1THOFdmLnqjfG584j/Z5DHg1jKZMZKBUgM7iR/n85FzAClpEyyXENrAagRi8NBlmVh48VfCxnW2vBymQY7HIeOuA5XiPPyG2MXc9e/Jw==; 31:Wi7pLN87RrASGc+xhkY3C6nZQohXBI7LPabvlxUXuErb9p1tPRbRWR5a1MTEwggommDA0LKAtVENQGryXzRVRZs7qjSU8ue2FkNfuCc+fE3BpKPANnaDs3IKc6tKcL73yzoO1L29VoEj/56WAuGC4L6iSJ9uQJ0hKRfQs6zIhQa6zoknnBl/pWtF422hKNkODkvMTQb2dce8esvLJU8AO91eVqsKnCNOeqOq36avIyI= X-MS-TrafficTypeDiagnostic: CY4PR07MB3464: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 20:2gP7zJXRtkaCJncHBV2I5iRdAwtcQq+HdlRNPI5zTgrzn6CyOD7FUFQ5QWo8Wt8rTydXsdSKfvmsO9X+hvgXLRQKpFllmcvHsn/Q6EfCpsI9IRt5qpYNBVcehQ1s8GKpm8dGTfagdSPsU22gi9qdUMhTjeCZyT/ZNKVWJWSdyZBOHyKV+7xWnhJs7aVTRterKuOdQVemxFjoKK/9iR+LkJb3n5YsCepDKj2qMtdVQq3I81P9NseFKQp1NhiPxhWWNED7x8DdwTN2+MSVUdtj/WX2P40mlwWvi9YOBaznpeRrbXQroUVO+sv38+DtRKHAHJuRrZmbi3t16tlYfFoPR4A806OuawLF5dlXL2uvaKc6VoEwiKqNPo/mNiKPhZuDV8eKldmoxM0KfP2rDOwTf9o24ezyN89mHBoxRIF0TnszFRQljWSnw/dCTnQIai34auoagXNV9PKbS4FpSAjz8ubEKKlo80qFpHGXCY+2lVadIJdxHheN/Xdi3+lSlLOWpgpCxaaTevqZMVn4pBknleckeySakzgceLAfQJxuGo1xHK9IajBVcA3/gNDeNCsqDGCeEx5c/Y/J/gmwu1xj5hKHc6b2cFCgkeYbRktSiNU=; 4:P25f3QIbAGz6p7QIL+frPL+PRWaS338ca3Fef6KRqjqZPJQRfckmMl+te0ViuiWj3ubVQ0ejzxfLK068+aZ+Yfmu8MCHkvVjYdYAjhFJfyaD0OfGMZSikXeuQmbqnlmhPSyJTxsWAu/s23bwqcuS/hJEJx+4YOm/qFWLTCcAxE/3i/ouURojQ9VF048F//Z0VHxBRRvttfKvfiVSr6RwnxvFoyf3mvNT38ghNqT3p5LNjOWvSmgJpsljPqFV5UNZ 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)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123560025)(20161123558100)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR07MB3464; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR07MB3464; X-Forefront-PRVS: 04599F3534 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(189002)(199003)(68736007)(5660300001)(53416004)(15650500001)(3846002)(6116002)(33646002)(6486002)(316002)(6506006)(5009440100003)(50466002)(72206003)(478600001)(4326008)(2906002)(2950100002)(25786009)(42882006)(107886003)(6666003)(36756003)(53936002)(5003940100001)(48376002)(69596002)(97736004)(105586002)(6512007)(16526018)(106356001)(50226002)(8676002)(50986999)(7736002)(189998001)(101416001)(16586007)(81156014)(8656003)(47776003)(81166006)(305945005)(8936002)(66066001)(76176999)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3464; H:PBHAGAVATULA-LT.caveonetworks.com; 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; CY4PR07MB3464; 23:hZ588DgjeRfEjmbHUbC5E/Eds2lefEpO/6ZO4tjdl?= =?us-ascii?Q?f55EQOBQiXZOcMJ6frOc/XkpZEiQjAiVyLTo05otTtP/l9625Dpnng7hkN7I?= =?us-ascii?Q?W8FW6ZqR6USKJtHY5sKLqgHlqUTctI0KI3iOhE1WTnb10xa33wR0KTUVg/Qy?= =?us-ascii?Q?EI4bfXteCaFpZgQfHtTDvLJ8enReWrqqLTin2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rSfG23wqtKPb4Wikru+7VG+eNGabzzGf6KTVSrx0nuB88Co= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2017 16:37:19.0403 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3464 Subject: [dpdk-dev] [PATCH v2 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: Fri, 13 Oct 2017 16:37:23 -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