From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0077.outbound.protection.outlook.com [104.47.34.77]) by dpdk.org (Postfix) with ESMTP id 925CA7D34 for ; Wed, 18 Oct 2017 14:40:18 +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=nPihJ6hKbbeXyqtcD0lstovgtRBg2RfY/UYyo780I8M=; b=IJlMvKqTGw8gYc5PbUm4Hk1goor2ya1tMzv/Al3dxhuCUkSh6pY/IXh9S4SGJO9Y7Ums5Of3J3mlXTZKVrkVXbzFtviAsYg7V0augH/PNcDh7Bl+xTOxTLo8lzqL8nat1UzwdGNw0s8A/orbMDyAYxpbh1veFHsMX2ks8wGleFg= 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:13 +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:04 +0530 Message-Id: <1508330348-30060-5-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: 3f1c34e8-8828-4ca9-b209-08d5162562a2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM5PR07MB3467; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3467; 3:qKwvGraXNh2By2Vqtaey+y1pRUZYdiMKA6LsdJWLqLKBh+boq0ck+FSASaeiJ05oylkpYtRHmQ5vQJcmd+ndqQkelAPqwHXJ7VryZnPqUpAol/ypRKkCgI4Qy+pWVP/qh/G5hvC7SIjt73UGHSlQg22AC4GwEO6hc+peC+00qqV3wLwr61bL8y3CV+qDQaoj9yhsfuz7Oo63twQz3ic2/8vT3iYcEBdKUNNZTQMGnprenPYvUc+sA4vF33sPLnUc; 25:9yZXY3lsveHNZ67J9PTQRgJcNh5sLrIH1WbPzeVr+BC9eB/2u+fqp6ZIP+pCd8xNTOW7OeC5dl9Bu3dl7QZldzQ1DaaZkhIA0FCo4GVUNtodV4a0EC7vhsWkGB+Bzj56hrvANftkFVueA5sVskvtGlsp+CZ1ps3YDFmVh+kIoXaJU/L7HYRaFRzIaNMPFltP5ib4MkutvEFa8z/81FX1pUfRqOclux9q5noWKuBB/sWNDnmzR4nSs4e2Tpjj5FNxQ+eI/RYB2yvyzbUJ1tJ7voLIY+yGe1VxP6wrIJkGTbuc1/xCDd4aAZnJJ60dM6IXTj1TDvH0kMcoK6YfwkB7rA==; 31:WxIjSt9YhYOgKYRPay+4tFHB73IDK2SQhg/5HUuCPvIz/FyQv/wyUT2KdfAOy/mPNjxh8G/ICXrNBbsgLDZkfXUiH2VYbfOR6578uc+kM0HMVZiLOu9PQboh57ltiGz1YLUAUX8Q01qfTSOYUsjBbkS5uxsy/m4V09OIuOKmWeVQLaRM+izo/C91+KsMCmOP9KiwqqGLgaAfgrOcRnpLP/416Xs19hSw5ie63AXsOR4= X-MS-TrafficTypeDiagnostic: DM5PR07MB3467: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3467; 20:IRif6RrQf/dQW6WZxQWU6muqexQATVt0696RD/i2sBx9jufSZW5GaOWyjZ2Vk61GvSf6JlkX2VAtuHaQ6tkPpMOu20hNAnArYUtWtTRAwRaeImWDD8ROobe7JOVMqhJEEjMvyIR5hz+J2riEIIwPAvxfX8uVViuU5eAgE14O6NJmt19VNtis1hF5UpIy+c+wMAoxIi638VxCinM9rvAnLAXqSqRUcuxOVZNtue1fnbjx/Z1Bn2NZzyhnjiNn/3SJT+DPsIwN/rWcYv/i/HScW5jWrLCaRKkIXEEODmuO9j9JCDcd9QKilkTJMWlPpkBChNFG4MVHsks9aYbC/IRcPozJghShqT5Ogluhb5NvqSg1kv/JspodjapR2Q4LF1pK3uk+G98sjQnVNOFxfj4X1raDTVFZPwJoWBQOhy6ftjP+H8OStYpS+uQka6M4VZlPv80WcyituYomIKQUJjdKAcmmgE2dp/HbfJYlboeExBAU6+GXClVrt7Ht2XYhVVP9bAAEVijzFAVKPslTJ3y79SahDk3wQhNe6M9c283j4zylPRa/h5rYqdZwVUlBtAwnL9OG72OTrtrsXSRSzIQ45qNSXOqzNlNTaYEMFg5eLf4=; 4:ugE2ozD+66HMtPMqnXcM+E4loGY2cBeSCle8+qGyseYPYLDb2axvops6XP/wY+AjmaFYvUTMgYBWqVZJqWhKkaZvJjog35mSILU/Rmj6CFAUNVuXRzL+nwId3WydR/NNpqsBosrGkUnSZGWmXujOaJYQqXVYI+a/Ct9eiPyONNaEl4ifEGm/sAOVBSA52O/8UkYMB5v340STnapfSKHVXK5evdG2ZHAfxl0/KGaA0awvjq2SkVA95EeAl0mvVcZ4 X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-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)(51234002)(36756003)(316002)(72206003)(478600001)(48376002)(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:BITC6bCjASCBVYj47z9NgGzxDY5QBawT/8olkm1jP?= =?us-ascii?Q?YaqxBTI7XEMuhFC1IKs5Teo+zl1mnb2TJw7ww0gUH/fjbSOPyLxWJVc1AYc4?= =?us-ascii?Q?PMZTIJrdRz0O6hQSnseuzIR2QBnpenilR0S2e0mxCId0wHi5BTPLgoQ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O04hwCleJjD21HMU7zzW1sU0VdE9nI0UvHZJvGFss6fxpZQX/2Y49kyq3T14zu0vtG9dMfx8PsqY7ARW6doQsZ2pCwTvo52DJS9c3TtcffSEpiBwM+n9L5bHM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2017 12:40:13.4879 (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 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: Wed, 18 Oct 2017 12:40:19 -0000 Add ethernet device setup functions to configure ethdev ports incase prod_type_ethdev option is enabled. Signed-off-by: Pavan Nikhilesh --- app/test-eventdev/test_perf_atq.c | 1 + app/test-eventdev/test_perf_common.c | 72 ++++++++++++++++++++++++++++++++++++ app/test-eventdev/test_perf_common.h | 1 + app/test-eventdev/test_perf_queue.c | 1 + 4 files changed, 75 insertions(+) diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c index f6fd5d9..aec50a8 100644 --- a/app/test-eventdev/test_perf_atq.c +++ b/app/test-eventdev/test_perf_atq.c @@ -281,6 +281,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 b26d694..ebf8900 100644 --- a/app/test-eventdev/test_perf_common.c +++ b/app/test-eventdev/test_perf_common.c @@ -408,6 +408,78 @@ 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) +{ + uint16_t nb_rx_queues = 1; + int i; + int j; + 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.\n"); + return -ENODEV; + } + + for (i = 0; i < rte_eth_dev_count(); i++) { + + if (rte_eth_dev_configure(i, nb_rx_queues, nb_rx_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; + } + } + + 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 ab2e599..5c6a615 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 3467bb5..4f3e7e7 100644 --- a/app/test-eventdev/test_perf_queue.c +++ b/app/test-eventdev/test_perf_queue.c @@ -294,6 +294,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.7.4