From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0061.outbound.protection.outlook.com [104.47.42.61]) by dpdk.org (Postfix) with ESMTP id 2B5081B202 for ; Wed, 11 Oct 2017 11:11:01 +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=VXlRknwFkRQI1RittASfWDB6m7RcoPI5NCCL8YzV9L4=; b=bk+qqh2fGlfVyaeB6S4dJnu3w29VyQYO01NE8AarhNcDklePAri4BUVj/UWGCsX8VpoEmAtcUIzaSo3CNtcrR8HTeCnl7A4PqRQaFoQI2VEOGObELhV+05wxPijUVSkjunlVvQMcdRrvtXz+DFdm1rGWSgkavuvjLDPUmMg3VxQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from PBHAGAVATULA-LT.caveonetworks.com (111.93.218.67) by BN6PR07MB3457.namprd07.prod.outlook.com (10.161.153.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Wed, 11 Oct 2017 09:10:57 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, harry.van.haaren@intel.com, hemant.agrawal@nxp.com, santosh.shukla@caviumnetworks.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Wed, 11 Oct 2017 14:39:48 +0530 Message-Id: <1507712990-13064-6-git-send-email-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507712990-13064-1-git-send-email-pbhagavatula@caviumnetworks.com> References: <1507712990-13064-1-git-send-email-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BMXPR01CA0014.INDPRD01.PROD.OUTLOOK.COM (10.174.214.152) To BN6PR07MB3457.namprd07.prod.outlook.com (10.161.153.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5bbc6f18-75c2-4062-9f51-08d51087fcc7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BN6PR07MB3457; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3457; 3:3UPjeUpuIh2UPBk9Ny1a49+wzpPF/bUzgcCEMt3yyvjnf8HCG+3TClfH+bH0DvtrNCOpalkDQDFc41Od4HsNxQbGNhIquSC5c6hRVj2sBHNfR54b3DNUJ85kJSEXQXlFKddvuLfznmD9+itvblgzVYRJCwoKe+uO2VXoaGbwmFlRPQNqttdt0QMmQjNZGwQMBMy+b1BtJdW9w85Up1E/wfjFpM8ifWQnH49HdTwD2AHS5YVvVi+baTrOUbFv/p72; 25:a7kVUMWONWTnZ0IyLQdGZnefNIumOkL5eF5lVMdwk2iXpO6ht6lcizFDOrxg4JgIAnsojTmzB777UcJ0TOKVv/cJSvuXEZ5b6aWU+CBRUJSAqZGt08QhoFCRvVB434zgnDrORuCZTpuBzl4oeCoHEkxht8euXpXGQAQEbjKC0+JuNDSTZFayGY9W2fClb1BIB5MIIo4cRibYOCEO3P53UWDDHCjHtPD6YTNsPHTICXP0PS4R4gYVi2uPy3VXBejsTOInJQHlsEoCt2TYqp9KBAJkcBM6GzbZ3Mq+XqDXUPGmrPmJokresHg9YKH56z2doFSkvuSO73oIBjoJPJB+9g==; 31:hox8qkMZCQlfkV4xYYydaX8KQj/Xh4qUKZv+BP7pFq8OsT++lIfMsfCYSnpXQcenapLprKtD5oQBimqBHgYRjVyW7kIa/FdLZ9EM0aJM3zTm+ao0GN++kRRYk7oAfbDhMprtgME1+xhbE7Vg91osLjYTcRC6DkwGlmduUp8epvBtUbWwcT+cRK7FgkHDD6zqjIX5S3sYp6KoAk2zufD2H4Fn9AqL9fUsSF0Icy6tfE4= X-MS-TrafficTypeDiagnostic: BN6PR07MB3457: X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3457; 20:anwzWrMfxiOL28LzT4tEdewQv/ZQUU/dP+R1sd0BFKvk+iTnz3lxh2FSZQnethIJQCs557/KgqVdgzpwbduRnv8Fzrw1VHDpImEvqshxZDBCMR2a4uS3/RUPmaI9ATaYk83agdyOsSC6KhYiwAdGbzXTzMHMMDUpe42KHV8xudPWNSx/usPjlc9mLS/8pG00kAV2FRt5aWbyXF6XCK9TdWwjRR7AKFxAL7IMxtzqpMzHCaFRnxkRcj/KUMe1SZpQ6FyDYLEntQAGyHoRQO7pTNg7ESk0ftkz9OuAWKPcLKm7PYpxpAEktyKFG3kuoSIhSOVvJ4tG8E0qAXI72KCKQ48gIg2SBkV8gYKsCCecFGAFe+SRafDhnjrDSpCY1D5FNUyBQUfsRCStqybk67CKrmcthT6f2zW41j9jGTbyycGCDH5lB65wgStzgREfwjWg1WRzPbeAYNyhR8BD4T4qjkx7pQAdFkSsRPQOpG2Q6NxKgmQmRBuzGwprX+Hd73CgRTjsGncPDqx93E08hqFkVvAnXh9vcJT2QsZQbpUkG3sCfYOw2gvjnJoSqo/Ontzr48WNOeQtmTwuy3BAZ8RZZOCZzncS3+P67rHkUc94sOk=; 4:wA+6cOIwdfsFENiB8EOmF+OUbdKwE/sml1XgY03vAd0LXsNfRrSDy48fPh0vLPDurMGzK2c7EkVQQis8gFW+/TwAft6onz2ouN3cMcPN21YjYsQeeZDTAzL86LiRZHSVM/r3O/hc9seYCy0WIW4h7HfMX6o0ldXDM3QzcXhikZeyj2pn4F2AcOzgf59IwTKsv/7mFv0pBwmaDdWSSI0w5XTJe07r4ITN8vRlK2nHgYRjnLhrroDgjraempj5JOGu 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)(100000703101)(100105400095)(10201501046)(93006095)(3002001)(6041248)(20161123558100)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR07MB3457; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR07MB3457; X-Forefront-PRVS: 0457F11EAF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(189002)(199003)(2906002)(50986999)(6116002)(68736007)(5009440100003)(6506006)(6486002)(76176999)(3846002)(4326008)(72206003)(33646002)(478600001)(16586007)(189998001)(15650500001)(316002)(48376002)(16526018)(6636002)(25786009)(6666003)(105586002)(5660300001)(50466002)(66066001)(42882006)(36756003)(47776003)(53416004)(97736004)(53936002)(5003940100001)(8936002)(81166006)(101416001)(106356001)(50226002)(81156014)(107886003)(6512007)(8656003)(8676002)(305945005)(7736002)(69596002)(2950100002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3457; 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; BN6PR07MB3457; 23:AU9xv3k5LhfPCXDLXNrURBf32/YZb00JqInnhoAxK?= =?us-ascii?Q?pZeQ5sIgtgbsuTBGjmkZLT/mQMSa6kpQ3KCTbAdTSo63/xEWToxPvLoAM0Zy?= =?us-ascii?Q?3P4AunIVyXvG/Hyfo1+dWR2JsJa48+hQ+OrYDlaIpf/RAp1C43zjlve16oYo?= =?us-ascii?Q?o+NGk5H5kwt9d6VXcYTb80Ck4VDn5uNLUNgG/of5jyJx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vY5XitST+EwhXrae39BYLYS0PO+lIEly1j6l39f4gjxVX3K6bgA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2017 09:10:57.1456 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3457 Subject: [dpdk-dev] [PATCH 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: Wed, 11 Oct 2017 09:11:01 -0000 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..f02fe84 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 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