From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr60086.outbound.protection.outlook.com [40.107.6.86]) by dpdk.org (Postfix) with ESMTP id 892B51B3FF for ; Tue, 26 Dec 2017 10:24:26 +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=LwmHWIC+6+VWli3FCxcdyA/jd9ukbmjXrkimPc9i1/g=; b=RfDEPsbuwhzYxLBTnF0Hny2ayA/etVQP6LcJocLC7mETyji0qB5K9BADNY1rqx2k7uC0oBJQXwiVufHVdWqqIgVjHy+zZSsJ6EaGOXE4/oE3Jdm7CcydZdLNgIWtBYC5jOuDWb1l0agv/ta9arcLvZ4NY+nf6mXA2omJP2UFYWA= 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:25 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:09 +0200 Message-Id: <738b520a0117ffc3508f974bfd529d7ea886c2ee.1514280004.git.shahafs@mellanox.com> 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: f06f88ac-1d63-41b5-cfa7-08d54c4274fc X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(48565401081)(2017052603307)(7153060); SRVR:HE1PR05MB3148; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 3:t5oQvVhNtC8OK8swk5elswekHUfz8buCLO7cYeJybi0vmXEfMdLGhCmcGEb7kcOBFP2cg//Te24Rh8Zp2+EacY0dXw7U4f50GH+ne5rvImjzw4zNDFXL8pavv6O7v6h0+bi3O35nBYxE/I2DPMGPLlPZEqAFEIgLKshUJ7Arws/mQ+7oeqKZp8fJSr8CO4OdrsAdFnxRY9fsXWHFORL5MlQ7EvVUokrHoChkR7PlXcH0NWeB8mTtdRcs5JBVEf/n; 25:lcD9ABFV6uSPav6ydz2TA2F63LjukGtsqE1KBvaLpHXFknLKqsNBMtKUyyu5R+bqr8uf2r1Br4+x033Bzsw9NSZvg+Wmq1XXstVNJ79yjQV4Kt55Zb3Emmxl3twsmgeI/23319haIoNi2Ut5O9yndHMX/tR9NLTY5wivvEZu/GYmNdtdT1W/0Rav+j6q+js9wdSI1CU0yvM9W4+AZ/KUtlyspogRrUgJfigbsU1MNgFlY0516Ju/2EQLoX1k6M2lr64Llh5J/Rt/tJPxd+8yaxNDGv3yKLUIBqjwNp/MuQsyNDagdd+l9CUi6AdS1cWbjyEaLSakchOEp8pJBUbNvg==; 31:L0PgnM8XtSseJkHmhGpkkONO/fPFi92wDdH7aPTCPwxmNULClJsgZVjQXad3nlLFPDC1+RiBmPJ8pb0nPXy2z0Tx1yOLzzoM27mbRx4VuWX3le1ifgb/zeRlzgUpMgrZFs7FAM4n3WAqJya7udL4maTBZ3CqAIZUGmtRvl5Z9vixM/njWwyoIBb0Yj1cAGk1j4DIpd4kvzLdZokOfyzI1QEw7PN26pnqwk9O8jsXt6Y= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:d5kUDnDkvU/ee5FOPPopm996qrfy8WESOZW14Q8WMn2EkVbj3O0sP9gXCbTOge0/vs0R5qZnYBxjFdvQ/2+O+O9Z2SY+h9HC6Lj8cxTVwyfA4K9ANsqkEzDJncrM/EwRiXDm6/sh3uWNBiYyXNy9YEfTW4iG/p56cyEd4co6kCcLG/OowdWnPrK0nFg1VB2N1/Qqf57OT3tjwVwpZvwJFAGk5DZ63ZbjsCL03RPTtkdlYeWlbGX3gsKhLtXOnMnNdroee5qFvX4YQhnw34lZgWAHDTfoT6U6N3baZwRsiU1NZCtPNg6bNgYDygY6EPQGhJE8RRvIdtzT2uXGljc0rMLhv8lFNLNj1CHmxuFo4PTnfKTBgW8KpDUWRdFjS3rKya0oNLjcmuI0d805T04hDXo1kEZ40tTdjZHioN9JHkO/vt7BOV5r60dsO+2TLjq4CAZ0dfxQj0XkPjz0QAPlzN4/Oqa/al+uclU8tM0KG5VMX5dffehiaVVpYLEyHB3t; 4:WUavCqiLtgDCAu2D95YYlNtIdC/40pub5PMZBzNo06WgPcvXaS1PI7/Jr82RJLSmCyU8kqDRTnlVLXc+n7k8WMpweBuFjSApHPZiPpLj1ujGsgoLLmGADe2+B7cvnEE7yMsej/yv8f+7KblNyakFyiAo+Wq9PF7nuuvRfyPDrAd2rR/c4hdtbOMpj1i5IKh94LxyO2U3YFoDppjo99k4A3MXPz9nnQqJ/kh6Ud6YhXIiPhfs7AjLvwoCYMoVAsIXb3a7GrCA8f5a2eEuCoEucQ== 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:WYYQ6kvwC9G34z2+ly31GedfLF7QNso/5p2R4eNdP?= =?us-ascii?Q?+UUZTk4LZA/OTRNi/evWUySO0g9ntrg/uDYxA60KNpLz0i4sTrj9OSIW6sxY?= =?us-ascii?Q?J4M6ECIhkhT0fyp5Ktv9GlButW1bKMDdd86Rwo0YlAr7hf5s62CJwAfLyguR?= =?us-ascii?Q?2nQc7bvCvp2Lo73HMmL3M64KenAEXkv14LF4QHxtr5J1+ZJOcRnJHiXnsGLN?= =?us-ascii?Q?1fLJ34G5CMMsllxXITybL5lb69ypG8xM0p/6vYuAN/cZeb09IdKwT+P3O8wy?= =?us-ascii?Q?Zs1VyXEY0Z6LUo81HJgiCVnQVwDnZJfphfVEro37P68iwaKdGVlk15L5+zEU?= =?us-ascii?Q?32XQiiGH4vkeMK+b5o5zX7XW7jlUKQmO4HE74WlChOPewolCtNYSLIPdIaCc?= =?us-ascii?Q?7z0Ecskic/oS5o7g6uBN5VFboiyAize5dOzeNsHL+pZXbHocERxNQWtYKvno?= =?us-ascii?Q?znQ2cWwizgOu1NANnnthCSz0Ig6xp2CdcU9UAiqR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U/Xmh4s1GGAmAxQHwp4Z7Zno4+39mAoFLtAUrntwbX4G/JXoEz28TuKl05fSZ4pojr3W+mqea1f6md12XB6OCgFLlZ4hGRUZWXNY+e8NnWXyflkCOdCOMKtOcN6QofaeOwru3rXwlaQtP9ugC0JZSaU95L43uhQ8aLEFT8KPI2USY8717zLcf9dsFnrJZRlW11bk2RW3tLTFRg=; 5:Oev0gum4iXmcjoTDT8A7VwZSOq5rTFr8pGhyCXwcAC3aQvCzcGu71LgTRwxux+v257nd19euAbtPgvfMfcC6cOCPn6IlrNq2Ya3VrFbtrq+zOL8vEFWALT92UpD8w+8NIB2gxVFDcwdsfVNEE3Z2K25aEBLrQn+Q5HcRfGRV1e4=; 24:4cQqvn8LBpn3hDdA/T5MM0U11kyVskc1vvVU5Yo48EEPwNCKshfRW2k7avz0HD7QktomEAvgZC4WF4QICjSa25E06p2W7CclQrcvSdqql4M=; 7:2wlIZDSvUZF2cU4Gw7M2bH6kajQEo386WIOiNMqfTWPxSUuY8LckQvRu/Vn+3zHvj7pqpp/gZ6YintR3bUEb5S8OuNHF+708jUu+NLzo41NfoL4LxTAfa/ajWYhcHTFnzN8PUF0JUBDnTngh1YfRhkfUDmfbyh/M0FY6UNcvL7UdWn7u8GxSjMPTHa32S9TUo2dB+Lv4QrWB/+CVD8xkzWNFaF894zVqLrKvl6uE5ug6XrqcCBCeM91yx0AHqNLO SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:24:25.3945 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f06f88ac-1d63-41b5-cfa7-08d54c4274fc 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 10/39] examples/exception_path: 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:26 -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/exception_path/main.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c index f8f5bbdf0..59ee2d574 100644 --- a/examples/exception_path/main.c +++ b/examples/exception_path/main.c @@ -107,13 +107,10 @@ */ /* Options for configuring ethernet port */ -static const struct rte_eth_conf port_conf = { +static struct rte_eth_conf port_conf = { .rxmode = { - .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, @@ -447,11 +444,19 @@ init_port(uint16_t port) int ret; uint16_t nb_rxd = NB_RXD; uint16_t nb_txd = NB_TXD; + 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; /* Initialise device and RX/TX queues */ PRINT_INFO("Initialising port %u ...", port); fflush(stdout); - ret = rte_eth_dev_configure(port, 1, 1, &port_conf); + rte_eth_dev_info_get(port, &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(port, 1, 1, &local_port_conf); if (ret < 0) FATAL_ERROR("Could not configure port%u (%d)", port, ret); @@ -460,17 +465,22 @@ init_port(uint16_t port) FATAL_ERROR("Could not adjust number of descriptors for port%u (%d)", port, ret); + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = local_port_conf.rxmode.offloads; ret = rte_eth_rx_queue_setup(port, 0, nb_rxd, rte_eth_dev_socket_id(port), - NULL, + &rxq_conf, pktmbuf_pool); if (ret < 0) FATAL_ERROR("Could not setup up RX queue for port%u (%d)", port, ret); + txq_conf = dev_info.default_txconf; + txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txq_conf.offloads = local_port_conf.txmode.offloads; ret = rte_eth_tx_queue_setup(port, 0, nb_txd, rte_eth_dev_socket_id(port), - NULL); + &txq_conf); if (ret < 0) FATAL_ERROR("Could not setup up TX queue for port%u (%d)", port, ret); -- 2.12.0