From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0045.outbound.protection.outlook.com [104.47.2.45]) by dpdk.org (Postfix) with ESMTP id A83ED1B1AB for ; Tue, 12 Dec 2017 13:27:34 +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=Zmdk6nyhlv0/e2iqrnSr9Vd/eZyMy03XDcRURWXjDRg=; b=h9YDAyhHh5x7bX2/kV5qIV2rPNb0heYLUoxm5dZjtEmJscrqgA4bOBdbaIzhb9XGt2ks0rHk3kUQOIaQy6yCDIpVe0wWdnQuRnZMoDgXUCGBtWmoW1gGz09OyFBsWkGR+2S+GKvMOBW6ICVBNJIqRSvj8//3gxxXI+DnOlrN7IM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (82.166.227.17) by VI1PR05MB3149.eurprd05.prod.outlook.com (2603:10a6:802:1b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Tue, 12 Dec 2017 12:27:32 +0000 From: Shahaf Shuler To: dev@dpdk.org, konstantin.ananyev@intel.com, radu.nicolau@intel.com, arybchenko@solarflare.com Date: Tue, 12 Dec 2017 14:26:25 +0200 Message-Id: <9054fbe1aa2d71bf1c4f751a5cea320126918c1c.1513081087.git.shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: References: <20171123121419.144132-1-shahafs@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: HE1P191CA0010.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::20) To VI1PR05MB3149.eurprd05.prod.outlook.com (2603:10a6:802:1b::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 15ccb6d5-6d68-4664-697b-08d5415bb822 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603307); SRVR:VI1PR05MB3149; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 3:ua0fA4ufOBLhurKKd8N917UaRerDkRuGZ/YJv4iB4Ml4BH7tSFez+33pFr0axhJB56m52m07vtBnNfIbZ3ki98WO3AeGTx14TMnJ21gXxznkdbiPEPxKsWTGowNgKhHLVlgeqrEOcc2hbfGub1IHy4O2u8tRbiEnrgBga/hNu2wwixAZoks6z0vrdClprtPIBcqsPayeuQmhUCA7dto7bSRWVV6+RBqFjRA8oDdZgLtThvwBcN4tT7wGg+x1OV1W; 25:+SG2ID3MB0naYwgT89zOY1aCBbSMDPhivQBBUoAWegKYawpDFEu5BRh12K4DU/q0Q0wgGCUybT3cxvQgCARfHpCCo+LeRqMsMx+/F9NwjKt3CF0AvcnDgoJtd1V/ggwKOfakY9ujR8YqqkQKt68xT6kNmGipCXaE0YM8DVWtsGBFxd0NlWzcrGuuDk1Gb/en9EC9dGUyA/3IjcYGHe1yVBW1CqcfVu0UD91ralmwIkWrQ36N9gMYc2oeSrWh9dUHxZWL+MWLmpgu4N2O6lCdjkmkGzdaoxWFooOiQMe9MSxBaVneS6Lr7ncj0afcbWKnVkrurh6E4XF22M2zUYHpag==; 31:QZObe1wpOJOnTcH3PbLdy6XdvDl4PqOputA8iYUjxRTitF2h2tMu11TenieRr0E1C3B49irQmcTlUz4UktwUSHDOqVvT71oW5g83pqs3sETOTxHyhvMihp5A3/7EHlpSlqLVYRTqTX0s1ztE2urSqunWv/8bXFqS3nNLnCFDCoxJi+pW1DQ6TNnx85pdH3TQt/UkNCBF/XZuFFuWtYOtyF3CIA5sW26Xq6p7CLf9fmA= X-MS-TrafficTypeDiagnostic: VI1PR05MB3149: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 20:r4ZwVSccepJh9gIRPVvrAn4eRbd9BYZyeLTgCxktJlmOLIsqbmBjtmxUSNKXMInNeVIwSd5Wv2VGNbrnOg87ihP8GjwUI8AqYOIdu0TQd6MV80OsCATI6uQv0YoK3Pu4RT6BheAkGWmlBuqzgNedhzrbxfwXTjo8L6zLNAmD6XXcQ53/7nhlQKaScjP5s/201eNRoOjTgHF7UQfNib7mLGGmRg5/SPcvzk9N0czGvthaCEU3w+kaU3O4oo4xW7yPgaunyhyPbH3HTHGbeIhor2R/JGrURKlVQIC8uPy3BpuGtA+FWbFJ3RGuCFxqd8RwSBeUlcVZBgVNQeNRIE8ccm7Kgr0pcvQUeRET/0Se3+zrt4uXy/21BJgfxLvsKgKHOc2h/YmfC18sFVVo37mLxUpcfo6w/xRpFBkCgOgKXX7J5RIwadGfQWk6Pgxg9h+vX9ITnf44kjdzF3JQKKF0PLVAIgxC4idM8awDsbOiLrUzn1WQ+Zbcv/9LDDFBBT2O; 4:x61qYJejd5zWsk8DNF3TmjW4/h212rGmx4StHqX8gljnwT/hgz6JA3DHb6RE6uYFiCqoX5jxNCxLsTJ3vmcwI5vyzurPkGxNhWk6LLLKOuc9QmEt7JeOZ5O4/zjXFiLFwo8of2aGvcgRqdGT8sPAtgP5WnUm7X6j+zFYypeVQbfOe9BKek0k5acs3xJrpW+r2p7kipSXk3+xcvkVJG82PWk4ASpAkdMUF8e/0Qh/qUhogHZRj0LcRfm+DEuQ79gguzHwmemK2NpJrJjtUhHwzg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231023)(6055026)(6041248)(20161123564025)(20161123558100)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011); SRVR:VI1PR05MB3149; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR05MB3149; X-Forefront-PRVS: 051900244E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(39860400002)(366004)(189003)(199004)(7736002)(8936002)(305945005)(66066001)(3846002)(5660300001)(47776003)(6116002)(2906002)(69596002)(68736007)(48376002)(33026002)(2950100002)(50466002)(81166006)(21086003)(81156014)(6666003)(8676002)(106356001)(105586002)(118296001)(97736004)(478600001)(51416003)(25786009)(316002)(52116002)(7696005)(50226002)(86362001)(55016002)(36756003)(59450400001)(76176011)(16586007)(53936002)(16526018); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB3149; 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; VI1PR05MB3149; 23:xD/YIPH4DCGAvQF1+7XheyumfOXfzCqB03S+aTyR1?= =?us-ascii?Q?n1WGM2WAI9d3Ng9iU86y/WUpOej/aYiz3AYUDRsHEZcWMAJtMyqN4gkOp0GA?= =?us-ascii?Q?bI5tW73oGO0q2LwuNbBpgBvcaLBA0LzZY5YXnekF0ATtSU2+0lBAJH6d+8AI?= =?us-ascii?Q?vcQ0ocQh6pqBWY2BiG58BAfY5p5sm1n5gs0CHgAb9wvcx9BolkQMpkfPDDxg?= =?us-ascii?Q?xLZxuD0LkYil+8tAI4dbgTrFMhq/OXWxPHpCzrIHwUQnUjwm8NjHLrzLA9lP?= =?us-ascii?Q?/PZKfNPijuI74Sx9E3EP7sw7F11J5tlETC752kWIxVkUtCF4wPoLmdbxXijs?= =?us-ascii?Q?jk9bksj0tOxU+5oxdMzH4Hs6+KO9hiAlKWPyWkFsn5jRdIuwOqze5yg+LyB/?= =?us-ascii?Q?UCcBNqMLs4Px+0G4TY5R2ewlSDEW+z2CbSaL4XyBzjnansOmbS237DtB5Unn?= =?us-ascii?Q?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w5MZVCfX+R9RQSro20uoWTZ1LHA0gYi0shaCTdWEmwgCpgyS5HB/Bzp8XV1PAoyi/KQI30bPaLLIrIcoAdScMSkyVhPGN11DY=; 5:Zsma5IBqb6IGefra0GWJXVfnEVqIKtE3PTlCnHuvmT2j0h57HkeEaPK3ktr+xmm0H/CQO+DggvZB3Lwa7AzWpZyMK43/bb6qFdzG35GgQDdYgJ3xiMHqaL8fE1xF05zKADuX8f3PNp914WM2gp3wL5VKY6RBARANOarh8cozL9Q=; 24:JTxCFptq529bGpu/L68cdzDjaNiuLmXI5iHlHI5n0XiEUEGwr3QqnuqqtDOkK65HR8Dpa5ciXRkG3fqIqZ9BQjQE0VEVC3Feex724RIj5VE=; 7:SjfmlgEVIMZUDHGCPviBjhPy/XDg7B1Bzac4aw7JhE8NjPsq3bOuEaYZXly8JNE6Mocfb716Awb5neUyT+1i8nZEizZ1Vfde3vZmvBaJKD47aTReNS0774F/aiJVW/knO7tSxov/9dZV0vn9nphTQGUCA6AzeWVS9zKxI4lib2ScdD0v7XEv4NnP3gJUVGfmtMnCl9j+FAZ6Y7s+PhKZPNVRExLao3wyRoOkE5AlHriidS1dj4zf3IqGKVGh/rr0 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:27:32.0979 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 15ccb6d5-6d68-4664-697b-08d5415bb822 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3149 Subject: [dpdk-dev] [PATCH v2 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, 12 Dec 2017 12:27:35 -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 | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c index 6ef89fc..04aaa13 100644 --- a/examples/l3fwd-vf/main.c +++ b/examples/l3fwd-vf/main.c @@ -190,11 +190,9 @@ struct lcore_params { .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 = { @@ -204,6 +202,7 @@ struct lcore_params { }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, }, }; @@ -1006,6 +1005,22 @@ struct lcore_conf { 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); + } + 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); + } 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 +1047,9 @@ struct lcore_conf { 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 +1060,8 @@ struct lcore_conf { } 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 +1082,11 @@ struct lcore_conf { 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," -- 1.8.3.1