From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30042.outbound.protection.outlook.com [40.107.3.42]) by dpdk.org (Postfix) with ESMTP id 4A96B1B689 for ; Tue, 26 Dec 2017 10:25:52 +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=1IUr5Cl88wt/5tddhOVzehga99ty9Iz8CwFV+tGOc48=; b=GEmAeZbNcYhZ+/YxVkbq7Joc4fES7w89YDEPc9HcA5mZzvB30Xu79c32GzuopC0N9kq+EZ9H2kp3WFF1DaIXDAKqAB2tdow4cX0pYungFE5nUS56A1PnWzuajsStHL6J6R7MSgnl9Qv8vkkAUy8R0gRXgIDbPP3mOQKBlzcQJHQ= 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:25:51 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:23 +0200 Message-Id: <77c2da157cb4f3831d3f9dc16f9241a81db0e254.1514280005.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: aac7abc1-9a15-4b7e-9fa9-08d54c42a814 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:f/mf8Kzlr9E7slKtARnSsCn0Sl8XovdNaha3ARu07yNRMoROoiOGu5LNTn9yUDVFKFCTsqGk2uOzDbUAf0ZsT/WsvdeqU9S56TNZ7dXXDQQ756ozleQVzzUrBVXyqkJvQfXu4PnlAa6VxDGdlhW4JktX6vyHZyrrwEK9Fw1VklIwk4SfgNb6Cu+r/NW88Fn0nUPwHBjYVSf2Fd+fR0vHtJd2M7OPJdJhMncRO6cy+sqRGZtHS5K8oqAP1qKGZdVv; 25:MuQ2nLyKBM1aefRfE4ZOcJ8fp/v01e+dfJgpHTIOZcZOmyMLvByqCFN6r/dHR/z21FetWscKl6mBhkFbXY2qE0tTdr8RRrdow/XDEzAFqjPopCIZVyBkDaXmpP0QNfdKCjzo95SKlqU7lUCXfm63Lu8OWD8/ZEywXYM9hIjhjeyIN/yBViuMyBx7glA2/jeeEM4j8VgVJbAN/n7rjIBzaSJhFRsRXchRLq37LUS33vs6csMMmkJVpEHqTyb7uByEF4JefiqEilE/92L981cGrQSZ7Qp81biHxqm4AEWV4X2SV9d2jJo7Zxz1IibF3bPBEuT4YZ/snMt20EWn2XvxuA==; 31:M64WqFUpe2uqgZr3E7y1dLDpHe/3CjDIaj/AyZv7gfjppEt10tiGfBIS4dB4YSkzS6BozZQdCFSdXb75zXwk32vgWu2pkdCVDM4pSn0OoOrrJrKYD/XKRKK5lQvZBQaa3dKp+a3vhYapgduVvqB/KUXoQKBqUqa+ofomQUz22zJ8ZHM89KDIdZndX9BTLJjdklHHv+YUvLgLjkag8IFyfzpgLdZiDGH8Fu0swSt/Ijk= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:LjW1yuiErm2n1JBttfnQ1WLh8m2+Ws+mmc5HudIuZxiMJZuzzCmVIHG0rWVLP57hr7GFJzSJcuudKXHmbGv4ZdCxloYJHTXzEevtveo/R8VPobEZmONwwqfyapMiwgNNORBTkxfrouNoONQ94CWukeypLBN4772GeyfnTrN63PS247m1pqAYTWvrpIy88wzcjnjX7OnNICvwBHuOz4N0a+VKpazvAbc+NVdYkVCGgP+0UefSQ8QhKklRp6jcjP1l5FSfNAhJ+lanR6H+9zgfVb/U5H7F/PY2jvQqVbZlfV4GQaqkhC5VGeGXn3jRIzmeeGBddk3VCzmENwdw5VvwtNL3nEx8ppizhRE7p69tSrYbReTJHsKJyCP5OsHWkGIzhfyYLQ3A5eROqbQZPdjKiJABp8WDQJpEq0D17l4vozryOHn5HO/HaGLH3l57Cs9cSGPfcqIfdnvo+nExyO8p6Ljs4ZgiR+rXnw1gBErjBzzFStrOYQuG4wrBeImzvkOD; 4:bOkkOD/KefXQe9oRvZIeq5c+mvb9C4I5ZDlGclB7ODbxyoCk3sZRDlRcT3CAG0H8Ru+L7LJcvgCk3iGZxc1rjX8qKJ8gBEgkGyNjKXTPIdaP8kK7ES9BGvkuDAVh27iBSptv16U/ZoHbyY7z9yfVWKP8OA2YioaqUHO4NkVOxkeoAvmhgpnxOv4h/c8xCHyrDhNeMYvmJYYV2DYQoaeY2jrsa50gi9a7IVBbDzBiSx5tnpWLGLgO0yvIdVPF/B+Fim6FtAIyNJjEt2X5D/ynlw== 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)(15650500001)(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:boB6vaeQR3KdzSQRAByHqKA+4bPPgLv+Lnq6J9HjH?= =?us-ascii?Q?JtlgIDtRQ8a/PbPnVr7NLNJQwAFjIS5X2y6/nEQLh2WnprDtrK7U0lyIIerB?= =?us-ascii?Q?StVpAI8Sqa2BGRDqEgRqnXioMtcLq8izeBOn5ro9eB8TyO/My3++iEFbe/lh?= =?us-ascii?Q?GtJnhvYwnnN5ha5YZ6qK1G5z4/GlIJzohrnZXPzrd3awM6zbVswZC7ezbmYV?= =?us-ascii?Q?4UY83c+B8T4hTzzx0aD7gPUvX4XjM14ZbDpXfBooS7EG9cf6QklkOCG9s7AW?= =?us-ascii?Q?3z1VXEd6j41y7lAc2NY0o4ybR5AsDR6Af50KCinesCRLou98IbvWVw4VQrrF?= =?us-ascii?Q?ORNdmMjAtC52ir7fz4h7sIOQXcD5vVRqs5Je3z8C8E3bkT5qsU+FDPwW082y?= =?us-ascii?Q?Nfrv5uMqskRmlkeiNYLy+RtqdSMNU7TjA0qyrjg0kJTXNACCV4+lojJ0juEs?= =?us-ascii?Q?KDQjB6LL69nMuNNVamx8fUIK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7DVvie0Rob5Z24Z0zMJX8K7Zq/ZFdRX6bcY+cxDLC90No5yW3ncnv72qNokyjs6QrTALW2QsWAAQFXtk7HV3OmOuGYB+klL/iSiHtckSxooBt11EgFMyxCf5vRGh8DumFyvxdG+1HFKglde1OlGqJera1bAODRkzW/JPEqEqxyyj/lnGTMgQHn80xSSfvup6tWBr8TCWh1sE65BBq8M21QHPw=; 5:iudg+7LfSL5n2Fk/U4joioFOtGDfgsNg2484Y1HXhsbbIPUA7M9uH/Zp4BnjFRM4egvZw61wnZTMxiNlb8BaS+/90da3p/MSQaVruxRD6xe7E7wydCaYo1+4QotMlouhcU6mra3pUeQkVX86OSN+shlq03I9irwa6pU1Y1PZ0KA=; 24:QcDiHzE5HiBKbcrTq2sdYZ4AOpWcoXrd7FXgviHrXHWCbeSIv4IDKOcGHnFpkprn+SJeSbUo2bUQhBs4xWQfZnoxhxBDasYJfjFy6pYx3Nk=; 7:qEb3QKZhwsfXM4qphtTJ4Cd8YZCl56OBrdUXENJ6w70y3nVXT4kEl2iWqcGa8Nap5NoBMTJhSCXsyDwC/3tfoNSrfi67nf9LprAlbnE5zrIDECv7jmeuLGT0Jd1y2tShix5tz+fDW6lNEns1TyjFm2oBZvDMGbUtJaYxVMem00v54db6V89H7lPjddsQew/DadYWvpc6A6sMAWAcb7uROkA/SwdzdmT/5HFN8NIOQ5EmU3xoTzgaLcAafLb7Hhru SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:25:51.1144 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aac7abc1-9a15-4b7e-9fa9-08d54c42a814 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 24/39] examples/quota_watermark: 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:25:52 -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/quota_watermark/qw/init.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c index 37b03626d..0f8a596af 100644 --- a/examples/quota_watermark/qw/init.c +++ b/examples/quota_watermark/qw/init.c @@ -50,14 +50,11 @@ #include "../include/conf.h" -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 csum offload disabled */ - .hw_vlan_filter = 0, /**< VLAN filtering disabled */ - .jumbo_frame = 0, /**< Jumbo Frame disabled */ - .hw_strip_crc = 1, /**< CRC stripped by hardware */ + .ignore_offload_bitfield = 1, + .offloads = DEV_RX_OFFLOAD_CRC_STRIP, }, .txmode = { .mq_mode = ETH_DCB_NONE, @@ -78,10 +75,18 @@ void configure_eth_port(uint16_t port_id) int ret; uint16_t nb_rxd = RX_DESC_PER_QUEUE; uint16_t nb_txd = TX_DESC_PER_QUEUE; + struct rte_eth_rxconf rxq_conf; + struct rte_eth_txconf txq_conf; + struct rte_eth_dev_info dev_info; + struct rte_eth_conf local_port_conf = port_conf; rte_eth_dev_stop(port_id); - ret = rte_eth_dev_configure(port_id, 1, 1, &port_conf); + rte_eth_dev_info_get(port_id, &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_id, 1, 1, &local_port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure port %u (error %d)\n", (unsigned int) port_id, ret); @@ -93,9 +98,11 @@ void configure_eth_port(uint16_t port_id) (unsigned int) port_id, ret); /* Initialize the port's RX queue */ + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = local_port_conf.rxmode.offloads; ret = rte_eth_rx_queue_setup(port_id, 0, nb_rxd, rte_eth_dev_socket_id(port_id), - NULL, + &rxq_conf, mbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, @@ -103,9 +110,12 @@ void configure_eth_port(uint16_t port_id) (unsigned int) port_id, ret); /* Initialize the port's TX queue */ + 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_id, 0, nb_txd, rte_eth_dev_socket_id(port_id), - NULL); + &txq_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Failed to setup TX queue on port %u (error %d)\n", -- 2.12.0