From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0049.outbound.protection.outlook.com [104.47.0.49]) by dpdk.org (Postfix) with ESMTP id 361C9199C8 for ; Tue, 12 Dec 2017 13:27:27 +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=fTPqWILnEEVtmQ6USiw9BjpyK89QrXCiL/sRSmLoI5s=; b=PsG/tP/05RkcNOTbmrvsXYB0JDd0bRH5Z890fDKEkDrz3tyYkCDuqECt1zD7lJ+PMXCkf7elFzCn3Nh36F8hVwl+LTKxQyF1DF9Uy/DzpZ+FdTMaH+Ow/+PFGJn4H5H4NCeO/0UrGHmBioY1ZkfxDv+hJBUyh9XfolbEwtCKi60= 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:24 +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:20 +0200 Message-Id: <7ddb1ea46013dad991a4330a5c22a90c2c54064a.1513081087.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: 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: 5fb052cc-9821-4677-d2f3-08d5415bb3e0 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:UCXW37eN9+cs/cO90A/Y/Xr2By8hr6RONMlEMY0GM13UMRSNGZ5TFoR6mEaTBcanPqa91hpaD6ya19jmfNnKQEOsjRb5IKBkn+O5j8+3jCLgK16KlJFV30uA1mP/RbrxdqJJzJAfmaronS1/QL1kd9RxxRe7pL2D7efMZK2G7duHvi+L3y5i8gwlxMUPWcWO3AWC/NjjGv3YLBkRJLA6/iNLcgNhpJnf3xdbHpkWnsq2DS7eBmP/hRvJ+uKuJyh3; 25:9Fl/ZkFwa2ChEmEfLt6ZjLQkOWPSfDbbdT0ux/RSekJfof6BVkkNMgYlvny5vGXxs23OmZ2EVyFnHZgAiEaQPvl4GiFSA7k7FT2KU9VKa8T89tAg0P2xgZKdnF5Mkz4XooAEXUgtEpk1Z6BQTR592MApI5EQAba2iE8ZGP6uttTXsJsSXj19ejhw/HHL3VFujxY+Btr/Tr7y9S70qg9LBBkyGqeBPkpbMAEzA2HEOkLER3KkP2gduOkU/q041Z20myRZ0fFBwfttVKx7ZBbG/BfR/91TSZYnuaQkELu6FyzprzsKMmRxicAjscmA9DD2xXTlHcmaOmUrb6TstIWJ+A==; 31:bdzYEoxFv5WCz3FkRZYKM1E97Gltpurgv7PpKX3jJZyS00XCssN+jx+Z/HcTQ+aZ9IK+LuccAWvGv2iwnB1+OW8oV2n/tWj1gnWcEDl+WW5DvIKnBtCL1HnrU4R1RrUYx01dnZhGw+kJ4b2yQwacXSRDtRHUDo5YNByf8gO19TIAaYL2j9NL+QBpUG5bjcqVNTyeDTHvTLJp8U+mHFKPDjz6DRRakw4/Ii0jzhL2KhI= X-MS-TrafficTypeDiagnostic: VI1PR05MB3149: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 20:jcaRlPkRqKlUWBM2283KkztePvdzNQI4L0nvpNlF3gSC5R8llLtHnU8kTh94lXnzY8lpsXmjsGt942xMzbFywyD1G7ZOKjK0/4XT+elktFT+KdikAhpUbf/uyiRRs9j7bVqGo5KqbBbNLJjElCmAGmHOIm5c/PhB+8VVIB/Mk0pHb4D9XiGzTGGW6rINjzsp+JA/oE/PIiXecy+8ooYFpQoThzxTnnwkplFiELKhAe+g3WsgJzRvhPzC9jJQoSa8k5efw52Wh9hWaMI3nvellJhRwKVBLUsbBuvqBCXk8fNq1yRrqUY3XE5neKMv19/LxqPNbymHYTarycNI32hwBEMevWO3KVcpYMLibMN1TeaPSao5cB5KNYSgdpcNj8OjHIp7ACXo84sjUTA9z7aK850GPxaQbLjMh5sM2o2l0CuoKqlwTpRzMcLlZpPUqdaFyjf7MQtLcKkjetubITv1aXeL91pjHYZdjBdBIPdLF69hfprHM3Sqw7O84Frjb7qT; 4:3p1a/0SJl4wmK/Nkdy9uJxQsZLyDcYmH4pp+0zQxcY+j95J9Ve5aS7uNkk11XKFMXnW0OQ1lRFIgfXc3X+2RDkYzgnsMRE91qqDnSCcH0NOKmfSB1NBAb3r70RGuvvU6bhnRkDjgnnNXKpGQX/8HoFGCojECpnwTxRu3mwSbyXzBjkynbZUfdB3rMkWHZrOMnRv7QSgWIaDzE9Y+NrB7of9xnISLreYeXYbnlDBlrI+19lf1aJmX/ijJeNJqmbIC0MSViIQzj14CTqTTOBGErA== 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)(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:lfBxHTLaJ3zGyOwesOTV3lJXyUl64FHTe5rHjd7it?= =?us-ascii?Q?DM/FVXxoxTI/mcwkrTof3m17ZgVxIIqxYRaZW/qKVyTsTS78iOmt+zPoBfS6?= =?us-ascii?Q?nGlgmhOqkr4vLY+cID1hR45gY82LcM11Enh3YCF7nsNJoY/uFJrhQH19q1ex?= =?us-ascii?Q?Q/FQ10x+OWn3TUrgikc1xHtJADjpJuliB6j5/VUspRSDBFbpgyc0hybtzX0i?= =?us-ascii?Q?TtaQKkaDAjN44CG9Yx65zc34cecdm16iW/zThQO4NLwgnZwA7bAhR6HLu9N3?= =?us-ascii?Q?Y/RVMsKI9VOe2FOgYIBqtRWgbUcgfbSZ8/4eK4PRAX6xR8l0pDNojd62SU6B?= =?us-ascii?Q?pKCnj740n5/7kjFAAMBQ0T06I4lXivw78wgb8GEt3JGhcakQIhJC9JPsDAKV?= =?us-ascii?Q?beCSt1AAjWk7bdMbqk73NwLNQeXHH/ptLpe2GiwQT+x83wGGxJSxuj0BChP4?= =?us-ascii?Q?f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mW1mn+8/muFMd7x/t0G3Md/aC/ChAr4kFhmtqYVlB8HEX9izMhYN70lWfDsC3ABWGKxFMtjqYy2DTUgv8=; 5:Jm4ZqmOenJQepSPOKxDZz45uCO4uyb2uCPfHlcCakQS6AzLRgvK77BNqk0a4DPP4sgRH44tPxhUIbftOX/SIdOIADIfMjoIlbILp9IeNrdVQUROGz8hIsTx50MjHU2qaQFStGWGJTBuG1d+GB/ZV95PkYYhviyiEOB8TM8QNjgE=; 24:C+5ieySGpAzpRz8qJz8LDx5LL3mjMzCrdBi4k5Jwc2sXm7o4pHF711zDZOsQb4J4/eJEGKPHFwJzcon8BKe4l7f9uM45bb7fjXOnMguRBLA=; 7:RQIYgCIDN7C9wL8a0I/xqSSoV5iBzJ2h2GqAi59gUs4j0X5ywKFr08fx0WdnA/aaCzp2iqwtKKHjneqodmA2ModkLL9RbjNu1GyYQjyph+IfcEKlX4yYUrPrlBKmyB7+4zvP05nRiDOygOD9MeBsYGWqccajFdMx6J6YDdDeXcDmK6vTsbBxkj1F2C6yZ6UUP1b+mKspVtdReiQvV0TAY9U37CVuKFXUYBOYo8VEMcg+LcKGn25CcXP8phb7CyXd SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:27:24.9728 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5fb052cc-9821-4677-d2f3-08d5415bb3e0 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 03/39] examples/l2fwd-jobstats: 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:27 -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/l2fwd-jobstats/main.c | 38 +++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c index 485370d..eb035ef 100644 --- a/examples/l2fwd-jobstats/main.c +++ b/examples/l2fwd-jobstats/main.c @@ -116,17 +116,15 @@ struct lcore_queue_conf { struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS]; -static const struct rte_eth_conf port_conf = { +static struct rte_eth_conf port_conf = { .rxmode = { .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 */ - .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, }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, }, }; @@ -866,6 +864,10 @@ struct l2fwd_port_statistics { /* Initialise each port */ for (portid = 0; portid < nb_ports; portid++) { + struct rte_eth_dev_info dev_info; + struct rte_eth_rxconf rxq_conf; + struct rte_eth_txconf txq_conf; + /* skip ports that are not enabled */ if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) { printf("Skipping disabled port %u\n", portid); @@ -875,6 +877,21 @@ struct l2fwd_port_statistics { /* init port */ printf("Initializing port %u... ", portid); fflush(stdout); + 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); + } ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", @@ -891,19 +908,24 @@ struct l2fwd_port_statistics { /* init one RX queue */ fflush(stdout); + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = port_conf.rxmode.offloads; ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd, rte_eth_dev_socket_id(portid), - NULL, + &rxq_conf, l2fwd_pktmbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n", ret, portid); /* init one TX queue on each port */ + txq_conf = dev_info.default_txconf; + txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txq_conf.offloads = port_conf.txmode.offloads; fflush(stdout); ret = rte_eth_tx_queue_setup(portid, 0, nb_txd, rte_eth_dev_socket_id(portid), - NULL); + &txq_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n", -- 1.8.3.1