From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0060.outbound.protection.outlook.com [104.47.2.60]) by dpdk.org (Postfix) with ESMTP id 545562BBB for ; Thu, 23 Nov 2017 13:17:14 +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=ujnrY52pqoCr0QLUxBxBD2maNB8WqfyBGC8IhHnXYtU=; b=cx6Ksxzo4NS06b48oafEBzy93bfA+Npv3JmDDRlbDwm/O7vZSCVDF0vNtsS3ZYlgnX/1Wxgj2wg+OQjslfUMQ0bBj2KnQJzi3JdAIxehhRtoC21tjIH2B3LJKFwGXhqgbf04Jk0zon+sxbMBi+kOEyBIBBaVijFXVb3RY6NScto= Received: from mellanox.com (82.166.227.17) by HE1PR05MB3147.eurprd05.prod.outlook.com (10.170.242.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Thu, 23 Nov 2017 12:17:13 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Thu, 23 Nov 2017 14:14:18 +0200 Message-Id: <20171123121419.144132-9-shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20171123121419.144132-1-shahafs@mellanox.com> References: <20171123121419.144132-1-shahafs@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: VI1P18901CA0022.EURP189.PROD.OUTLOOK.COM (10.173.66.160) To HE1PR05MB3147.eurprd05.prod.outlook.com (10.170.242.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c6a2b67a-e7d5-4b5b-8b3a-08d5326c211e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600025)(4604075)(2017052603258); SRVR:HE1PR05MB3147; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3147; 3:q66Nw75QTRoEq4E4VMdOXMInExgpt4P74vtThA+Xr5cMU76OCyZoPHUz8csxuuwZLgrgrozx3UUhnnXmnhVfluhZUEBSXTsiEp8DGJPPe6oYfSDEQXVnrqzZ7NbD6s1/0+3A+SP/F12ugDZBoX8YUPU8NTq1VBn/DdSiFlRzfH3ykGJu2SWoC3ua3+5MN66PR+0tx1L44JwSSonJhEw4/XM0K90nBz9DnUChrm8MuZ9Wv60T0yfpYxHi265qsOAq; 25:9UWfg3WbPiaCuvCCT2H4PoxqWrFfIVvIF4qBYiTEl9gl1NFw8MjME3leE+53u6XnC53AIUEyY4iIYUVQCd+ASv2SFTqBn8BIF2RMGlTbGZqWMNIMsUMceH3cbMO53ikWZp8kAzRF2It1G3eR1UvOwRlWVmAlxvfcSepiNSErMm1hR9p9VUSIsz7l6LsUXWBGXIDfFUN2TvH0dDqdEk6D4Fe0I2qWGtsfXr/eSPDKFc4QxKufwmlMlnPYYjcFLZNYM870400rhig4TFsryd0tD6noY428EXUAzbK+IFHwQPZc0AZBK509A5xLmiFqJYYTM/rjuASuCzrg+Oyu2tATl5y5EtgplhaJp7ljELd6jhY=; 31:4FoV6WOQyWCpTVE4Dh3ubj/r90KexhJGH+RKYI++jC9PrNSpbIAf7Oj4nTBViqZnvlja77H4J7gIpKzSwuhXh9YRSO1eHV+KV1Kz/i9gVW/XGHPu8lk7qy6tovg4fdLP9HDv8NZypzf4zT1L+8uAHhGkQ3YWW5SBCgmV73+ut+AN7nFCVGJtjT985g0j7PYc92lZ9lIH4Vda/ldEYlE7XaiNz6OXAMS5veGHtURCWmo= X-MS-TrafficTypeDiagnostic: HE1PR05MB3147: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3147; 20:e2Z2wUDveGeNrQVUVBmYB9pVibldQ/40V4uCW6i8jNbE0TvB+9HBEEeUPHQJ4TTmtykhkatMxpipuaHwLOQ6Rc17vUaiGd1UjC5Y5nzZOhWgLF1O2Ah+E9oVeTyVCmM5BzPeGihRELk8jHTmV9Q5L8RxgNERG3rNTWoji195hkVt+b87qXLbRqhEjUwsQj5+5iN6XfN6OT4YTmLobz6kppzuXXqyYQBPQ4CTOSBJ7wftXjQ0nvBO5TThVEScGSkotDOFaz/hOmkKRzF/yLAKxgjPrMzcVC4byMy20uUjh0nvGUfj6Y/52VMi8/bCPSi8b3I9vgkj6Y7FAJsiIQH9pyfiY4Uud2mlY/tCVeJAqg/B7n7sXP1/c+YFvThc9w+gkGuxbIO7ogGTC3VFSxCqo63+QssLKj7S7Q63mOT9u1HVANejqcm8AQicqVx/prVDwbDQA/cIXy3s+AUpzGQDUB0BPyB2cgIeYryRSMzbqh+n+VURJgqyI4XB9iWw86lI; 4:qdw0+AJU22tLwYWE9NYlBOIon8Gw6VYXSYS6qqnGlSuSPiUHXL79NlpNiVXrQirZAoNgvaaTeceePDjIOBY+gdhklCulwSHQVlkh95En0JprGdSFjSTq52H5FHx436YgjmdLt4MppfLCCZHAXh2Wu/a+8Aj+LzztmaEod2ntCk+SUWNy2iSROVQVKO67wTRRsxyF23ueWz6/X+CMoyED45Sm1o/G3hLAMlZOzWWWkxGHR+sJO4oD/9/UO4K1LKZ3NGXsEnHoGutovQ8sANWJ7Q== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3231022)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123560025)(20161123562025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR05MB3147; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR05MB3147; X-Forefront-PRVS: 05009853EF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(366004)(39860400002)(189002)(199003)(106356001)(50466002)(2361001)(7736002)(105586002)(76176999)(55016002)(305945005)(2351001)(189998001)(101416001)(97736004)(2950100002)(5660300001)(6916009)(69596002)(33646002)(50986999)(48376002)(16526018)(2906002)(47776003)(52116002)(66066001)(36756003)(21086003)(33026002)(25786009)(16586007)(316002)(81166006)(8676002)(81156014)(3846002)(6116002)(1076002)(5003940100001)(478600001)(50226002)(8936002)(68736007)(86362001)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR05MB3147; 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; HE1PR05MB3147; 23:hocplln11wKYQuhFZ76XUjdQHnI1C1qxFdRJRMGK6?= =?us-ascii?Q?V/46JyrMsiXJxNHqo9V02jcLLQKmMweW3Y7EUvzJXL/fHrOGs9hCkuVmBeWa?= =?us-ascii?Q?KCUDUtoJlPspKxJlTk/2LyMhwoivmxnvIKhlgSR3SHAeyKGz0cNSYpUdp9Vg?= =?us-ascii?Q?jbkvUSdHRaYvLkPC9YYSaq/aXTJWZvrBs3cHuIAzCn77MkW9l67rChtH0YtP?= =?us-ascii?Q?iKNiP9MYgrtNb/saTNx1gykHbauondn0wnJ/6oMUh9isQcNefw1+n4bdTVLW?= =?us-ascii?Q?y2GppSCPXHwwTt3ITctElwszIDDpZ1/HvsZQZfW8Phk4fqoFV+Tnd5AA9wvQ?= =?us-ascii?Q?8VKd2eJbroCHE6r0q9UYKFuIIn9rqiAFAs3QhsVlusQEVwZM2/0irKr1FY63?= =?us-ascii?Q?eR0z8K60/Y0knfdSvRB0zANjCszA02OsofcHYrmCVzrvblX3kJH0i0P77ROW?= =?us-ascii?Q?3o6YO99RN3GBIwWq+XQTEuOyfcfRxkV8mCGBNw5rTRZneesSkYp23rFU1P03?= =?us-ascii?Q?eCLmYyk5WyguxMpcKZPdx8cNqED7UKA1sFWGHCqD+gTl46NKS+bfWFWVn/Jp?= =?us-ascii?Q?NUISaZAekrPQ/jmZJglWybZf2Q25uJRDnaQJDxvB3lANAUwYK5vuz3n3KqnO?= =?us-ascii?Q?RHhsCURVkBkW/Ll4lczk8e0QJ+DahsRMxRxm87V2+Kgn9scQUcpNMzKQRgsv?= =?us-ascii?Q?YYXIEOxgtX9fuK0w9dGkyaN0VoCdTxAe7JZ1xhNnQ1IwOSpRzymCQkx98hSB?= =?us-ascii?Q?ZD4nh3rpFNe/KQEuUciFUY1ZbxG0lb7XoOKV1SU/Y+TnkcxUh5Px2Vx2OE70?= =?us-ascii?Q?19gSvhHTjc+2g0CBkNeqhe/vU2xof+ozRaSM658toY93Odfcx5rhf4Ja9fsp?= =?us-ascii?Q?PYarqisrHVeuEddZ6tHQEWRFa92bbPM4D734E8pVs9SG3D3Og2UoFXKgIMtF?= =?us-ascii?Q?Y3JzNMEdiJRh1v6ItF3vGbn/Ss/NwpYHmDS1Nhq3jdAajvIetMspXkhxYdqA?= =?us-ascii?Q?bHFMvnLV0d7YOjjmmeRGSrGKuJIpWSPEJK+UR1dgfbvjnUWl26OZQRCYxBWI?= =?us-ascii?Q?yMBMlP2AEDOmfsB/MpPKgieTK0jTnfkSSCoEWTMjW9SuWUV2668rlUnVPirv?= =?us-ascii?Q?0HYAEd/bMlduP0jWVnYDPcgYJyktzjW71vajYHrxUVf1viNidAbxpcqWeLIj?= =?us-ascii?Q?L3UyuTLFJk8bTA=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3147; 6:USrjHH1eeBrllkIhXnRXYD20OSyDeROce1G3wvKgJkmc0+rLXzG0/7RehSj5MyLPL57yunsRkR52n+PHH3lD/6q3hm+jn3cytRmZE4PAV2YvawHhR9oHuY2V+4n2gRYIH2pBAvpbgbDI6Sjt/a2WGN2x/ZR+HVStm1QgP5e6AnCfImQjpuU1W02sCCJNTygGWCgmbd5ZyaDe5+lCLMHJueyxE2HSaayO5pNKWNMRsv6BqYHYkcv4mUg4FezDW8+ryRJ66axrgaDp9qEhS13t3Zj3ybH4a8MyC7T9AelRIX3nA3vMHhvPemdB/pwzt/xSdhdp+ugyd7EVImBBqh+YV7ropqfoEXLQrk6bEGpKyiY=; 5:z+p4WZkHdtcj37XvvayYMWBQPANKOlEBe22Kdz+ppLXPoLedU5nwdRjJBnGPU6J3iSWTcdVe8hvp4kPWGGUJ8/Sq6+yjzyJysX0LC40T3iuXJCmFWI9yin6wviR7Bw4iIIahaO7ifeUSWoH0jCg3IdYld1A5qrel/DEZCLCouio=; 24:+jlZB7SEEnSdw2zrrZ4GPH4RRTaTTk7sZPUOiDo7fqUF2YoMNPoiqJMCnOq5Zx+zfvcijKZoLY/l1KX5Um1P77Ro/ZXgvNB6aNzTT78hLdY=; 7:STGoruXy2URsDzKphCrNos6beMQ5qG3pPs90WiATP6KEIL434L2PdHYm4IDj1/0myT2dOCLd/yvlrfmty9w6DnDQNJpVdeUY44ktvK4du78h8khI5oRyCBVfR+GP+AwvxJT4wBOb+uaysU49oS8Mqwr7qVBfsw/NlHIAo/43WxKrwl6WyFr0USpdxc6BSP+t/RrQncJkflJL7VvqQufejiaudIdAkcs2f2EP5kXsYHNssw/+P3kdgPDpsmE44nvS SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2017 12:17:13.2393 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c6a2b67a-e7d5-4b5b-8b3a-08d5326c211e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB3147 Subject: [dpdk-dev] [PATCH 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: Thu, 23 Nov 2017 12:17:15 -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 | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c index 6ef89fc8c..060c102a9 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 = { @@ -1006,6 +1004,24 @@ main(int argc, char **argv) printf("Creating queues: nb_rxq=%d nb_txq=%u... ", nb_rx_queue, (unsigned)1 ); + + rte_eth_dev_info_get(portid, &dev_info); + if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) != + port_conf.rxmode.offloads) { + printf("Some Rx offloads are not supported " + "by port %d: requested 0x%lx supported 0x%lx\n", + portid, port_conf.rxmode.offloads, + dev_info.rx_offload_capa); + port_conf.rxmode.offloads &= dev_info.rx_offload_capa; + } + if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) != + port_conf.txmode.offloads) { + printf("Some Tx offloads are not supported " + "by port %d: requested 0x%lx supported 0x%lx\n", + portid, port_conf.txmode.offloads, + dev_info.tx_offload_capa); + port_conf.txmode.offloads &= dev_info.tx_offload_capa; + } ret = rte_eth_dev_configure(portid, nb_rx_queue, n_tx_queue, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%d\n", @@ -1032,10 +1048,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 = port_conf.txmode.offloads; ret = rte_eth_tx_queue_setup(portid, 0, nb_txd, socketid, txconf); if (ret < 0) @@ -1046,6 +1061,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]; @@ -1066,8 +1083,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 = port_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