From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0072.outbound.protection.outlook.com [104.47.42.72]) by dpdk.org (Postfix) with ESMTP id 7B6852B9E for ; Thu, 30 Nov 2017 08:24:31 +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=DRcqTlPfFUupLtsTiRBFrJsjxPBS58wvXf1NpNWVO60=; b=nq8AwGwCfw1dYUtj0ssaOmk42sJ9OyATk8mbEhmwiPQ0vZwcmk27iwOCyQvA7OZaQ2C6OOLJ8gH85+vzVjK5eqLmjseeEiRLCaLbXNOO/yz2QjdHdkyDd5z4p8WwAr42FGdClMmnnnUlSkDHJddLzJA8FX1MB3kK/MuLPIF//J4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT.caveonetworks.com (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.260.4; Thu, 30 Nov 2017 07:24:24 +0000 From: Pavan Nikhilesh To: jerin.jacobkollanukkaran@cavium.com, gage.eads@intel.com, harry.van.haaren@intel.com, bruce.richardson@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com, nikhil.rao@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Thu, 30 Nov 2017 12:54:03 +0530 Message-Id: <20171130072406.15605-1-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: YQXPR0101CA0013.CANPRD01.PROD.OUTLOOK.COM (52.132.74.154) To DM5PR07MB3468.namprd07.prod.outlook.com (10.164.153.23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0f3c059c-6702-48a7-88ba-08d537c36433 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603282); SRVR:DM5PR07MB3468; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3468; 3:SA4MRL0s/7gWabg7ZofXBYE6IWbKD8WiBCsrpbz0Ze3wsYmB4ZyUoYn7jn7BeClUC2x08x8OaHuoJsIy4MwUSfrjHpKshAL2kwzrrxHnhtidzahffQ2aPWKWPwabQv7YZLcPaLqJKkNiDYrN+rCHARVO+Sr9OD2RxX80tG19U9orok/b/NJMRx/Jc3yr2J5v0QhJVN0seq0iZCCn+JzI3bMGgJYn6XQVGDigwMkv0P3uEI3AvzQPRnpXJOL3RfHg; 25:oYZHO3h2S/6cFOQkSecAYKMZkBBVd5rhcGvLpEUHSbzzmLblIjUHo0BaGtyQr9PIpEQkSG0ZgnvfaIikw6hb/pyuwzptJXPH+9ZhWdVy8EyOttwrmY8c4LixqNalQ6y023yeqboXjdmNxF5id1rhx7XzVtcpencf49NznrsiwLw77pqq8n+aM2FxiN6mNFj1l8d0elYjO2Zbkk6NUQxmniJPdeRie2ML0NLWI4dZVR8FORgVU5k+jUY1896rrrcxgaulP8GVpFMIg2pbDQXYsq34YWqYw4u9v9xuSzCGObjnT8VdsNds8tDSOcJ4v+XltvkV9hrGOnWH/2oqvpNZ0A==; 31:PhDn5jBiimb1m8YHAF1RkZCujLYGCw11C/KkclvMJe1TyLOMLRkbZH+otUIR3hKDcZeeFdd8yod+q2PHF58wdyCaSrAzX/QpoF7IWJhq1qzdwYxMdWtshkJMFVqMuXdCs9k215gucO44zfYCon1apg7ALw9qL2VFiRR/Wj21rMi0HX+OTzHzbL/Q8y0wXHMUTFpiWvonzGhgRI1KKnNKL8dgnwZTDlZ6BMkOrdzPrp0= X-MS-TrafficTypeDiagnostic: DM5PR07MB3468: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3468; 20:nDJ3XSzJpvhcnPs5dPTmOzY6dS9XcYFtxSzIASFV+8/EX5ybImbesHh5e+mZyYBU9Q4IB2T8/6v5OgEfL/c+9uN2LMEIs5sSJNb7OG9o54KlX079gMhhyBpFr6/YechL8VeCaTyI6sm6FkkFnUwyRoPg74ZIaL50m29/wAMrR+gAEslCvyHDGuPI6Iwnw3sZKYXKvor/BngpMcHUDctxNFjw55sKNfC5poDusrD4SdeYxNhJ+7wRBvsXHAY3xIS0cyH0NO6GgYzi9IFKYNLmfqJfc0KmCr/0FUu1JOwoUyfDtf4FcsVGiJRutYRypqz96PiCecPTCVjrGnnTOGtO2oP06cxPkPq2vicEs3Q75B2dhq003tc1ISl3DBMSdXey06mus3EGJNV29Cw1zgL2oly+BzyZmCk0ValBPHlVJsm1RqaI//gQdftDO34MlvNBFWECdvqokuGt/nMfF5tInux4Z7rFRUJFVRV7DZR+nRJXpoG6gE1pwxl+bKF+khHYCjp4BXYqPb4txvPfXIvngM7vhxHEJvfx15Ot73vuYB4CKWRIbxQeZv3RUUgAAA5g8pwD2fdA2Sc6uSPpBSDPnzIHTmv961G4cSSJw9F3i54=; 4:xQDrXCdiSAHHX1hWsW9Pft5JojcU9xBenUT2XKJb1ar51FKGll7YvWvfaiObM3novu8KhmZEShNeAbKVdKpbYpGrfoHr2qT996B0MvklERvwSKsxOPbfPBOduzZmKbqZ7MK19p4+9cki4pX5LjOC3mEWl4DPA/FaR22sUck9VMghWomQRdCOQWJw0SxBKqaeWd8NoUeo+eDLro8jbWBag9E10uSYAuxqnpjtoO6OphVut5ypB2l5jgQdv0xuggMOJoRKPH06TNrQnyuDoZllpaTNcJJRUpOGDauTvDGB1WryWfZVnW0vOy0e14sA/lG9 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(131327999870524); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(10201501046)(93006095)(3231022)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123558100)(20161123555025)(20161123560025)(6072148)(201708071742011); SRVR:DM5PR07MB3468; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR07MB3468; X-Forefront-PRVS: 05079D8470 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(366004)(22813001)(51234002)(189002)(199003)(66066001)(48376002)(4326008)(7736002)(189998001)(8676002)(81166006)(6486002)(81156014)(47776003)(50466002)(53416004)(8656006)(5009440100003)(478600001)(16526018)(72206003)(97736004)(69596002)(316002)(51416003)(16586007)(966005)(52116002)(6506006)(305945005)(53936002)(6512007)(1720100001)(36756003)(105586002)(6306002)(2906002)(5660300001)(25786009)(68736007)(6666003)(8936002)(42882006)(53376002)(101416001)(33646002)(107886003)(106356001)(1076002)(3846002)(6116002)(50986010)(50226002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3468; H:Pavan-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; DM5PR07MB3468; 23:xoA74IVv3Xay23B1Ll5yI6YsibYZNenPncwOzkLg6?= =?us-ascii?Q?LLmRIP3bMfiVjJ0HBuy4N0VrvTisYoxzH1J1dGlCjMSMfsaTkbktRGiH+V0A?= =?us-ascii?Q?jjXZyqkPdwJwr0S5FTwftnZhdU1EIBfIRs64NuVdJMdrzeCNHoIDAniPXFdL?= =?us-ascii?Q?itncd9t7TiGK30OFngv/Lww7rlykRMmzG4gA/OMqxSsZ31ZQ591AbnWQlLMQ?= =?us-ascii?Q?EetNSy4QtEdQIfWHk0pUnkvLjoEEqgtJnoEXBDVOYiOV/tETsCZYACNpUr4n?= =?us-ascii?Q?G9p/G8bV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uXVLBsZNR+JF60AMmOigSDw/tQWiCX+FePubhHD6e9AYwxhy3WXj0hnA/qMYRALi2Tqm0usj1NKCwN5fkqjGYpX SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2017 07:24:24.9049 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0f3c059c-6702-48a7-88ba-08d537c36433 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 1/4] app/eventdev: modify ethdev setup to support Tx 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, 30 Nov 2017 07:24:32 -0000 Modify ethernet dev setup to support packet transmission and probe through ethdev tx capabilities. Signed-off-by: Pavan Nikhilesh --- This patch set depends on : http://dpdk.org/dev/patchwork/patch/30520 app/test-eventdev/test_perf_common.c | 56 ++++++++++++++++++++---------------- app/test-eventdev/test_perf_common.h | 6 ++++ 2 files changed, 38 insertions(+), 24 deletions(-) diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c index 873eab9..60965dc 100644 --- a/app/test-eventdev/test_perf_common.c +++ b/app/test-eventdev/test_perf_common.c @@ -92,7 +92,7 @@ static int perf_producer_wrapper(void *arg) { RTE_SET_USED(arg); - struct prod_data *p = arg; + struct prod_data *p = arg; struct test_perf *t = p->t; /* Launch the producer function only in case of synthetic producer. */ if (t->opt->prod_type == EVT_PROD_TYPE_SYNT) @@ -126,7 +126,6 @@ total_latency(struct test_perf *t) return total; } - int perf_launch_lcores(struct evt_test *test, struct evt_options *opt, int (*worker)(void *)) @@ -232,7 +231,7 @@ perf_launch_lcores(struct evt_test *test, struct evt_options *opt, return 0; } -static int +int perf_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride, struct rte_event_port_conf prod_conf) { @@ -494,9 +493,9 @@ perf_elt_init(struct rte_mempool *mp, void *arg __rte_unused, int perf_ethdev_setup(struct evt_test *test, struct evt_options *opt) { - uint16_t nb_rx_queues = 1; int i; - int j; + uint8_t nb_queues = 1; + uint8_t mt_state = 0; struct test_perf *t = evt_test_priv(test); struct rte_eth_conf port_conf = { .rxmode = { @@ -528,33 +527,42 @@ perf_ethdev_setup(struct evt_test *test, struct evt_options *opt) } for (i = 0; i < rte_eth_dev_count(); i++) { + struct rte_eth_dev_info dev_info; + + memset(&dev_info, 0, sizeof(struct rte_eth_dev_info)); + rte_eth_dev_info_get(i, &dev_info); + mt_state = !(dev_info.tx_offload_capa & + DEV_TX_OFFLOAD_MT_LOCKFREE); - if (rte_eth_dev_configure(i, nb_rx_queues, nb_rx_queues, + if (rte_eth_dev_configure(i, nb_queues, nb_queues, &port_conf) < 0) { evt_err("Failed to configure eth port [%d]\n", i); return -EINVAL; } - for (j = 0; j < nb_rx_queues; j++) { - if (rte_eth_rx_queue_setup(i, j, NB_RX_DESC, - rte_socket_id(), NULL, t->pool) < 0) { - evt_err("Failed to setup eth port [%d]" - " rx_queue: %d." - " Using synthetic producer\n", - i, j); - return -EINVAL; - } - if (rte_eth_tx_queue_setup(i, j, NB_TX_DESC, - rte_socket_id(), NULL) < 0) { - evt_err("Failed to setup eth port [%d]" - " tx_queue: %d." - " Using synthetic producer\n", - i, j); - return -EINVAL; - } + if (rte_eth_rx_queue_setup(i, 0, NB_RX_DESC, + rte_socket_id(), NULL, t->pool) < 0) { + evt_err("Failed to setup eth port [%d]" + " rx_queue: %d." + " Using synthetic producer\n", + i, 0); + return -EINVAL; + } + if (rte_eth_tx_queue_setup(i, 0, NB_TX_DESC, + rte_socket_id(), NULL) < 0) { + evt_err("Failed to setup eth port [%d]" + " tx_queue: %d." + " Using synthetic producer\n", + i, 0); + return -EINVAL; } + t->mt_unsafe |= mt_state; + t->tx_buf[i] = + rte_malloc(NULL, RTE_ETH_TX_BUFFER_SIZE(BURST_SIZE), 0); + if (t->tx_buf[i] == NULL) + rte_panic("Unable to allocate Tx buffer memory."); rte_eth_promiscuous_enable(i); } @@ -591,7 +599,7 @@ perf_mempool_setup(struct evt_test *test, struct evt_options *opt) } else { t->pool = rte_pktmbuf_pool_create(test->name, /* mempool name */ opt->pool_sz, /* number of elements*/ - 0, /* cache size*/ + 512, /* cache size*/ 0, RTE_MBUF_DEFAULT_BUF_SIZE, opt->socket_id); /* flags */ diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h index 95a2174..a847a75 100644 --- a/app/test-eventdev/test_perf_common.h +++ b/app/test-eventdev/test_perf_common.h @@ -45,6 +45,7 @@ #include #include #include +#include #include "evt_common.h" #include "evt_options.h" @@ -74,12 +75,15 @@ struct test_perf { int done; uint64_t outstand_pkts; uint8_t nb_workers; + uint8_t mt_unsafe; enum evt_test_result result; uint32_t nb_flows; uint64_t nb_pkts; struct rte_mempool *pool; struct prod_data prod[EVT_MAX_PORTS]; struct worker_data worker[EVT_MAX_PORTS]; + struct rte_eth_dev_tx_buffer *tx_buf[RTE_MAX_ETHPORTS]; + rte_spinlock_t tx_lk[RTE_MAX_ETHPORTS]; struct evt_options *opt; uint8_t sched_type_list[EVT_MAX_STAGES] __rte_cache_aligned; } __rte_cache_aligned; @@ -159,6 +163,8 @@ int perf_test_result(struct evt_test *test, struct evt_options *opt); int perf_opt_check(struct evt_options *opt, uint64_t nb_queues); int perf_test_setup(struct evt_test *test, struct evt_options *opt); int perf_ethdev_setup(struct evt_test *test, struct evt_options *opt); +int perf_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride, + struct rte_event_port_conf prod_conf); int perf_mempool_setup(struct evt_test *test, struct evt_options *opt); int perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt, uint8_t stride, uint8_t nb_queues); -- 2.7.4