From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0056.outbound.protection.outlook.com [104.47.2.56]) by dpdk.org (Postfix) with ESMTP id 9EE84200 for ; Tue, 12 Dec 2017 13:36:03 +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=qBOf71LMumY3BEJqrJ7nw1p6Uce46sdFRQpj+zN0NRc=; b=XSc+Wa4wXIiC3atWQ88waRL38+0JaB0PDXSlvC/V7kofdVbCzoR69fnMZafrc6yRso6qdk6pO8s4uKHmiTTY7hbKrHLCQDIlfwqiDGSxJU5eZJ+JmTDP34UD0kvuK0vLKihPPXy2rGHRWlMLBYfLx1s0yzaF8lHIhOsssFpZyOU= 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:01 +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:23 +0200 Message-Id: <5da7c8e4a34240c31a43fb6110717a7c30627b4e.1513081088.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: 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: 36c0a7d4-7b53-49c9-27d9-08d5415ce75d 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:o2dJTgLlATRhQy5x2kLB505mdiZZW7vV07uk/k+T+mM8REjXu8401IisCNv5qnQT+Y/1+Is9gFjvd18Q+Jb0DWt8pJ6f4N9BfZarGwZPLWWguvQd5v/anVfQmTR9KV6Hy97JUx09aeewcQXBXibgyUP1IBFfnmbAgw8sAs0ZBcCd4glPvymoBdNC+jhnWZm+1uhIYpgTbucVBrNE3ZII90DtMB/gpZtsEfIS5AnKN+6ckmDqRmjiR1REZ3Dx/D1C; 25:F5jiw0uxslY1G2pQSELq7M/pUQu+esBJI5dcFZujdTO+0hfZGyyuX4jH80mZaAsB0H42q5BbWNfeRIixGgRwW8xoQul2PPg1Y5nIuQjRuc7inbRdhqhdkjuil+6JouJHeWJLjuftVh8bDNXpYlFlFUMG+RbSZrH3ml23/Li4xrvUOatgwe4+Q3UHGy1Ao9vt7TUonS/4Ytgf9DZ8v6ngPhXtumCOgC7DOJTM+K1C8F6zfW5qmH/912J14UkLnVuBISjKId1cF3YakTNXLqSjHCigt8Iez0iqyRNC1SPlK1SLvDJAeMKe9HhtSia69ecFluzZ2WMuSSO2v/mG8aAMDfZsoqo1g3sFkkRFl7dlIKs=; 31:WzpX6F7dLmeVRTk3nwg3stI+fOmMVnfUI5qa83eUDqgrk2xnxo149D/SW6HAt/ibFCBuHwLMXQjfCiQ/enNzX5/zSP30vUYh/G82jfa0G64RvOjhy7DKtHvGgs2/kEqEq+G/9tP3pwEz5kAOCprlE4onEnKQ3E2WjzrAKXDxKAW0pcxgRX1d/lG6OHnnjvLnpkTxX9doasLad50hGzKHQOWYOClGLkhuwwT+cDERik8= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:jKSBVcL1QllNJzlRBod3/P52beJR63jneL9MJQeAUuF6Z+FxnPMrm9ebl2X37nLgmX2jOM1kLL+iSuXZ6dLuGMLJLfHInaz4w2sHt/dNwZ4yiHQU3pxzmRcCru64zR6052MSgtWtZBew0bx3549baceWhsxVWriKAn7cDB3F+Y3YQURljn3FJ5KBbgtPvDEWuA3mLh2UPResd8hf+veHk7qV2MCfy8KM9+t14Rf7dhAgLkX8S4Kpz01YV87x19aaqFChxPv0v1c7KIl8BsiuI5CX6QUUQxKuq8sTDfcCzcgzxDLIqT1WO972SYIxvjPJV0oftqMuKlmC90Mm2UuJ/6iQ9lOAy9dpfhSChNgjr3G69JPNp9XZjvykOpOZ0kj64wg091BSWRkYbymNGl/9rjug44M4s9Jr5IU9EFMg1z4uSDf2tp9lD+Xey2HTm3OJ3a+OuA1KpKpR4BYjbEqgUrWznADJNrMR86luXkw4pmDCe25nAI6hVRCYk0vdXaMi; 4:EUBF4+U34/rMqGuFqO3A27eT2i8/ZRUFuS7c213Fxf4tCpvZj3nlmzVpUgKIzeNUoT0bQZB85SAcwSgzSRUmEuUsijCtgKLVlSpy1SsrYRUW0J08rsmNEDt/oSbTWJwkMRagOp3vRwgU+Ha1LjK/fEyxXkhqEHO7QxQT7bAqoOOkjVOOe7WE7XSuY78sa3vR2LI4vlTxfxb6QLZ5LPjqbQTEI+5Jhc44zXH9gzlCH84rJf4F5sIoEFYL//GmwjDxKcVoIcjX6n9mBacj68PaqXqyqy3wrw6Wid77rNIirzUOfdfizc5x2CpiVF6P1CWx X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); 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)(59450400001)(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:KVHE9hxZlJ2gPl6fQw3AovymODPmhUkC2MWknprLB?= =?us-ascii?Q?eMzChj95lOVdgRPR73CB+jtAqr/ROLikF38hdYeM7quoH+FBwNo7DB01o1ss?= =?us-ascii?Q?Bp9zSpip/0GMnujMNiOVPj/Ms5JyQqRl/dnVDJSa2Uxf1ffEBUi4JZU8SidY?= =?us-ascii?Q?GtWCs7wPSqBPLRy8yHythpBoXIMquMWMbwL55gbbqZphw8GppDFmvv0UeBm8?= =?us-ascii?Q?FrZ9iuPvaxDXYTvDRI5OAsZbVD0gEBlLQnNGro9+4cyZ+j8T/IvKvAuN3meM?= =?us-ascii?Q?oOcToMpAhis0uFhL4GoudwYCHcXPUjfkkm3LFgLp+DaDA7tkc29wMsG3S5ny?= =?us-ascii?Q?ktyBitEr14Upgrjzisa2v5L5ZYTjL51WHG5iqQFJmwB41QKx27I5Btkweu07?= =?us-ascii?Q?f8ZN5YOtBRhx7ZumS+M45XfEPH4ybeawH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VFXijzhxktIA4M0QkReu1ED1BPDBJlq+EcvRbO3L86v2SNPlviNOlPmxtwwBbiXBkQfxgzQtn9ncl79uhUDkCFgKSmJsjHhVrchUkplmshmOTYmeuJjoOgARSuGpU=; 5:ZCjlEKIpMsL4vQ51GHwWrQZiyRUWKEAFnKpqrpe5FTJsn2vr5c/lFg0911DSncoyZhmQ5TcRMfaZ8PlJfYmfc70i8J6GbDlv0MQ+AwxAnEMnBN6MHBEBS3Qn+DIpEX1lJuTB3m4s2sjncQpPeBgufefac5SuRBNtNvVObA9PrWg=; 24:8fcc0bAAd2RTNgVfncc6eGvhddebUwd6qqQ3gfiowQxu0MCuIOBDyuEmuwqhREaqxTW+c1ALcyZXj9hUrqQ1qvH+wrKDkdpHwORq8ytfxdk=; 7:POMmp8dVh5j6T9GaoUC9k4UtmGl8tqlH+8z1F2WWt924Np6VdCiajw5wMsBPzVyl8OOijjImECExaAZmkRmbLAOSGroOXU9t8iVbC/FlVEsUIpB3g8/eT2+XVcfJ7a4x+wYjaGf43i+WaF58pDAVhbRfZn8gumU+jFoDvZsWmd0UnQVQQXoLTQzRQyFPtIG1sh4Jfgs6Y4GWS1xKFsnhEDAfB0+sPVtkOjfPStwjHy1t3p/PJApGVcZdOislbFz2 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:36:01.0981 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 36c0a7d4-7b53-49c9-27d9-08d5415ce75d 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 30/39] examples/distributor: 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:03 -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 Acked-by: Bruce Richardson --- examples/distributor/main.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/examples/distributor/main.c b/examples/distributor/main.c index 61e6e6b..c2ef5cc 100644 --- a/examples/distributor/main.c +++ b/examples/distributor/main.c @@ -108,9 +108,11 @@ .rxmode = { .mq_mode = ETH_MQ_RX_RSS, .max_rx_pkt_len = ETHER_MAX_LEN, + .ignore_offload_bitfield = 1, }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, }, .rx_adv_conf = { .rss_conf = { @@ -140,10 +142,28 @@ struct output_buffer { uint16_t q; uint16_t nb_rxd = RX_RING_SIZE; uint16_t nb_txd = TX_RING_SIZE; + struct rte_eth_dev_info dev_info; + struct rte_eth_txconf txconf; if (port >= rte_eth_dev_count()) return -1; + 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); + } + retval = rte_eth_dev_configure(port, rxRings, txRings, &port_conf); if (retval != 0) return retval; @@ -160,10 +180,13 @@ struct output_buffer { return retval; } + txconf = dev_info.default_txconf; + txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txconf.offloads = port_conf.txmode.offloads; for (q = 0; q < txRings; q++) { retval = rte_eth_tx_queue_setup(port, q, nb_txd, rte_eth_dev_socket_id(port), - NULL); + &txconf); if (retval < 0) return retval; } -- 1.8.3.1