From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0084.outbound.protection.outlook.com [104.47.41.84]) by dpdk.org (Postfix) with ESMTP id C4DEC1AF03 for ; Wed, 18 Oct 2017 14:40:25 +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=n0om32wi+j0HiuWUqPbJigxo4yq4s1RxBIWrNM6a4PE=; b=Go3un3Cv0LME9Cr6wBG2qYxqhvBY3wrTS9fOilDguTPY0m60R1KBk5aKpN43JbSjRz7UiF1zg4a7HchuMTjhfERWXOMbEVQPpJ8CC80qpE7Bz8t3OYTn1Hzy6dlfZYhvp7w5ctFE2Qx3V9HnMZIL7S718cvV+mm8+3K82KHq50Y= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from PBHAGAVATULA-LT.caveonetworks.com (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.77.7; Wed, 18 Oct 2017 12:40:21 +0000 From: Pavan Nikhilesh To: bruce.richardson@intel.com, harry.van.haaren@intel.com, gage.eads@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com, nikhil.rao@intel.com, santosh.shukla@caviumnetworks.com, jerin.jacob@caviumnetworks.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Wed, 18 Oct 2017 18:09:06 +0530 Message-Id: <1508330348-30060-7-git-send-email-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508330348-30060-1-git-send-email-pbhagavatula@caviumnetworks.com> References: <1508330348-30060-1-git-send-email-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BMXPR01CA0040.INDPRD01.PROD.OUTLOOK.COM (10.174.214.26) To DM5PR07MB3467.namprd07.prod.outlook.com (10.164.153.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5f03c3e2-aa2b-4375-7e0b-08d51625671d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM5PR07MB3467; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3467; 3:XTAp2MqIz647YM4Q1dz9Nhm+B/yt5ptYQYaB20rNfWLW2oWgu/e4TZslFIW+LVQ0Fv8tzOhl81m7qPsRllSpfJ+jeOuTXB3rR5sOPiXml5chw+2iRpSztoSSPZgfQQMVZi2UX4oi0IQOnwPnYGhIoNclzxV+WJD9MAZikssqaqlryGAK0XPc1Bl1E6DqVOJA2iZO+eM0/R10fqOASnyq0DGjHuf7rlz0ihhiZSxUye6n11XmX8+55pnoyOL/NFYT; 25:ENz2EI5beHmSGW/09Ks6rtu4B3ZynhT4EKAa9LgnShCke24BKOstv/yH/VLHmyGYRy+YxqPilMdPC0rVpyK8dwZ8QmADsAFRor8ib8GzyJjGf/ZOK5sKctgA5b1FIFxcCqyKvuekmx/3a6oeYEdjZi9CNBPbbe9LFsNAoBsWbRoo971EaWGdB5UAH3YGM6qw/bJ7dFbks7J1U5J8iR5qiyupGwNe8V5rIR8faV0p70JRFhOHpPdjICsSBXCn1cJzlbAdcp9uZzlWkrPfT9ak6UY00OKrDiIuWcXG5ymaYpy5YQOZDJ9YPKqZGgtGDANzaKWw7DWQIhkby/BmRHWfgg==; 31:DJPc7hHPyApVh2cGka2S6ZN6MXbOtSrZz0aAMWnIJhKg0wcFT0QPTFvCvTOP3Y/vdAjNQbdcB3fY5St3skggGiYK4T4+OpzNEvgcwQv08Dz1+50bt4wAfaFp0k0qglsj1ZVNLQByFw+njwFeOK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ft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(100000703101)(100105400095)(10201501046)(3002001)(6041248)(20161123558100)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR07MB3467; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR07MB3467; X-Forefront-PRVS: 0464DBBBC4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(199003)(189002)(36756003)(316002)(72206003)(478600001)(48376002)(575784001)(16586007)(106356001)(25786009)(53936002)(107886003)(6666003)(50226002)(8656005)(6636002)(105586002)(2950100002)(42882006)(8656005)(50466002)(5003940100001)(6512007)(6506006)(101416001)(189998001)(6116002)(33646002)(4326008)(5660300001)(2906002)(81166006)(7736002)(5009440100003)(6486002)(3846002)(97736004)(305945005)(53416004)(81156014)(66066001)(76176999)(8676002)(8936002)(16526018)(68736007)(50986999)(47776003)(69596002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3467; H:PBHAGAVATULA-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; DM5PR07MB3467; 23:Uka/SB1ziFmseHQlTp6YyuW7QZ+FAiCPdZuRFiUJi?= =?us-ascii?Q?e5sE1vg7uQdfiQfI6LPDf3UzhNRSU4niVddZyG6X9XhNWDF1e24R0LkDhbGo?= =?us-ascii?Q?pKjB/qNoGKJZl9YiTgRpRyOQdmuVP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Ajoxu+Ur5jUjtFGXYODqg7ZI182GeAvVHKs7gZtriUzQhqsFpQvDlmfYMUmfcC+euS00W+ZQmnZEDkGxXLV3tUVE5h2PJOVbdKwvKfGb4Q5/OfEQdqLSPKm4OmymXgVy9SVqi5W/4uHoM1sKMgis= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2017 12:40:21.0505 (UTC) 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 6/8] app/eventdev: add event 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: Wed, 18 Oct 2017 12:40:26 -0000 Add functions to setup and configure Rx adapter based on the number of ethdev ports setup. Signed-off-by: Pavan Nikhilesh --- app/test-eventdev/test_perf_common.c | 97 ++++++++++++++++++++++++++++++------ app/test-eventdev/test_perf_common.h | 1 + 2 files changed, 84 insertions(+), 14 deletions(-) diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c index 04c0c65..0ade1dc 100644 --- a/app/test-eventdev/test_perf_common.c +++ b/app/test-eventdev/test_perf_common.c @@ -232,12 +232,68 @@ perf_launch_lcores(struct evt_test *test, struct evt_options *opt, return 0; } +static int +perf_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 = { + .ev.event = 0, + .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; + } + + 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; +} + int perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt, uint8_t stride, uint8_t nb_queues) { struct test_perf *t = evt_test_priv(test); - uint8_t port, prod; + uint16_t port, prod; int ret = -1; /* port configuration */ @@ -272,26 +328,38 @@ perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt, } /* port for producers, no links */ - const struct rte_event_port_conf prod_conf = { + struct rte_event_port_conf prod_conf = { .dequeue_depth = 8, .enqueue_depth = 32, .new_event_threshold = 1200, }; - prod = 0; - for ( ; port < perf_nb_event_ports(opt); port++) { - struct prod_data *p = &t->prod[port]; - - p->dev_id = opt->dev_id; - p->port_id = port; - p->queue_id = prod * stride; - p->t = t; + if (opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR) { + for ( ; port < perf_nb_event_ports(opt); port++) { + struct prod_data *p = &t->prod[port]; + p->t = t; + } - ret = rte_event_port_setup(opt->dev_id, port, &prod_conf); - if (ret) { - evt_err("failed to setup port %d", port); + ret = perf_event_rx_adapter_setup(opt, stride, prod_conf); + if (ret) return ret; + } else { + prod = 0; + for ( ; port < perf_nb_event_ports(opt); port++) { + struct prod_data *p = &t->prod[port]; + + p->dev_id = opt->dev_id; + p->port_id = port; + p->queue_id = prod * stride; + p->t = t; + + ret = rte_event_port_setup(opt->dev_id, port, + &prod_conf); + if (ret) { + evt_err("failed to setup port %d", port); + return ret; + } + prod++; } - prod++; } return ret; @@ -487,6 +555,7 @@ void perf_ethdev_destroy(struct evt_test *test, struct evt_options *opt) if (opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR) { for (i = 0; i < rte_eth_dev_count(); i++) { + rte_event_eth_rx_adapter_stop(i); rte_eth_dev_stop(i); rte_eth_dev_close(i); } diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h index f333656..95a2174 100644 --- a/app/test-eventdev/test_perf_common.h +++ b/app/test-eventdev/test_perf_common.h @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include -- 2.7.4