From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30057.outbound.protection.outlook.com [40.107.3.57]) by dpdk.org (Postfix) with ESMTP id 3CBD51B633 for ; Tue, 26 Dec 2017 10:30:56 +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=Y+rBVOiqAT1lUGPiSgOJq/rfEUunPnQnstd3rwPyLgI=; b=nLi7hire3H70m2AauiEegU1ckoxbjsR50pswrnrkmd/IGagpkFZHzrn5T66uPw2w0LbwAb9LMn4gIJe1aOod6Zad4vVIJYlYnRc8Aw+8+NO6MHSEyPErQy++DJvMzjbIsVt3OqxZRgDF8+vO0+lvg/sq/9bEQUcCC+HxBFMtuEM= 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:30:55 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:38 +0200 Message-Id: <6007b400aa7e04144b623544a35888900b7b2055.1514280005.git.shahafs@mellanox.com> 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: eaca5572-15b0-4818-620d-08d54c435d55 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:kgb+mG19xBYVhuUyGryTekgkWACU9QzkFhoWMYYxYen5dE9OyYZr8fskuADI/KO3xOuOOWzfFa2Tj8R/q08Akt+/Y6cXC5bjIuv3ga47TtmpvwLEBscnRTQdC/sSFZrmahuD51IMxPLXS0Bq6gfTGfO+ACJ0OVR/4gfxS9ysEvO89htF9yoJgTapDeB0QKt7Jpj7olVE7us/q03CE4wjIJn8QT0L16UkXPCQ5dcSWDgzyHwuknm0x8GX/TDQZo3Y; 25:EIom5MOmmlNUcbtl2sfrkx7Tc1UCDqJptX+CP0lwk2vyriLnZQTYlPDOFop/fnvY2YoJRkR7h0ZG1arz/5BJOcKJhQ2I6v8kGCBl8E7Ys6dsusqfwDVveHIyXh1h4Anii06Sj0LIddLZN1BayeEZhBmEs/kb+RPTWZ+FBwRCjghW9x101018589hn+BY16sv6aU8wv5fgQjIvJ0UGZvRdjFfHN75wPCDtenK+ClgEHaO4vcYVy862aGSTFgEPU/w+i/8Cq6f9zfZIcE5RPxSn1Y4IOR5so1Q980iBe6x2729DbMMQJh4nTxgExeoRKEp6TdEY3DSLrOFbCfmWM+sQA==; 31:UeIDTUoLWGRcBIusJxj1W9RNJmYpNG8+jd+MJD5nLFMO/t1fPHrUfzlyRLIY4HUccAnAiSsfHVVO1gMMVgeLZjiBqj2kyjLhKzWbw4NcySaj3ycTXTBSLMkzEzpDqahch2dBPfJwlFoTAmu2ywdJnp4j0HeFXZ8XvDvcjn2BM2gVJeOzKcaySi/FdPKkTUQ2dFu9rpyR5++BnfuDNWkYJAKQ4jWQpV+b0XpY3EaBTz8= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:/uTlrVMnv+fj7T2IjJxlTdkRySXPrVjBuvdskkZLd44kN5uIabY2qG2hZyxhm8pLnoomBM7YgWFw7kl38WVv5KffB1UMYKKW1g96T3hIYPhL+t8ZY8zo0PQ6nuym6cicRh6QIQgjmi3BDAOPwQaOZ4i5kc917A04KOX21G6Ab8xytpq3pq4N6KY4iAVpzBI5Mf3tJi3hZGZEsnHiS4pnVegw8RmD0SHNHjgIarcMHVVCCNqhyKa1IM1p5mChcNQJq/KvDi04jhwmi7v2QB59aFWlLMnzTV9u3viu8QtCAuZWE8/SaPFl8m/HMUXZWnxFW/i4OzU/1v44ZEJLEP2JGY5WN1OZ+9G+lsnkEEHVRqrXZvEOmn82yGDYHCgEH04s1FrEUYwxQQ1IM9UwS1kzcngt8MVeP5DleQcLv+tj2gR8Blb4BN8FXClClJRehD41vOJNfb3QZ/1ZT+efUnOVENhz2wbZOZkoNG0HE9FBlwr+Evw8BXQyXMe2xdS/BDuu; 4:K+EpR1bjUX+T5jZEj1MlNLp4TH1BbIAWDKyELdwjCHyoaTgCKy6iRWTw4kHSKbutt59wb+Q7jKdkRZG/BjMhY0V5sp5XDG7adm9mZzpTDmIhs8qRT6gOrJkSMmEg0wAML3d3PWUPli/5pGBEzgTJyYOElUHHvNU57ict1BjKgDNFFEgOk61ByFPn3D6qbrxEND30uin42m50VR08tMzcEYe7Md8b2aJn7f54vvrv+pRZwj+0G8dqwf+SzxhOCuNTryyl0BKJwFzoskmXV13fharFSCF1q3QlA4UBH4YT2Mm4M/UnAowSv11lbmkRvfv8 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)(396003)(39380400002)(376002)(346002)(366004)(39860400002)(199004)(189003)(50226002)(118296001)(47776003)(66066001)(21086003)(16526018)(5660300001)(25786009)(2906002)(97736004)(3846002)(81156014)(81166006)(6116002)(8676002)(53936002)(2950100002)(68736007)(6916009)(36756003)(386003)(86362001)(69596002)(106356001)(16586007)(478600001)(48376002)(76176011)(51416003)(7736002)(6666003)(316002)(55016002)(105586002)(33026002)(2351001)(8936002)(50466002)(52116002)(305945005)(2361001)(7696005); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR05MB3148; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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:43pT0IUuM0IORMNoMLoWpKclWnQ9oqhL66uuefh0H?= =?us-ascii?Q?K1+X1d0CkVvRSUH7xIXK21jIwTsfxBK0IxQelnWldgQynGpNvw/aV1Du1K8d?= =?us-ascii?Q?8QYdj9E2yccI2l+CZvcd/3+w74kFs4wai52kyXNxC7kX6p4ZPXG9ugwrSmSd?= =?us-ascii?Q?Nssn0Hkm1JdqxgfoFtQK1I2f9Le3fCtB0m8InWoApr2Bqi5M4W9UVWe3Fm/j?= =?us-ascii?Q?JgsiCXmrW3NPz9Y8lMXgW9hA6JDagJAMuqB7COt/gdCZysOkduJxw4UfLDUd?= =?us-ascii?Q?6pe7+9poku4aHNkX/Tbx50vC5JdtL3MkreLdtPrG60R+0wj3rrBEZsX5AZ6l?= =?us-ascii?Q?F9IQc3CY528Tlv38vvf0s5+a3S9HzPPwi3tUP5s1Expg2KplIuJhM4PefBi3?= =?us-ascii?Q?INWNjwaj2ZLMt+z8/oWsUK5ICpTAHaiu7p02i+FzuodQzxTZYBvADnKU/nxr?= =?us-ascii?Q?3XGHiQ50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ORSzWT0IBNaxXNrYvJROld84lmctBDq+kHHjiHRWw4PWejHX3xnwi1jszyk+f2PuqLoxdfgwKzAicvbJqfAO6B7cI8ra+D+Ojq9gcF+sLFEoPHPI9bcVT7Dmb2BSlA+XDcWA/9vT8wL1K42HIXmjnozWeU9uvIyC8c7NrGQtdvWYegDpGwkEfWFXcio+aA=; 5:VPyQl0U56eHAPCSzhQw+w7CVGhiwMjqAkX36XCnlkTIoJ8kcQrls3pU+hqNJa8pLad814tcDAoikdvtrWdRHFoDtYFqwIDRb/EAT8M/Z3icnc9oaRpdTlK+kZZJhjlHl/EXofoHbvlwQ1MRVg0G3PnOGoNxLcr+wLFWfGK+wPNI=; 24:LK/RaEA2MZ50AWDIhAdYK3lC9Ic4YvSRDw1+ZjByYKT/eXSqLWfZP0Pdk09PB8/kAm1ucZ2e+SnIolhmHGJP7/6dhv2LwUdqf80fCUC5EIs=; 7:8xnPDwuXuce3Nt0w4eUBz5a6LjYC+/jsgx9T78laXtazqbVzg1IutOVvzDmY6ImcmKp5ure6SZt/o3333GjN+om6P8ROti0MZ6CPbKV7/N81KxTi1YB9oXSur0ix/VH8899ev6byKbEcksSifMjrFy0P45euieOaGeQATJZtWdvcauhXmC4Wi+8XnnJ57X+rVSbbG8rmrNI+Zm90KLCsZwOqGcoK4ybaJFKfTYgv+FUkM7hekFTd0QnS4PWEslJ2 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:30:55.2064 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eaca5572-15b0-4818-620d-08d54c435d55 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 39/39] examples/skeleton: convert to new ethdev 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:30:56 -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: Bruce Richardson --- examples/skeleton/basicfwd.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c index e623754cf..b46c4325b 100644 --- a/examples/skeleton/basicfwd.c +++ b/examples/skeleton/basicfwd.c @@ -47,7 +47,10 @@ #define BURST_SIZE 32 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, + }, }; /* basicfwd.c: Basic DPDK skeleton forwarding example. */ @@ -65,10 +68,17 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) uint16_t nb_txd = TX_RING_SIZE; int retval; uint16_t q; + struct rte_eth_dev_info dev_info; + struct rte_eth_txconf txconf; 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) @@ -86,10 +96,13 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) return retval; } + txconf = dev_info.default_txconf; + txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txconf.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, nb_txd, - rte_eth_dev_socket_id(port), NULL); + rte_eth_dev_socket_id(port), &txconf); if (retval < 0) return retval; } -- 2.12.0