From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0049.outbound.protection.outlook.com [104.47.0.49]) by dpdk.org (Postfix) with ESMTP id EA69A1B21D for ; Tue, 12 Dec 2017 13:27:49 +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=yBpoiQVZSbPjj6bdoBVMCZZiTPz02uzE67nJ1U59xAM=; b=Qw9/vjk1VZ9DVJ+dHObl91nUsMld7CRL+eAxzjUXczXLdL2s6paChniXmb//ZZOMBkn14CxCqQimGSaXfcaEi/CpYrxAshBQuNM3lEDxAadwVpmGWA2fJDNOY/mGMg/Ixbhz6Y9RNJ5jGXDAImNZkz1RNvvXW5Jlc7aOlEcszfI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (82.166.227.17) by VI1PR05MB3149.eurprd05.prod.outlook.com (2603:10a6:802:1b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Tue, 12 Dec 2017 12:27:47 +0000 From: Shahaf Shuler To: dev@dpdk.org, konstantin.ananyev@intel.com, radu.nicolau@intel.com, arybchenko@solarflare.com Date: Tue, 12 Dec 2017 14:26:35 +0200 Message-Id: <2997db6f3f7baf2d7d88067b23a90e5dcc986ef7.1513081087.git.shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: References: <20171123121419.144132-1-shahafs@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: HE1P191CA0010.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::20) To VI1PR05MB3149.eurprd05.prod.outlook.com (2603:10a6:802:1b::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c60b7d6b-2669-41ec-c891-08d5415bc179 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603307); SRVR:VI1PR05MB3149; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 3:Ktqp2xUEP1JB6BhkHY96urt2bOM5OgdVFeRadmOH0ohA8KvAWL8z0Y5GfDrgy3VpvxobDXzLsfZ05eEdoxlzwr90MajZsJov2RNDsOdiPjPfdPvDQ41r2jlfwHg33WBP5uULZ1PO+zLA4yQTnii0Ls22Qt+15QMHtbcyl/DjenTGQx77jF59T1yHQ4QFD7y7PIJGbnlzrKBykqY4gl7DyDTW3C4+p6sbbwHboGeMypiYmDZkx64t6FsJ3i3Arjoe; 25:ZqcMqRRh3GlggTCMh5CJrIczPlXs/DKWNovZAbJpRSv561A6AVY8YNPfXyPyD2avazAUzXmgrem1pJhph5Ts+mxGU3fbHsxlxRwDJ67MXKcDHpXcCoPLnN2u47b/IvNY6Ixll+a2bNjOQhnqcOM5ZPC5cZETxqPPqC8mOBe035i9E5yU7nkeAnBd5lhEGv5IqyjBsh+gwXPrLXSdsg4Y55AnbI9WXVYcOwwQm6Wn2c6tASID/ncDqLAfaEl+IGCc79vHGvIJNVVd+vWim64crzRbdA55H/X8vVosg6YzWCzAYK21aKL+mnpTldEXOH8IG11XWdYohSD/nyzgraLs+w==; 31:PxdUmYjI5g6Fv7/BzP7wH2Ad5ZFbLtiAvDwYsolKhfBILSo/dK2oP3DJExjvcgfnV0YZQ8cjWEka/pvQNMaknqDKzbuD3mXhziuQLr2MqM6u/B6Gyp0dH25KzZwjMw0iiOUuPvXlsxNlGPl2vXIpE8qY+a98DKLg8HC49EvxNqJhLePwjPENEuZh6z/ZrIoREz/Qu4jWpL/8wgovwgRwKE5cVEiaK0LHW8ZYnIBSiBc= X-MS-TrafficTypeDiagnostic: VI1PR05MB3149: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 20:6LX/bEhBy1bHlptgepG958g11fu1RuXyVQHaztjYNs6KKRkv5wqDJIbUBT+o/87l1cozYnm3p0kUKdcEccisgRoBA32ch3UvNaY92UY9B6iL9+Vz25depq7cQQcDXzxdZaek3BVjpH45cqoxWSe8ZFP30ZeYGJNMALG0QUzur3agmSAyf2LviT4laPWfya05xFwClaD8qnVBJRgaC/KdfOK0P7Mb2jFsg2N4SsPYPaKck9WIM+mM1vh9lMVDrwYTCit+BiMysoyDE/l+ZkkxUfWz6OPcVl3fXqTbx/KcMeXnXdRGHYVTlxMvmAhY3xIn2pW8/H/k8Bla4zFUCwnDjO4rMEdlFWIZL7A4BJCrRGkocW1GqsnFxlPEFF1QZh+lcGE5WTjrZTKhv5q1SFJpkcsclgeipq1nzKYK052PPWbeanlraLZsw5QQ7TbzIn13b2XH33iBvKRp4vuPW+qGYJDKTRG7uChqXJkuiz7ry0oi2/AJNXcbnCw5bn+8Oj59; 4:g5hSvpL7upAu7s81U3kaD38HaTe+k1MlOowxbvVdc6oLNdBed38aixMFhVpQAn9J1HJqOl08phuLo6hJOTOmXXIGsBUXjk/KpSEs00PqDY4BBI923UhngFoZni5jLunhJ7CkHzwXPtuv3o0brXxFOGsySYR+0s0sf3I88ks82qOS+vG+zGOOX3eg5KMTXB2HDkPsMaFRuKh4XPf5I3/Y0tCp0nybP6xw5SXhw5TEDLSKvzL6aGvYeffV56Io12/vjSB4m7e5Tm3PjlES622HDg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231023)(6055026)(6041248)(20161123564025)(20161123558100)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011); SRVR:VI1PR05MB3149; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR05MB3149; X-Forefront-PRVS: 051900244E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(39860400002)(366004)(189003)(199004)(7736002)(8936002)(305945005)(66066001)(3846002)(5660300001)(47776003)(6116002)(2906002)(69596002)(68736007)(48376002)(33026002)(2950100002)(50466002)(81166006)(21086003)(81156014)(6666003)(8676002)(106356001)(105586002)(118296001)(97736004)(478600001)(51416003)(25786009)(316002)(52116002)(7696005)(50226002)(86362001)(55016002)(36756003)(59450400001)(76176011)(16586007)(53936002)(16526018); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB3149; 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; VI1PR05MB3149; 23:FDf6hJrYfpE9VAXE2OMvbeeigy45kllPubYpSjGbY?= =?us-ascii?Q?w7Dy7u3FCt7TeMyOrvR3vi29/YuKLA0iOKyv/uvyvTyPM4xyn3H3GXlNqwMy?= =?us-ascii?Q?4aFFCva9K0pNxNJNTyxFO0HkUmWWflP4MshnYOsWORWy9F/yUB+GC+jWTHmi?= =?us-ascii?Q?+Z9B0lEg3iSl8yaNstA4jc1jHOIqQ9f6SuPZAXLdYozfFZ0Wcr/U+ZLNEmgw?= =?us-ascii?Q?hHfeLHGASUP/fVfl/BeqL2r6GkMG5+hn0i+bdmvRa/+u4HN8bsx/EZrp7Kod?= =?us-ascii?Q?BZpiSdReak1QIDFznxgUIBHpKaMQSw+bP4haX6OjSpgqFSJWTuOMl+zIUMIJ?= =?us-ascii?Q?CSL5xMEWZlc0f7sFjDKW0DfZDOn9WiVaXbrRgVWK9z6h8uo+S2NyWab9+pc+?= =?us-ascii?Q?ZYVfDce4/UhL/9Q+fSceuDGXcYRcOTGv+zkXKWp0hn2g5PJzdzOui8bQu+5V?= =?us-ascii?Q?qWgS8ssUR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9RglGYl3noSKgq/QaqAj77okRMVnHd5Mh5DcHFooWeKKUQ5sjC2bdVibVvXEYd+U4nK38HsEF6HDyelCsaQ=; 5:JKUxMzwHOb4E9c9eu9sw2P0fPyeeWxGqO2L5n/LidzXBVGt5bgoAnK6MBvTXsMck/f+r82eRqj154YfcEjJU0tErQVQy3w+q9DEPQW2FCra875N1mTevJYN4UvdapkKaDb3GZZ3YC7v7nTpjLaWq2c1BUW1FkuIk7owAN8Mji7g=; 24:wolz68Ve8Tk+N10IaMrRgD3qe8gniRAhJ4tyJIJeNH8lFvc57+1mudqYDpo0TGlxSPKi9HgO/juK51mDeOaTRcSB6HWHFGKGWFMqLHYYvEI=; 7:WetPlQ8opdukR1RgYk0zyTpCZa9NwPQER9sSAtneWytHq8Nmn/5y5eA/ssEzAc2MqDIo6kViqiLerQrXmjh4Ate/EeCrm2VAoYkogDMQdi5WSHVpBpslF9QKRc1PnPEIpY2OectskO6rFOoRTsZVDvqy6WGJGrdhe4LutTjkBoqneAni2SQ/5sPgKM4G5SGEwEbCXNKX7DqLRLP7jTOLcGRW3QHyNomuqJyRqocWTGoZy0vvs4iZOLYuJzu8jUhh SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:27:47.7856 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c60b7d6b-2669-41ec-c891-08d5415bc179 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3149 Subject: [dpdk-dev] [PATCH v2 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, 12 Dec 2017 12:27:50 -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 | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c index 3dab7f2..e348fc1 100644 --- a/examples/load_balancer/init.c +++ b/examples/load_balancer/init.c @@ -74,11 +74,9 @@ .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 = { @@ -88,6 +86,7 @@ }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, }, }; @@ -430,6 +429,9 @@ 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; n_rx_queues = app_get_nic_rx_queues_per_port(port); n_tx_queues = app.nic_tx_port_mask[port]; @@ -440,6 +442,21 @@ /* Init port */ printf("Initializing NIC port %u ...\n", port); + rte_eth_dev_info_get(port, &dev_info); + if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) != + port_conf.rxmode.offloads) { + printf("Some Rx offloads are not supported " + "by port %d: requested 0x%lx supported 0x%lx\n", + port, port_conf.rxmode.offloads, + dev_info.rx_offload_capa); + } + if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) != + port_conf.txmode.offloads) { + printf("Some Tx offloads are not supported " + "by port %d: requested 0x%lx supported 0x%lx\n", + port, port_conf.txmode.offloads, + dev_info.tx_offload_capa); + } ret = rte_eth_dev_configure( port, (uint8_t) n_rx_queues, @@ -461,6 +478,8 @@ 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 = 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 +497,7 @@ 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 +505,9 @@ } } + txq_conf = dev_info.default_txconf; + txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txq_conf.offloads = 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 +519,7 @@ 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, -- 1.8.3.1