From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0084.outbound.protection.outlook.com [104.47.42.84]) by dpdk.org (Postfix) with ESMTP id 37C0C1B169 for ; Wed, 10 Jan 2018 12:10:53 +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=fOwWBaxASB2f7aw5rFYayYYDAt+2mIDhBdtlox/XWVo=; b=LXZxaTWoEZFXmP5fASYUYsxpKPQxfRgJOwrwP7imgoZL3EoOBluwso334PYZCHomMBDYMBocO1hy54QWqUGCCyq3irsA2Dupt35pg682yjx2ZeZ4Pp1/HJp3WDWV9v9y49KhQIy/Hf4qbIAdqvuXYO6ZeF3lrxIBiEBF5C37VHM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT.caveonetworks.com (111.93.218.67) by MWHPR07MB3469.namprd07.prod.outlook.com (10.164.192.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Wed, 10 Jan 2018 11:10:49 +0000 From: Pavan Nikhilesh To: gage.eads@intel.com, jerin.jacobkollanukkaran@cavium.com, harry.van.haaren@intel.com, hemant.agrawal@nxp.com, liang.j.ma@intel.com, santosh.shukla@caviumnetworks.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Wed, 10 Jan 2018 16:40:03 +0530 Message-Id: <20180110111013.14644-5-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180110111013.14644-1-pbhagavatula@caviumnetworks.com> References: <20171207203705.25020-1-pbhagavatula@caviumnetworks.com> <20180110111013.14644-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: CY4PR1701CA0010.namprd17.prod.outlook.com (10.171.208.20) To MWHPR07MB3469.namprd07.prod.outlook.com (10.164.192.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b2ea5a56-48a6-4f14-356a-08d5581acf90 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020); SRVR:MWHPR07MB3469; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3469; 3:5Cr4p0rqyrWDOJtJ6V2dAS0TPaJvKRupmWlZGaNyt0T7PqNoeskJyNZbloJqlZ2cvkbW+i94I9dtF75jOpB/V+hmU80pG2yPCdLCmqWahDt12Jd8f0nGzRGxV5bz0sVAclejs+Nf/+3L9tLFvs53N2gLt84ZISgXWlM5cpe/9mPu4woBym7+NISexjuZjtIJNgPVDPvp+kJP1lPfBo6dISWjXJ9XCL4rVDK5G/rlqO+lVxSCrwOqicek0Uk3MUir; 25:0wFMblBXEbXRKINDxUglJDQFVcIOD4A7vXAIh4ViQAgJzT4JcqCBYNBLJb3gJDuds5NNGyiWVpqfa5SFKYHDGV6C6PeRdYGQxs1SAAGLWpYAp4DIM7D5denmDjhp/HdSxfVwoKQ7ukhSa76gvHxPuPYAOX3oIdNbfm+on0cu4g2J2G/JVQIccvR0lyfZu8dRb+CyYLWgU9ECdtCSDeoXNgQrPUA6PMy+WvsxPdMlVrMYZQqFyAcni+uTtf0eZ8m3RP7I6IVFfV7hPElhyvCbfkqUHkYw9eene8pPKSoEBdUyJFpIF4Wd5jVre3zBo0XZEWkwGVIBwmwYzzyS91+qlw==; 31:fyGB3FNveCkqL1VrRzVX7nMVvv9ky+Q+aHCLmwIVmgsScODyonDsNO5rcenK8DsM8a3HumVcL0MTWTEmb+tyODtFmMOUggYI4DkafvLmc0J7mYa4EemoeALDN0CoxsymocGaDdJ2qr+yCN5fqdg+ny3dSY8j0BlLV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PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(3002001)(93006095)(10201501046)(3231023)(944501075)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123564045)(20161123562045)(6072148)(201708071742011); SRVR:MWHPR07MB3469; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:MWHPR07MB3469; X-Forefront-PRVS: 0548586081 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(39380400002)(376002)(346002)(396003)(39860400002)(199004)(189003)(4326008)(8656006)(81156014)(316002)(81166006)(5009440100003)(53416004)(50466002)(50226002)(16586007)(8936002)(16526018)(47776003)(68736007)(66066001)(48376002)(36756003)(69596002)(25786009)(107886003)(575784001)(42882006)(2950100002)(106356001)(5660300001)(51416003)(52116002)(386003)(59450400001)(53936002)(6636002)(6666003)(105586002)(97736004)(305945005)(7736002)(8676002)(6116002)(3846002)(2906002)(478600001)(72206003)(6512007)(76176011)(6486002)(6506007)(1076002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3469; H:Pavan-LT.caveonetworks.com; 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; MWHPR07MB3469; 23:tsUphsw6OCdmlW/zj524WHCiUK2ZrM8Wy2Fa/6rff?= =?us-ascii?Q?8qH+HEvp18v83NRrpf25tdR6VIcv6faxKKtoX1AQCnhQ6tUon9iZbAQAqjyL?= =?us-ascii?Q?dcOCPrKTeynZUqloyJTz+LXYu2/JrYFuTWYN/W6jlCMQSx3EhJ8KOvnmjvVL?= =?us-ascii?Q?Y2Z8QMyw1uwf+GZG/Cbf4sJO1mUKPPA7FszOl6nsRI9fI2IGlpdr5Rq/Hzch?= =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Crcdp1RT6yIbIr8MMI8ScJ8L9/52Jiw1Q41mpYjYJ+T+NkT6kGKEYdDupShrciOUxcUuh1uMw/ruI4ZEofCYXNKvTN1D7xu8Gu0HItZ/7FwJAQWReJSm70IFIA7WF4u9iaJwOpnTRTTLaFu SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 11:10:49.1583 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b2ea5a56-48a6-4f14-356a-08d5581acf90 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3469 Subject: [dpdk-dev] [PATCH v2 05/15] 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: Wed, 10 Jan 2018 11:10:53 -0000 Each eventdev pipeline needs to allow different cmdline args combination based on pipeline type. Signed-off-by: Pavan Nikhilesh --- v2 Changes: - remove redundant split in printf examples/eventdev_pipeline_sw_pmd/main.c | 16 +++----- .../eventdev_pipeline_sw_pmd/pipeline_common.h | 4 ++ .../pipeline_worker_generic.c | 43 ++++++++++++++++++++++ 3 files changed, 52 insertions(+), 11 deletions(-) diff --git a/examples/eventdev_pipeline_sw_pmd/main.c b/examples/eventdev_pipeline_sw_pmd/main.c index 295c8b692..9e6061643 100644 --- a/examples/eventdev_pipeline_sw_pmd/main.c +++ b/examples/eventdev_pipeline_sw_pmd/main.c @@ -253,17 +253,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 379ba9d4b..9e1f5e9f0 100644 --- a/examples/eventdev_pipeline_sw_pmd/pipeline_common.h +++ b/examples/eventdev_pipeline_sw_pmd/pipeline_common.h @@ -82,6 +82,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 d2bc6d355..d1b0e1db1 100644 --- a/examples/eventdev_pipeline_sw_pmd/pipeline_worker_generic.c +++ b/examples/eventdev_pipeline_sw_pmd/pipeline_worker_generic.c @@ -385,6 +385,48 @@ 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"); + } + + if (eventdev_info.event_dev_cap & RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED) + memset(fdata->sched_core, 0, + sizeof(unsigned int) * MAX_NUM_CORE); +} + void set_worker_generic_setup_data(struct setup_data *caps, bool burst) { @@ -395,4 +437,5 @@ set_worker_generic_setup_data(struct setup_data *caps, bool burst) caps->adptr_setup = init_rx_adapter; caps->scheduler = schedule_devices; caps->evdev_setup = setup_eventdev_generic; + caps->check_opt = generic_opt_check; } -- 2.15.1