From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr60066.outbound.protection.outlook.com [40.107.6.66]) by dpdk.org (Postfix) with ESMTP id 77A611B3F1 for ; Tue, 26 Dec 2017 10:24:24 +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=Q34g6WN9eqN5/WEYarmb3V/OrCFi7xLEza9JySIV33Y=; b=uqeQtWATlf2RGnrj9deU4weuM0mkdlpOiPvPgcVw7y3nOXihyKqUaIdJ1HyYp3oYfqJLI0vi1y0S6ugzuMTBToXl/xOrW0Ya5jEL8WqhfLgkhjBqD5xr2V7LVoLHtL3GlRov/Ppr5kH0o3zaXSwZFkCnSc4YYNzhey+BnyTIaEs= 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:23 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:07 +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: efb8d5c9-8bd3-4506-2c61-08d54c4273b6 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:JTpzVZjK2uoSMpSxXnv26QlJSvTvOPf0uCn3s6Lff+yGCBJ0z2SU2aovXgKsZhAv8WWoz4i+mbR3bSOSOicL+rEGn69uCoKTy+dxmp5anTnGI92KGtFjZUFkrNK1Fn/X9efLQkOWe+9lxGk4QT9ydE2+vIQq1y4EDsR5trUZ0wPLzyqgK8I83D+ekqqn4iqA2mLzoTKbTe9ws1QPtftrGOTrfa442P+RD/xFfemIxgsVMBEqIWnbOrLEU6GGVDzl; 25:mprR8B9ozOr1nXH0DM6sYrfdnrlf5GaytCOmWDAywQYkkyj0dc6PkoajWHNsKefqVDYjAEUBsoO/+7a4Z3DMk6/eTM1KrmUTVgDddVH8q86WYI5P+U7Fr8nr0ffddJMtpTL0QuCaDKligdWhpHoRKWGRNdjmTmbyQOOvJNd1z67jXfLR3ipPrdAkVozMOopUk72PRp6D0oqnDt6P9PZB3g+BRAz+lkIeZzgIFYXaUBfCWjkyjY9GCVFygaAskEiniJjtDMgLCa+kN+wdeXxmaa2fNsgJ3UdPbXWaNsRCUa14A68PIIIsUPuZ54PRiy1tSf0u6DSPsslVu92CpN1RqA==; 31:NExANB/1bjJ8z8jNowKE7U/UM/Lip8W75PyAJKDSuSfzPrICqGreBfvrT76pNLgwpdezYhVEbF46rmsDPqE9Go0ngccNPzCVEI+yPHDbIn+za/6X1awQ9Xm1BRIprSwkaV8kwry6klXMgKLevrr47VPA7KcWJWXg/McuF0td6DGCY/Gtj5nkJXdcL9csKmIeL0Ieg39HcOCx2+o0VAJVZLQcSQIWabecsoBEF7OVVP4= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:O9lCHtYHkO7/QFvoAPSBsjsYlpP7k54s8vzfc4/1y50qyjIBfBqoWNz1+WsyDCo4ACZXG3EsPU/qiUuyZ1ezn/DyxwtGkPukL4t/CfQ/ylGwn8ZFYB2BHFqy7W55e7LSm0hPey9SqRkTS8ijyivrnTnVtG5Kac+cbyN7dmg7YPcTWfyXlScgos2GfWwxJ72jsPhpMc9OtCgDENiN7Fq1aGhahVVxvL47skP3dqYB+UX7rhnbV/YFnZgDe7YB28S4DaUhaxlhKPx2mPrYzyUDLJMJ6nGLjtT7zTd93jCXQq6SnvsD73iOElF9xO9/u9A4WlB/IXT95fXyi41aT5fEAfCkQ6UubQsOJG2QAUdx6OSNlKvPppEwTTK7llgM1yMzeHl5aULRnyMhVRYxO2B8bZEZ7zEeQidbokuxQSTFxhpEuPdXz3EIvceb6XUZLpjDwZS9xbNzUZhibPNjyka74rodgLKtoG9IGjJ6xTIVi9TvonWv1yGRxjV81C6Pf/Ym; 4:VDpMQz/V5Zopnd76pbwgBIt83X/8xVhVezJVpxd6bupGhGotJ8u4nXvWJS0pT+BwdcZAAji1aOifayQUR6i+BMYrIkXBlMkuLagsoyKnxJStPq/KxzMQmBU0qpjugb3Fp0EBE+Qqf8ZmwQSOFA6C2Hqp/ANX4F1E3dEccZfEsSafG4guy07L8LCuUFNUgJxmj/biS16n3ltfAdTWcIbHvzeOZetpubgUJnfc4RUdjHov2lT6/vaSNmFX4Yamy9VAmopp4SiKXDc4j4z5i1Phqg== 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:PJjY4wUa24UzKn8lbgbxt18Tzoloy2fcFYrdo6vCZ?= =?us-ascii?Q?jy16h21hmL/zxQYGyQk+h3KCFJnSWqWsgvW1xvzWmuQsQZGIw+agWK3igbYA?= =?us-ascii?Q?nJkHhlb9+wHpNLTJpm2t+0pQz3Ors13fF7DcB0Anlo1NniqQLKDpv8tUGxPo?= =?us-ascii?Q?sbOJPCM08bbaMMDu2IT0Lz/1BkHuNEvZAdJunw8/Qa2Z0dl6F6Me2QH9vz3y?= =?us-ascii?Q?21tsoN0avDcZdmJNz2lTaZ3vAV7Ctvi/AorpuRisG3oRxLF30bbU3IE/uY0O?= =?us-ascii?Q?zfILzSgun+bJn66Ny0G3Kz8/rqABANRPkkt/ImrCZebAwnX8rzEnrky1v7Dn?= =?us-ascii?Q?aVabacPHWDrJxybbHAV9TpFbrNWSO/zXmLos1YZnJPZ5slYy1TsgJwEG1N0N?= =?us-ascii?Q?zxWchqh6bbfAngmwvgZNsFMobR3eKdjy0blhpvHiIWfUUAycWY6Go3S8vhyk?= =?us-ascii?Q?ul/QJ90J0JaCUUEKzcSLSccMeY7taCtz5Cx0GNhvgHtCbhhn6oiooIZHvGjY?= =?us-ascii?Q?X3W6RFthRQex/HhTzP7We4Yl3ij2tYeRKZbq4doVC5Ap0RflccDoqNqIOEEh?= =?us-ascii?Q?a7Rd9EVMPLz9zoznWGzEkiLPwotnxY9WzWaxA3lyZ7qwFOboU9Jry374/qFv?= =?us-ascii?Q?z3AFTOmzm/adPnzJ/w4lDq4+t6r77JlUDhP8bSP4Ff/T5/DQNtfKd3/3hV6M?= =?us-ascii?Q?/9QC1kcIQFTECCZlUQqIpqmpkM3faX8mp7RoRG5akgQuKEeIwFJYL8mG1zGm?= =?us-ascii?Q?mSwQJKKU1PmFkM6exQQxfLvnDKNS3wCdsqYDQAbYGNRFxhYeqpy+X0NBue09?= =?us-ascii?Q?hO0s+8tJv8MXsEE5nrlxwvkgxvAbgdraR+YrehUeeMTlx9ZczluXQ0KA8UvX?= =?us-ascii?Q?8zX16FPq008pS7VeCSqboR9JDXQ66Tg8tJuIzOno5VkiLQIwt5DOMqZkugj0?= =?us-ascii?Q?8FxYcfISfE2gqtSUejshqdNFXO98/rBi3FunKKRZp24rkdCbIfeK23xZuWMM?= =?us-ascii?Q?8v7V9p8E6J6EE04NLKRrieCXu+yY/CxWBZ2cyd7vrn/1CJPU0woPkPe5jO2+?= =?us-ascii?Q?RJ45J2IlsEPp9f87c8rqAe0qksuQz178L0LNtzBI7vchOEdUdxGTdZCazwIL?= =?us-ascii?Q?it/PNelbOno/V1ZN5DsThTBSz7bku4C6xliEDFEJqx6QGRmakgBllSScBmna?= =?us-ascii?Q?mpUwocloVt3Noc=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 6:xWyeBJQOEJrgOp0zBWuJewBW2u3B5DZ7MAHFyc3G2zAsnU82Vf8yhrbOkLTTIXVCaFUDZyDrgpoB4TzuS6R/H9A/wtByTNHLRQtsFuibGAKU1IBaFt9pJRdYagEGlZHqhAl8m1ke8lrxC4PNQvUxibCoSWva0cjdXSY2c1mrr/hdqKOD7IM2qBHb+YKeDZY9DexPdHAWCjaMSQGXjc+FmV99PH+GeLlOGVCjExGRR27irXBcDIku+NTtCcbRiMaQwwbpEM8PkvmJh7ErDtFm60AH9Z1D0WslUeXvoWVgKUwFB9gQSNPJBfvj054p4f8yBkE+98mnVpoMkwUIdO1yut0ytmLW1CiXsWI0Vnfs3XQ=; 5:JAPUVVX/DUQRJxo+4qVnntGvXHOhmq4wfkWxDmWDKMHChim/LW/Yk9InmnR/lgQ8pzDl2IifzXjgnVhjiZFYMpyfgDVWcKVBGsKJkesJhb7uVBY1sd3PeRpl9g+CW6wyY6lJ84zxc5Wk2vLydGrRbpOk7m2x/6Ur7ztrHd/u02Q=; 24:D0ozwFLd2MgY5uHkaapZ6urhqhNhDuJgbw3OSEIMtRN3qRo/gJVBUD0WiH7op7NAEFytgJtak59570pjiZx6zM2mDLJ9sb3OBmEeYmtoAac=; 7:bZYAo38FhIJyGBshJBr9zp3xcWU+EXil5x75kct/tNrNKUhJIkM2RONQeKbsnA6TiP14UgGQSkPNfrcnkdSx8oa/736pMTY3K/LbBoxqmCy7jqfL6kW8O4wbaWCgwEwMtkF0zxLKnBrmSfKmWyQEJ0E17be+IUx0odIhMans0TsVdOpLKxHyZfkODglWumW02xx7KpPDnDxl5ktcMuAQpWcKqvIXlzItM3NocUCsLaMPqacBkmbHQ7Wlf8YDFBJR SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:24:23.2539 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: efb8d5c9-8bd3-4506-2c61-08d54c4273b6 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 08/39] examples/l3fwd-vf: 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:25 -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/l3fwd-vf/main.c | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c index 6ef89fc8c..a986c3b11 100644 --- a/examples/l3fwd-vf/main.c +++ b/examples/l3fwd-vf/main.c @@ -190,11 +190,9 @@ static struct rte_eth_conf port_conf = { .mq_mode = ETH_MQ_RX_RSS, .max_rx_pkt_len = ETHER_MAX_LEN, .split_hdr_size = 0, - .header_split = 0, /**< Header Split disabled */ - .hw_ip_checksum = 1, /**< IP checksum offload enabled */ - .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 | + DEV_RX_OFFLOAD_CHECKSUM), }, .rx_adv_conf = { .rss_conf = { @@ -990,6 +988,8 @@ main(int argc, char **argv) /* initialize all ports */ for (portid = 0; portid < nb_ports; portid++) { + struct rte_eth_conf local_port_conf = port_conf; + /* skip ports that are not enabled */ if ((enabled_port_mask & (1 << portid)) == 0) { printf("\nSkipping disabled port %d\n", portid); @@ -1006,7 +1006,13 @@ main(int argc, char **argv) printf("Creating queues: nb_rxq=%d nb_txq=%u... ", nb_rx_queue, (unsigned)1 ); - ret = rte_eth_dev_configure(portid, nb_rx_queue, n_tx_queue, &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, nb_rx_queue, + n_tx_queue, &local_port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%d\n", ret, portid); @@ -1032,10 +1038,9 @@ main(int argc, char **argv) printf("txq=%d,%d,%d ", portid, 0, socketid); fflush(stdout); - rte_eth_dev_info_get(portid, &dev_info); txconf = &dev_info.default_txconf; - if (port_conf.rxmode.jumbo_frame) - txconf->txq_flags = 0; + txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE; + txconf->offloads = local_port_conf.txmode.offloads; ret = rte_eth_tx_queue_setup(portid, 0, nb_txd, socketid, txconf); if (ret < 0) @@ -1046,6 +1051,8 @@ main(int argc, char **argv) } for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) { + struct rte_eth_rxconf rxq_conf; + if (rte_lcore_is_enabled(lcore_id) == 0) continue; qconf = &lcore_conf[lcore_id]; @@ -1055,8 +1062,13 @@ main(int argc, char **argv) fflush(stdout); /* init RX queues */ for(queue = 0; queue < qconf->n_rx_queue; ++queue) { + struct rte_eth_dev *dev; + struct rte_eth_conf *conf; + portid = qconf->rx_queue_list[queue].port_id; queueid = qconf->rx_queue_list[queue].queue_id; + dev = &rte_eth_devices[portid]; + conf = &dev->data->dev_conf; if (numa_on) socketid = (uint8_t)rte_lcore_to_socket_id(lcore_id); @@ -1066,8 +1078,11 @@ main(int argc, char **argv) printf("rxq=%d,%d,%d ", portid, queueid, socketid); fflush(stdout); + rte_eth_dev_info_get(portid, &dev_info); + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = conf->rxmode.offloads; ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, - socketid, NULL, + socketid, &rxq_conf, pktmbuf_pool[socketid]); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup: err=%d," -- 2.12.0