From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0046.outbound.protection.outlook.com [104.47.2.46]) by dpdk.org (Postfix) with ESMTP id C055C1B260 for ; Tue, 12 Dec 2017 13:28:00 +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=GT3RRIkkQAPzqpKi4lTgDgkGzZil8Ms5NoOFAvy6vgM=; b=Q3lDR29vR37WYs0/jmK86HcsU1BVk4DQhxs3Ccia8TzgYnzJRnvFKUc2xG7DPz8N2LcJL8SSZ9JJZPtmLpMajh7we3vKFYAVoHv/YZ45Y+MReijhU7hSpVHzo9L4+ti/Ew4OqoiYqMWtHTI6q3WNKE5wkVGHGThZJVnPtvS4WS0= 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:58 +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:43 +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: 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: 32d8aaae-8669-4fb5-5a37-08d5415bc7fc 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:UzMA4qs4UUhItnN6YJ71O9GyC4Mkdmpvx2w1CycoFZBj1CC1q54a8zj+YZVDr8joSZK0mmGboBRw+2a+3K7VP8LCB0ibISmTSR08ImH6rcUKdLyughR2H/6gZVz3x5lRnkdPgasHHYV9OHKWqwGcgd3RnKWLz9BATkF683oXXQTk9EQiOX+MTemTTfECwlp0X3dEDLK/AmY8mP0HRthoURpkIUvIFL0J4Fj3pNtMBGcj1Ds2SvN8y7dV+/lewOut; 25:ONmfUUWbnB5jCW/+TgxxL3edHQx5Dg2ebV/sycqcQJPgPMzeKJzFPd8tZOCF3MJr77tCvbE8R/OcGJeoN6BcXnXo0xLJPfJB06NIkc5gnza9DoiMBaTo5uTqMnFlotLBkNrlpdHyKNh5wTq8hrkkgEhIPf0JG/9P+WLxjxR5VYqpUdwzx+RwtlbBSNEtqTvGtc5dvT96kdRFYnP0TfB04ag+lNPgy5U+41blMtOaT6E6iMYPoEhN0QFsBhk5gR5RTULXWgojAdm+1V045gEu1kCzSc5hIMgRXS4jMen0z0BC5+KUawjjD/sUBlk+ZXpp4F/HX6kCM+5pwz9GLYJuRg==; 31:Mk6PWil5i4rzRun34U3eTyASbzS7g3ZyntG7pAxzHo5C1MH6jOPnevQC++ZiypafmI5O/D1z4gx1gk0E0FJ4xGXc+M6DdveSENOG8vwoXQku+5Rk76uwUaGkvr+Pj+JobljzEcnCvwWYKz9PA8h7LKdMwVJcYgb/1znKb8q17cOZOkNLDXxvfRvfpjRlEu0xk/nX/dPgGasFdBIJ43hCTCrGTZcHvGaXNFowvdCpQyU= X-MS-TrafficTypeDiagnostic: VI1PR05MB3149: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 20:pblUOgCr8Y7wWKYIgsizhwLVKI2Ov90BoxwbtMjgsfcpl/OCqnc1mZXJ9F95BtoZN1K14BUIpKIUXQl1I49uB7jfymCML3jr9unz1nrg3hUj5Qhjst8rfrtC/qmF5yS9Koe6k7HIjR4cCwbs4Ar2yHU+dVVrh12nVlajKPyV24GJ04TIMWR1d9QG09UnAC7UtDLcdMOCXF3jBFVawBgkoAw/hc2VObFzs+w6lCP3pjOi3rzEJmcO5vNA6I/2MhcLGisW4J0DVhnPlnWK4wOjA1LKAJ7oRaLl/m0AvkMo+qYVd51HlO1kFyJrZJMMA+I6fhNnX0MOLCjIgl9V2xZJNu79kFE3xzwtOZJeJJtcItxNMRJX/2nIh+bJQuc5Db6FllfV1xtxONvxh4fGIqIliXFduBrhy285aq+NWKQUBHj2p3xEYMD+sCDuLxSpTMwXezxLLTbmvB0VRIHzqR+zkezbltgs67RDGQdMZLChl7AI/MPQc5+nN1pfCKmxQVmm; 4:/ydOhGKbhlG0xvRHe+f7ZTYeVpDfJ/b+V7kNl3L2LDWFrmY8k/Vwa0esOh3e92dcryBHHZldyzXFnJekDVem7voj5pMf23RARF/IwB0wgTdw86YbrTP7zwHUaKzUKTRCSlHDoYvudYdNGiH/xh9i18t9zLirCQjbzqbT1cQEKu8iWpfR0Csn4EzToxqcR4kkWUatZDiPxcU+DdFZKRM0kUhapL/jdBqf6gs2AD2bXTz+NfP3vjnO6irZbnlT5OI/xC4GFOOTqAKC2UPfiazrRA== 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)(575784001)(76176011)(16586007)(53936002)(16526018)(309714004); 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:eitLKHmNS2L3AO5ujzjnOyWzo3kpB0vAHuU9Z64EL?= =?us-ascii?Q?JuydI7XLOi7AxDEC1QDJvBofOiJP/zQA0U9Os2gxMDVA5P9Q5yk7kSi0Rk8F?= =?us-ascii?Q?qA57AbxitpPEEeR1SKSqJf3Z6KygF9XTIFI6e29eS19Wdt8Oow1t6DUUQHAv?= =?us-ascii?Q?b1wo8lTNb5eGh1K5kIOxlkCa84vIBbGX7EgS+Q28Br4XmmKX6n+mY7SAgDf8?= =?us-ascii?Q?CG+bsGk9/jTqqLm29jPKL0dROrcuROg9Mte8Bx61PqQ7ftIfVCh/sqICiyxy?= =?us-ascii?Q?30noqAQxU0nP95BA9PHzOEJaX3e/zwy6Ze98Dc4VrZhmeXazXk2lrSpLQPLs?= =?us-ascii?Q?LEMH2qHBkwnnx/kREiuUJ1VyPE87Nh+YjYaaNU5OQEEiRGTyNx4JI+LBD233?= =?us-ascii?Q?I02tbsjHd3NRkyo9x+Gbr3upCzYOashHq6Wdy2I6au8fCOr8hb//GJlTOn6l?= =?us-ascii?Q?gcJCh3bsq0H7VlX2xdc6UVv3U3AG32rI9c+xg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CJeXfTr2elDUT3kflFZccvrRdF5MD7KHh+BD1fSkk2EoPMXBpxgyIAPGjJ9+05Mig8VAWadlc0D1hDbB81vS0zuN3zqistUX8wfmh6WFk/BfA4=; 5:oq0AQPHnycOCA/yfrIfu/cqJTTxeqNa7mHuzOIaA8Y2ZsC3gVCrFbFXCS0isS2izJrP/cTDq+nYFp4eN5S5nfv4iUtdbtIi+ay1IQbvagjP+Xs5df9IDBE6AZb/V3RWXnIX58Lx4KdgX3m76MAcmJeEgghxdzR65IwZZdjmpe0c=; 24:zx6y6tj1n42oK6fBrr98duCHQND8ySVCSjBhEg9wj5IeDa7vRBlPukoTynJzg+1GJKzTEvuq9XIHjd0AtXqADrBscf7vrJxHREMzqGAnSm8=; 7:LLpxr2wFHVO/2gxm+9fqDh038+JkzM2nxDLasqvtThBEv6DQ1rS1UHRpaYapafiwkkK+YnQCdTQIuV0brLlMuTrFyOxUwT3DVII0ri67ONXPeIzrCigZL8mkOdViBOKyFfPQhU6uWgoVteVsasa/u2PJFVtRgUhTpwOvuiXVQyQL4KOx8sBq1sXxsT4L0NbXH3nTZFoqPXkRATQqwOtFsb8rMLyasWqLvL2r4jU6cN7oX8DmjMhrf/nh0o8iJ/tO SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:27:58.3951 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 32d8aaae-8669-4fb5-5a37-08d5415bc7fc 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 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, 12 Dec 2017 12:28:01 -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 | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 89a61f0..5e0c680 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -145,21 +145,24 @@ .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 | + DEV_TX_OFFLOAD_MBUF_FAST_FREE), }, .rx_adv_conf = { /* @@ -176,6 +179,7 @@ }, }; + 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 +292,7 @@ struct mbuf_table { 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; @@ -332,6 +334,20 @@ struct mbuf_table { rx_rings = (uint16_t)dev_info.max_rx_queues; /* Configure ethernet device. */ + 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) { RTE_LOG(ERR, VHOST_PORT, "Failed to configure port %u: %s.\n", @@ -353,6 +369,7 @@ struct mbuf_table { } /* 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 +382,7 @@ struct mbuf_table { 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 +642,8 @@ struct mbuf_table { } 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; } -- 1.8.3.1