From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0064.outbound.protection.outlook.com [104.47.38.64]) by dpdk.org (Postfix) with ESMTP id AFD2E1D90 for ; Mon, 11 Dec 2017 12:13:17 +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=c/qWKhydfW6kNPKDEkZTFb2cTDGoX8DeK+xYBMNsNwui4hlY2O1th/fCz9Y+rzPw+/+b1Vx5HrPuMjFXSyy3MJoQFc2WbeVZ6VgXuGkGUFD/OFaSAqLl7D0hckaIEN8wto1z7PmBP9/u+jG/7ECUq3SLIRKdLqk6PC7OxDZBsv8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT.caveonetworks.com (111.93.218.67) by BN6PR07MB3458.namprd07.prod.outlook.com (10.161.153.21) 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 11:13:12 +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 16:42:32 +0530 Message-Id: <20171211111236.1331-4-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171211111236.1331-1-pbhagavatula@caviumnetworks.com> References: <1508330348-30060-1-git-send-email-pbhagavatula@caviumnetworks.com> <20171211111236.1331-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BN6PR1301CA0010.namprd13.prod.outlook.com (10.174.84.151) To BN6PR07MB3458.namprd07.prod.outlook.com (10.161.153.21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7142ccde-7119-460b-dcca-08d540882ce8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:BN6PR07MB3458; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3458; 3:5J9CnGp4m+kvg7F0RXvIE/hLOLT1cG2eyHQn52MaPjf+iy5wjdhgKpI5+ZfOaDjB1EAtMCbb/tVeJXzvTZ+e7GZCoQqyEfZgNcDE+f4fctFUXDCxeahQTfxylez8dWrRx19zfZdy6O0nhg/pFbvWW6w1gPDJeBlpFyUD/IJCL6hY2Zs/cs++smn4RU7U0ENSGYRTE6h3+X3toobtdMD9eFGRN6+r5QJ8IbBUb4AiXaVpf31D47MHndksog9uv1/H; 25:8xMeeSVgCDhKQdlMPAfzvUaUQdrhu7Qe7M2skxom+MUtpK9Tyr/gEDjAOeyHqKTHbMU7b06jlGMV7rR7YBnXWV8tmwQccasGehxE8+WXter4nOyoF2KMnwCgvoFBXYSvG6gRW8XBNSvHZaQ7st5O51xOJu0cv0DtjTS/HWfDYQ+1k9fLm0Us95IjNCp2idaN6yicJzD5g1Imj9NGKyBCBnDg+B8l/CXghU59VCHAnGDLQxMJ8ZBqWI3DKJF4RtfOprM+PkxsBlbBNXAqp32PampB5fSI1ZnL5J+vp/t6VLOu5SPXUQXE/mBVzdWFsRePp+QRofhuPo9VFIQayMkyGrLdvuEurjAvfsOOqbFfbIk=; 31:3UymLL6GV9IKIq7tO2sojzwh+NHc+zoUgVAMTccU4RuazcXVpcGqBIiK8fxZ5pAWyNAO5x4FWirkR4TBrGDj+FGuUtn5wh1XCWnIvMD7j+4Do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eht510lns8yadobhSIZkeqExBXXSg== 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)(3231022)(10201501046)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(6072148)(201708071742011); SRVR:BN6PR07MB3458; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BN6PR07MB3458; X-Forefront-PRVS: 0518EEFB48 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(366004)(376002)(51234002)(189003)(199004)(76176011)(51416003)(105586002)(48376002)(5660300001)(52116002)(6506006)(3846002)(2906002)(50466002)(106356001)(97736004)(66066001)(316002)(25786009)(305945005)(2950100002)(8656006)(478600001)(4326008)(16586007)(16526018)(42882006)(81166006)(6636002)(8676002)(81156014)(72206003)(8936002)(33646002)(107886003)(36756003)(68736007)(69596002)(6486002)(6666003)(50226002)(575784001)(53936002)(47776003)(6116002)(53416004)(5009440100003)(1076002)(6512007)(7736002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3458; 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; BN6PR07MB3458; 23:UIQY6j3isiFTVCG/nR2Zo2y2HqQkt/ZM+faMITjN5?= =?us-ascii?Q?4/8dpVF6AHT3HMRtf6f2jX9pu75DCHFvhXX3fhl/kjQyGtpED1p5er/Da/N2?= =?us-ascii?Q?ULBynqevWz3vLb1jMjmWQCv02ruUAa8jA2Idf0FLCRurO4NgQ/LVHHLBT596?= =?us-ascii?Q?EPzji9kM+QMq6LCYh+kS+DelbRgt5mU4HFYY+ArJ834DLPgC6RTCG57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E0QHbThNiViFvf01WTmmVXdx9dKTDcti/3om4ljizaYyriPOzhYwKPL+S/6UGxBKObk+kGsaxc1uoEA1kIQXX8SrUPG5N60uA SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2017 11:13:12.6606 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7142ccde-7119-460b-dcca-08d540882ce8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3458 Subject: [dpdk-dev] [PATCH v2 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 11:13:18 -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