From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0062.outbound.protection.outlook.com [104.47.0.62]) by dpdk.org (Postfix) with ESMTP id F1FBB1B26E for ; Tue, 12 Dec 2017 13:28:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=WqIN0BcGeklOy0XCu8nmBB96lut+LHEDr4bOAI5sEDk=; b=rvYHUBtfqjfLVjqJqxZ5kUdJ4F2/w2mP31WVY3SDg1dx0zk1w0OzYgdIOflKCFRFuy/6Lc6EnH9cPd6XjSV1tEnqEBgHrPUMMiur2NTXqqYgjaA0w2SBOkiPhABLh84mpSmCU9tB2yhOHSEkSbaCJfSw/6X2yMLCan0P9YOIn5I= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (82.166.227.17) by VI1PR05MB3149.eurprd05.prod.outlook.com (2603:10a6:802:1b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Tue, 12 Dec 2017 12:28:02 +0000 From: Shahaf Shuler To: dev@dpdk.org, konstantin.ananyev@intel.com, radu.nicolau@intel.com, arybchenko@solarflare.com Date: Tue, 12 Dec 2017 14:26:46 +0200 Message-Id: <371aaf9a57983d4210a51c57aea095200a6832de.1513081088.git.shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: References: <20171123121419.144132-1-shahafs@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: HE1P191CA0010.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::20) To VI1PR05MB3149.eurprd05.prod.outlook.com (2603:10a6:802:1b::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f7919768-1825-4f89-4118-08d5415bca49 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603307); SRVR:VI1PR05MB3149; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 3:9MoWZHSADMY6b6Wr9SsbaJJrU9I5DGVCHy8sEqozEGBm8yDHDccymaH3zovNvcJ+V+BR5ifao26fHsVIbYENJRVKm1pQoEnoyqALmvzG2XqWb7i8G57nik+FszL/pea4iEh/MO+ZBCZT6oj4rBJNUxrB9VYPoXhA/hYDsWYE7oM2FGiDX8TUEAT7gzOFl4BpEfZA7d83jwIBfs27J91dIhO+kGVYa38gmvbKpdYQMIxV6eNe47pLQfdfBQ2+2xnX; 25:ANZFBEifg5d4pkaQCYRJis2O4WeGmUwYC/jlordRtAJG4fsxFyY7Ch+2b82PWJ7DwNfKL5DTuAjLackevuam6cpDWsB4bjHcbyGgi/E/UgfntOMnCYBaM1ysG/GNwpoi3FfpiZDPA9yJVilwnm2xe8fJN/6NNJCm3fuPNSgZSEqMN2zWY9JcO4pqzwKRRwShGnhHz7+hh28nN1SHbl/yTDQbHBdyw1allz/FbD++NkAekoKhDOuSEScfVihCmuxI1AMw29knLIuClPw9kSA1dSIfhd0kQM1zOgTmovcnwMhKII8cKtH8Ff/jD+YMWrCVi85f0NsYTofCU8agFg3Xeg==; 31:XDrs15L/H5WsTHNaDprmMtqXds8jTeSaWnx//ywnWGt6HHCaN8KdkLn4EaqRFWADUXeTcrrftBSYId9Fd29iJD5vupS6r5QM+M1qr2L1p8GeaeGZZR5Rn14/Dp06SDS9rMLqRFQQzd/MhoU38jA+aw32uKIhL5cqrMS1zwg18rW+YB8n3+1wz6VgIbZfPsySpeJyN7xoPJo2N6I4m83OAEthzTziX7EQDitHrZY0TuQ= X-MS-TrafficTypeDiagnostic: VI1PR05MB3149: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 20:N0CZ6fgo4EUpABhn45FHIsBMwTQlfYxkPVXQ1mysi+r5tSva1Q3TJ2xzAaJrYOmNfJUmAV5wSgjYB5R9e8oKjwbDZ9i882ulDhLSUWsWL1OCzz5YvnIozU9QeAiieskYeDsVLPZaArqs9ZOuBtC3JguQJnxo7s5sOVS4eMKuWa6KWeeiUEy1lWXElVN60QbN1rJFup7GLWuE9xQE40dTnYH0zrui4fgH1kOwbaLON9hpqDiQbrwYPCrM4hg6z63sOPbZ0VPRa9qFbP74NivXh/VnaPk7MWoC9spAmEjIzLUzMz8vivBGihNSbLU0+zoizvRahsTnvoAJhlrEMMttHb14Vk9u6SVvMiGY2hgav2CX0cdAJvHmOx5ksoT2XfnT0cVIKEZRSOcC1jP1u2eB3sekBey++kGdN4uH0Yfw2TA/3T3QOtSqTtLwUS3Q6qO34t/YrB0Lri6v8erIwYYamktmA+dhVe4wZvkPdoIeE+vfQHkG00o0S7+JBqfgCnPk; 4:zqzggagWFfkufLVL3HmU6wLNduwFyL4Ygzvg8/muw1raeEXDO36OhkhPxXaXFcKX5GAeBNb4FT1ir2QZehuaVT88ffazvDdviqkMbYDwDeApx4oB7iAfVOd8qCncdQRYN3Xz04hOxLaMId/YyZBeC2J8eexTMMzupmaGwSiXPP5h/Vew0/JN3/3XxfjAHkkmjAwLf6YXQSqaOrDdjTurgmBcN5cORirdELSrBQQLKDxgFLzXmmKNgP5uvbwDitOKRA7sPPP3OfkrzOVapXoyNMDKUO36KkgxD/phg/VKgj2A02COalVUwvEUY2InJhgJ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231023)(6055026)(6041248)(20161123564025)(20161123558100)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011); SRVR:VI1PR05MB3149; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR05MB3149; X-Forefront-PRVS: 051900244E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(39860400002)(366004)(189003)(199004)(7736002)(8936002)(305945005)(66066001)(3846002)(5660300001)(47776003)(6116002)(2906002)(69596002)(68736007)(48376002)(33026002)(2950100002)(50466002)(81166006)(21086003)(81156014)(6666003)(8676002)(106356001)(105586002)(118296001)(97736004)(478600001)(51416003)(25786009)(316002)(52116002)(7696005)(50226002)(86362001)(55016002)(36756003)(76176011)(16586007)(53936002)(16526018); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB3149; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR05MB3149; 23:cQfAIhWFGb0aw/tsvYS2jT1jM2hFni1kelm6cP6c5?= =?us-ascii?Q?+H5xMA1yKa/3xGlVPGm486A5pvyTA2fNjtRhRzzQiASZK7vfXMyqfETQoLSh?= =?us-ascii?Q?/x+uDUscS60XKzRH3Ok758ZjuZEBTU2NwNaMaqFDRXoQaCuEw11yBOdvt1tv?= =?us-ascii?Q?GWaulF9PBsUJT1zE/2vGwqXmM5GjXwXEkJ2qJpsd1Yiaxxg4IIFsUM4kXRqQ?= =?us-ascii?Q?KL4yMRxMN+HVqOU7vjH8qG/dHCCs0C7zUJSgrXEAR42CHzcbyGQ2JmAAUavS?= =?us-ascii?Q?FMdIaHMJuo6Ymajsvy2VUmeUasfMVRKYPGRGdGri+QTEPhEsWScO+ihal8Q3?= =?us-ascii?Q?3U10OrC/+F/dM1B2eupQF+Y/saPBVnNtaU81dWkvl0FIrhfnCfgYO+OkusO0?= =?us-ascii?Q?Gdzks+6ho0QvG5eyqukBtqNg7ky/MijH52C0h+9ZoULtR3j/0rF4JrZAPzYB?=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m4wcvS4sfSZ8bkLdA1p2Jxxnfp5Zh052sLT/8/0ZHYX4Y6hP8j8Ip5aifpGHdew=; 5:/vG3Qx/kHBu0u6c6WAohPZLbPtYY6SK+AcN6qiEB75w/C7MwtkRjqztN3fcE7afPMuICjCbfru3n6tTo9NcDMe/GU97NobXFUaxdqFRMIsv9peS87CLVcdfJWQ5/lGZdSNa+XTU4JLB0EFlUDacwjMaU3MpzvWlDJef3rB+M9CA=; 24:L6z8PajoTmEl+Db6pQ7dt3nVjLd76S0zxbdb6+1vfT1e9OHy271sUcvEdOhPmz8Oqv/wTtzIePyUkNBKbl/KETECDM8H9q/PqrcI6pLyD4o=; 7:Jf2uDkC+HOMiWTjR1gWsJb/5GJvomoDkxnT6bQEBMopLTIWFJRJ8cJmueMSquK3b6A/aCi9AJIQScNeKOiqwOFxH5wbE2z6MOFv6GqnLvmQAI59FKKzRz9qYPEumSZx23FkYYoMKPPIm0Qhqyh1WH5aIma7fG0GaMroJDUBOueGs2Rv9qhUOj+h9ZHIGHoYY78xTAq5BJsmDztQTTsKR+Wnc+yfb5F6Q4UN+XxlAwKrQYc3Ch3VsOk6nxE4XFiQp SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:28:02.5670 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f7919768-1825-4f89-4118-08d5415bca49 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3149 Subject: [dpdk-dev] [PATCH v2 29/39] examples/vm_power_manager: convert to new offloads API 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: Tue, 12 Dec 2017 12:28:05 -0000 Ethdev offloads API has changed since: commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") This commit support the new API. Signed-off-by: Shahaf Shuler Acked-by: David Hunt --- examples/vm_power_manager/main.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c index 399fbdd..3248f75 100644 --- a/examples/vm_power_manager/main.c +++ b/examples/vm_power_manager/main.c @@ -74,7 +74,13 @@ /****************/ static const struct rte_eth_conf port_conf_default = { - .rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN } + .rxmode = { + .max_rx_pkt_len = ETHER_MAX_LEN, + .ignore_offload_bitfield = 1, + }, + .txmode = { + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, + }, }; static inline int @@ -84,10 +90,28 @@ const uint16_t rx_rings = 1, tx_rings = 1; int retval; uint16_t q; + struct rte_eth_dev_info dev_info; + struct rte_eth_txconf txq_conf; if (port >= rte_eth_dev_count()) return -1; + rte_eth_dev_info_get(port, &dev_info); + if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) != + port_conf.rxmode.offloads) { + printf("Some Rx offloads are not supported " + "by port %d: requested 0x%lx supported 0x%lx\n", + port, port_conf.rxmode.offloads, + dev_info.rx_offload_capa); + } + if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) != + port_conf.txmode.offloads) { + printf("Some Tx offloads are not supported " + "by port %d: requested 0x%lx supported 0x%lx\n", + port, port_conf.txmode.offloads, + dev_info.tx_offload_capa); + } + /* Configure the Ethernet device. */ retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf); if (retval != 0) @@ -101,10 +125,13 @@ return retval; } + txq_conf = dev_info.default_txconf; + txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txq_cont.offloads = port_conf.txmode.offloads /* Allocate and set up 1 TX queue per Ethernet port. */ for (q = 0; q < tx_rings; q++) { retval = rte_eth_tx_queue_setup(port, q, TX_RING_SIZE, - rte_eth_dev_socket_id(port), NULL); + rte_eth_dev_socket_id(port), &txq_conf); if (retval < 0) return retval; } -- 1.8.3.1