From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr60046.outbound.protection.outlook.com [40.107.6.46]) by dpdk.org (Postfix) with ESMTP id 8B9B71B3EA for ; Tue, 26 Dec 2017 10:24:25 +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=AbLfSHalIZqAiKR8U7y93qAvbcmQgy2mvIpwljEdg0k=; b=vC41YaW4mMehNY/Z1qlzbNjg23XF/1XpGiW7v8GgVE/R6QdNmHn3XldFtcGvhTnQEjt/7yDMd5dfC+ppc9Yt3sgiGfPapEze79tpNrQOZJ4TVwq0VNz7sFwoZXVYdj/JMhKoRMGtWXNM/JOa6aXyjKkjIKNKc4vkiDB9PfUibR4= 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:24:24 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:08 +0200 Message-Id: <033a1b55e0a5f09ad7d455b1e60a0baaeb61acb8.1514280004.git.shahafs@mellanox.com> 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: 4b94a229-8f60-4be1-4cd1-08d54c427458 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:TYgJnZVXFyX2pFBxG7BJLE5LsUFXzAV7KU8Pzgequv/tmxTi3YIrDPq/W2QjR4tQdhjAikVLHidDQomSSHO8hnqVPNuvZb70GBO5/1WledEzcS10a1lp4yn7LsHFi3Dl0wmykMuYiRU5goAa5wHUlDaR4NTl1NSyUFvGOXXLh/FHL3ZejC2QCqcS/N2TiKayRZXPeFCDseraMdykplDbkB39eEGhfE52ZA+Pbsv6CIJYoVssHfqeCc+aB2jmq8XX; 25:g0OW1g0DQBwBbWteLApf62pakrS36yNn30CV+nYTMSGfFUP/E/7m+MPJ/QhHvLR4CUQOwPX72Gsa9wDNBIA0pB1Xd8V2GobnxwOF1KbOW0NOnJW5HlD1AoxwGyN/7oepSUkUzEPs7Y8i4RfwE4uIwZn5tro2EZ+i4JJAT7RVsjVkgRwXMyHNCKgWRlJGMnsIgEUCZMpOaJO+4TEDAEvBwIh3GqGEfuoBUY3YF9VQk28x+/aecS+LXLfPQb1IcnXP3kOAGWzYVKx9m4avzAJROCYv2tm6/Ohsjw31al9RZ1JpPEYafyEXDeLxj+t2q6lMD9qOxwk9oL7mMvaiPerxtA==; 31:5IK5QJ//g2zOrC/U1c38sUYsk/P6L2lEXYDmQbhQmxoc+yfeWF5liHOm0kIfhrhEWsdsgNaCHDZRvSj7zBUP/Ek83weQ2BWZvFu1qnHwXoiW2e49ZmGzdEbQVkums3nDQBFxQGJOokrTqb1StfCMd3NY7MrffODXYxZPBwUaKwveShPUVUSUj/+kr5qCyBv+yeA0zFgSkgQJhai4RpNjYKLTzQArDvPMmwKyGMesaQc= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:c7JDExiFtpDQ0Qk43Xs4tDlZRuw8/Y1SEuNAIZjmS1NXNTXd/fGZwi98ic+JcMVJMgqV9680grMN0WxvRhXpywI+4t3THqHs9kZouz0iacQcZlbeYlbTolnPTFGQIp0joPxPc721m68snoJSs+jnkJvwbrfdz8UF5/38s/mKi2ZBOV0bmRXeq5zAIMefZMqv3dsW6DHA7yoCYU5QgKIUyKlaoak9iaAMLvoFqCBxy4uNkWfOk9C+dZrh+6pMI95UXjSjekkktLTQcOKVAvkUfA3usWXHR5zyClYJq+YHwJLjJg5w7It6GAyWP1geiqdgo56nijlJ3HZblv6G235dwe72aGevTgnEY6tEBkDrB24ctxuiiXJpEGrIk+K4jO5sjRs4p/hSHCVNjvu4CzK1RayEhG22feAnmwfF8TgvSCG/z4MMjOTX2LjDM6M7pvfdOK+CM9hevu8J8pbyqae/H9PIEmlQXihNjIrz4n7y/TiZsGLq5koyV0SNQped8eUI; 4:6uAeAJEUcpvSwUANB4i0B3ucEDwIgFFxWLRU9QL1v2EI8MVIYuJPzW/1HNkOoGBnTUx8ZM9fhiVFkCKwu74+Ba5AVuhTXLdNi1+1W/AVMLWlXsO3j+ONHVl5tvOOILedDu+yrVm8jR7jriQpg1688p4M/N5GaHEALuJ2+fZVvD0mFBmsHHcECnHVozojpYP2mDnlK5KQnR4sJa+MSfIjltyHu8JEAdE5QcPCULVsMMwm3Q8NtEMOqLWHDRrdZ1wYNqea7DInSSh4QI+Gm9d68Qq9ghVj0F+L8D/CybtYgb/4nsE1pcpGw8I0I3X8UVqV X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); 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)(2906002)(97736004)(53936002)(68736007)(2950100002)(81156014)(81166006)(3846002)(6116002)(8676002); 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:YeJEjyjOKw4/2M1IwUuTGMIyDV8OHBLOjd55MjZ4V?= =?us-ascii?Q?9O7xyyJZOpZABCzimbGA42VdmN8q6a4zSC3+3iigAMsEvAhWgH0aYmONhLM2?= =?us-ascii?Q?ajrXISx1w9psKnY61w5as4v3q33omzhnCviIHup+Cebya3qdstd1by2Egd6O?= =?us-ascii?Q?Hw916J7HKX2Fo6cP2RtaqAYx32K0QpUZvk2jAjTH8S5Mblgt0UkQbfCTqgw7?= =?us-ascii?Q?6QQmPR+hqsxOlO0zrrzd6Ti+Hh6ts25FPIdI7TS1JXstJs6onT3xSUjprsvV?= =?us-ascii?Q?4CBqjXj8W8qEvloHTNBG9mkl+WKmHE3/TuUbfibMGz+8huNv8+ZkjzHcatsM?= =?us-ascii?Q?kSlVH7GvlmA4Feur5FbqJncmnyRDpalP+fCq2tadffDS9vMgWvbFWL1BFpOS?= =?us-ascii?Q?/KmYOwdKFbG6V5iuoxLDTv6ben6lykusNp11XIb0AlXcBJSFxU+IElgazV7x?= =?us-ascii?Q?Vh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cr1g7S78h852YSv5midQMti8iX7NMX1SR3JCjJjROsvGaQTwMFEte4kAXBPRuReliFyTPjtknPHKizSL+TRQ2crYp2lAUv/4iJrznsKErnJSiyal216tZHF7g6PWYppiU3qe2bYDQTMKwFEShkfBHle5TftXMmVO57BmbCs6apfIIdG8vUSWWOb8Rb1TYe7QFWKlqPkVmKCt7yeX7OebCMjlDuvnC51RQ=; 5:yYsQjU9vte83g3DTQBl6Laqi+bMUw7tskwk0wT8F9bLaMboAXjcBMj+JmRtJEA0YKBNYlpkc3SFxmfijKuvEGW1/2Al3NldE3TFM+okEr1CaHOCfXmZE/NVR0/fVwzHP/Dmqn04zZ6tNEie2CXr3hSYpEkmfWBqKMSZKNBkTv80=; 24:OwKA1nW61omvvnK0uxjvtqEN0f9jZp1ZM4yZi9IAWZq8llb7hAejxwJKJHaf+20OmM3rC/DS7O6zBg/nbHaP23OVAjfYKAZLbKR5lqqzdX8=; 7:rW3YaHctWyqkx49A2pWu+ceBHp6PHGvDL2IIIIgtLVtNplKMZP7t/r+PpVMmTQ1NLXPM1AavxPzyteuyqaR6CRp4g/Cl04TU4eZDGkhqXWFauN2qB6ushHcs6KxpauiNc0e4JaPiiw6af9xCyPPku35kT12vHzA4UwlG+hq+LLgyRfhKITxiBq77rDbS5BjqtuE+TNCmFCJaDOT9YUoGxdrbonj3E6yiHWlfXBqEPkOPZz6qk55as4KQLTw1HxrA SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:24:24.3164 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4b94a229-8f60-4be1-4cd1-08d54c427458 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 09/39] examples/bond: 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:24:26 -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 Reviewed-by: Radu Nicolau --- examples/bond/main.c | 48 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/examples/bond/main.c b/examples/bond/main.c index 8e3b1f340..68dd53856 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -151,11 +151,8 @@ static struct rte_eth_conf port_conf = { .mq_mode = ETH_MQ_RX_NONE, .max_rx_pkt_len = ETHER_MAX_LEN, .split_hdr_size = 0, - .header_split = 0, /**< Header Split disabled */ - .hw_ip_checksum = 0, /**< 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, }, .rx_adv_conf = { .rss_conf = { @@ -174,11 +171,19 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool) int retval; uint16_t nb_rxd = RTE_RX_DESC_DEFAULT; uint16_t nb_txd = RTE_TX_DESC_DEFAULT; + struct rte_eth_dev_info dev_info; + struct rte_eth_rxconf rxq_conf; + struct rte_eth_txconf txq_conf; + struct rte_eth_conf local_port_conf = port_conf; if (portid >= rte_eth_dev_count()) rte_exit(EXIT_FAILURE, "Invalid port\n"); - retval = rte_eth_dev_configure(portid, 1, 1, &port_conf); + rte_eth_dev_info_get(portid, &dev_info); + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) + local_port_conf.txmode.offloads |= + DEV_TX_OFFLOAD_MBUF_FAST_FREE; + retval = rte_eth_dev_configure(portid, 1, 1, &local_port_conf); if (retval != 0) rte_exit(EXIT_FAILURE, "port %u: configuration failed (res=%d)\n", portid, retval); @@ -189,16 +194,22 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool) "failed (res=%d)\n", portid, retval); /* RX setup */ + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = local_port_conf.rxmode.offloads; retval = rte_eth_rx_queue_setup(portid, 0, nb_rxd, - rte_eth_dev_socket_id(portid), NULL, + rte_eth_dev_socket_id(portid), + &rxq_conf, mbuf_pool); if (retval < 0) rte_exit(retval, " port %u: RX queue 0 setup failed (res=%d)", portid, retval); /* TX setup */ + txq_conf = dev_info.default_txconf; + txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txq_conf.offloads = local_port_conf.txmode.offloads; retval = rte_eth_tx_queue_setup(portid, 0, nb_txd, - rte_eth_dev_socket_id(portid), NULL); + rte_eth_dev_socket_id(portid), &txq_conf); if (retval < 0) rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)", @@ -225,6 +236,10 @@ bond_port_init(struct rte_mempool *mbuf_pool) uint8_t i; uint16_t nb_rxd = RTE_RX_DESC_DEFAULT; uint16_t nb_txd = RTE_TX_DESC_DEFAULT; + struct rte_eth_dev_info dev_info; + struct rte_eth_rxconf rxq_conf; + struct rte_eth_txconf txq_conf; + struct rte_eth_conf local_port_conf = port_conf; retval = rte_eth_bond_create("bond0", BONDING_MODE_ALB, 0 /*SOCKET_ID_ANY*/); @@ -234,7 +249,11 @@ bond_port_init(struct rte_mempool *mbuf_pool) BOND_PORT = retval; - retval = rte_eth_dev_configure(BOND_PORT, 1, 1, &port_conf); + rte_eth_dev_info_get(BOND_PORT, &dev_info); + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) + local_port_conf.txmode.offloads |= + DEV_TX_OFFLOAD_MBUF_FAST_FREE; + retval = rte_eth_dev_configure(BOND_PORT, 1, 1, &local_port_conf); if (retval != 0) rte_exit(EXIT_FAILURE, "port %u: configuration failed (res=%d)\n", BOND_PORT, retval); @@ -245,16 +264,21 @@ bond_port_init(struct rte_mempool *mbuf_pool) "failed (res=%d)\n", BOND_PORT, retval); /* RX setup */ + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = local_port_conf.rxmode.offloads; retval = rte_eth_rx_queue_setup(BOND_PORT, 0, nb_rxd, - rte_eth_dev_socket_id(BOND_PORT), NULL, - mbuf_pool); + rte_eth_dev_socket_id(BOND_PORT), + &rxq_conf, mbuf_pool); if (retval < 0) rte_exit(retval, " port %u: RX queue 0 setup failed (res=%d)", BOND_PORT, retval); /* TX setup */ + txq_conf = dev_info.default_txconf; + txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txq_conf.offloads = local_port_conf.txmode.offloads; retval = rte_eth_tx_queue_setup(BOND_PORT, 0, nb_txd, - rte_eth_dev_socket_id(BOND_PORT), NULL); + rte_eth_dev_socket_id(BOND_PORT), &txq_conf); if (retval < 0) rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)", -- 2.12.0