From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0075.outbound.protection.outlook.com [104.47.0.75]) by dpdk.org (Postfix) with ESMTP id 9ACC71B193 for ; Tue, 12 Dec 2017 13:27:35 +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=MgSER3g/+Lvg8eLwwR5HJYxt71CNG9rDhCIFQ8OTxu4=; b=tE6OqqeQ0nQqbCF6w/jTBVcQ9eWG8ElyccgR2Fi6woii7OLj7WpOa2kZN+hZLFRisT/FiH7XbeNCaV4iv4E1zWiIck7vIlWCRBfwa82vJU34BxZkf8KMNrStuhe9vm9atIQOmTe4OB+/DccTiObNDz/JFGr5S5J7g4MNyKA/MXo= 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:33 +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:26 +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: 577e9983-c48d-4f31-4d61-08d5415bb8e8 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:nFmgp8bm0r0nNuRec0B3bX7ibu1UT5euvNlGZyInZZm2HoXklAJnyBaqSQmKnhoC69ZFV+rlJIj7/eL5IWuwqtA7GluqCwBlb1ZBkidHOhhNGSQFe6Hxal0ZtgcvI0kt0oaie+UjFPuhT3aZWqOujSMOFwun6R8gRKJeB2SRcCqKGorjeYHofn/a46gxKZnbKhJSMiJ2ZiUOa/DFB3SGJBxkPvJCHiIaCWnbW6BDQ5cttSjvrII3wMRtYBINhTAE; 25:FLxO3LiyJd2TtLV3Fc26n8EwD/iFUvAmCIyf11pM4TDrDSjCDqvuOJuJxUAt/Rh5nBbuGG6wg4A8FNxWqtJFVBxY0dYpRc8CCnU4EQHmmL4A62g4HQqqBfsQivmBaMC601S/qQndPbDee/EhZ0wN7M9DJYVbV+22lMAsprp7FEz/aA9gr06FDGF0wW7i7L+RV+R9vXWss6Up8+fob5vrDWwkVd9hEIKH33/ugzG7wu5SxLPnqQzDwxyEHMlSIHASM/BDpDJlzo/zNtecv2b7wN+GJdhQ5oO0PY4ysgUoW36Sh8iRxx88wtdUjJWGxPxP6chbHr/oV4OMEuCoJTEHgg==; 31:v0PzJPUv5nAumD/vg172VG3MR2IcqcWUspFOIm/uQRt1ZiZf3/5zc2FIl68VrZH0KFs86z/gdlr60fFFkBmZCA0pRYVQexeks4daS8b/znfc7KSuT/tZBEBtWS8UGMamJer5dHOd0oqbkpk8Rr45fQL49usAZpRWDU21wgJ1326NWvySR0LeQAgZFngkMhVMMmfqBpd7bMLt2KpdLGb0F0mkYm6IVogLAbIGKN9++KA= X-MS-TrafficTypeDiagnostic: VI1PR05MB3149: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 20:kLFNCaYV2YYUkXirod/r6HP77l21EpsB2IHHSqOTO8fKYkJfoDX7sQ3fFOenjJ3yhm5QnhvWuoqWfdN9r6w1FTW+hQu200Y6ibOfWj+0IyyoCwmUbnwZI9kbjM28cHjdjm73mEY5z+Ynz4HT3So8oN5nGIqUQKmtjOu37TFHsOooY3NwLBu31ffIzFphJbjgur8GerLRZ+riykOsPX9FO+AmTAFkdp1Q0HL/2qDao7Iv+c+oe+Ef9cATDwc3mph3YoWReZWaVwkYqmTOxNke2zXVVlXI7TOJKoUZVF/0OQhvo4jaenU+OwGLEUHAvyRU6Y685IXlIHF5pf/wR8MwOHpHWNtj90LbFO+iNoC48ceu+Uhf42iPVe6Z+fjwcpfJicfixB47I7NW2dyYeNw95usgocY1hOMq/OMtZSDDlvX0m4E/rAb40vfo8KtMAS1rUBSguwBDezFacFgys8q0tvA/p1Rh3I1ekFuWu2GxoPJXJV7NYsdkqrITJ5PpQNAL; 4:2PpMzo+ZHHpswM+Q0GaXi3OyQEFQff5yPvkIrJECKlXJkmlZl4n5dDqoGZx5Xa5wQ5krZ8xrx2yoa41I1gUpqxGScgh70Dvy1bm5DVS8AN6ZEsI5jWqH4s4HV7OmAGedWyuPc8LBYPLCX/ww3l6GKPxkHeSXq8R1VRoVRQSJJ1O/z6GMwNx2C/jFgVQkzaha6ieeQYs7eTJUgw2v42AGy/QxHsjVLXSvWEzWpeLPth9agvmeBwlfqixMQG7qIzgXV6o7y7dPLLxXNb2OvMV7WUH8sSwVDlT1VlOKbQOwwQVdzNXlt0zIwoPFJvpXhOIT 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)(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)(76176011)(16586007)(53936002)(16526018); 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:QdUl6L1200dedgzaE38Hy7MQqzpILSfOcHz9/5Y/t?= =?us-ascii?Q?/ONKXkQM91ro0XagMrCX+3J0XW3jELix9VDTfR2oz4V5bT3K8O/XEYr5jYmR?= =?us-ascii?Q?HeD6E73IEBQbhvgMgmyUQXldgSWuiEpjxQ959cJKmlzLWA8kEAa4L1djthIc?= =?us-ascii?Q?rtuEoDujeesHKV3FDZ7CsQiWgpdfmLwY4mf1hfFVxTX431VSzv5o7c34TqN7?= =?us-ascii?Q?xkj+WnSVj45mLAKwq/rVV2zrpEHCuA+GXnaUjqukGK2CXTyXGOo7w/6W/HNN?= =?us-ascii?Q?0tZ5bQi1sJY4HSjOS0xBddqYwK51ilEcovC2mFL8eByRHB39DSpseb3MyFhX?= =?us-ascii?Q?T8ULpiQHsxsAjPPTNKPqBBlwpjEPVTBXNqxuVxwXNnJ2mqBxVHJhUgZiQNia?= =?us-ascii?Q?uycBcqrRwMr9YQ+JmENfFXgYtVRQ0c4rvj3ER7od+XpZvp1OhxoR2gysjlan?= =?us-ascii?Q?nWL6b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KGxvQGYYmcftfjjrLWzdB40f5dOtmEE1KXJAVbX0NjfOD4ERIGAU5+BNZDioUGtUKl/DA6mYYk9tvUAyy1CaO43Y=; 5:pCNqvBGOUR22jliV7c85cP4shrqSuldWPQxKi1TYRoToykvCa9LYEzAU+MxrcvDQ05Q/TM1rj66bG9dGaf1z3XiIBhPKADLTUR3J4D/zbktZXItSQ6X3HMhcAvVbD3i72mtdwraLrsB4m2Iv5hIwJXd8qD0pOT5BVjxD81uqvMc=; 24:EUZYSAqtBpZB3xvR3Zm5L/Rh/tgAyMBXr4Y7Gi8cOzXuvEKY5dOW4uVFjKTiPsj6fytknwdzBmUylS7XeeQZgRgM+3zo0ECFH/hL7XUjHDk=; 7:UokKpynz+gLOgliz1o11RyoupL7IpZrwdIPbM3wSxQ+g5z3lzLbCnWc02o8m+8rLzLpCJV2QOSA7t2zCLBdcUo4n0Uo9pvLvZiuEaacYqwjnZy/ZYd9GT2Ix/ISsY0A1SRfM75Gqu2LdbeJQ2vFHCtHWKfweyUiOsN/PypICLhCNJFY/bye0KWPmMunddo5/28Cs+vFGjLs6Y7BSoFturR8xTeLOlf0YzeJfZ2w1edCojk6w1Hq1DMPAaSCReM4f SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:27:33.4104 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 577e9983-c48d-4f31-4d61-08d5415bb8e8 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 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, 12 Dec 2017 12:27:36 -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 | 65 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 55 insertions(+), 10 deletions(-) diff --git a/examples/bond/main.c b/examples/bond/main.c index 8e3b1f3..d0050b3 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -151,11 +151,8 @@ .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 = { @@ -165,6 +162,7 @@ }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, }, }; @@ -174,10 +172,28 @@ 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; if (portid >= rte_eth_dev_count()) rte_exit(EXIT_FAILURE, "Invalid port\n"); + rte_eth_dev_info_get(portid, &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", + portid, 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", + portid, port_conf.txmode.offloads, + dev_info.tx_offload_capa); + } retval = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (retval != 0) rte_exit(EXIT_FAILURE, "port %u: configuration failed (res=%d)\n", @@ -189,16 +205,22 @@ "failed (res=%d)\n", portid, retval); /* RX setup */ + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = 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 = 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 +247,9 @@ 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; retval = rte_eth_bond_create("bond0", BONDING_MODE_ALB, 0 /*SOCKET_ID_ANY*/); @@ -234,6 +259,21 @@ BOND_PORT = retval; + rte_eth_dev_info_get(BOND_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", + BOND_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", + BOND_PORT, port_conf.txmode.offloads, + dev_info.tx_offload_capa); + } retval = rte_eth_dev_configure(BOND_PORT, 1, 1, &port_conf); if (retval != 0) rte_exit(EXIT_FAILURE, "port %u: configuration failed (res=%d)\n", @@ -245,16 +285,21 @@ "failed (res=%d)\n", BOND_PORT, retval); /* RX setup */ + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = 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 = 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)", -- 1.8.3.1