From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0056.outbound.protection.outlook.com [104.47.2.56]) by dpdk.org (Postfix) with ESMTP id 5D23D1B197 for ; Tue, 12 Dec 2017 13:36:17 +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=7eOFHABijy1Mfm782Y2kT4WPNpaOa/eZ6tiTW+FqonI=; b=KmPn8IAJ5qivUnX/2gvPokuHXtGDKDcM9Qs2eK0MjEZOK9sLp8t55KlCU5Y0eo9Erut7zZbtc6Oi/a4RNwox8LQl7dtqjKcLq1ihJmA4FGTVpb4nvdnOjINDtgW6JBes98AybeYPz92gufkAnU2s+Hb9fCsg3YhxvQsLgYMYYcM= 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:15 +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:31 +0200 Message-Id: <12ebe3f2c7767df4aadf570da5ba96e422229f87.1513081088.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: 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: 8a6a1cd2-21d2-4470-5464-08d5415cefe0 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:bTPxt22tBsOYPDY4zJaQ8rRC0FO8GXzaPonDyJopX9DTkap3StSk0cKryfiSFPxG/D1EnriuH8rGERyyJQjhoU0Tf3Ni+OHO4MQZEgTHwJMBg1TvVnND50Uc5cO+wTgoYlompccXok5G0VL3JDnum3oAZ4FRgOd+dRd61A2dJ8Me4PWNCV3IRmq2qiasRaMtG5J0f+pkA7HnUXQ0/txzvPLU1b9z/moaf3St1yXYCY6dD5tgMDJaX262eyJTTeW7; 25:0jRfr+1I6QoOIPmg6ywzs1XyUwoztYzoi4vmAw7JC9Gl/vT6sD2mzjhln6MTQDpvK8DSWCYJAAy9hfmjjsS+ey0DdjLF6g7xE6hwipDvKebyWF9X4aI60AM/lyCaxhcLWmIwY3MIAqF005GOVHyZB8XujzTge6feqXsU0+cThBQlOHU4BU7H746KaYxtkFd6J/C93gmsorWU+LID/CpDYegRdeDFWJ5XHCT3H6BEHn2Hhn0QZqO/NrkSXF0ejbidPI9dExuDxwmZrUeSqxuhVW0DaidGD0fw8MK468RarFkqRycVtJIil3kG5pTydlphWP8Nf69j9+hcnqI3Pn5+Lw==; 31:+WULXbqAH8biFipGK+FiCOKKNTXp9sXfGyiMxZTk/aMn1XAH7adGFiclanxIXqYWO1qZ5LD1M5Om5WHOKyKmHin+/ki9tao0Mvt8J52KEuJsyFBds7W+9NfyWxpEpx7bNLPwi4fJ2QKW0fFpcyTN3HjvD8wEiH6rvAHjuOsWvzZ6jEL4oUhnYoYQ7qjvTd1XhCyu6SpJV5ILR5DlvnbSDaPSrJDPhzHubh/61kHgzCY= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:sLJfZdUHCKmVnc2smliFI7BhHaC6GqoqGbzsbPi9A9r2ZkSz09UNzNcisaO0RYiAmaeR0f/1xYTB7x/rx3MVJVnXZb5W4UM+UaXo1H6bJCAnrUn4f9FS02jS5BuretByUHTD5EQwTmVxNFHBD5b7HCZsXdO+vvQUhD++/cXs1VdWFhbNm7LpXm/p8exMT41vSLi8Rqp6x4f1oPWMVeD6JEwQVVKB32xykfTg9lkZ27h55xZzHdVnL8PcsL/5iIlXGFbUxn0LjRrTYcJkm7Vr0T0ol6iN6h+F+rg21y6LUvtgwNOYaUhooXYJXrIM5G8eKHFaLBb8mxxoOIjP8E6ouDlqQdXBcxZM+42AdMHZhD8vwFMxvwffe7pRnjcxkYAPAu9xcSdmvFJMBnB3RavfFkh5Q3WIL0Pbp/Z1LKBy25wcU8VBq/59wvOS1UqH/AdtpWAESmQ/W2JWWpU5GdZ/UdBY3sTtLYTF19nryoIsIbyE0TC0I9vGyqtWS1d9wPKo; 4:q6STyks+rrCiv3vt1H4GF9uqOsYDEXptG0XoDBaBylptEzPYp4ZZPuFUY/WIOJ7k1Ji3rKZa9FUaXELk12lllgpHMxtXvWlbwKN02weQIxj8j5SPIjDPoSDk7OQEksRLyb7WKS8u3aOamrzE/vlbwOkn4/HY51iG0MC9iaJQslFvD38QmfpgsbMc4GV5lVA1jes2CvjwrML3u94o3XIW9868NE/s2+kkzFQz8r4XdKaLlJrxu9KT2+TiiX9p4DdsQ1hVoe69mjTSyKTktLOEFstQ6r4W63wloPPcuC8Hz203gOqFt9KWFR1NHu4whs6B X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(158342451672863); 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)(979002)(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)(575784001)(105586002)(21086003)(106356001)(2906002)(53936002)(8676002)(6666003)(50226002)(81166006)(81156014)(33026002)(69596002)(76176011)(36756003)(478600001)(118296001)(969003)(989001)(999001)(1009001)(1019001); 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:wY7klE/dWrUd0xS+b+VllvqGfyu0LiHt/mO1GzKqf?= =?us-ascii?Q?axRHfyIJgm2gGoaXAyKL1QsXBTGjSAJc/OB4LnEWNKTD3uJ2lzAnLAhB/HYU?= =?us-ascii?Q?AdztvtPDewt6wDb5x4vqoyEOWa7eLUM2Xn+e3zhijSYN9QxR+SWbl4I1LGHF?= =?us-ascii?Q?pLxWobCCPDBrfCz+12YFT1taObsRAkAUj/bkbpU8eL0BL+oZHQ0kcwSIldlT?= =?us-ascii?Q?Dr4lQjQvEXjZ8zS9zDto44DsbQEWa4nR0p+7TxE8NuVaysxGS9OyS+/Bbqge?= =?us-ascii?Q?/8/Mu5knMSVzxIQEMHi5PUxq0dG4IU+8tCOZFcE7aHoIroB4JJIkVX/Mt9pN?= =?us-ascii?Q?Qk0D81boQHchTdjIOM/niNm+UwtG9ruelxbAdmts9FWU00Qun550hgOLQFyv?= =?us-ascii?Q?XOf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qq9RQYdxZcmHeHC+Qb/yZbKDif6U7lKiMCNtcGCl8iJVbrmz1azdaBMdXDbeQT5zZRurfHtwa+U0dTt2IY1FHGw4zyeS0nyF0xuxE77ChzW+OK9SATvUsQ3zFEuFbGi192Zn4+J7fJi2Pw2cNzbPLLy/IUenyXqRvOUJYIFseTeTnYCBpMAl+NzQFCwH5XY4vrrrrF9o+s7bsAN++bIGdS27sjUpl2o/cmCu0J7bFdN8gIzhCBVW5iK9t6bhBadGDlxZcgsXKisYhdceYnJ7UeV2pw=; 5:4yw2FlPLp1J8UnDnETyynegzD40OR2/54eymJ5pvzVsq/W+F9uDGcA7iGnB/0//jHDulLoZAmhFKRmyOM3SvbAlrJae3Xm43GfeQAsNLEs1L/7MLPl84oMRz1Y6cyCKE3lYFvdZ4sq/IOmVZl+Sgcuwx/zdq+N4NDsRsFpDDbv8=; 24:PTRbFv/dcn02lRvM4/jmIQ1GSM77SpiH19heclRrZLkRBTle5PQ1RqI9zHQCuxiw8lWQsU/7ricbGY6IWfzOQMPxDFqB8mgi4AYxqAcCUMU=; 7:qyBhDQ0TsJ22fDrOfotmz+/f9Du4fvP3Rm5H4r2NL0lC9MDp8P0vdwIBBAotHdVu1Jn6uE4mlg33okxmCF5UpiAV4y5M2CGFcSgTD9rvXrSnzKwfKNNC75MltptS0thSnMEY73h6yN4w/+IKMjV2H/AOC9Khg02uSiMQ4jf0byxNottlkV7EquRF3oMIMMqmMYQ/FiovQK3Y8JuXsQGq6n4TppdkeLQxJYXtL3u17Asu3RTtjO4Zh4be8HX8CmGr SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:36:15.3952 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8a6a1cd2-21d2-4470-5464-08d5415cefe0 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 38/39] examples/server_node_efd: 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:18 -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/server_node_efd/server/init.c | 33 +++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c index 0bcab8c..19d0ff4 100644 --- a/examples/server_node_efd/server/init.c +++ b/examples/server_node_efd/server/init.c @@ -123,14 +123,20 @@ init_port(uint16_t port_num) { /* for port configuration all features are off by default */ - const struct rte_eth_conf port_conf = { + struct rte_eth_conf port_conf = { .rxmode = { - .mq_mode = ETH_MQ_RX_RSS - } + .mq_mode = ETH_MQ_RX_RSS, + .ignore_offload_bitfield = 1, + }, + .txmode = { + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, + }, }; const uint16_t rx_rings = 1, tx_rings = num_nodes; uint16_t rx_ring_size = RTE_MP_RX_DESC_DEFAULT; uint16_t tx_ring_size = RTE_MP_TX_DESC_DEFAULT; + struct rte_eth_dev_info dev_info; + struct rte_eth_txconf txconf; uint16_t q; int retval; @@ -138,6 +144,22 @@ printf("Port %u init ... ", port_num); fflush(stdout); + rte_eth_dev_info_get(port_num, &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_num, 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_num, port_conf.txmode.offloads, + dev_info.tx_offload_capa); + } + /* * Standard DPDK port initialisation - config port, then set up * rx and tx rings. @@ -159,10 +181,13 @@ 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_num, q, tx_ring_size, rte_eth_dev_socket_id(port_num), - NULL); + &txconf); if (retval < 0) return retval; } -- 1.8.3.1