From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0078.outbound.protection.outlook.com [104.47.34.78]) by dpdk.org (Postfix) with ESMTP id 36AFA1B19D for ; Mon, 11 Dec 2017 16:14:22 +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=qmX8/oseYrEPaIjoXytbRUR8H20jeNoZt7H5SDQSOGA=; b=Wy10qJY6fknsbm+G/qkesLi3/Cy14vIQjma3o5e+1cRtiyqdIjDtGkcsh2NGxfplNyFqcRjSJZqfzBsH2YHPWrkUDllwUALgOUMjLnj0PEQqvSGSvwtyjKb9nwvaAlVFP9iKDwynMgkWkphpw26IJEeZ/GBgkh+3utb97Ex4/Nc= Received: from Pavan-LT.caveonetworks.com (111.93.218.67) by CY4PR07MB3463.namprd07.prod.outlook.com (10.171.252.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Mon, 11 Dec 2017 15:14:17 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, 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 Cc: dev@dpdk.org, Pavan Nikhilesh Date: Mon, 11 Dec 2017 20:43:42 +0530 Message-Id: <20171211151346.14405-4-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171211151346.14405-1-pbhagavatula@caviumnetworks.com> References: <1508330348-30060-1-git-send-email-pbhagavatula@caviumnetworks.com> <20171211151346.14405-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: DM5PR13CA0046.namprd13.prod.outlook.com (10.168.240.160) To CY4PR07MB3463.namprd07.prod.outlook.com (10.171.252.144) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a523b0cb-7a00-4903-642b-08d540a9dab9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:CY4PR07MB3463; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3463; 3:+GhUQfNj3UdiMxioD9ffTF9o1zw5QE8BPxww23iHZbZm823dNU21oT5oiHzeXqyxGwNZkgSAX5toR3aGubdJdzX/yGCOrUHO6Aq+H1/agVA7rN7HDBaGYAio+PHQv61jgWuUZMIxIAkl/KwuTaHW2WEVxNfRcLUf1bBc12cLpl82ojKzSlk3akfTvg9/eUWXmRWOne4VSujT9L70PhIvHL2QRa5q+NSoeloziR3b5KavnmMEVcGxHkAeaDJIs9yC; 25:WeZXQIfn7FHe3pTTjiARKNXiqTq7H19pVb+rwJLAOYrcIOZpzUiVCujmiUcnaF38QTjP8dC7J8g7D7tPiZMODTknoXIjpobFCbgtfQLMxgBWnkFBjKaC//a25i3s3KW9+jsoWLzg94/5NBqtFtsFLDF7GZv/4q24rZ8ipebBDo2zjbUrdvK/SBo+zhUFyZ83vJuJA5H0/4d6f2izbNQ98HbuKf4bhX0PMH9jxQfLEGyG1+xycaUts5qENIySqy/lqtAhQqxA8uO0DYKDruxfDlCQ3qizW1SCkK641/sTrkabsKvYmaxcMAp/sQZSq0I1M1+sN0MM3Y8JOPWEYo86dw==; 31:rrKFr7docl7wweEOaBRKfFXy1lKAOGKzSFUCcA7lLc0WhyMsLGZJABGSj+d0Ca+OpNx3crzZ0CYIIqYhyicISRg1K30QiBi9ntL4xs7KGcubhw+0enTLg0Kj4RM+kKoeDVI53kQdMDqDQutNltX1FmuWWg1fNvjjK6quZojlytVvS98Yu4ro4e5eqXkdGW/RWd+ft/5nCx+gaZ2fjDB8sdGhooTKAr+TROtHFAKhfSA= X-MS-TrafficTypeDiagnostic: CY4PR07MB3463: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3463; 20:Wx3P9gUku/En2Cm8v13wENgwjuf/UmtqeVshb4LKsxbK9xMnr7LdC5Um3aKlMhHdFSvw2CUQ9n5IljyB6KzancfjrZCF0gRyhoEKEmlQJ1kJDBFn9Ea3cf/L+Csk7Ek2dEwARp91sdMcG0GrIufKBbLervkceOgo3Tbj6Dj/WTqnGX8CJQfCbMQPWKeGi6jLBB2fpZBjpawTD9USpRkALfeUkjCxObHlBIxY0PBt7eGHSD7KcJfRJtdih3OfMgaNFpI42j8mMAOeYgq3rpzFKGWa23JQxM2dFhlFujhCbmMnYGrvMyJIbP0BJuGgVTOx4VO/vzzwI9JlgS4M8F774DRi08rnKek8PgCeqlkdP9XLhNkdcYxMLl6rbgmONGiIyblJe08bHKvwZ9XiIeWvUa8fxnjVjFTymP7ByGFXab/ywITTndjEK9rfkHsFGEHIPcJ0yUILRjPotyF6TtTGdnZlft5didS0QChSb3kkJwsuSnUvmFgWUDli5NnCvpkfypA2GckxeZgjHvq7AjEF3DAOUTLq/3G/Qvkd1ha2B1AVsYwJM5vofr5tKZkM1xIKfGJGpsEe3xJOV7Xj9KV2OouXmXG/xdg6j+T6gn69Tw0=; 4:R8W9Baq+Y+AhEiQF7HhmMvM8GAHeig792cXzynUxuhRTLLw9H80TfE4GqriHDKA7qAYyCQa8eVhUsheRUj66+OY57d8E3Tyf/MUlgkPX50lDHNhebzFG6r0YWX5eLoYmbh879OdZU+bdugWs9+CpujWtdtzcHjzIVZ/Nqqi3/tVNbPIAZSUs2EyYUYdaw+IagGQYmYadR2mWLRA6SjzrDEbO7Aa0St3SIvFjan2s+8lFD8P24NNSMaOEPC1SDHaWkoopdarSlqooJzYS4dCwdQ== 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)(20161123562025)(20161123564025)(20161123560025)(20161123555025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:CY4PR07MB3463; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR07MB3463; X-Forefront-PRVS: 0518EEFB48 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(346002)(376002)(199004)(189003)(51234002)(97736004)(53936002)(53416004)(106356001)(16586007)(105586002)(8676002)(25786009)(1076002)(8936002)(107886003)(81166006)(36756003)(50226002)(69596002)(7736002)(305945005)(66066001)(50466002)(6506006)(4326008)(16526018)(6486002)(81156014)(3846002)(2906002)(2950100002)(5660300001)(42882006)(6636002)(6666003)(6116002)(316002)(68736007)(47776003)(478600001)(72206003)(52116002)(6512007)(8656006)(48376002)(575784001)(5009440100003)(51416003)(76176011)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3463; 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; CY4PR07MB3463; 23:ArN1pTJNNIr3PZWwEaHFFToPRMbB+tGh0IoplNUlh?= =?us-ascii?Q?j25Om9k5ePBJs+suPPRW7yFB+qLykSDJ7pVwpHul2ADXOzT7VchH+5nBByAD?= =?us-ascii?Q?KEEd5gq8uaVLwAlSa23X337Z3oqeF9v9qqev6/uAQjigzgyibmJ+iNBitGPb?= =?us-ascii?Q?tnVCBkgqlt2Vzb/BNM3nx58XdiYUhtzoYrna57KUITZ62QDtk1D568R4P3tY?= =?us-ascii?Q?k2z8/9Jd5r1TE+eLF6CUozZsrdioyRYXqi0vwOQAl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ticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2017 15:14:17.3995 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a523b0cb-7a00-4903-642b-08d540a9dab9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3463 Subject: [dpdk-dev] [PATCH v3 4/8] app/eventdev: add ethernet device setup helpers 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, 11 Dec 2017 15:14:22 -0000 Add ethernet device setup functions to configure ethdev ports incase prod_type_ethdev option is enabled. Signed-off-by: Pavan Nikhilesh Acked-by: Jerin Jacob --- v2 Changes: - Removed unnecessary "\n" from evt_err, reworked ethernet queue setup. app/test-eventdev/test_perf_atq.c | 1 + app/test-eventdev/test_perf_common.c | 65 ++++++++++++++++++++++++++++++++++++ app/test-eventdev/test_perf_common.h | 1 + app/test-eventdev/test_perf_queue.c | 1 + 4 files changed, 68 insertions(+) diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c index 6082d4ff3..a2067345d 100644 --- a/app/test-eventdev/test_perf_atq.c +++ b/app/test-eventdev/test_perf_atq.c @@ -280,6 +280,7 @@ static const struct evt_test_ops perf_atq = { .opt_check = perf_atq_opt_check, .opt_dump = perf_atq_opt_dump, .test_setup = perf_test_setup, + .ethdev_setup = perf_ethdev_setup, .mempool_setup = perf_mempool_setup, .eventdev_setup = perf_atq_eventdev_setup, .launch_lcores = perf_atq_launch_lcores, diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c index 18945c0eb..ff5c499f9 100644 --- a/app/test-eventdev/test_perf_common.c +++ b/app/test-eventdev/test_perf_common.c @@ -407,6 +407,71 @@ perf_elt_init(struct rte_mempool *mp, void *arg __rte_unused, memset(obj, 0, mp->elt_size); } +#define NB_RX_DESC 128 +#define NB_TX_DESC 512 +int +perf_ethdev_setup(struct evt_test *test, struct evt_options *opt) +{ + int i; + struct test_perf *t = evt_test_priv(test); + struct rte_eth_conf port_conf = { + .rxmode = { + .mq_mode = ETH_MQ_RX_RSS, + .max_rx_pkt_len = ETHER_MAX_LEN, + .split_hdr_size = 0, + .header_split = 0, + .hw_ip_checksum = 0, + .hw_vlan_filter = 0, + .hw_vlan_strip = 0, + .hw_vlan_extend = 0, + .jumbo_frame = 0, + .hw_strip_crc = 1, + }, + .rx_adv_conf = { + .rss_conf = { + .rss_key = NULL, + .rss_hf = ETH_RSS_IP, + }, + }, + }; + + if (opt->prod_type == EVT_PROD_TYPE_SYNT) + return 0; + + if (!rte_eth_dev_count()) { + evt_err("No ethernet ports found."); + return -ENODEV; + } + + for (i = 0; i < rte_eth_dev_count(); i++) { + + if (rte_eth_dev_configure(i, 1, 1, + &port_conf) + < 0) { + evt_err("Failed to configure eth port [%d]", i); + 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.", + 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.", + i, 0); + return -EINVAL; + } + + rte_eth_promiscuous_enable(i); + } + + return 0; +} + int perf_mempool_setup(struct evt_test *test, struct evt_options *opt) { diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h index ab2e59988..5c6a615ef 100644 --- a/app/test-eventdev/test_perf_common.h +++ b/app/test-eventdev/test_perf_common.h @@ -157,6 +157,7 @@ perf_nb_event_ports(struct evt_options *opt) 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_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); diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c index 0caf5757c..18e1bd59b 100644 --- a/app/test-eventdev/test_perf_queue.c +++ b/app/test-eventdev/test_perf_queue.c @@ -293,6 +293,7 @@ static const struct evt_test_ops perf_queue = { .opt_dump = perf_queue_opt_dump, .test_setup = perf_test_setup, .mempool_setup = perf_mempool_setup, + .ethdev_setup = perf_ethdev_setup, .eventdev_setup = perf_queue_eventdev_setup, .launch_lcores = perf_queue_launch_lcores, .eventdev_destroy = perf_eventdev_destroy, -- 2.14.1