From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0071.outbound.protection.outlook.com [104.47.38.71]) by dpdk.org (Postfix) with ESMTP id 6C0E07CE2 for ; Thu, 7 Dec 2017 21:38:44 +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=aU2GpmBpz3vspl125vMP59ySX3hv1HNMw3xdwOnS308=; b=G2YGlK2BhMcppLrgfpTGgfHeoUeRZreMuB+MtAJVj3Tvz2j0OPH3RML2r2V38Km631lJOcMmTfZHEDUpTLYeI7k4VgREtzR9gnUFWiXD+HhBTDk06GQhjoI5shcqkSxwRSjPkpGNAN7lkNIKaG9XHUrcBCX+wJbQSEh1OfAO8eQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (111.93.218.67) by DM5PR07MB3468.namprd07.prod.outlook.com (10.164.153.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Thu, 7 Dec 2017 20:38:35 +0000 From: Pavan Nikhilesh To: gage.eads@intel.com, jerin.jacobkollanukkaran@cavium.com, harry.van.haaren@intel.com, nikhil.rao@intel.com, hemant.agrawal@nxp.com, liang.j.ma@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Fri, 8 Dec 2017 02:06:57 +0530 Message-Id: <20171207203705.25020-6-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171207203705.25020-1-pbhagavatula@caviumnetworks.com> References: <20171207203705.25020-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PS1PR0601CA0101.apcprd06.prod.outlook.com (10.170.176.155) To DM5PR07MB3468.namprd07.prod.outlook.com (10.164.153.23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7727d7a8-2bc8-4847-4429-08d53db28168 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603304); SRVR:DM5PR07MB3468; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3468; 3:CRkRKAZ/TBK0ovb6f/6hoPTcaXibuRK7FTk3gPpAA6iXeApevwn9ZDrvQDQAs1NVrTHxN3nl/ihvoV0LhHfK4TfH7qbwzigSYmy5EDtkGn4tMFsuB/fGtm9i30D5djogDHni+Iuds2eguNwY9K0H/qrWavw4LpdPPsv2Fxcrv4QBAxKbjyX7x3mWFC5EJbzXJPPE+C69oEkioPMgloq0MXKX4JiDFM3RSWagb8v7zYHXHKJqK8in2XKUckj1uTcD; 25:2LW767QOlqbLvBXlkM9ByDwY73HRUi2R0Irq8Q4ha+G8AcdBqdljtpG6jOQ6qZLFDucvdYgSX25ZEtyYPT/3Hc2iTJG0tTKy0pL4ZHe2jyeLpO/UsK6YFBTPVCEeDP2t/9ADpz6TzZMfHe55kEr9oIKTWRSQqVuB3aJK+QaoO5YIh5dyCB7680by+lzcMpaPWK8DI/5h8RjNv2aEBd/pA/SuyTW5iEMBgy53CO3+yRzOqkVc9+LIBaq7iJpHBFZXLpb9Ec0cqCgoQ9ZkztOSmdgpDJQmeZFj7AtneQpAhgx9K7F24ci3+LYUX83jJpSUHDtIsuLthOcjwPXpvV1m9g==; 31:oDU9a+eL1pIhm533eyLX3B3HXcfrmHzEJO+fOTVU9vrKEtGy5+z9j4SHsbd1r0U9XCwWEQ0RwGXJherBFKaB9wQQdcb4tX24mWypWnCyERV4YTbdaHJwGqSOwzdNFoa96aajQeVigNlJy4VDgQg4IAZMv5im65pko3qqY8LJMK6ZWwMQYxuFOUSDzRhmfSIPBFGI/FB/rzvVSAvWp/X3dIf58jzjhQ69XPrNvKTJ+Fg= X-MS-TrafficTypeDiagnostic: DM5PR07MB3468: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3468; 20:Vdn0s564CRHlS1GbC1x6Sal1HY3PzD+PZS4hQMenjaLwsOgvQldMJzMDwpn/VXR/1so705NxiVGd9AH2o3Yv3I3J4GDQbvfoJdIDRmr4LkuTHpYAKe6wMQcxCeGfv1CqPMKFyp8Xu7MCi61CGeir89jl89uNVvS7MgGimdbi0kqlQaywnc1LiHGuYCkQI7eJQ5ullJ6kMdWHFRjkeQ4nW2hIusXggad3irUL6LEBbYxR3Wv3QsUY4eIzY044Qdy4fDybDutVQFk9+U0r8WVVNsspkXjlhu4C4u0VMEY6xc+f2zfF9qwa4RtTxQNfh3+D2hnai+vvUAwYFJ6tHqaisZUD0XcWkFL2SGvFqlT6pQBF+eyve5cpw9+AepgeEHuv5TKthqBJO1AUvWeqgX3EJUlcF2fmdI8HQWzirEbadr2SwMky4YanFVGONjFgjrBf/imwRkoST6e8miGKmnr7rBuSDkx1YmhIdRpIWA/Av9R9Il1SSwFQHlc8rHOKUY3DK1JrH98TjvFHFGJqWdYOMt8q+g2NYhRXAhsJJEQa/vVPzkoKYzsbg+JVAOG5r7XxFFa/rJxXCBn3uylvxX7WgmLEhI0upa7lSNaRy3KCRPs=; 4:RXzadljhxPoaVbsEA+oP2/zEhEx9V+iLMClXje01R379a8kLd9vEI0kCdpt2C1CaUktRPjz77xEuiWftH+u36VFUrP02j3x4mWpL2yolRGbBfM+LiEL8laiZyglMRYgDYBm1J8rzmHBAxljU7rT1H+py9GkffGHSwz5Uc2dq2VvBfdVcR4Z3sQCn5lqMq+dLUmFH7TktgP8Da2IlWxGqV2ebT1n84ITrowdyBHhbCFvtE5T7AMrn4Na2JrYS/zGJlem+AxebVYZnxhaocQA5vQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(93006095)(3002001)(10201501046)(3231022)(6041248)(20161123560025)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(6072148)(201708071742011); SRVR:DM5PR07MB3468; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR07MB3468; X-Forefront-PRVS: 05143A8241 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(376002)(366004)(346002)(199004)(189003)(6666003)(8676002)(2950100002)(42882006)(2906002)(50226002)(5009440100003)(305945005)(81156014)(8936002)(97736004)(5660300001)(101416001)(33646002)(478600001)(7736002)(81166006)(68736007)(107886003)(4326008)(25786009)(16526018)(50466002)(16586007)(48376002)(106356001)(6506006)(6486002)(6116002)(105586002)(3846002)(51416003)(76176011)(47776003)(72206003)(52116002)(8656006)(316002)(66066001)(1076002)(53936002)(6512007)(36756003)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3468; H:localhost.localdomain; 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; DM5PR07MB3468; 23:UCsyB7rpP27Ii3bzVsSrJmELoBCz8KbucTk6E+gWY?= =?us-ascii?Q?lctvrEuqrfnFTWIgDWkRaVzcuSkZGcKg325YIn2qxnHAbwwfT4tkt0yf2B4Y?= =?us-ascii?Q?B13J12ftuWga/AVYqJBvDNYOpup298v6QQq5abTRtG4Lr3NHDlXHRsYLHmQa?= =?us-ascii?Q?DtE/rQl0yvPCLpLEMQTkNBJw5i01+nNX6XY3WmjTzTa/njqwmRFkXIs04lVq?= =?us-ascii?Q?4EA+M/UBaNswjH0MHx5EicHVyKjkZlu+MWnTtbhkmtM50pIFFZLDAlnG9cSw?= =?us-ascii?Q?6Sgy3fg9lxj/wXKNRyK9kfOX+rHk4ia5nt3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; DM5PR07MB3468; 6:tYUPA6MW4dQoeAcFoAydNBPHE/TC5taUhJUuwhKwv4Bz0S6XFBog7uiRgyNmXRmkV7r60A4M7zCBMG/sbqdqU3/Uy12sV3lFZuC/XMXkL51eSFeYZbP8aIkrmWj3GVp8e/Rdm50TkGYnuwDmWP9upt5DzGTmNCVNCosoy3IoPegGQrB7ZZq8UC/mdXl5Wm4Psdrs/BZlj03yo1hh0TXaP7UX2AEcb62t1cgIAjjrnGvkM42M/9vU24+ZCT8cI+/2Ybikm9JMQwKgVJ0X1nfDFgifcbZdxXJR/N1vqpnVEXwMxfz9ADTzkk6qCIVwKRsWBeIM12Rvea4VR1mbMgBdeqbtUed77BhuaX/ZN6Y++cQ=; 5:UpV+LR7vj9+f3DFaAwCLNJYMneiOcUJqfw9KcwiXJc750jEw6D4eB24lgEm9it6qj7Qh+rnZh4YJHy7V19Oe4vGOTnG++WbPy2f4KByFi1BnvnsZTYsrnAvSOIR9YtWmkotuXGI8JUihh0nb0EtLm+LS0mrWtZKJMhT5TNJQyNY=; 24:yrSw9S4Ih5QN9OzQxpTaMcfDPHP8v8Bq6oIKKot6oXHn7x91LGZINdXUK60dSbCcEzuZrefYVaM+sdOv/dwys0FAZTOuxH0qFZLFE3qqlFY=; 7:ABF5fi2bkvYiqEkecfmoiGHtBL6bDd8n6aOo/q04X3jnTHP1p8Vh2q1FeDOK48E2yZyYVe2OFpfWe5QABd/k63zyQfojrMvdhEN1L0PI6NJVBkZUPEBBm0nEnZRhawa4FnQohdqbZj8moCD4jzCjueyeZXhZt9Fgm9DfE9u00ROQOFmBsPkb80ZGyx/41HQcgupSPGCBe4w7KmbgPi36/kzVdiia05GNLcm7VJaMZZW+5+iJE7oKT0yOzdw9q8Bx SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2017 20:38:35.0797 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7727d7a8-2bc8-4847-4429-08d53db28168 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3468 Subject: [dpdk-dev] [PATCH 05/13] examples/eventdev: add ops to check cmdline args 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: Thu, 07 Dec 2017 20:38:44 -0000 Each eventdev pipeline needs to allow different cmdline args combination based on pipeline type. Signed-off-by: Pavan Nikhilesh --- examples/eventdev_pipeline_sw_pmd/main.c | 16 +++------ .../eventdev_pipeline_sw_pmd/pipeline_common.h | 4 +++ .../pipeline_worker_generic.c | 40 ++++++++++++++++++++++ 3 files changed, 49 insertions(+), 11 deletions(-) diff --git a/examples/eventdev_pipeline_sw_pmd/main.c b/examples/eventdev_pipeline_sw_pmd/main.c index bd53acf76..2e80841d0 100644 --- a/examples/eventdev_pipeline_sw_pmd/main.c +++ b/examples/eventdev_pipeline_sw_pmd/main.c @@ -254,17 +254,11 @@ parse_app_args(int argc, char **argv) } } - if (worker_lcore_mask == 0 || rx_lcore_mask == 0 || - sched_lcore_mask == 0 || tx_lcore_mask == 0) { - printf("Core part of pipeline was not assigned any cores. " - "This will stall the pipeline, please check core masks " - "(use -h for details on setting core masks):\n" - "\trx: %"PRIu64"\n\ttx: %"PRIu64"\n\tsched: %"PRIu64 - "\n\tworkers: %"PRIu64"\n", - rx_lcore_mask, tx_lcore_mask, sched_lcore_mask, - worker_lcore_mask); - rte_exit(-1, "Fix core masks\n"); - } + cdata.worker_lcore_mask = worker_lcore_mask; + cdata.sched_lcore_mask = sched_lcore_mask; + cdata.rx_lcore_mask = rx_lcore_mask; + cdata.tx_lcore_mask = tx_lcore_mask; + if (cdata.num_stages == 0 || cdata.num_stages > MAX_NUM_STAGES) usage(); diff --git a/examples/eventdev_pipeline_sw_pmd/pipeline_common.h b/examples/eventdev_pipeline_sw_pmd/pipeline_common.h index 0f3426a3a..a5837c99b 100644 --- a/examples/eventdev_pipeline_sw_pmd/pipeline_common.h +++ b/examples/eventdev_pipeline_sw_pmd/pipeline_common.h @@ -111,6 +111,10 @@ struct config_data { int16_t next_qid[MAX_NUM_STAGES+2]; int16_t qid[MAX_NUM_STAGES]; uint8_t rx_adapter_id; + uint64_t worker_lcore_mask; + uint64_t rx_lcore_mask; + uint64_t tx_lcore_mask; + uint64_t sched_lcore_mask; }; struct port_link { diff --git a/examples/eventdev_pipeline_sw_pmd/pipeline_worker_generic.c b/examples/eventdev_pipeline_sw_pmd/pipeline_worker_generic.c index 032a4f2d2..a72b7b2f9 100644 --- a/examples/eventdev_pipeline_sw_pmd/pipeline_worker_generic.c +++ b/examples/eventdev_pipeline_sw_pmd/pipeline_worker_generic.c @@ -370,6 +370,45 @@ init_rx_adapter(uint16_t nb_ports) cdata.rx_adapter_id); } +static void +generic_opt_check(void) +{ + int i; + int ret; + uint32_t cap = 0; + uint8_t rx_needed = 0; + struct rte_event_dev_info eventdev_info; + + memset(&eventdev_info, 0, sizeof(struct rte_event_dev_info)); + rte_event_dev_info_get(0, &eventdev_info); + + for (i = 0; i < rte_eth_dev_count(); i++) { + ret = rte_event_eth_rx_adapter_caps_get(0, i, &cap); + if (ret) + rte_exit(EXIT_FAILURE, + "failed to get event rx adapter " + "capabilities"); + rx_needed |= + !(cap & RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT); + } + + if (cdata.worker_lcore_mask == 0 || + (rx_needed && cdata.rx_lcore_mask == 0) || + cdata.tx_lcore_mask == 0 || (cdata.sched_lcore_mask == 0 + && !(eventdev_info.event_dev_cap & + RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED))) { + printf("Core part of pipeline was not assigned any cores. " + "This will stall the pipeline, please check core masks " + "(use -h for details on setting core masks):\n" + "\trx: %"PRIu64"\n\ttx: %"PRIu64"\n\tsched: %"PRIu64 + "\n\tworkers: %"PRIu64"\n", + cdata.rx_lcore_mask, cdata.tx_lcore_mask, + cdata.sched_lcore_mask, + cdata.worker_lcore_mask); + rte_exit(-1, "Fix core masks\n"); + } +} + void set_worker_generic_setup_data(struct setup_data *caps, bool burst) { @@ -377,6 +416,7 @@ set_worker_generic_setup_data(struct setup_data *caps, bool burst) caps->consumer_loop = consumer_burst; caps->worker_loop = worker_generic_burst; + caps->opt_check = generic_opt_check; caps->rx_adapter_setup = init_rx_adapter; caps->schedule_loop = schedule_devices; caps->eventdev_setup = setup_eventdev_cw; -- 2.14.1