From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr60064.outbound.protection.outlook.com [40.107.6.64]) by dpdk.org (Postfix) with ESMTP id 4BB2C1B233 for ; Tue, 26 Dec 2017 10:24: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=+TubFXjuAgDbaaKLUyiAoh3qFkirFmlnTHtreNx58bY=; b=vuBZQnPI2ymHmuxnffPzFzS3twcI/0nx57adNS8yoIyDu+15+bkb0cjIYGddwd51/ZGbTpke4E3sirUIOJonBS71kXvEDc7cs/mODAgeCCldZEvrcHE6b9jIG+TYr06yl+JhLMcO6K81BZtFGZzCjI5nRkgYH37lyFjjEzN8zTA= 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:17 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:02 +0200 Message-Id: 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: eae58d5e-d1ad-46cc-f1db-08d54c427011 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(48565401081)(2017052603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P5i8aXMKKNog3NeL74viPEvq2Bon9HVYTcRb1MZyCg/1Ou4kKJCXLOsq4i4cqST6ZZtZpOVWqEvZVWTPJzcRNUSaaoHJLVuNOw3jx58HI+Ks69bhw1Y7AyDQhuZvSPgyH28PcJ2fBxb+v6ly/umiU5tVWPp04RXOGQhfzwCpmQSe1nzvW1QTWSLQWGbVpiktrq9YQjGFlA34GMXADtyVaHvc8EjFRaB8yPn5mkrWPwmjRSFMcOPYwQG0gZ3Z6LfL+YI12EG8YxEnIiJ0Fy+vFb5a4NCPKStE4D1FFBUHwu1fxhqp+j4W9BYta7Os20BR5VhlTL9SdVF01M4BhXDUiEcAdBV3W424ztUkSWZXa/xwhF4am1KN2bXfl8ekDM9CbF3ZB6xhlQEHpnMGPxeXD4gCm0MXuBZOZubU; 4:4p9qYJA2T7HobcADG3qBv8vivqOGlUEajUsX8nRZXfSDtIsZHX7LcL1QnOKgMzj5lFnETp+uNyOe5Yx2eaT45M5BjIcC/fuKCMqxY8yrbQCr2BjJZXmXHZWnp4AaOskSahLj4/6LJpEjyc2Pe/2LJkKWnFp8xXSwjPvV0IzSY7yalYTaaHofphNvf/oJZU5c74QEXJpTmKDtH2KYsa0cdiBVyfLI15zqBARjSeuRiD8CJ661VtclfbEHdMSVBtrdLJa6by5QLKrDTG1yQE5cpw== 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:XoAvHV6mF+jJeSbeTsVC9LDdA8CIm89AuzRICTFKJ?= =?us-ascii?Q?WzqHAsRXTqif7VJqnktqh8dkyz42AAaYY7RuTd3KzXM8dP7ZA0QUnzqyz2Hr?= =?us-ascii?Q?ilJBQTTrZAG6Ub5kW1fFzp9sqlgYLDOy/F8ZfZcHNXAFbGSw90p6h8QIMSgm?= =?us-ascii?Q?0YUfEMk0AAVJaOFja5F/k/SMgHRfxkf/uNkcM5XoKxkKakqCYbssH3ahI/20?= =?us-ascii?Q?XL+KNHwKgQPDVCXnkLaakgk02fUFG2fA3/0tKuS4ou6g4957E1gLKQfwH/Le?= =?us-ascii?Q?8cVpAaTTpDTr1eY4nbHU+dgVnfwy5lcE0Erl1TZa1svM3FuoQaRgCqTBnagd?= =?us-ascii?Q?V87EH3a4ljzdglOoKHdsmgozGvvb1HZXL1Z0ScRd6F/IOstynHvfFKLVxE4p?= =?us-ascii?Q?ghqlnBIk4HS0H8hcAQqXf9t68ejto/drWmqPRy9XObWmVRWKakr1nIlvSbQz?= =?us-ascii?Q?VwnVJuy3OLaNZMWZHCN2OaJ+dnWAYs6V6Ur4w7UzWVw5Bqb+zyJkfT+ZlbhO?= =?us-ascii?Q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ic5fg4ktJjxbOyfUM7LvcH+09YOKhRPe6nL4sEMIaNjcXiFXejEQNpwuRbpVARNxFUNExMt1uqUSL2E7XeEvLrNam+pbKyQyT4fJqBTTu3uQ+1d9XRxkoNVL1NQSlwdw73jTvn49orZLKlz9gHbrkVGvFvJYg=; 5:BWxWDP6oCxZkdwv4D5AADlDlNamqquGKr2K20ig2gbwUqta45xqmIL7z+YOc3O5Yt8cu3kdxPrru1iowQxxH+61grF4+/Kpjt623m6iy69KKzCnYIinpf2ptzIfK3OzmNDi6jAaFG0BE2KNeIRYEebkrhs3biLeEKjo2WdW7xgA=; 24:xWtDJWmZZkW+JgCT6OCB07nUUs1tBCxHotf1BIklljZxGzGDov354IorFhSkEzuJqCje9bqv6XOXRyRroY8BhTwO/Z4AlUG8br+NZ31jjg8=; 7:ILN2ftiHvtC6QYRXfN7IREG5OZNAic9IyS0Us69Ha4teT34UcXpRaQQcsLAqmDNFrwWTp15MKveIGOAcF+nGi2MbksWwVQmLBgqs6HaMHaeL+B7+KO9ikjMvXZ/A2mK/f9MPQxDKTxIGXutNZboZd9Z1ZyHJzoKdOCcmG6PVj3FjG3vyYLo+gumoAX7gr7UU+P53LcLOtqq9ckfqUQBKqjZulT9W2sBxyw3OczssYuPQwIz6+iRUn8bsPG+7zjbg SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:24:17.1444 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eae58d5e-d1ad-46cc-f1db-08d54c427011 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 03/39] examples/l2fwd-jobstats: 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:18 -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/l2fwd-jobstats/main.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c index 485370de6..a5ba86be7 100644 --- a/examples/l2fwd-jobstats/main.c +++ b/examples/l2fwd-jobstats/main.c @@ -116,14 +116,11 @@ struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE]; struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS]; -static const struct rte_eth_conf port_conf = { +static struct rte_eth_conf port_conf = { .rxmode = { .split_hdr_size = 0, - .header_split = 0, /**< Header Split disabled */ - .hw_ip_checksum = 0, /**< IP checksum offload disabled */ - .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_CRC_STRIP, }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, @@ -866,6 +863,11 @@ main(int argc, char **argv) /* Initialise each port */ for (portid = 0; portid < nb_ports; portid++) { + struct rte_eth_dev_info dev_info; + struct rte_eth_rxconf rxq_conf; + struct rte_eth_txconf txq_conf; + struct rte_eth_conf local_port_conf = port_conf; + /* skip ports that are not enabled */ if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) { printf("Skipping disabled port %u\n", portid); @@ -875,7 +877,11 @@ main(int argc, char **argv) /* init port */ printf("Initializing port %u... ", portid); fflush(stdout); - ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); + rte_eth_dev_info_get(portid, &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(portid, 1, 1, &local_port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", ret, portid); @@ -891,19 +897,24 @@ main(int argc, char **argv) /* init one RX queue */ fflush(stdout); + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = local_port_conf.rxmode.offloads; ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd, rte_eth_dev_socket_id(portid), - NULL, + &rxq_conf, l2fwd_pktmbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n", ret, portid); /* init one TX queue on each port */ + txq_conf = dev_info.default_txconf; + txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txq_conf.offloads = local_port_conf.txmode.offloads; fflush(stdout); ret = rte_eth_tx_queue_setup(portid, 0, nb_txd, rte_eth_dev_socket_id(portid), - NULL); + &txq_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n", -- 2.12.0