From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0040.outbound.protection.outlook.com [104.47.2.40]) by dpdk.org (Postfix) with ESMTP id 901961B197 for ; Tue, 12 Dec 2017 13:36:18 +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=jrJHT7pFTfNc8Cvj4lfTaY1S3EirV/DVzD5kFZU48ac=; b=YLFjBZrmhEWULUbEICWChn1H8AjAfBQZEYKi9g/StaiKKIFNwySpwLvu2tHfAgS4XKDspc94FQ9C/zxax8IKfk8rInuNsagjdNI7qrK0N67MHaRxFZ8AkPL9ZzsCfwwo7LUpkfEHdTfj7aQ8ktfvo9wDxddkVAvcGqxMukkefL0= 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:16 +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:32 +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: f207ca19-f3ea-4b32-5f4a-08d5415cf0ad 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:3zpqXuLDgiFgyU++5By9OfP2o3UDjizOwHbV/naA7PjKXmjhW1+rxkzljCrzs9xmJnfx2eudr6m8DCrQIAURcyectohyI07bIPIHVgSkfKz9h/F+it92UUfgn36wXlo3bkwfGvGzMCIzFCeMw1QENUf+eOQALUVhxeTuTWFKXPlrnH/ZbIGFvruuT/FFw2sK5UWe031WZaGPBpQPxEPGkN5wbydegeHc1GwsNljkTVfCOrZrAxFQkxCN71MLvVB3; 25:MBffFmdahbq3JSMU7MSZq7sNGd8pfN0ikA5iqMn9hG13T85jUH3o9fQcAea69VjAzpNp/fapUgCafEFf4WaHke1ihPnVPLHeAiU0nOuQhkKw2f+WmXJkVqDqMwoL5XYFS8khK2FEcv+M7BiYoQDu4CtHbSg1VneRX4epkP+tr24SDuGC5UdJ/kUXlKb+m1xjvhgrm6Q8s5AHgJnXUwFxdWIZT5nMt8CGUaeivPl8KV80fSUCXbFFNYRMZCv+cVtBnyjo0hC1dQw0b0H8EWI40EGRhP5gMXsoZLGx6m/cqu5DGzQGw3Pnqx7MMT4SZcAo/CqCvx3oZuo6fwxZUSjTbgGCkqiD4HL8NXB6/TfYglw=; 31:c7NTuCs4kT+2yBNp3Z/cUAccGr0Q5AQsaauPVlwiiuJ3+0o7CEHb3MuzmB12ePtQqBxuCPk3YnqrbmDx4xoQHBRLbqGjRk3eaKyfND6aczg+yI+JlOeuRBkf+eChf4xffnv6r2EHeP4EJvc/yXO6ieOZ5JcVGCNd1Jy9zCgJ9Tu0DR5BCDQBkMpNHorXRbZpnyKnVaQXY9Ui88HDlaofisPCGoMO4q5V0zv+CXdovWI= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:GIWvvRhaSh6/pahRWa1e+dbiNcRuQjLGlKa19oGbuAE8UrqLtxslmgeurjgGkP+4f+leW+5JxZxXa4Wp9z8a0CX3Em9jJzuZ8L7fjPCDC4W88YPVGpxy1f0FL2RAYiiDcFzkbkARBaRn5uAt9H2T8Pf5l1yUe31pKzDWr0QOzXQ4Jy7IvMhRxSYwaufaztmHd2YKi4bb0uJKToFbutSoKMErieikbSi20x+hiolDnyquNtYXr7GE4DT9pCMSwa21eCryrcc1gvKwhCqYf1KcjtrjppemnLec3+S4ZjNqeZriazLXRrCmxt9NWwPxdkwK7uNPuoCOsaidkx33VzqGfRczUyRic5uyvEl5H1QFmRDSJAt8wiOTQmYbXdPxeizfcHtFh6ZLHrVkk4lga8UEvDL3Lnk+gHtlQCqSywItxI2uXlrEHaF46zfJ6lMN3dqPVBaRcrZIdo4d00n+swqt6QeA5c6YcEVOXqSPTKoU1fo3dhjenLMCRMYIrgOXqvkb; 4:rHILtc047OoUT0Hnrn+0j1qk7s0sy24fNdwFUF1rJ92QdMw6yK/ockgAd4IHbZ/CtOecp1KeR+yTOydF0q3w7vOiaCcQWIgmJKhGm1UmmRkEWYzc/JbiPVotMwjGCZKxu56ku9gQYuE00hZHmbeH2osYzShP/qdAOB1oZfcBJ8alyOE0/5wtByH/laaxh05zD+qsT3l6S+e8q+C1tqk3dAb60GaOpLvP4dziz+QV/45xK/hyz1M8wcgaj0qwQFXsaBemA49YML4RdeuQsb3th3CQt4+BIWfhG9xH5aF77f1f7a30MbgabwtPF9ca5zUJ 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)(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:ig+24dWMaEuMtEwnxmdu8gtI1k22lzulwG8lP8IlJ?= =?us-ascii?Q?jxHS8E9BMA7PcYB+EUXwiiT8Dy5wEhXdZgIaiHv/66YveaEokiTMB1Tkz0qg?= =?us-ascii?Q?y8ipYLX3TEMZwf2L4BxuD22KrqARkYrZ7esjAVAb9W025A7Impnvuw5bByjd?= =?us-ascii?Q?l1dWMygKWtR4g8UJyboQUYuitgGF6ECYzml0BRW9Kouj+BbBe6qvQ3NujbKF?= =?us-ascii?Q?c0Sonql83cfmkmLSh9XUGTr7XuA8nQiEWKv0zMnZBifNPzXhbElyxFrHJypM?= =?us-ascii?Q?23a6zpkW4lauPrwSersLTU8RPhRlMMOzAMwzGmule0Qh+51M1+PzFPRxPBO6?= =?us-ascii?Q?9fEofeBEhoJfJrD6epawYU751tZnCGl4/6lNxldvj2D/sbEFsxO26M+X4WU2?= =?us-ascii?Q?ppG4QFtuIZn/SJfw+hHwaH+K4xFluoBppSTlx5wZ9YcT057Qj9Xl0cFCngN1?= =?us-ascii?Q?A7RZK/h7wcz3KbtLv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ZYcI73J3q96ZHaWvDrTbqHi0o=; 5:uUsQILeUvFHGLOOLdIxp0VZ4VcvgtfDsIgCRC+V6sAri/4hiTzVcfHyAPbaHKeH0+2sfZVV/Mzdgj3dunYGmsaxGuo2JsorqXXa9f2kaZ4Jx4nPFH7mgf1607rQ3ei2VAVtCtrwVunZwd+EXI2f6glwuApu2hRdt4/KXZ5RjbZw=; 24:CJMkvyKPyVclNT7gDEjuXNqaBT2GKxTJQamdBBbgpTxAWiP/oDQrDvlpLbIePZH03mAK4ISvkbU7LJM5f+NL+atW30+BYwJwr4ICt1IkmmE=; 7:yClzEauaGA5vZv3TaOu4KFS4Hn66+Jg3qDpRnwZyg1MmSBx7wfLGgXSrWdsuVaHKsaErmFlJDqUj9yNdcSESvSPr9EoEY8OBYkRszLsw82w4IegFkQzs2evCouJxbFdT2+hXoWdqxyMm2/mmFbFf8R5xsxGB3IFu/pmaY1bmnGw1BewfGqKqGkGqkzXfZbIjjvQhRXCKU3N90ZFx37f0Roq01ubm+yypWo1SKUseeh7FkS7WqDbwNoeLBj6IxOuu SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:36:16.4108 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f207ca19-f3ea-4b32-5f4a-08d5415cf0ad 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 39/39] examples/skeleton: 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:19 -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/skeleton/basicfwd.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c index e623754..02ce7ba 100644 --- a/examples/skeleton/basicfwd.c +++ b/examples/skeleton/basicfwd.c @@ -47,7 +47,13 @@ #define BURST_SIZE 32 static const struct rte_eth_conf port_conf_default = { - .rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN } + .rxmode = { + .max_rx_pkt_len = ETHER_MAX_LEN, + .ignore_offload_bitfield = 1, + }, + .txmode = { + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, + }, }; /* basicfwd.c: Basic DPDK skeleton forwarding example. */ @@ -65,10 +71,28 @@ uint16_t nb_txd = TX_RING_SIZE; int retval; uint16_t q; + 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); + } + /* Configure the Ethernet device. */ retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf); if (retval != 0) @@ -86,10 +110,13 @@ return retval; } + txconf = dev_info.default_txconf; + txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txconf.offloads = port_conf.txmode.offloads; /* Allocate and set up 1 TX queue per Ethernet port. */ for (q = 0; q < tx_rings; q++) { retval = rte_eth_tx_queue_setup(port, q, nb_txd, - rte_eth_dev_socket_id(port), NULL); + rte_eth_dev_socket_id(port), &txconf); if (retval < 0) return retval; } -- 1.8.3.1