From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30084.outbound.protection.outlook.com [40.107.3.84]) by dpdk.org (Postfix) with ESMTP id BFEFC1B3D8 for ; Tue, 26 Dec 2017 10:25:54 +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=qSuuFyMF6aLG/I3s5gIy0hrj/NSL/MK0l+0xIjXccek=; b=Ml2dOBDw4tsccg4tZnkgw8YCVxlzmGBcMmlKE44EmLn/UwxN+OnTcH6iMtps/Q2Qb/JZUh6QlQoqWeDOGbyDHvwA8mmkgEj8mgrDMM7VtiEyTrCCRCrD5D3yuL0cFXXaFVlXwzmtm4KS1wz3LE0Co83jtbDF/H8lObjA0KuoVqk= 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:25:53 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:25 +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: bc12bc19-6f44-4587-df2a-08d54c42a977 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:NObx1f5LrBcWRk+Sc/x04X+NwLRO+K+F3Yqn0inQi/KNnLY8NQ2BBFhcgqIKK6JxrCDoa9q8qHzeqR0GugtPSgFyDKGe8pYnz6B+/BxZli5RCMunsKKb+Du5gLOJk4uZfbFVCLL8a/C9QTG5IejjOyo1LOsAzPl5H7n0WkqGwhFmsGlHofFqe73Y1g+lzo5clERH4z9AkFGf0HX6qL7UM6HZkfDWp6j6SVw+3sfnO6PG48GS6k8beg0myza2NtoT; 25:/zbd6ehaJh1N3ZE/EyCGa32SMBXZmaL482h8hY8fgaPKG5/eY1RuqS2TfHE/LCbMM4eRcb1GCM5ZvFtxPEeFG65Bn7qSzn8JbQmAVBT8KKfsHGG/g3KL6BaFv1R/Ed5rhNjkDWrQiQxDuoxDkL1tglBBnBDBKi0qqHvmEjf+dS9sZscEcgrTbSgeRFCJfOoCPt5JSwBsgZ4dhrk0rmJdjMxX+9eX36Fg1Jh5C2gMGXZ9LW7jINulGHM9b03nQwHzAaPGHCOg9Xx5cHlYxmo8iG/g7skKBXqLn616IwrMbWODBv2nB2ebMxmHdewbK6wy+T7RcKbV1sQ0Pclvt72VTg==; 31:c0HxsArHrn6kX1VraWsdGMV70bVdRSxougtoibG90KfsitlNdvVsL49wcWjJXQPMofzCWhiEn0Ek0ltyvJgeeiKvFgJOy6MmSNglY3OrpxjjVznCq+Kb8iCbb10uuVqTSgSuH+0624NGXi1w1YtvIGD2NXlGbFN86vw/E/Rgx+oPMajJiugltU632+Gnnvg7hkVp/fjMH4G1O1t27rtueUWazrtKzUYCuMapvwjwmF4= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:Qr3Xi2Bv71oII3xC9CEmokquENSHGNWq2a9b0OtDnHEuW5DO5Qqt4cKztzrEppxVD0Q9y9JxZQCh2401jtyoYXHM4UzCzbN/Zdso3gu23XQYY8cFUjeoV5m5SyDu6+6qc5evIGwuigKdW6/2etP2U8qPvcAZhTqjp4cqp9aYvPnnuOCrhaDBgyLd+ROIJRGQLvB3W80tobDJ7tkshji6GUbA711Ou5BSrR8heRtJl2BndCzJHSlDbUdimIoABLe9jjKa0mcGOfTuZRlhwpCAlURLCLaguypjnuqvmifVlx4/Oh4w9I+zVDKOO7+dy40gKbReq9uDqkRrtzy2cwcvREMLYlWOx4uELzJKVBmSG7szN0eX3GOGpzDPWyiMehfSwQA7BfN2TnZ0PP6RjqLZoW82YycYjmbWChmv5i34rMA5t8al6Wvf6jH/aMNY4fuT4o5niY6/VDwZs7JozzMBpXFtGs9LPW7lPnSA2TBw0OpH+fFskWzpFU7RAem194+w; 4:oQCyGcmpucX5339A5Wu+tu6JzV/iFey2JKXuxMEUpDZq7l07PS0CICmp/u1NOxs6oX5u+xpX2m8B8Q7ubSp4WE6BbK6Qqq0lDWEiNyB8+fp9j4ySDJXDkd3C0cB/fgFJZFhDFdfobxQxzRyBQ/7TPImSuEq9m8Y2jer/r+7LZnnghQ2hPChgT656KxBudR5adKDB/Kg1WCjkdgFZwX1YS+1UCKE/p4ipKkgYFI2pLj2Rl+KY6sO68yMUUr50PunXJn8A6dyxi0Eg6bFkjyLGDw== 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)(575784001)(2906002)(97736004)(53936002)(68736007)(2950100002)(81156014)(81166006)(3846002)(6116002)(8676002)(309714004); 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:HacK/2GdWoTfwuTVYoofvHpAJvI7ZilosAm3lFLyN?= =?us-ascii?Q?QNqAillkglr9M0hdWP0OHnp81wMv1+QhRlGXGm0bSLze4NUmlOprKAZNf+KM?= =?us-ascii?Q?Eth0H2m2R+9qT5/EC/2llgizUkbAPH++CLTNqXg+zuFg78VYC2P8Twu38KeJ?= =?us-ascii?Q?BB9jCBFQWoI0SEDg5zBnqiS6orX0vvPQ4ZFUenhkKlbfcldT+QPzO93BqATV?= =?us-ascii?Q?TvBX1aG6xnQfKgs8hxLwAhMWdkh6jdsRaN0JSi12pXnwXJAVkO+EbuxfHP0J?= =?us-ascii?Q?D9/osHsVKkIrZFzeer6HAkoASjHyF163I4IHXJbFNT8Ii64y1hQCgYbpfLAA?= =?us-ascii?Q?PQSdHDUSkF4Mbb/rnmLyYMs/+w9mR3qUoVZVp2oa6+3ot/b/tZ6zwuNTtH6O?= =?us-ascii?Q?LIaDdMckCxSSpqj6XE1fqXw2Mq2VmjgSABStVmqX5T/Tuy8UG/0UjZ/R8N8c?= =?us-ascii?Q?P0jbRUCWNFE9gTsuxFEtgL/2C/+BpX2fwPPJ98OGGXMe66eEIEni/YKaeBBy?= =?us-ascii?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TGPwnkADlV533TDeUkAl04BztzuiThfJ8Fo3Cp1O5lgzyjn3UnUFb5l6xAiaLJpQxyLCTbsU8ACv8J8heCd/spMFWJsqLEKMmJeNdGuX3XMJVMyecXQ0KuC4X+bTnRBQo+JpIPvCrRqBgW49eZ7P5i91LjpWU0xjl6+x6f3U9P7IRi71XsYsmUuTALeyDMKRP32uaT4v7XVSJXvqS8PWXlQvQqwNmoT870=; 5:BzjjS1TZsUy4BuI7pkCO9f50rW3zX7uK50juZTyidaBPC4qBmW0KRqYv8XdvEKksSHHv7mGk9464+G2yhvofLxbhN4eDbUZd6Gikfx23FBZH/llCciWTUfdbF6jn7srTTEwZOCnfGAzluQEy0TXrLegJeN80buWoLWJooI3WhZw=; 24:HUxZfahxypgdJJK79StRO3fNCbwI+m7TMhr0HmAJ0jGWO4mlRrqylrNgdx7hUfpJlTbXgEsO5vxumnqwcjbYWTRyQCg8o3EeKIPq0KJcJxE=; 7:lX3iwsdsUvlZ5orq1dJrlXwA8GmSoseSsUyERia/+oj3EnbTFiMF216zETHliV4Tw/Y+/75J/HqYCYpuk9l2OJTq07LkHNHh+imY2TIKz3TzjuPPIViaXtgpBRyVrtHWzX/GoLyY4bYH9xAqb47Hjb1XgDPM3XkwkROoA8UuXij4K8ij9QBKFSFW3iaX5o++7DpjaYINb3YuOySSlMg3CCrxRWb6UEv0cUBBu1xWRBtKZcQCll7NhVxnmXqAX27w SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:25:53.4426 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bc12bc19-6f44-4587-df2a-08d54c42a977 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 26/39] examples/vhost: 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:25:55 -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/vhost/main.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 89a61f0e5..eddcea64b 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -145,21 +145,23 @@ static struct rte_eth_conf vmdq_conf_default = { .rxmode = { .mq_mode = ETH_MQ_RX_VMDQ_ONLY, .split_hdr_size = 0, - .header_split = 0, /**< Header Split disabled */ - .hw_ip_checksum = 0, /**< IP checksum offload disabled */ - .hw_vlan_filter = 0, /**< VLAN filtering disabled */ + .ignore_offload_bitfield = 1, /* - * It is necessary for 1G NIC such as I350, + * VLAN strip is necessary for 1G NIC such as I350, * this fixes bug of ipv4 forwarding in guest can't * forward pakets from one virtio dev to another virtio dev. */ - .hw_vlan_strip = 1, /**< VLAN strip enabled. */ - .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 1, /**< CRC stripped by hardware */ + .offloads = (DEV_RX_OFFLOAD_CRC_STRIP | + DEV_RX_OFFLOAD_VLAN_STRIP), }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, + .offloads = (DEV_TX_OFFLOAD_IPV4_CKSUM | + DEV_TX_OFFLOAD_TCP_CKSUM | + DEV_TX_OFFLOAD_VLAN_INSERT | + DEV_TX_OFFLOAD_MULTI_SEGS | + DEV_TX_OFFLOAD_TCP_TSO), }, .rx_adv_conf = { /* @@ -176,6 +178,7 @@ static struct rte_eth_conf vmdq_conf_default = { }, }; + static unsigned lcore_ids[RTE_MAX_LCORE]; static uint16_t ports[RTE_MAX_ETHPORTS]; static unsigned num_ports = 0; /**< The number of ports specified in command line */ @@ -288,9 +291,7 @@ port_init(uint16_t port) rxconf = &dev_info.default_rxconf; txconf = &dev_info.default_txconf; rxconf->rx_drop_en = 1; - - /* Enable vlan offload */ - txconf->txq_flags &= ~ETH_TXQ_FLAGS_NOVLANOFFL; + txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE; /*configure the number of supported virtio devices based on VMDQ limits */ num_devices = dev_info.max_vmdq_pools; @@ -331,6 +332,9 @@ port_init(uint16_t port) if (port >= rte_eth_dev_count()) return -1; rx_rings = (uint16_t)dev_info.max_rx_queues; + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) + port_conf.txmode.offloads |= + DEV_TX_OFFLOAD_MBUF_FAST_FREE; /* Configure ethernet device. */ retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf); if (retval != 0) { @@ -353,6 +357,7 @@ port_init(uint16_t port) } /* Setup the queues. */ + rxconf->offloads = port_conf.rxmode.offloads; for (q = 0; q < rx_rings; q ++) { retval = rte_eth_rx_queue_setup(port, q, rx_ring_size, rte_eth_dev_socket_id(port), @@ -365,6 +370,7 @@ port_init(uint16_t port) return retval; } } + txconf->offloads = port_conf.txmode.offloads; for (q = 0; q < tx_rings; q ++) { retval = rte_eth_tx_queue_setup(port, q, tx_ring_size, rte_eth_dev_socket_id(port), @@ -624,7 +630,8 @@ us_vhost_parse_args(int argc, char **argv) } else { mergeable = !!ret; if (ret) { - vmdq_conf_default.rxmode.jumbo_frame = 1; + vmdq_conf_default.rxmode.offloads |= + DEV_RX_OFFLOAD_JUMBO_FRAME; vmdq_conf_default.rxmode.max_rx_pkt_len = JUMBO_FRAME_MAX_SIZE; } -- 2.12.0