From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30065.outbound.protection.outlook.com [40.107.3.65]) by dpdk.org (Postfix) with ESMTP id 296881B6B6 for ; Tue, 26 Dec 2017 10:25:59 +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=FbFF23NTFIrAUZJYKLISf8kLRB8gf73eEInZl6lDlls=; b=fDwH1gLMf6tww4FsPknHBXYFhK/oDqpXKvFRcFWn8X6up0HlD+IlXB7VWdHhbRGhGo4Qe66R2/ttUlt0AesQsuW5AHT1O21yNSQ83SK6lfR+zyFYJmM4DEV2RDSVhyRzXnbx6afGFmBa2tS6SRufOwuZGTpZ5yeNykI9xpRtuJU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (82.166.227.17) by HE1PR05MB3148.eurprd05.prod.outlook.com (2603:10a6:7:36::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.345.14; Tue, 26 Dec 2017 09:25:58 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:28 +0200 Message-Id: X-Mailer: git-send-email 2.12.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: AM5PR0102CA0023.eurprd01.prod.exchangelabs.com (2603:10a6:206::36) To HE1PR05MB3148.eurprd05.prod.outlook.com (2603:10a6:7:36::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 11383fe7-8651-4c1d-7285-08d54c42ac32 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(48565401081)(2017052603307)(7153060); SRVR:HE1PR05MB3148; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 3:LVW0W9YKTuQS75gmYo5W1+oGPYK6MiC+lx6eFfSkIWhrpCAzZuIM+MMfpxyAIvtHTaIF50pQZAeu2N6gPBWCHxXdTQ5iRMNXedV8asOAfDL2GIy/3Xgi0ybcYfuz+w0k29higKK1jzrYSVnFc2n+DGPUZL2xOzfzWbutW+mgHhGSVlagAJjERlB9YYPF71iehccuMu7I2orSSLcWJ5d5WgLvN2TKjDPaX+4d/Ja11nbIWhngO+4UITIuHCwGPdic; 25:a5n82l8aeg3eR6bgrCY+l7lzAZolISUKSaYVn9io3RX/zkEakqZkP8PbQy49eB5KIi0nu793nwyqMV7PtmbOVZOqE8MevG9fP2TvTqodBP7twy3WQHwuGaDYCqG4Dqh3QEBwvGcl6usbMyLL6hoWV3fa4U7N2LB+2tAgKgTaXbuIzxcLoGGObX3g+TPL4cab6oXTLqAOTbxfF2k5yLLHIFrMRGesA8hUP7bqmvDTN5oPMnT4yb0J9zaZuGP36cYHZNIdE7KUXqE+Ix4VMyHN/tXKBbNtYzdP/IL50rHRZJSybXLxLU1efexLmu4Q7u8wycvmL3ciIlNtSdLvVVOjsw==; 31:7BoKz/Iu6MrZI2e2GT5km6cluXSNpCoiPheBEgq8TX8IUMgrPrQCDxozuR++Ti6PudK3+YBfaW28E08a8iNOsmaFBVo8ElJtqSuoMzAMnLtS6rqVkJ8R40ne6NUZIcVOynaX/eR6cIoNg+8Ndt5ld0Hi8nQQSY5tQ2Gr8Bl9CRqn/jDk+xii6+AboILLMl78TUvT8HNDVWCBbdUhrMdKDGdhw80dqag3Mnad4uvgcgI= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:h61LcC/OUSap9thloFy8Nj3/OFESDh46pasqzu/gK+fGaWS8IC+QSy0LdR9XyiKOPhzUqrdIRIHkXJmhNhydchq9I06TKM0H/MNjM7S10NcGWUJtydwEkHRgNcHxuOPe9pFg5Nl3oEnFSAnRPCKRkwf2IgHAo7d1H0wUj9ETbOfELLb8YS3ao7rIDbp4vSbFTUL2U5s8nOCwLQ+srP6+gq9nO0NsMbI4MQ1S/63ET0RWG69j0SURcw1F7ci+tVuKiD0qSJjzjfhf4v5Ij754GCYEN31yjEZEDv8eB9GKm4b7qNG775ZBu7vbZvbTHKh+KHKLw2gdaKuK/fLgOzK8rSWkHrMxkDhJEcS/UOd7RKEFRUXrth7FKoBdIiiSGLGSEIppR+Xb5VZAu6F1zlmQkOTLgipg1ZyMwQpQyCo2/k8bm2L/xO+pGL8+lAFjHC15rzuOTsuGdCe42+NwycJZjHPdclgIi5k666H5zrCBpH7adfqWrFm/Lqf0kgeOrguc; 4:Bo9iB/BJk6hSjn14eodnW7CD36G9yv7bULOFBW2dFuPvpousjgMqZ20pCR0rp7lvfits1xWJ+9TyVRrSjvoCDy3JGXgYG9cMsKJ/9SEFeHPWybuepFwErVQdwH6Gip9wuZ9Vi+ZoNaAf451jnG/kymqM9X6qsP0l4C3yG1haUQqKJzF9bw/zwSQUdHI+OHW0Xue6ixZJzYZ5mg0O6mAVJ4JI3NtgoyTRBH4vcddcB2+arSzwhfDTVJkx34BtESQE08BcSBj+I7ePi+aP+1VXyUj7i1sPl4+rMVK0HeMFZquD/DX2nScJHIG1NFe9lQwS X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231023)(944501075)(10201501046)(3002001)(6055026)(6041268)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:HE1PR05MB3148; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:HE1PR05MB3148; X-Forefront-PRVS: 053315510E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(366004)(39860400002)(39380400002)(376002)(396003)(189003)(199004)(316002)(6666003)(55016002)(105586002)(478600001)(106356001)(69596002)(16586007)(51416003)(7736002)(48376002)(76176011)(52116002)(305945005)(50466002)(7696005)(2361001)(2351001)(33026002)(8936002)(25786009)(5660300001)(50226002)(118296001)(66066001)(47776003)(21086003)(16526018)(36756003)(6916009)(86362001)(386003)(575784001)(2906002)(97736004)(53936002)(68736007)(2950100002)(81156014)(81166006)(3846002)(6116002)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR05MB3148; 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; HE1PR05MB3148; 23:XzdTyNjZ98yWGJfr66Y+OwV0I/61yKxj6EkUdV8Tg?= =?us-ascii?Q?eFll0cYn0V1QIjP0cfluM0C2nLsPXTTQpFR24tPsATNh/F7ReeofqaZPz4RM?= =?us-ascii?Q?+nGf8Dg/r/ChD8nLfhyKpG/SQj4ZwE3mMCUqQD84gnIsvd6jcG3BRAfwGk+m?= =?us-ascii?Q?QwJUfZWDlgzfZuQaWUG8i1LTQTzHCZoL1gGXG5KPAtEchYIz+CebfkLkFtXN?= =?us-ascii?Q?A2utHN20/EzGZyVkoEWjh5FErWnu7Acgzo0SJ5rNMK9Q8Hs4Vysy+3VDQBBi?= =?us-ascii?Q?BzjpfjAErhigMrxz9ceLAP91+zfnk49mhlLQ6Z932GUTMcpChvTL13qw3eon?= =?us-ascii?Q?vavzdYv7ptAkjXae3pdcEYMVKvpxBNiSd3r7KStRwtjH2WdkHE5+RvaQAy/4?= =?us-ascii?Q?Tn/VoXaw/mFJF/iGYloESv3rvS9JBpGSnZbyBZNmZznRWM0kIIVhy+qK+MjQ?= =?us-ascii?Q?pQNKU8sHmhkqXwU7HW0iupNn4p4GdnbjYK3C5NVnN2MH77Aj4Cyk6/ndH+hM?= =?us-ascii?Q?Cd/qZI1nT8Qj2VqYkj+jPYzy9xt5YuerXzjFc2UfeqjsoGAT/kGnJmcoHi4+?= =?us-ascii?Q?XXBodWgoUUb5G3C3PtrD+0NJHgOFw18SalHdyw/yXys5Yw1UoYx8bBXiQFoj?= =?us-ascii?Q?U6kg0wSE/VRmHL9f9h3V5YpTgSspdZbxVAhYtGAYWLXDHHoywG3VTagfXKEt?= =?us-ascii?Q?nX5EFBKIBjkVRjO+Q1ikmgz4cqkLi5J8uCurePhGIeIdxXopuvfp/GlQABWL?= =?us-ascii?Q?3JYgigj+DdF2DzVryKnsPmZX6k0RhTDi/hNduUDEQxRPACCOyjw0JK46vaZN?= =?us-ascii?Q?lDKhtMRCLow/+1eucl2BXOaSRBitL8C37m5sDaH+pgJGqh60jiy7H2ir96QZ?= =?us-ascii?Q?JZVRucgVyxEoLArBhzfhSxE6zmVhAu0g+Biu26InR9iBuR7cTBgmRwqi6RXl?= =?us-ascii?Q?DLaeezTDp+AuOuKLa1nETzUr7p9EmCggW3XOMel6MyRF/MM2shbIC63RvECo?= =?us-ascii?Q?3KIWvfu531ZVGbdKorNgZGda+ZyOwVDKBc0V9GwGM9uBItldX3ILEXo+cHle?= =?us-ascii?Q?NYBwBydUqSNky2PI7ulgD5xpVqTpYgWMDDi/9PvBIqtDBzfGyC04sueqOI+T?= =?us-ascii?Q?h5IIBIpdsn+J/nigRwfsoEmOz8NxkcNTDHu90SQHYXdGvA1UpE88OTT5Y/rv?= =?us-ascii?Q?BiC3wpryMr7nKs=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 6:YRukpjS9IT9PCUN4Kkc1CBSrDG9LXuqLINkX3WdjHGv4mkzD6z94d9potfiJBXt1dnYQfmdJIljMyNvGUG7UKwNCkwzqHnzKX4Puv3dTUlZpW5mHtHatGe37QvalkApJTovULoInIgRp+RMeijr2HqoH2DyncwZW9XmLOepTLLLx0MZtKFKpFxMHog+KpmomCv177aaB22aYa9LJRywuyWONQzohI0kUaP1mOPZn1ctRCSqHxaLPzdI/LV5+4cZpsu/l+HPw/rCvEs6lNNCsv5R4EZ+P+NffwdKv+cTrr0gCRbDg3dQGxNCcyFJ7k+oQvFCJEwRMFA0d08sB5/GSEwrwwpwrTmstlc3dYMHwW24=; 5:isFEpKSVOMwtBHKwWW25EECoEJ/I5ZsWAs/PAsPX2zMo/1RCtNa+YjccLnk2y8fjibEQ3yNI4F9m07DeSSYoiX9+Y5p8teF4YPsrmz2tBEtKHvemK40EsdNPCalLZEjniE7oy8OYED1RL2rsKws9t+vfZrso8AGKe+yUDnjzPfc=; 24:c4ZYVqvUxiNGs3N2PxDdGNvAZ+RPi6kgZBb8Z3COcsxGrTZ7Orkckjw6eAOyoh53Xrf9WPvbh+GuGHFcQpzCnSLDR8yE80DEIqGJmzaLqis=; 7:x2AWA79QrgUKyp5zbV4ChTGnhMrk7wiiRcV99F16xObNoSK41/yevEnHCzagPcsSKbR5zwTbbruqyk9B7bQTqajkavfyMkjXd2rXZcvMcTpqOyeQP/PCdEtMWEwlKwguoAVeg6P7nSC8kqFj7fe2iiUjdonkFbZ3LApdWmEsS7whmZaklqBkz3UoK/PyWk23FUTPFzfYbKBGAvM6WxVQBB6XRMnzT+bulxFz+nzZO9gbyERaCRn3p4bvBaQFtrhk SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:25:58.0207 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 11383fe7-8651-4c1d-7285-08d54c42ac32 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB3148 Subject: [dpdk-dev] [PATCH v3 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, 26 Dec 2017 09:25:59 -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 | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c index 399fbdd43..a0dcb97f5 100644 --- a/examples/vm_power_manager/main.c +++ b/examples/vm_power_manager/main.c @@ -74,7 +74,10 @@ static volatile bool force_quit; /****************/ 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, + }, }; static inline int @@ -84,10 +87,17 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) 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.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) + port_conf.txmode.offloads |= + DEV_TX_OFFLOAD_MBUF_FAST_FREE; + /* Configure the Ethernet device. */ retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf); if (retval != 0) @@ -101,10 +111,13 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) 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; } -- 2.12.0