From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0070.outbound.protection.outlook.com [104.47.2.70]) by dpdk.org (Postfix) with ESMTP id AEF2A1B36E for ; Tue, 26 Dec 2017 10:24:15 +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=elP1Z3FtGCivahMMjtTx1tpWniJvvAhTKdGHqCbSYhE=; b=TJw9nnjy+tJKPzMBwTmNzZjImAkk1UPfOtmDlKvh4wewzO2K9UcOgGaxFpJiYx4AXWfjGngpUzDEKnFVJeKAiYayxF616BhgZJKhUdiMagW+DqaAmA9+hGttLmhryB8eM7Z/9oKH9JSY1UJBz2oWfE7AoqwCPIj4mr3ax3lsbkI= 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:24:14 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:00 +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: 8a961551-5426-4456-5297-08d54c426e6e 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:PdU02aLfOiu52gRnJfX9GBWAg0iBIXD1WlubH/oKLLjlM2yVnto5Z6XNhJChz88XAGqtn4esfyRjrnC1Z+rqMeA2/KSeSmhpKX/H2YrjAx8eHWRKeFp7i+OqPt9YbQkQPcJiyjopSiEBtXQCPOSLgMx+dc5gawCfWmTTa9q9WZZBDCKH89mpV9L40NgqWVoSDWlQi+SsrafjfWy+GMUSZtDF3JeYXCFl/0tVYk2V/k4NZ96Q3/hCinQpUWC8PR07; 25:rh2bwSdUyZY6aTZYJTDeRO1jVaWDDpmwD30DAkWgmP9I0RTYxDovdMg4WM6C4Z9qjd9eWMtzBmgtK4sXJeRW2VSicdgFZzXX7O6Gas25KRn2XcjSKCGPp/URDyneegNRjefumIKg35Hpe6Apj80hTw1YaSFIL5PxNGMl/Y9lie6I3BcakmLhyNmtSp6R89NDIQ0pmB2Xt4QFzo+TxFJdxQFHloRYMVz21nfp6CK/Oq9ZUE3G45uHTbCnXKdXcvoeOP5ulXBmboRjYrhRda2/PDeL5Z+oXATgCFbhE8pwqCnkXtSajW0MmZBcC7dbrBVZAX9KYZ4SecBthuZxaerWjQ==; 31:Uy2xoeHUcp3tYj6UkR7wlHz4XDLHJteougUKKEVerUllWGl5F1wbosuOEgB66XaOdhRwYsnBNSWx0zKBPOpsDfIHHEcdUssvdxjghHZ63uxgWU1umwtVfHuXqF0Vt6wiMtV1KjK1jHtzdOCfM1HfVPZOD9w4Y89zxtw9HwLMoKjgMThI5tJ6NLpXb3AbUQwHkQvnSreAqWIUdddiyXYViva9BUMt6ewvnidaTsAJg4Q= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:lZ4F8SV8Zo3XySUzAWRKWSZVafSVX7cFjwNPmDMVDjQenIoZinOi2w2jd8iVwCSY/bEVmfDDX3f2m1W3TD5wmNP+c+MsWFPZLBeDQzHLFFh5DZmmYOcBV2LQ9ftHUesEwGcYCekivr/TWFgiBTIVDKx7AFAiD5MVaOz1HcjjtE4VtYYP0M2eqvJpZKkSVIMaax+x4uIgLqO1v6qhjXLT5rX8kO5AiP4Tr5hBRMgnEw401b8k1BXphxfpB6k866u3LiMGv4Ys7yLVZgvGk658NmE3+hIfE2CP3C2Gjfw8TIipG/7V/La0jEoaGvmB2txCARtgvzPXwnaC25Lekj0SKPBhBJcQkr6fmFh7jMZBLzAF7fhmiOpJSw/Zr4fy14KkF8GiHt4/wa8tvjbi6d3f6lzm1tkaZg6h4f4BDUKwsIixd1JN3lnEd34droemDeooUJqxn3fB9Hb5PigUy4L2okmKX48NcMxL8xA70RwqBpLlFuEW0MovMTfvrYls1xDC; 4:0jaqmZ/Xfi8cuza7l24uIp5rD6HCOVSyGrpylfmZlnN6tvZtctU3k6cP83limL385kVJCQ2zyuLjSGBAJD0qNK3z/Nqkto1e4rz8Xi3WxlD6zTB88lPb6IWjkrAhsnz5KnBFyStGu5PuRmHK03ltwEdf2dX9Y/PQI4k+lwPwXZ+vowfU6G562U47xJv+Rn6qgbU1wILZdQR4iZDaQw2pU9QETrt6sq/lfuc6d7kcCWewGvYbv1iEb9A4K7QEh/JPvaMysWMSC+smnVOLHna0fA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; 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)(59450400001)(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:dQ8OOtYbpE62Js0MVno8IwUw419W+jYvt83Ftm7D6?= =?us-ascii?Q?5sVr/w3KHAMYHBOD7Jygbj9re8nUf/FKh8ju8A4rSnQ1hOAZUh3kPjPKl23V?= =?us-ascii?Q?AfScYCiTESvoeQ7TlTPaNTJC/nZN2lyZqnGR4+xf3ZzTPs239/CItMSw2/mM?= =?us-ascii?Q?8hShP2uNI688hnPAgPLYXQE4VgEEibTLhc6P/+RudSb/FMTqKVqT0emrE8bn?= =?us-ascii?Q?Gl4gFluPcq6E/AXDPDwS8Vts91GURIr06TYboiVRs2h0bffoO6ECZtVA227O?= =?us-ascii?Q?ApY2aKwBoGEPB+Sa/dU7r12NerQ4Rka4xZOBZBzgG2uvmCw4aI/c2Gyyrmwd?= =?us-ascii?Q?tU0OBftIOdgFKML+WXQxYqyIJoDsMzjnpQSFXKwkiz7EcbSkbG6VM2PgpUtj?= =?us-ascii?Q?/dGoqJtCtHmlDiPPvvKDScTEQ+EwbkLGlC+REMp/EUcDWbVBMZ54coEA9IUP?= =?us-ascii?Q?2C0fThw8zX4mHfPyziyuEVqJRzJsEymWVcPTwT5AlG+lIDAGgi5fC26CTrjH?= =?us-ascii?Q?er9KlNEc/vcNh9Y3aTn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jH9CiHzTbw2I5K/EkX84TjY1mJzfGO2EhMvyl9fHHiIWJ7bTn+zY7wVzXoZefHqRCaFqzrPBykKZC8p4E65YrQfy8vamCxXwaEcDGOoHxJiuJF9YuvPv/sGeJu0Kqv+umwfsKwYSGbM=; 5:n5vJ7G27lYyhuLyJQXPuBMw9wD/03qpIQmZYSPGDhcRO61sgnQgfS3qIXYitnryy1RIdvlHa+b9O0213cp1bk3U0lD1DQJcqonMKduAqpeo/pxA1oouDJYj9+8EBBUEvh2dnI+usXLkckI8SvXmaoIognD4PF1+5qo2pEkDEuEo=; 24:Okq4q/pq/9ZcLzH/lFQHXJb0j3r78LvocA4eqdJYCLInj+Pb5tDBu6aJcXfdPXYiRh9PQKQEnJICINm38d1unbdHk+mIybSTTgCL//l8fxQ=; 7:4twOAK9/hyA7TfgbZdIe8xc2JiKKNjS3fkm/xsBpwUIRQR5DOM4iwyaXgfbxRLNkIE30pvFRTaPnh6pgwf8ijDwlnM85NwTW2NhTSa/MgOAc1XDMj+ZgZLw4ylLZ7zsNdWlhzxTcGX08r0E5La+5W9TvWSOa72uFEJUiVx+k0zC/poP+lgY/7netNrvYy9MeLGqC58NvU3bYGbQsk2VzCDxPYvQe/O6p/B+7NLnwi/63mzlp0VPmPJkebJ729iXm SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:24:14.3944 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8a961551-5426-4456-5297-08d54c426e6e 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 01/39] examples/l2fwd: 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:24:16 -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 --- examples/l2fwd/main.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index e89e2e1bf..4436ea587 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -110,14 +110,11 @@ struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE]; static struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS]; -static const struct rte_eth_conf port_conf = { +static struct rte_eth_conf port_conf = { .rxmode = { .split_hdr_size = 0, - .header_split = 0, /**< Header Split disabled */ - .hw_ip_checksum = 0, /**< IP checksum offload disabled */ - .hw_vlan_filter = 0, /**< VLAN filtering disabled */ - .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 1, /**< CRC stripped by hardware */ + .ignore_offload_bitfield = 1, + .offloads = DEV_RX_OFFLOAD_CRC_STRIP, }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, @@ -649,6 +646,10 @@ main(int argc, char **argv) /* Initialise each port */ for (portid = 0; portid < nb_ports; portid++) { + struct rte_eth_rxconf rxq_conf; + struct rte_eth_txconf txq_conf; + struct rte_eth_conf local_port_conf = port_conf; + /* skip ports that are not enabled */ if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) { printf("Skipping disabled port %u\n", portid); @@ -658,7 +659,11 @@ main(int argc, char **argv) /* init port */ printf("Initializing port %u... ", portid); fflush(stdout); - ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); + rte_eth_dev_info_get(portid, &dev_info); + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) + local_port_conf.txmode.offloads |= + DEV_TX_OFFLOAD_MBUF_FAST_FREE; + ret = rte_eth_dev_configure(portid, 1, 1, &local_port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", ret, portid); @@ -674,9 +679,11 @@ main(int argc, char **argv) /* init one RX queue */ fflush(stdout); + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = local_port_conf.rxmode.offloads; ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd, rte_eth_dev_socket_id(portid), - NULL, + &rxq_conf, l2fwd_pktmbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n", @@ -684,9 +691,12 @@ main(int argc, char **argv) /* init one TX queue on each port */ fflush(stdout); + txq_conf = dev_info.default_txconf; + txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txq_conf.offloads = local_port_conf.txmode.offloads; ret = rte_eth_tx_queue_setup(portid, 0, nb_txd, rte_eth_dev_socket_id(portid), - NULL); + &txq_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n", ret, portid); -- 2.12.0