From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30071.outbound.protection.outlook.com [40.107.3.71]) by dpdk.org (Postfix) with ESMTP id 905451B627 for ; Tue, 26 Dec 2017 10:25:48 +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=uI0HPbMxHHGH23fWYRihGl+09JojFDVhiLmLYn6zuQU=; b=S7+PVcCbF7AQBDhJ7xiMJel74tmV9xIhxT7E8iAQs8N+d5xja4c+/uC6g/4y92oAketY0oEyY+XH1lGcdaf0K7XWZ7uD5FgXSuYKXDCfLj7fOxobVCT2HMjbPtxNMYT+mRshMhvHDd3VaJu8Q7dDFN9+iC3F/m/nXNlayi2UGs0= 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:47 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:20 +0200 Message-Id: <85e29d6a1f3b0bac8a4e61bfaa07e2fc8f3cedb7.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: 2892eb6f-a1e7-493a-567f-08d54c42a5c5 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:+/1iZx0f/QutmOlw0BiPEZ22oLZGeojOoASS1iKcog6szuXjb41X5sgK3/Bg3y6VpwwtvefA/dSS0RORHz4UziSQXFMQMTDOoOkMgMC8ZoPKSMk9rTlcnZb9Mzzfiq3EIAUoFSGHbE9AgtmrHUInOVZUu3BQjYin1CoK70s8asJjRfzg8LF+aI6wDqWTIrr7RBITeJvLSlGwN7+kzArJDCNEOkNw/rZgt9IWKeSha6wiDc8VXiEYrCMn4UvESoCY; 25:/DcsPnNGW/ibgBKPkuFG51aA3ePMsJvZ9ahq59WerBM1R7PyH5/SlbezP2rLyngSNSqqPA2d6l26lbKfpwqV6T+ifxaoGtN+TELxH7/v59O+eI5usEVytzUCt434Mvs4CmtkbjTKYazROFxhtH06RniYlk8vB7XgOoZbyYwfvkmyMP7e2yKnWxSgrhb4FCuGDrd2bGkfiZHREQccWFgrqjOAxGprqRwWj7Y3GbLjByLU1vpD9lXJlsq1RWI5mJOPtjxBp1qIDOoAUBd7iJeFrzYnDx7DQIjKH5cMmWksQyEKkehJ51waxiwrMNGo+M1gGYLRrJIsXoIvXt6SUM5beA==; 31:7IJ6wBBrsNBOvrUVubZ1KRZ+YJh+wfu9EZy4qVoI2fOjHsv3kkXG704jx0D0uHu8GKmVaDB37sDfnJUS7p96PH3awyPhcefuXnuTQSI+6HrTOTWtAjnUbpuef3awHc5/ciNf2Gq63SweKk3OMjzSZu5pY/3RG/hG4pDtl3ek/cwzysGbkIJnvbFiFBpOcES7AYb3LyPLQg+Ynu2PXCB5ygGwWc72+oQuT52cqJRO0s8= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:sHBHTKdODW7zU0ZcJygVBuUsEkZsqIv13/LJ8E4xAKtmE256oi5wWAXDnp9XLI2HlbjtHQ+GEWwvsorFT05ONOKNnoBybqyEqdeVOVvrzKrmMW0w/K1awyz4TryXDDS0GuXJ1DelEP6OG/pLDWpmw8xIc8OwGZBV6GUqWj1rrzincZzI1gHmrV6C8eWobl54Ms/eFVJImi7o1fp2P5YeOU5tqNcfCVwo0vdHrdBLKn1f90hN426jKT7HFqqx084YwoXsr8vfBamH00zCnpGVtyFrGBoE6ioQOAv2+Y1Hmr8xoNHJi3nNylVwSQ844HP3LlfhhK26rKI7z9Si6TtSyJBeXLTz8p6QOOdPWXWMbAyM+3ywCSIRlf+FemLhCkKKwKzg10Si40hMQmnw5r/PmgTtXlzzO/ucnvGrw4AT9pVl09pYFtpdOB9yiTR0vP8lJlhi+8FSxpmrPLx0winaHbMpaf/qc2ZxrGZCfus72FWqT34Su8qVyFjphNmqz/00; 4:12BWN3gVkG6LXKMvaLWvXjdrfhbrCE7+FnsSz2LsOArND/bKQWsLo2lt9f9Qi2lIeYJoY+WGMRnDR9kTI3XyUXMr1ZpJrR8efJx8KqObTDXC7EvZfNlmhUH/BbZUIyAE9dk8BpoeJvLDps6RUXdRxZpmLupWoozyMCKVLf6Z64KfK+dKeZFcx1yTRz3aluMNGhjwr3Qw7OksN8n4q8RrmDI8yK3S9s4kr2d5CHoO8KPC4VHTGtNVJN9/MH+rXsKsm8o+soqI88CbIEi7z71Fxw== 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:0BUxIuaQIkpuWv9dh/V3vCnJIitgoMgbu2I/std0n?= =?us-ascii?Q?XSPCj64lD6wgQ0pXk7UZBJtyJ7qhXmPUSGE25Y9RqAmLN8whzbjHK7nO7mCu?= =?us-ascii?Q?u4sy5P4JAR7O0hWIbHdXHk2KHDMaZR3LZ6L2/Db8IqXXO8oiiQQSyTifTZo1?= =?us-ascii?Q?ns9NlFGZJaSO6KHtA8VybmGjYaWIa21V9Cvqr5KjcSxRhT/+4ggn4hyLPSxS?= =?us-ascii?Q?f74qgcrutaJFLuva4ix/ataC0+9ntwv3P4i+GiG/9bRsKvQzU/KAULK1J77A?= =?us-ascii?Q?9y996HnH5hZ94pJihw5G51zOuRu651BANM96YVkP1nKMttufPPyFY8UeE+SR?= =?us-ascii?Q?yJ8ki73PfhsJqyUPXk7eziUCAdPdRGj0L8WokRGEWUalXEMrC/v/GshYdau9?= =?us-ascii?Q?JLJUJZlj2yz7G3D++A2kgAE7TRP0iZdhfDw+NpWU3PRDO0yPli+bRUGgXyz4?= =?us-ascii?Q?7Iz2mpLhQq997pihWBQ88e4iDoydTbvhhqc6fcyowCkSlFiISzwE25FTxOPt?= =?us-ascii?Q?NZGeLXXiVaXN+SBSB7sPH722C3clOAW53r0xphvJDRn7FuQ8bsDtl3QhQ01v?= =?us-ascii?Q?ojQcxcEWp+CNZql/vOHFdNhW/bdmZcjQXrxHlMSWRs+AwBEu+iSlLHbm/TbK?= =?us-ascii?Q?tDD+ZrE3b/MBihd/Pk0Rd9RqC7bzNT7/1ifs8SPtAE0dumzt6CJ3cC4HzK/k?= =?us-ascii?Q?dGI0gtiMytIGsz7umganXtKelrYr7guH7ZYHg552qrP8VYnstQH4I53I1H3T?= =?us-ascii?Q?6RlaQ7iw6lnJG/1rY1SGvtPrTnrzJQhxIlRM0ct/GTKpZq+4ELXXESSAc8xI?= =?us-ascii?Q?y2QwUjwFAFbmojrQCCvQECglQu4SVFIG00KntladeMVq50x2liLqJlwGeejE?= =?us-ascii?Q?C5K1cr9OSjRd03mJluPEOEjKFOxBtcfXfpdkLrZlITc3US+caw0DEdVD5mml?= =?us-ascii?Q?y6Rd1HVN3qGStaXTSDE4JBHzYB2eFg5lY/sPUKydiWL0H4cFT0a89EKwUOCT?= =?us-ascii?Q?AZ4qtssZY/zD2NB2MesNrimJpRiy4/XckzAzGPm+FmFJwIm2lx1KDgoEDdgi?= =?us-ascii?Q?4Akl9IJkU1wLxqrwdd3rxfEkBxzXH4LpD9e8G0lg/6HJY7dX0Lh+ybEAwdem?= =?us-ascii?Q?2qqxAns/305RwblxAAaypeMruUwRorU+QA/C/L3Hmxx0zfgeYriqbNqKo0tN?= =?us-ascii?Q?EVR9x+argVatXQ=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 6:WFwW9SjAUYkfl+eYojf5G7Q/aIaBE0NWXWTM+D/eHwBCE23NFbFsy70VZk7EKSeJpmqQv96OMi9JUt6KKijWiLrw1vsatc+xj+ugMGs79z3ajGMVgNry2qUqGaZimm38dbzfkAFg82znoVCDFMT9cJ3iBBaQPixmnJ3/kl9pPgZhicHOixlq5R7mJR1zWHwVJOMVY93UAP1SaMa4mDLDtYWtEuSZUTDNbX4RqOiPjtFHBl0CcEiCXzqmqpvrgOBWJDJXShSHl3byfAlQNRJa3gHoSUkKXT/br7xBsBySSmN1TOAePIHR5SxTzWRXzH2jjwJc5ytGzfpvMlxRzWZaCLS8L44Bn+Y7/PA2qo2OjZY=; 5:vPTxnilZl8/P5kqNe/NEOr7SfiBhaZz2OEMSuxTdNEBh4m+qNa8G1f3ecmldq3tl3AHY7rcld+I2y1qdNFahEhhGWSO8sqBTqpWfLQaalRXyJk1vniHUqc7PQBFW0cCmfRnllBm1vmdYClhjl4T6V9AN0enTWbQyQqN64/zoW9U=; 24:Re1Jt39u4IyAmt531WX+ORPcYBMXCChzW/f9fKtoOVFCsw99Sd7BcXN5smHPBk3mnnwCT/5kPOZuOzqGkunU0IklhUP0QnLHwnvvRPxesw0=; 7:oOSPwOmv0gNBiWOw38XSBrESeRzu3ywNAELeU24RKjX8Uo6SpG5DKy68yx3dF6kChjmzB2Sficd1ys/mHy2XPDF6lVxigJLspOoP9pfH1XFJYYIyGrSfTeVvxbbxVfBBFPO4VfOTQFnMkOGqfgKdqyhKu6QOQfAiV4SSsS/djC4c+MK1Vinffe0Jc5uYvd6+zXds9l9vqTv5hnW3ghZz7Ntc01WHy8itK69/6ifX/9hgd2/WQdw6scrzTvAjyH4m SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:25:47.2237 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2892eb6f-a1e7-493a-567f-08d54c42a5c5 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 21/39] examples/performance-thread: 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:48 -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/performance-thread/l3fwd-thread/main.c | 37 ++++++++++++++------ 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c index fa65234f3..ada4c785a 100644 --- a/examples/performance-thread/l3fwd-thread/main.c +++ b/examples/performance-thread/l3fwd-thread/main.c @@ -335,11 +335,9 @@ static struct rte_eth_conf port_conf = { .mq_mode = ETH_MQ_RX_RSS, .max_rx_pkt_len = ETHER_MAX_LEN, .split_hdr_size = 0, - .header_split = 0, /**< Header Split disabled */ - .hw_ip_checksum = 1, /**< IP checksum offload enabled */ - .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_CHECKSUM | + DEV_RX_OFFLOAD_CRC_STRIP), }, .rx_adv_conf = { .rss_conf = { @@ -2999,7 +2997,10 @@ parse_args(int argc, char **argv) 0}; printf("jumbo frame is enabled - disabling simple TX path\n"); - port_conf.rxmode.jumbo_frame = 1; + port_conf.rxmode.offloads |= + DEV_RX_OFFLOAD_JUMBO_FRAME; + port_conf.txmode.offloads |= + DEV_TX_OFFLOAD_MULTI_SEGS; /* if no max-pkt-len set, use the default value ETHER_MAX_LEN */ if (0 == getopt_long(argc, argvopt, "", &lenopts, @@ -3551,6 +3552,8 @@ main(int argc, char **argv) /* initialize all ports */ for (portid = 0; portid < nb_ports; portid++) { + struct rte_eth_conf local_port_conf = port_conf; + /* skip ports that are not enabled */ if ((enabled_port_mask & (1 << portid)) == 0) { printf("\nSkipping disabled port %d\n", portid); @@ -3567,8 +3570,12 @@ main(int argc, char **argv) n_tx_queue = MAX_TX_QUEUE_PER_PORT; printf("Creating queues: nb_rxq=%d nb_txq=%u... ", nb_rx_queue, (unsigned)n_tx_queue); + 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, nb_rx_queue, - (uint16_t)n_tx_queue, &port_conf); + (uint16_t)n_tx_queue, &local_port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%d\n", ret, portid); @@ -3612,10 +3619,9 @@ main(int argc, char **argv) printf("txq=%u,%d,%d ", lcore_id, queueid, socketid); fflush(stdout); - rte_eth_dev_info_get(portid, &dev_info); txconf = &dev_info.default_txconf; - if (port_conf.rxmode.jumbo_frame) - txconf->txq_flags = 0; + txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE; + txconf->offloads = local_port_conf.txmode.offloads; ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, socketid, txconf); if (ret < 0) @@ -3644,8 +3650,14 @@ main(int argc, char **argv) /* init RX queues */ for (queue = 0; queue < rx_thread[i].n_rx_queue; ++queue) { + struct rte_eth_dev *dev; + struct rte_eth_conf *conf; + struct rte_eth_rxconf rxq_conf; + portid = rx_thread[i].rx_queue_list[queue].port_id; queueid = rx_thread[i].rx_queue_list[queue].queue_id; + dev = &rte_eth_devices[portid]; + conf = &dev->data->dev_conf; if (numa_on) socketid = (uint8_t)rte_lcore_to_socket_id(lcore_id); @@ -3655,9 +3667,12 @@ main(int argc, char **argv) printf("rxq=%d,%d,%d ", portid, queueid, socketid); fflush(stdout); + rte_eth_dev_info_get(portid, &dev_info); + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = conf->rxmode.offloads; ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, socketid, - NULL, + &rxq_conf, pktmbuf_pool[socketid]); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup: err=%d, " -- 2.12.0