From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr60076.outbound.protection.outlook.com [40.107.6.76]) by dpdk.org (Postfix) with ESMTP id 817EB1B655 for ; Tue, 26 Dec 2017 10:24:45 +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=LCqKRrBP2yaZD6eWBIL2FF4UmQ33jfKQNrCV2pEx3IQ=; b=gJ6Xe3AVllX7b9UFtqU3femm2RJUg0OTY8gy0kBXq0ns+QDgskQ2bU8eYqsAGTGlIvGah8HjsrHQnfvuS8EKnj4bQgM6wOXUymdTIfiQNE+4Pc/R2wn+AYocKNuBixAHngyow6P6jj7OH2f7Hexug8qUov0lcjtqSqKbwzqLjz4= 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:44 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:19 +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: b6b8a692-2193-4294-04c1-08d54c428050 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:DtUvUIazby5YtFHuxYll0Dul5CuTh2bpHxy6J69W0b3iDLprTL+ysuD8ViLf1WipAjZAWF45Yl4ghwQt/AaBvScTAd/qzxG4XpwtMe6yGx5Wh/8wJAdZMqZC7AnHAV7TV5Kw/sPQd+QvQoEj5PCjVy4MZi1jVE4QW5UVJa0SZ/UzKYZYTnNBWCMkMrlQbLYoIyUF2veIjjNEX7fKQGPaauUVUL7Jxh0hyaZE1dlMlIIPJEp6qjvEh0d7H6ZlaZ0a; 25:vZDEUDJHi4wRWeQETo8Qrw26T4qKAZpqy4JlGks2bhcFkJ8auNkAr8WaRyau+YDU9osN4TY8z543D1Kp9Iv2sLEsSYzL+HXoDTru+ULaGLV+adaW9qcsxUis0YOyNEUO/bcx9RVvuZ5nmj/lxfC3unjaVRC2fc/f8CBtAGPo57HQenvXWzIbVkIaWijDLQsXu4cAxguWsBKk+RWtD/MjHrrQfyGDWD/2nClkxfN0cUxaVvhrwF0letndpfwMHKhmgRPFkKuZ9pfJvh6Pw1ll0Ma9mFYa7wYTFOgIwULhhum4ZJzrxRLPwnNCTo3wjse7Sf2kV73XnUYgRF1eoLrIvw==; 31:F07/vW6+7debznn6fcxRqhSgInHmY4LTyhMc1Z29Lh07aPuBFIHsREmu7pDRUmvVwKUPYIhh1m+iLytAwh/5Pyu0LGgtE89lWrFMs6NOVw+ryJCDNv8C0crHkDqysUg4mBSEBHs0HHSNB2qpOeNDPlQclsMhtAAQ2dvOjJyu1mzg8KcS3PTleB6F0IElT420ger5hThNVwXGUJNYX43wR7y/KXv+pph2FwzLhfZRPM8= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:GtXl8wzVK96ij2/VD8Jkh6YemLlV2Igx7z1ocmJZjk/ldkYr6LgNj0CwwnFu9VMuduXvbW9LKkuehlC9ZYbviBXygXK+js9byvgw3l50EaMDXnJVqVsaU8BPVqhxGlNCiVksSZv2xo4KFfXCIl59vLrlnJSOsEhStdiuxyXPq8Hkry1N3W2Eag9Tqz/mUd8Aus6LAk8QrCtsLE37rxtK/vASppES1w49LqtRPwxXAnLcweTYT0LOmEXPvBVRxqqo0/VyZidNlDvjxeFj5PZ9tqYERlhqhoOZTzXPioiWdBn+okgLcc0PxR5zw4TE14z5GAHmeDLcCFV2ND3MhQ3sokESCLkRj9JOD4RAaG/5grAn+05O1bQgFIpPl+WFSJ98OW0+jX33tNJXKbnQAL6yiHIEqGyVZTvhBk36y7o9w25y2xVbcIGER0EMCtsgyu/8XHsJYQy9pFruvr+EDCTZQesl1m+QhIDDgtY9HENBDMh+DpOf7SvEwJvDMoUPQalS; 4:YZ0K+RXLCgLqWSJusyJh+PtttwwVhM81cghJjcQNmk+uy8D1lKyb6ESt0xPo1SufhIMZ6rA+yn+cM98ELg+Mnop9vMig2oyudJfX4cKI+7Kopt0G+daplm1pT3Rdxo6Z1Wl+SOVE4e0NTjEygWJ5AnbcixiyPr7/Eh+K6jjqBhaMdaQnB7uw17yrOlpVVC5ItICiaOKoe3uBFCm7sCWjlmXKdTGruEdBPyoGsY9SmOs611Dfl/UAkeAiSYafFXhz+eWAtNWxfUJqnktrVLvjrA== 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)(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:11huQl1hWl4yGH69a+Bk8kMD4B0hAUa11gxg8wOqi?= =?us-ascii?Q?3MEPc7UPYjn0Wom+nrrpycZ9fp6/u5tmmBaIB72qUey2/97K7aZ9ggo1D9dg?= =?us-ascii?Q?pAecfbsqa+n3ZkdF+AvMAghrsnYehHyDgJtQ5TZQAyUKC4ETHZOE5RZTdVb6?= =?us-ascii?Q?Xdadczj2KowbUp7xRoAbZrDb4C5uBqdec2+1N6gQl+iX8ClE28j/cQCsftoq?= =?us-ascii?Q?KvFv1FXA7OjaeK7DoWWwHhfhHpga55HWl+U36QC+2AdeYOu7NM5TXJiklsdQ?= =?us-ascii?Q?FfM3ab37hJYDTlAoVTc9b4IS9hLyhu3OLsuuXahDs/WifEI7VnWvfJCmTSSY?= =?us-ascii?Q?gMo2qdbNTc2LZ51R6Iy3HWqtG+khbwWNJCcoDfqt1f1sfyAnHNV4kgItCBl7?= =?us-ascii?Q?Dk3V1nFF8uo+EyjBr+CzS1+6ep+CVMv9upWU67OOO1j3Be0HyfcXmfcO/Be7?= =?us-ascii?Q?kPE/4ZKb7XtICZzNMhAVAFrd552oO2AE+BdqH86LlsnXyQEPnl/+XulpZVGz?= =?us-ascii?Q?zMJMoLVLT0szOX1Na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NlnQiA1wiTo8t+SONqDecsLhpI20c3wp4f9cofdzOFhMgM8z0JgBkyxhqTRjaQaY1LtPcKHgfC0Rt7lq8o6/sq9Chl9/IPWld6d3Q=; 5:2HljrE+iYsEZLKCnWVRHbA3E4Ij/+YtAZ74holkOykvBRuKwqDEo95YXNXlfg3dpQIwDUH2gIT1MvjSYL9jlMbJ4yGOyBg/+M2KYrp/4U0NgzVX1DYFnfn7m2t1s/Iz+894I0c6GXix0FBe46sKUnb18p2OtbDvlirxTTS3BNDw=; 24:uDwlNOXvGwBZlC9UPqOhr0ISEdqfvK45RLqIV5Uf65GQI32J8nLKa5vea194lJWRi7zdcgnifXZVKUc4p3kkYKzP81lNG4pvk1Nr3MpC53w=; 7:7gzU8RIQN3LekR2v5OJB2/lc7enxm85HWbVSkfrSqRrU0EHSja6YheOrbU5QbDMMCiIP4F/I2MIctA9sGVUSlq92qWwN1XCoGXk6g5x9/m3sn22F4uJFJg5lxDiN44dSxVrLJQYXw4OWHsnbW+ZP6AOIPIKrNbdRSjvPFfwzZgLk4RprGI/VFlxEEyXnyKRPwVRHmLoHEi/3Xs/VTjyHDtfLH3jkzgEKp78iNmQ5vSSSXAdWukme7sAHvD6eathc SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:24:44.3948 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b6b8a692-2193-4294-04c1-08d54c428050 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 20/39] examples/netmap_compat: 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:45 -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/netmap_compat/bridge/bridge.c | 7 ++----- examples/netmap_compat/lib/compat_netmap.c | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/examples/netmap_compat/bridge/bridge.c b/examples/netmap_compat/bridge/bridge.c index 2f2b6baaa..33c38d3cc 100644 --- a/examples/netmap_compat/bridge/bridge.c +++ b/examples/netmap_compat/bridge/bridge.c @@ -55,11 +55,8 @@ struct rte_eth_conf eth_conf = { .rxmode = { .split_hdr_size = 0, - .header_split = 0, - .hw_ip_checksum = 0, - .hw_vlan_filter = 0, - .jumbo_frame = 0, - .hw_strip_crc = 1, + .ignore_offload_bitfield = 1, + .offloads = DEV_RX_OFFLOAD_CRC_STRIP, }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, diff --git a/examples/netmap_compat/lib/compat_netmap.c b/examples/netmap_compat/lib/compat_netmap.c index 12b3fcbe0..ee65697fe 100644 --- a/examples/netmap_compat/lib/compat_netmap.c +++ b/examples/netmap_compat/lib/compat_netmap.c @@ -690,6 +690,9 @@ rte_netmap_init_port(uint16_t portid, const struct rte_netmap_port_conf *conf) int32_t ret; uint16_t i; uint16_t rx_slots, tx_slots; + struct rte_eth_rxconf rxq_conf; + struct rte_eth_txconf txq_conf; + struct rte_eth_dev_info dev_info; if (conf == NULL || portid >= RTE_DIM(ports) || @@ -710,6 +713,10 @@ rte_netmap_init_port(uint16_t portid, const struct rte_netmap_port_conf *conf) return -EINVAL; } + rte_eth_dev_info_get(portid, &dev_info); + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) + conf->eth_conf->txmode.offloads |= + DEV_TX_OFFLOAD_MBUF_FAST_FREE; ret = rte_eth_dev_configure(portid, conf->nr_rx_rings, conf->nr_tx_rings, conf->eth_conf); @@ -727,9 +734,14 @@ rte_netmap_init_port(uint16_t portid, const struct rte_netmap_port_conf *conf) return ret; } + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = conf->eth_conf->rxmode.offloads; + txq_conf = dev_info.default_txconf; + txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txq_conf.offloads = conf->eth_conf->txmode.offloads; for (i = 0; i < conf->nr_tx_rings; i++) { ret = rte_eth_tx_queue_setup(portid, i, tx_slots, - conf->socket_id, NULL); + conf->socket_id, &txq_conf); if (ret < 0) { RTE_LOG(ERR, USER1, @@ -739,7 +751,7 @@ rte_netmap_init_port(uint16_t portid, const struct rte_netmap_port_conf *conf) } ret = rte_eth_rx_queue_setup(portid, i, rx_slots, - conf->socket_id, NULL, conf->pool); + conf->socket_id, &rxq_conf, conf->pool); if (ret < 0) { RTE_LOG(ERR, USER1, -- 2.12.0