From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0087.outbound.protection.outlook.com [104.47.37.87]) by dpdk.org (Postfix) with ESMTP id DD61429CF for ; Mon, 18 Dec 2017 22:45:12 +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=h4UmQ7pP8vTWZx5UReNF0p6j0srKxq5w7UQLGLiMWp4=; b=mKhmHhI5YjeqE7Jp5TVddE6zAV/kWRJy0f9fAHtQwHmNlj7zodL9KQvAYEme6IareDMWA55v9blHcX60xFmDNy3wJia7HZ6GEI9ESD7az6bcbX65kFx/1e3AoIofLPZ3wDqT9ShEWwpRxyk40B/SbGQL+pVNPD3rRiDIZcHiEUs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (111.93.218.67) by DM5PR07MB3467.namprd07.prod.outlook.com (10.164.153.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.15; Mon, 18 Dec 2017 21:45:07 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.com, bruce.richardson@intel.com, harry.van.haaren@intel.com, gage.eads@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com, liang.j.ma@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Tue, 19 Dec 2017 03:13:59 +0530 Message-Id: <20171218214405.26763-6-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171218214405.26763-1-pbhagavatula@caviumnetworks.com> References: <20171130072406.15605-1-pbhagavatula@caviumnetworks.com> <20171218214405.26763-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: HK2PR02CA0163.apcprd02.prod.outlook.com (10.171.30.23) To DM5PR07MB3467.namprd07.prod.outlook.com (10.164.153.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a8239dbd-eac0-4f84-1ca5-08d546609d2c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:DM5PR07MB3467; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3467; 3:J/GOkZsgnTMsXQkI9uz1kjvAFMC1ZyA7JdUqXQwQ+GsLPGXavvsapSvGUJyRbq5t+enujdQDZQuGBmQAcXeixQ/QNKOVe401nxAINPYpRQjCzcDo5EavyngeJX77U+SN6y7WbxSSbk8royYPSTf5bqcW/TBHitrFU2usNdPuAwSL9bN7c/oecAlOWuYGhDmJXIEAR5RQFOcHYarhNxumq7zLtFcnj8n5ioEUddalozcsMapml2UBWqvNbvkCmH7E; 25:yHKRIkLtgsfwZ7hVv7hLToPkLDPpv5+UYz8DquW+i7nR5e2tFIDf9oKZRAK+W0ihhBcklNHyQOKtVBADVKZOVZvz7fzsGCAHxZhwr4r47ZtHgML1EjR+y8coH7ZHgLMgl2AL4sekxkCAyWyASe3f3ITZ5DFYR1PFS8+Cx4caOVgOm9oQ6zQ+r2f9YXEFEMaskBAT/ox3Xyqd7IGxWYYPbyeouTKovlRWUMq0wstZHdGCFzqhs57QiKZ1VLKrGtO5vW8HmevRj77XD6MXC55jPY4IGTvLq7nAULlm75BUb62I5sVmX/rbLTslbvc1QYOffU/qZOytNw7Z43dFnL4rSw==; 31:3yEyhGeu8hlSnFsWhrf97DZL/oCx6flCOhKh8ZstFC4E5iULXotEb1NdHx1NXzp3AfpWZ4IA2/wIGYPGKPpdZ8QsbYTxg8EkwQ2wFlkhDyxp5JMgT7xULg1vCNqXjjuEsHcgZPPT9XSZIWdHtunzkylQSRbhd/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S: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(3002001)(3231023)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(6072148)(201708071742011); SRVR:DM5PR07MB3467; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR07MB3467; X-Forefront-PRVS: 0525BB0ADF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(4326008)(2906002)(53936002)(305945005)(25786009)(1076002)(8936002)(50226002)(16526018)(6506007)(386003)(68736007)(52116002)(478600001)(51416003)(48376002)(5009440100003)(3846002)(6116002)(72206003)(36756003)(6486002)(107886003)(8676002)(5660300001)(106356001)(105586002)(8656006)(2950100002)(42882006)(6512007)(6666003)(16586007)(7736002)(66066001)(47776003)(76176011)(50466002)(81166006)(81156014)(316002)(97736004)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3467; 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; DM5PR07MB3467; 23:WHuDpHatj6N7xRIJUO3/T5Mv00dBj3+75M/HgooDX?= =?us-ascii?Q?6CyMsChOAM5K0ut9EWRAj9zra2bHKG9DKhgcyirSPL6wpANBW+r6DGltAFEF?= =?us-ascii?Q?wn+XMcH8O//TMB6VKYCO4A7ucOqgMak734GVMbzgOsxVIsQ+/79b1N+6zIOV?= =?us-ascii?Q?ROvR9wWgyHLCPDbyo0sM+B+x2zzhvaO10wp9J8S/NWIzDW3rk1voC+IeX9Lc?= =?us-ascii?Q?8+Yw7DfdRADl+Z9t44GcgwCvpJJ41I6yI02kCC+cP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f2s7pHwbiI7B95bkFXj5zzOQ4Ap1x8DhutOUCBK6JAiT?= =?us-ascii?Q?fTJJryzA0/Qw+g=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3467; 6:YRXjvaDe0YO8AU33RrstmBdL97mWQBSH2B7Oa3HcvptrigAEwhi44yffuDxtUhBvGloqGi9L7puKN+ln/QZtsTvtWaYO3qMmIro6U5BQNdgNhcYGi8WoxE5Fycx0m3qsZoottMKIE08048NPsF3NtSe6KZUFZoip+ypFtTY+/POiXRE6Ba6cE4RVkPlU+ofOsIKWEqTJyua/ptUGVHnKED9B5FviWNZZwRmSgN35tOOZfKJf4ZZWZzUe8q2WYTngRzWDsJFnh+aPFc3aqRv+f9tblHyVQAIzodSkVHeIVnuElf9iqe5DN7192bt4G/nzTVJ/qY/JQu+leFsqa4bVNoqIC1aQI8s9ky5PaHu7aoc=; 5:YCIRqWpa5v5647yL7CL+9paKMmy6yk3n3uz/saj0bhMnB858A+uOYjx9nEzJrGG8yDycCOkYBzHOJr3UTZtV2FJriNvKyqF+GTMOvHdrcP9iao5LK1rcEVgEOAJsckcuRV1U6OQnUhI92UsimQZ1+mycTyKBKg4Q5c+Lkf/TLZQ=; 24:8x0g6Ov3ujAHkhkEvQYiSM0t/q9aDlyUjLE00BqedVqF/o+efnJbpiMq/FU8yMWCfXvqmoEdMX4U18n4UddOD3P6SvuUylKPbsRm33XLvSk=; 7:d9zHqmF2F7NwaF0CwroHH/DpUQiwdnxkAlIlwIj++4mUZE3RPREP9kUdk5AQVAyyyqLDUHCy3UfRUjrTfTwiPfPoz+Tm2yuvALhtUiWSRjcMsXOviu2KyETaKugauRZgiyaSupZqahUUh3mIHSGq7RasZ6JbNwPpDNo2VWK04rSVIEz+8atqnQOq7SKP4oUq4ovbbZOiK38BvuMeLMQXDcdQIZl2j5KCxAKTiINBR5iK7PZPKWipwN/pBQ0Mk7la SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2017 21:45:07.5358 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a8239dbd-eac0-4f84-1ca5-08d546609d2c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3467 Subject: [dpdk-dev] [PATCH v2 06/12] app/eventdev: add event port setup and Rx adapter setup 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: Mon, 18 Dec 2017 21:45:13 -0000 Setup one port per worker and link to all queues and setup producer port based on Rx adapter capabilities. Signed-off-by: Pavan Nikhilesh --- app/test-eventdev/test_pipeline_common.c | 102 +++++++++++++++++++++++++++++++ app/test-eventdev/test_pipeline_common.h | 4 ++ 2 files changed, 106 insertions(+) diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c index eb3ab6d44..df7521453 100644 --- a/app/test-eventdev/test_pipeline_common.c +++ b/app/test-eventdev/test_pipeline_common.c @@ -191,6 +191,108 @@ pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt) return 0; } +int +pipeline_event_port_setup(struct evt_test *test, struct evt_options *opt, + uint16_t nb_queues, const struct rte_event_port_conf p_conf) +{ + int ret; + uint8_t port; + struct test_pipeline *t = evt_test_priv(test); + + + /* setup one port per worker, linking to all queues */ + for (port = 0; port < evt_nr_active_lcores(opt->wlcores); port++) { + struct worker_data *w = &t->worker[port]; + + w->dev_id = opt->dev_id; + w->port_id = port; + w->t = t; + w->processed_pkts = 0; + + ret = rte_event_port_setup(opt->dev_id, port, &p_conf); + if (ret) { + evt_err("failed to setup port %d", port); + return ret; + } + + ret = rte_event_port_link(opt->dev_id, port, NULL, NULL, 0); + if (ret != nb_queues) { + evt_err("failed to link all queues to port %d", port); + return -EINVAL; + } + } + + return 0; +} + +int +pipeline_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride, + struct rte_event_port_conf prod_conf) +{ + int ret = 0; + uint16_t prod; + struct rte_event_eth_rx_adapter_queue_conf queue_conf; + + memset(&queue_conf, 0, + sizeof(struct rte_event_eth_rx_adapter_queue_conf)); + queue_conf.ev.sched_type = opt->sched_type_list[0]; + for (prod = 0; prod < rte_eth_dev_count(); prod++) { + uint32_t cap; + + ret = rte_event_eth_rx_adapter_caps_get(opt->dev_id, + prod, &cap); + if (ret) { + evt_err("failed to get event rx adapter[%d]" + " capabilities", + opt->dev_id); + return ret; + } + queue_conf.ev.queue_id = prod * stride; + ret = rte_event_eth_rx_adapter_create(prod, opt->dev_id, + &prod_conf); + if (ret) { + evt_err("failed to create rx adapter[%d]", prod); + return ret; + } + ret = rte_event_eth_rx_adapter_queue_add(prod, prod, -1, + &queue_conf); + if (ret) { + evt_err("failed to add rx queues to adapter[%d]", prod); + return ret; + } + + if (!(cap & RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT)) { + uint32_t service_id; + + rte_event_eth_rx_adapter_service_id_get(prod, + &service_id); + ret = evt_service_setup(service_id); + if (ret) { + evt_err("Failed to setup service core" + " for Rx adapter\n"); + return ret; + } + } + + ret = rte_eth_dev_start(prod); + if (ret) { + evt_err("Ethernet dev [%d] failed to start." + " Using synthetic producer", prod); + return ret; + } + + ret = rte_event_eth_rx_adapter_start(prod); + if (ret) { + evt_err("Rx adapter[%d] start failed", prod); + return ret; + } + printf("%s: Port[%d] using Rx adapter[%d] started\n", __func__, + prod, prod); + } + + return ret; +} + void pipeline_ethdev_destroy(struct evt_test *test, struct evt_options *opt) { diff --git a/app/test-eventdev/test_pipeline_common.h b/app/test-eventdev/test_pipeline_common.h index 204033a01..412c6095e 100644 --- a/app/test-eventdev/test_pipeline_common.h +++ b/app/test-eventdev/test_pipeline_common.h @@ -82,7 +82,11 @@ int pipeline_test_result(struct evt_test *test, struct evt_options *opt); int pipeline_opt_check(struct evt_options *opt, uint64_t nb_queues); int pipeline_test_setup(struct evt_test *test, struct evt_options *opt); int pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt); +int pipeline_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride, + struct rte_event_port_conf prod_conf); int pipeline_mempool_setup(struct evt_test *test, struct evt_options *opt); +int pipeline_event_port_setup(struct evt_test *test, struct evt_options *opt, + uint16_t nb_queues, const struct rte_event_port_conf p_conf); void pipeline_opt_dump(struct evt_options *opt, uint8_t nb_queues); void pipeline_test_destroy(struct evt_test *test, struct evt_options *opt); void pipeline_eventdev_destroy(struct evt_test *test, struct evt_options *opt); -- 2.14.1