From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0040.outbound.protection.outlook.com [104.47.2.40]) by dpdk.org (Postfix) with ESMTP id 2BF751AEF3 for ; Tue, 12 Dec 2017 13:36:16 +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=4l4+scdcRTpsln65u+E5DB33++LMtV829ewfhsvHyyE=; b=DFSXGWEmgrZlY+Xf3xwbVVC6X6eecoQVZDCn5nJS7BzR9D6mFR+0lMRyCtGqhM1KWUmrrvfu60bJ81VkTvjCfMH7FSfG+lAxEVETQ+Y5FuDMm3PuL8RLETUSysF7G7UNd43HxgITu4cFyR1Vh973Y0K+Jq7v0N0zhJiBlfpa60g= 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.302.9; Tue, 12 Dec 2017 12:36:14 +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:35:30 +0200 Message-Id: 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: HE1PR0102CA0051.eurprd01.prod.exchangelabs.com (2603:10a6:7:7d::28) To HE1PR05MB3148.eurprd05.prod.outlook.com (2603:10a6:7:36::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 853f776c-c9a5-4673-5b0e-08d5415cef45 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:HE1PR05MB3148; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 3:fxkqhPqqGTz2ieKw6lu5e4D+aLFgi6Jrz/9Z7p5hziLwVpUKHKUUue7bNlqeC0BCtqbRPWzvJnGU5lgy0v3t8ptO/q2p5JebV6xFwiIKjxq5+ncq3pVMq0ObUZIwhCsgXZJSCkQDW5vkTKmI7HedkT3OIoZGtibJGcYYsCWEteUXSl3b27A+H82zvRBVtVPinu3D44MJzOWufTyqlEtmIoBeiDw2vZVVTpSmU+baNA4FFHFmSYEB4H6woBWCLKKD; 25:j9IigTJd2Uqkr+yQMlisJd0r266lUzu2VWrlZ9wMZDqY6R2s/bdVqMrULjhJztilU1KpOhXMyyCc+1+926TRgRAda1Wu3iTEkn6vZvXSvaTeGJcngH6Dyjk8ZuUbGUO8dJKIb4K1ZIO9utPo9v8wB2n2TmozN8m7IyNe0halwiDvJ6jaNegYRI7fssgoE2ogzNwXxNruEJiCvGftLCLAyhzg0QH8XFi+mc421MsBq/zbO9m0lnXVHzwkVEVZfNS3M1R2Ddn5+p9DHyALbU4OCRMHJCbdVr6t973IhCGFOUbsQaIBqnyYdkhZJaDRFsSROPaufFlb3kzWixZFkqfiZLTe5RLqqsx4qMKioyOrSCM=; 31:DI/K93keWFgAhe/vdN7u8us0h0QRKBfdIelxpAoUuJXopxmkrKd5GLzy4EsDc2zVfEzoK6yCNyjiZMGBnjpW/Zz8WVxkQicfF9IgZC4jTmz5YAN8oC8NDSwrcw3Bknjiw6+DIEXn51TKHFyUHeSyT7kHtyf+G4thfo+F+vZdnJmRINqYvuOY+3A8NjPEG/2xrIh0vlh/b7WNEyiPkxEXQN4n7zMb8H9WpmAEetcjaqM= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:qntSZhNMej6ezeiGyCKSmDoa+IsNAxRqN88jJ8VtBNWuEyLwZ9lnEN7IBdS6IH6sT/ecfq7LrE1qNZvKMIRKwIuxShoEw8A9eCez9bVpoD9Z/1V0n3Co5apidv9ewCM/8qbIU6A5KDn05gpBZS2p6iQbcEgMnmzrGTWWkCBusy3zINn1Q3bouq+1XvsOVaY2wpDkVNiWh1mt0TgvwOK3B8NFxST8yH6KJQnlxGAlwnnjMcU50NoC0hyfbv2JYgwSuo7hgU7ZrHHEQ+8y+KGxcSX7DNXmhCK5GdJQl293/c+87zzpXWBa2gjeRosMlGzz6lXxosidhKT0avF/RpxZeJHSLmYxPxUFsXoAWCZASUBmdF/cpNu6/VPlsawnYVU68KWYbl8KQsyyUEZ1Bw86ET5Haeu140FTbFkuHuwRSRjpoS2ayaguQHs6LMpUevYQafVX1FgVwoCteJoAUFuhasVXAA9CPlDTvIMnbnVtUq29jUnPajxhCvpEhOfDXeCB; 4:AI0bvyq4dWhNjzdqih4nMdAfVcBHzzGoVuVhTwLfS2fgUQosQLkGgnYl5iYwqeSyZi8l2ECHIU5k2zex628v0fZC98VQE/pId787OwUFGXr5s/W2c2wQCEuAQaBDMo72KEyGCk1l4l8j5cvPUrv9TwK02FKRJ3CSMWrr9GvRqgfD/lt/eFSd7tp80sKtUzX0Ukz8MUrz5M3HzZ9lacIKmUzts2lVyjZJRjlpYPb8l73nLpn1l4ArfBoICt0YGD3vhjlmGJGH6sU5An4zhpmNhXAdtkzvf9touxs0M1TcRUVXCjzlY3FtvGcPh6HLegC4 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231023)(6055026)(6041248)(20161123560025)(20161123558100)(20161123555025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:HE1PR05MB3148; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:HE1PR05MB3148; X-Forefront-PRVS: 051900244E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(366004)(376002)(39860400002)(189003)(199004)(25786009)(7696005)(52116002)(305945005)(316002)(51416003)(97736004)(47776003)(2950100002)(5660300001)(66066001)(7736002)(8936002)(16586007)(68736007)(50466002)(48376002)(16526018)(55016002)(6116002)(3846002)(86362001)(105586002)(21086003)(106356001)(2906002)(53936002)(8676002)(6666003)(50226002)(81166006)(81156014)(33026002)(69596002)(76176011)(36756003)(478600001)(118296001); 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:JU/r4/B1RDJ4LV82vh1l8RCC9AZ8ETMiAzInGV7I2?= =?us-ascii?Q?g8SpX5uxU3bFXzEiOHgEiRHdsJI2+hSIWQxI9oRcRBP65GfXetSI2xNvJVqV?= =?us-ascii?Q?9DVwKcp8Kuy6vVGEWWjLqWROLzw2YqEAibxph/SSHEt3M+zved9PKaR3J+n3?= =?us-ascii?Q?2YyYiQ3bRIHSJsP9YSV3D188O7H2a6TQ+9WfyVcXMsK8gRI+KFmejBhev10J?= =?us-ascii?Q?sxLdNntLI9U6dimwA95q9yrlb6D9WoFDMAMcgyJvr4w1Ccas9BDl6i3TloaR?= =?us-ascii?Q?KGq/OQUFHeQOUE18yZmkfojnw2efl+Nzf85tozAWWXB1Und/I4Kr6PgOTNBl?= =?us-ascii?Q?bp9hW2Z7fOtnDjv7rs8G7MTb+rogh9qqaXZnWP8Bwq3lq5LeuSnYa/qFsGgn?= =?us-ascii?Q?VXa9VeeSodOss8pHp5U3MZFYdRvp9UzBShQfFdu+qTwYoXTWX4yqTO2WjoyH?= =?us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5O1Of4TW1HKSA8Ik2nGLoe3JAaWu0+ugHoAjUtuKcEjIUf1aqQ67Aunoh1w7UFbIuROZA=; 5:yTuubX+ri6pYHjAYQdZpacA2LLm3OlmbkdDSSNFYK8SL7AJoGIOyRAECOBxLzxw5GtaRUnYykPIKDsvfKmEpFPG3gP2K0YRGXE4ca3HxZST1yc7rZMvMQJobfsm/bqfjaDOCs7beO/qDtICYhAKBQSjm2U85FIFGPXLD5wfOFhY=; 24:rJ2u/mgRSYpVHAEaMytGGV8VlN8AgbdNdm93QSYzb21Q0BwTILPiOVqbC2bki/ywN+JhPbRq+wAjCAZCI3O+npjW2bqmhr3TJGdJUJXljTM=; 7:XT7WcxicDlvdG4da6NiKHJYU7uSE4Ee8rjIxgNqSkqfauU/4c8v/rw+y1re/EkfLEL2I1Q4MXY7m+JjYhTw+MlkMylDz4YV2nde3fvFWzIe64K0YSMmyD9+cTzyudAKiIRZpfWDCsVfg/a4hVLinu3LZa9EhYbeUPa5bhEPtYQP+zBdWylW3eqeimvzYcehXGtxrvS1onwQK0VooeEMZ7Sj/aE937bCc3kXyiD9zcNoRNotHtXF54CbR6YZ8HnGY SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:36:14.3639 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 853f776c-c9a5-4673-5b0e-08d5415cef45 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 v2 37/39] examples/rxtx_callbacks: 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:36:16 -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 Acked-by: Bruce Richardson --- examples/rxtx_callbacks/main.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c index ca135d2..0f563f2 100644 --- a/examples/rxtx_callbacks/main.c +++ b/examples/rxtx_callbacks/main.c @@ -47,7 +47,13 @@ #define BURST_SIZE 32 static const struct rte_eth_conf port_conf_default = { - .rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN, }, + .rxmode = { + .max_rx_pkt_len = ETHER_MAX_LEN, + .ignore_offload_bitfield = 1, + }, + .txmode = { + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, + }, }; static unsigned nb_ports; @@ -105,10 +111,28 @@ uint16_t nb_txd = TX_RING_SIZE; int retval; uint16_t q; + struct rte_eth_dev_info dev_info; + struct rte_eth_txconf txconf; if (port >= rte_eth_dev_count()) return -1; + rte_eth_dev_info_get(port, &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", + port, 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", + port, port_conf.txmode.offloads, + dev_info.tx_offload_capa); + } + retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf); if (retval != 0) return retval; @@ -124,9 +148,12 @@ return retval; } + txconf = dev_info.default_txconf; + txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txconf.offloads = port_conf.txmode.offloads; for (q = 0; q < tx_rings; q++) { retval = rte_eth_tx_queue_setup(port, q, nb_txd, - rte_eth_dev_socket_id(port), NULL); + rte_eth_dev_socket_id(port), &txconf); if (retval < 0) return retval; } -- 1.8.3.1