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 3706D1AFE8 for ; Tue, 12 Dec 2017 13:36:14 +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=RAo1OSbmSGL5zM3U9HPLINLY5XOCbEmxbA6aOhaizVk=; b=NOYIbLm8hy9rqatezfCl6wp/ew8zXD0l+u+P/qXvsGcvRPBUugrjQz0Idg4Zyv3sVxKQA6ayiumBYnsPc9p+US/vdIdpLfhun3ZVWOUmPb7r/hAzApB+vFEo6Qi34AicPdd/DakztXH74FfdqT7pzRLk4miZVJ72CCbW11i7hq0= 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.302.9; Tue, 12 Dec 2017 12:36:12 +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:35:28 +0200 Message-Id: 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: HE1PR0102CA0051.eurprd01.prod.exchangelabs.com (2603:10a6:7:7d::28) To HE1PR05MB3148.eurprd05.prod.outlook.com (2603:10a6:7:36::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dd13a9e7-7841-4f79-8f60-08d5415cee16 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:HE1PR05MB3148; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 3:uK9An1Bomm6U8mPNbWewtYoVPSxCq4O+VPcEuQYT+8uktl6d/UHr8TqcqMhskEyCKBquCy4yliSMbZAqOy0Zxai5BZN2Cxb52DLXzxqLWHGok3IPGg8U4fPOd+W96auzez3q5lYmleoa8BsaKYmcFJGBoaxFCoTQOh5Ce3EIYoxFIQNPkuL4hdP9ZJJ2wkYqdnKYOt1iToxqma4jlq1w3YZoXMBXZJJSCdSmbW2jYz3t7DK4cKG9uYYSz8ZQkhWm; 25:EOEnzVV/6W88pKlvfcLFGWd/lgU4sYB1ft6wY/rBV4/teYYjaqwW0ffDKTHoXoP83aPvOfSZ9K9ewdP8vNRxx6JPHgAqI7MHO6u8YvmAmc17jXtRyKd7AYtLCPyttnmKApaMd4ZlME/D1d4isUs2aTKGeLNnO0U+lesUNwB9IW/GPlRLVS10PWAgW4jAWG4aozu9EBzYZUFsklq3r9uciZQ8rVk47pizdEGJpT6bKz13DgKfTLRpIlSpa9F65p4eH7ICwGgIPqnG3u+/nmHkJxZkyCFEeG0ka6/jOMe/IER39gVV63wAX1wGSe8xL7qsk5P3xX/WQ5Vq2aEUGJc5MOLK3EH3uOGYkiieBzRBBDg=; 31:O/6VAiCT34VpkKVgrdgdJJ8OucggIJexCA9as/cF6vSSoyHm52agrNTRVxQtHYD2BeEo/z5MOfbLndBzgsYPI95S8u+UzBoWCNhTaJZu1vdAlErBI/DJSe9fUXYDUHe6AGLFk/zm5SWiQNZaWlfTPPXFCkgbT+9pjkEO7Pr4gnVlgmgG8NDFsDUhw2G9Sl0OFbNYikFKAvqO+Tm6P4ExBvG/1g3RdO6TCBJYWKxjLzI= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:/8mWmMLMPTVegkXIBdk9PJhw0GZGp1SnFfwwUHglC+sFs1mkY6/hA0YyrBGvMojVw5u/rADaAxw1GJLc99exLuQba5s6V/RuO2UEXRAUWGCKP4IGm7FfgftIzGJL4ZIiSawcVm4CFFoEzJZiryGi0x8svxKNr9Ou2QRSYBtIk/I89Dt4Qd8dFcFGYZQgVYsAgs64KM94kA7TtpUTkWKg/9V0sL/XIG/TnvAP0HLKkO5Qz2fcK78hbobiUhvObWP07BLfiI034tQKXaY8qBZGemjeyH0K9FZNyr2TVsXw6Dx2WfSX4DWQ5zbeVJDA9/WNOqUaff+nAtUM6Z5wHIXSZhEQodQJHUzqw3uCJYV6KoAL2+7tanQH3sFqG+SkdJqh/AgMzizIxmjKj0Zb1UYNGB2IUby/LlpNff00Iuw+QjCVls9WU2q/RfSpbJ9wPDyzBL+oFC754f0coyywzkXbdajhvLNl+jI6eCfQU6PidzWy5XBsHF1bVlzP+vjuBA4A; 4:kuskbFlC6L+0LGFOeojY6v/nPi6aP9VuEnVuQ6cSzatl3u3mvaIsY5myC8+b8a3aoimA+6M7tWvHF4L8LetLTsb0VKAvW28ZV/ViDroQSqq3jwaybG1u7F+qQJyIhBYazvllc2OLolFZM/tQ0lHkcLMRbPp4AdpU1of9dOwEsr1PUoDg6xxu3sSUL+iybtTepfBf68C8kJ5kn/XLP4NpkqPAYbOK2LkkmMgDt7G1v77xe8qYHGjwrCcj9uWHgHq0/qIefvyHpfShu7JXd7yReA== 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)(3002001)(93006095)(93001095)(10201501046)(3231023)(6055026)(6041248)(20161123560025)(20161123558100)(20161123555025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:HE1PR05MB3148; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:HE1PR05MB3148; X-Forefront-PRVS: 051900244E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(366004)(376002)(39860400002)(189003)(199004)(25786009)(7696005)(52116002)(305945005)(316002)(51416003)(97736004)(47776003)(2950100002)(5660300001)(66066001)(7736002)(8936002)(16586007)(68736007)(50466002)(48376002)(16526018)(55016002)(6116002)(3846002)(86362001)(105586002)(21086003)(106356001)(2906002)(53936002)(8676002)(6666003)(50226002)(81166006)(81156014)(33026002)(69596002)(76176011)(36756003)(478600001)(118296001); 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:EDR2nrpCFYdOvXIAHheEob1njV+RIPbFAEWWwyvej?= =?us-ascii?Q?0AFAQh/tkvx5p+oSo7FdC7ngR+CemC9XBB6BEX5j+OX+bEYClwjO58TUFPhy?= =?us-ascii?Q?mP1Z5o9ZXN/XxlemSotdKqc49v0rqPMQJOBj1QYz967DAxL1P+YEboo0ITC6?= =?us-ascii?Q?SadTh9NlV0Z6kQj680WfuVFIh9qjfhALDOdOPE1SwttMdsYUdjQQ4N5cnzlq?= =?us-ascii?Q?hbstw0ZcBjizHUEm+aIiYXzaYo/LBOVU4WIEizI4LHC55uzQE52eUIPiI4BH?= =?us-ascii?Q?JlYwA+4xuFCezu5MQWG0UffWm/K5X3izZr9BIAtxgJvIp7XDOedZxXpSNPie?= =?us-ascii?Q?PSySvp/XT6tMu1x8q5+ujho33O3k1jJmez09Bwp81VVovP2Q21rVMMYTWyok?= =?us-ascii?Q?d5iJ59gtm/bPkkNORJBrBOFnNYZJdzLt0PdbL7QRLip5wMu2fKm9/LuH1qWS?= =?us-ascii?Q?gOfjUV1l2QlOIWD98S+xniHNwRacbK/yhfOTcfgvGFwNYUj7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 5:jCXszHsS6GDBVc8h96UNdJlsHljZPD+TpUSNZUjBNWT8dODjokWp7msYdn4osD3GyidF41rUI3sQS7qsjAVjEPbmcJeyWbaJfwpDjQkkRMKoammuidWQShZAxqE9teJzUCJFjkNwU5xlpyIgHzRhcRKunSDh1caKeDpBmz0IfIs=; 24:2MoU99+NunhjnwNglvIRoq8WY4kohP9+25lfKCOQF/IYCoIG+NwJQzP4QxPfkGQ3+MWenJeCxekSFVna5lgPtS59pitqHO3yLeFuMFaZL00=; 7:M+cipyzdENolNHnw1NRcqO2seM7s6SGuha/lYcpPJKYCZTDPatv74TehmrN9WPstdjqISt5vXWkWEwSzMgxkTLgvNRJtCqDyUQfHwhy42QrvqAkKSG+1+RNhXE+6It7+F/ODWJzQT8hro8Q9G8ht72kfiVnEQsxX0NI76vuoF0GuzBKNtbU0ZXwDEN+EBEDAKoh52amwByeC6aMbHfso1kpoMTExfBL9fqPanJ9DU9+EktpRwcHuk0cpnqEAGfFl SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:36:12.3951 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dd13a9e7-7841-4f79-8f60-08d5415cee16 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 v2 35/39] examples/packet_ordering: 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:36:14 -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/packet_ordering/main.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c index 3add7be..4a58e4d 100644 --- a/examples/packet_ordering/main.c +++ b/examples/packet_ordering/main.c @@ -64,7 +64,14 @@ static struct rte_mempool *mbuf_pool; -static struct rte_eth_conf port_conf_default; +static struct rte_eth_conf port_conf_default = { + .rxmode = { + .ignore_offload_bitfield = 1, + }, + .txmode = { + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, + }, +}; struct worker_thread_args { struct rte_ring *ring_in; @@ -293,10 +300,28 @@ struct send_thread_args { uint16_t q; uint16_t nb_rxd = RX_DESC_PER_QUEUE; uint16_t nb_txd = TX_DESC_PER_QUEUE; + struct rte_eth_dev_info dev_info; + struct rte_eth_txconf txconf; + struct rte_eth_conf port_conf = port_conf_default; if (port_id > nb_ports) return -1; + rte_eth_dev_info_get(port_id, &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_id, 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_id, port_conf.txmode.offloads, + dev_info.tx_offload_capa); + } ret = rte_eth_dev_configure(port_id, rxRings, txRings, &port_conf_default); if (ret != 0) return ret; @@ -313,9 +338,12 @@ struct send_thread_args { return ret; } + txconf = dev_info.default_txconf; + txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txconf.offloads = port_conf.txmode.offloads; for (q = 0; q < txRings; q++) { ret = rte_eth_tx_queue_setup(port_id, q, nb_txd, - rte_eth_dev_socket_id(port_id), NULL); + rte_eth_dev_socket_id(port_id), &txconf); if (ret < 0) return ret; } -- 1.8.3.1