From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr60052.outbound.protection.outlook.com [40.107.6.52]) by dpdk.org (Postfix) with ESMTP id 7EB961B3F4 for ; Tue, 26 Dec 2017 10:24:35 +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=Mi8ohE1MCjnYYUFA5j6KPFFOdabF+CF0fLqWmUi6BOk=; b=ca+QstKz9N4ITZcI2qsOi2nXLW/NeSSK8paWEhdhm/SdzUyB4Smr1J/4K9RhZXwSvfTxHV+66Y75P+X2AU7esfhalMpINn6Z5D9P3TnRMqAO844V6z+EVyth08i4PXG2fu1Smbkx65h2soHHMczAN5bfzKWFL9VD8o0vrSrQMME= 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:34 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:17 +0200 Message-Id: <41751b823cba9c4ae3e1dde3e9f460162ab1063d.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: 3027f226-4e85-4a48-6f78-08d54c427a2a 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:R7iDEICHaH4tR6iJIWnDyEtmyweVHkRMRYI/yaKLcm5Q12Xe/4DTnu6oCSNz4giIS8MR76KcVcwgRl80JoL230vATcNCgFngc6bxqhm9J41Jt0eurIQvbv3lnetM2FS18aXLa2kBL4aJjlX2XP5m1A3y5QRnXWGqxn1oBeuUw55P1mSyaQGVtsDCWRtpFxB1v508h7exJSIH8UBnXMstGOHg28OWddMqqOZGn1EmEpunxb6Wdz7AUz8ZZxP8WKyr; 25:q7qqPcNUtd9VtLLjw6Hv35W7sBfbdDUQdGkrBOHjfu5JIUWuWe/Pf6Dv71X09J1i7B3lxtBYtKh2eeecW1Cy6Iq4hvZmIxKb/iobPOZUd5sHa/lCe4D+ceDWwTtfq8EaR+3YloFvVspFVU7yIRc56YXG4kfDplmZrVFo8oS8WizE5H9pBs5y2pNZjea874+Dsw2gejTLjYwgyz4nBmTW2xFEOCktcgA1doh3SkPbEkmH5+iDrR4pfaMUjXCn1B14Bu5xw3yzFJpAb8M2tAV7PIlbVMT8SvpHdXH/aB8E+DoIy2vPiAZtzk06GdgEaafmi2NSB+ybjY30JAawO0UU3Q==; 31:YU6j9N535VrRFZxICBqbXV9H85lOOCRrzsJyRf8OYOZEf0civlyunW1nwhWcqF9EMI5c0K2BXQf0BNUILo6z5Brl21w1LaNTIqWF97u9PP07yZYEn4q9D60SH7PLYC34ObvnSkb2t3UuJamJDQeBxuReDZgE2S7NaRIc2zHLuB+t6/ASPKPHRUw1UXaz1PiJSnxAjsc2+SP1FhXi6FN7mXXckUnkNWhaeT/dGGefQQA= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:AdY4sWvgb87IaKZdXBxQZRc/1YX3vpQpd3PGb0KgQ0z398IL9ILjOSYVP+M35oVNkqCJj8x2otCllfd7I7alNK2G39sZevAKmRWEiIgiMguQwbQYzeCTD0EznapIdZ5dMxa7wMuRP2XVZD5XVht8yNPI/Zdbc9B/xxRJO8gMipYvpWZbtYjt74FYd/0M5LXRHoABPVQsPamurD09h4La/h2ixwHg92bFA2cmYrJhrEypylocecbXBfo9emgnp5MQguWS5Q07Wcj5CWi8+spB/rdtCTkjSjNOvclB0tL9asnx9D8LmS33c0lv41g5bYhR6G84k5U36Gp5+flTEkABLqAH9ITVawTw+t2xwqr3xvnm/1ZxxWWA3kxuwAp69e8J9BPHzSQGdkQOPsrC01qiOItm69le+pxv8Z2J28TOzQsvaLmtJPeJzjJu80zNRX2XVmHw7RYoqNVmYgZeLUVII9IzEZiGf/+cB2HwH2QTqUFCwbsvtEEu2xxiPG/xMVWE; 4:/6JBaesMFD7cLdXZfCQ97SI+ix6JYPoy2Gdq706B0nAFZFKzk4yJarDqPR1+EWlf1ScQXSvuBStxNzvPoYl829Q5E3tp0ntbfzuUv7e9MgfezWun0JtJpAAZwF/SlSBT5d6xkQkVWdoNl2t3HxRzY5PK1gKcgMVtVXihoy/429fwMAa1QHzX4/pBE5VBVBiFE4j11tCvdPrPaU16DxX/J5XJwqyWnSLSiUEd3QMy9rPp24dpmL2/UtxnprxqxKbSHMZGFzSnlaow5ThFCOrV6g== 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:sDD7GjgGCo+OxGMTCPAX5/7Cg23ZaiFmqdT8RThyi?= =?us-ascii?Q?3JgwbJcWzQjUkIn0+hV+XDq3LfGSuwpoF4n+Le/vy7saPM01tFw/g071wMVE?= =?us-ascii?Q?VZNAiDZCRT1Dly25oBJn9OdOWWICuQxpmV0aTxAnqe3bpSff/RzbOR+qak6P?= =?us-ascii?Q?ZqxQ1LlPeWeGeECHlROgK68SnMnFMKwFW731SthcJYEG5fXkFAW/GJy2LG0N?= =?us-ascii?Q?xZJuY99h8rWEv7gmyb4V5+FMRvn/Gtqg9RCQan3J2uN0X3S49jSgez8uiHRg?= =?us-ascii?Q?hYI2rJprKjyDLwSwgqYrRoKAsiEJ/KaLwWSsjFwGR9tysvwlqf45PMXu6B4S?= =?us-ascii?Q?P+U04B2JzhAsYgucMskXUhBUE32dZ+bTtFN8lJ1l2VL4bxkkfsx97Osb2rjE?= =?us-ascii?Q?MYM85r8l+UiNxuYUBW2KSFYoWK6moSC5tcDQkx6XzCVZujLtnn0yKDN8eEIH?= =?us-ascii?Q?sWPJa4aJifm4GYAU/suolHYcXk12jOIi5Om4BeWvKgjq6wnRrNGtP/YCyMNg?= =?us-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kXs/2FAGGdqHw7rwbSqUd81P8De0Ak2YA04P0/GH4wrZyMe/2Wlzrza5rT0iTiDl825iwQDEqMnFDayp43ms53dqO6Smk6Pa4x507pb3lylmB602dYVt+VPGAUzyDkL/tkAYH3a18ANnYY4yktac+VPBRYkV2Mk=; 5:TOt/PtvcKt5L7XVmYnHdC1n19dVKUhtOO6GEPGOFViQbykQ6ymYyltgDnHPAdv9sviT/Ua1otHF3G0OYonb7T4itxTYYu2Vm5SWq7qv+q4lzRShxsfGoyzWKbwr87E7X8J7z58alZJlEFS9oUF42D0U8Z2DN/0cvBfezAG9hiyE=; 24:i8t6xj7Px2j38fINyNvICwzmzn5tNPcw32cNCpsmPCFNPMAH7HiJahjF1FHu49JgvhC0EuoPg1qq+IZpu8MeLssRvGe4ZERihf+ER9RMp48=; 7:vptDj83KT8gEUrVUw5ry+Tmw12nL8LfKuYdzre11FeII1yvge8/JHcDE6W0WuWQ2uZh79SXj+Nf113rPOOvutioeXXZyOG4L8eiFN7i8vrKLSQYX9hToMkRmPvcFrZrwx24K4cA5UyRTlMlbfBtm9Cm8+PgFbwPU5rw+LkER7Q0FBNieUrhtjWZv9XD7DxqM2j+FNU6u/ZmKZ0xsVDezsvV/BK+Rvqc8B7teGC0yNjYiAux/zEcuIghRleB9GgpL SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:24:34.0822 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3027f226-4e85-4a48-6f78-08d54c427a2a 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 18/39] examples/load_balancer: 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:35 -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/load_balancer/init.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c index 3dab7f258..5b2ca1c22 100644 --- a/examples/load_balancer/init.c +++ b/examples/load_balancer/init.c @@ -74,11 +74,9 @@ static struct rte_eth_conf port_conf = { .rxmode = { .mq_mode = ETH_MQ_RX_RSS, .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 = { @@ -430,6 +428,10 @@ app_init_nics(void) struct rte_mempool *pool; uint16_t nic_rx_ring_size; uint16_t nic_tx_ring_size; + struct rte_eth_rxconf rxq_conf; + struct rte_eth_txconf txq_conf; + struct rte_eth_dev_info dev_info; + struct rte_eth_conf local_port_conf = port_conf; n_rx_queues = app_get_nic_rx_queues_per_port(port); n_tx_queues = app.nic_tx_port_mask[port]; @@ -440,11 +442,15 @@ app_init_nics(void) /* Init port */ printf("Initializing NIC port %u ...\n", port); + rte_eth_dev_info_get(port, &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( port, (uint8_t) n_rx_queues, (uint8_t) n_tx_queues, - &port_conf); + &local_port_conf); if (ret < 0) { rte_panic("Cannot init NIC port %u (%d)\n", port, ret); } @@ -461,6 +467,8 @@ app_init_nics(void) app.nic_rx_ring_size = nic_rx_ring_size; app.nic_tx_ring_size = nic_tx_ring_size; + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = local_port_conf.rxmode.offloads; /* Init RX queues */ for (queue = 0; queue < APP_MAX_RX_QUEUES_PER_NIC_PORT; queue ++) { if (app.nic_rx_queue_mask[port][queue] == 0) { @@ -478,7 +486,7 @@ app_init_nics(void) queue, (uint16_t) app.nic_rx_ring_size, socket, - NULL, + &rxq_conf, pool); if (ret < 0) { rte_panic("Cannot init RX queue %u for port %u (%d)\n", @@ -486,6 +494,9 @@ app_init_nics(void) } } + txq_conf = dev_info.default_txconf; + txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txq_conf.offloads = local_port_conf.txmode.offloads; /* Init TX queues */ if (app.nic_tx_port_mask[port] == 1) { app_get_lcore_for_nic_tx(port, &lcore); @@ -497,7 +508,7 @@ app_init_nics(void) 0, (uint16_t) app.nic_tx_ring_size, socket, - NULL); + &txq_conf); if (ret < 0) { rte_panic("Cannot init TX queue 0 for port %d (%d)\n", port, -- 2.12.0