From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0057.outbound.protection.outlook.com [104.47.2.57]) by dpdk.org (Postfix) with ESMTP id 466CC1B160 for ; Tue, 12 Dec 2017 13:36:15 +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=6Gz6TtwyxjiznesCzngPM+u3b+2KI1NDGAs07nZgpCs=; b=tVj1Q9d9cJxVDFa7J4FttBY8e1Vx36qI9hDrm5DgiFXNLfgCBzrPmKmgSF6RniXcjxtLfRR5Q/eXmYhvAcfn085jwZ4sa/1HzlWzrxPDTJ+jOmrlRS4xSePhAuTpWY06tnbzkufzxaq0Hh7+MR57kOLJwgi7gukrRpyr7ssVOC8= 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.302.9; Tue, 12 Dec 2017 12:36:13 +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:35:29 +0200 Message-Id: <948032d7c4cbb0484d73a447e28c0bc361117871.1513081088.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: HE1PR0102CA0051.eurprd01.prod.exchangelabs.com (2603:10a6:7:7d::28) To HE1PR05MB3148.eurprd05.prod.outlook.com (2603:10a6:7:36::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 55db84d8-e0b9-474d-eb1c-08d5415ceeb3 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:HE1PR05MB3148; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 3:KsU9PSVFXG9mxp8ncuB9+oFALtqLzjBCccx2akkf50zlR7uBcZMwjIutv2o6ZHOUHLfpVJZkHJ3UaLrIzHbgXODIm7eXw13R8GV1l0f6TDcq12HEIFuKbueZetshtjh7HlBnZb8hHinc32cT4aSvH9vw38L6tvdsBVIHvIk6Leh+fEbnmkKeUmWPJakja7ia3awxB3uwa47/QjZQprEFEBux0v4PJPxtv2DGiyqls3yIR3WbXk++0DjjJ8h6kkkj; 25:CzN7qxEy7iP3omELk4/GBuG4IY7MgBvGVe4AI680H1uCeOxr0uPkOIbwSGMc+txm4YlrrRI6DuhahZiJ9wQDBAOfr5id4Ars8m5d6mPfYesIzGeNJWn7zClx1mpyHZlTucHDoD1pqqhrgdsLezJy4WrTWAjuCBZ4FxU5qjJj9qAiBajX5JDaC2r0U6c2GuNqGV/2hdT0aM9yMx3glUCX77lNT7KBrBR7PEmVP2bsohGzkQhn71J9ldDu6/8MJcrP9zSEdIE61dFqLy+z9j3432uxA91bCtBpbXZdPLeUikAQjrXIH2CwgGjjSPqjUR1tYfUKMk5w5Eyh6eIiX99R1qAQjiexrS21pJN7lKsl7Tc=; 31:RAL1QD1sY3XBqL+R3KeM4k00qJrqhUTl/8TbKjlWrZaLJING5OYP5k4daCK69PiJEbyqRwXTxSm1IorRksNEah5xx2x3wCZ+NsZPXUMrDSc2DbjHBe4EOGmEbPG3Ogf+3WIAP7OJ93bqPMLTwwEGyA2Yxg8fezug+9HnW3hgSVzLogj5bOIy5tj7dGdXZv/Xz5KLMmbHrnhJB7xMOevyxa35HR1LuylNp2MPN/C9lCE= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:1e2M4g73CjeptZuT8wjU/N7qO5uoqq7qprgyDTFEY+qetHr6EWfJJafz99mWv5o8d4isNA0sMDdxnOm0k/zPZNaiPaGVKcZ40GEKAQhqavGZfUTa0C05obItIE2TNIuklxQHFHfiXi++fe3JhileehXjkyJrRpcygpbdEh+3eI3tegNt0xc3fMJWY2EF69KLanKXbfjtn0ojHumeTmMsL9A7NL7V7hPF/eyFSH5fEWvbYMSHgQ7GtHh7ceEBxIxUIP2mLWEfauXLqFPMyhHLWApAEre5T6L1NyGyAc9zS1yU780LqO6P82klJqUdvklR9vN/xueK3zGKzZS8Fhyt6VoeazHjo9hs5nPfAXlf0GtvOAWw/rS+7Z6Skh4+haYKUbNadmbyAqyK2bAXXewGVlGCyKEgIhDjGUynRhv9piGCNZ8z92+YwqfKeNH2mEZ7LtuRutB+mfdnhEyUjtSh3fMyVdeO5+KJlraVUCKMRkeT2Avb/SuqTXij7mnqS8Pa; 4:iEx+Qv54EwwYCiF3Qird8GDSgMSTlr8cB71aghZ8SKxf9Z7EQaIO6ElakNuwzIxwMR0l93fshGJq0Ncfb0+3rBjUN2ThMpceLt2s/2+uLG4FAJlU6ACHvdFKjc0fpvwk4pLudE6mrdUpnjbtmJk/6ovsP1GTjN3sgj/ZSVU7xxMeOVPjsoZD43UdZtShLb+jdbciZr6lxBC+i/6NG5kGxNEBd+rBli5zDHcwr63VkBsNwJeXqcelcPKXlh6hKH2ULlIQtvPogsH9RDRqUI/6BQ== 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)(3002001)(93006095)(93001095)(10201501046)(3231023)(6055026)(6041248)(20161123560025)(20161123558100)(20161123555025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:HE1PR05MB3148; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:HE1PR05MB3148; X-Forefront-PRVS: 051900244E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(366004)(376002)(39860400002)(189003)(199004)(25786009)(7696005)(52116002)(305945005)(316002)(51416003)(97736004)(47776003)(2950100002)(5660300001)(66066001)(7736002)(8936002)(16586007)(68736007)(50466002)(48376002)(16526018)(55016002)(6116002)(3846002)(86362001)(105586002)(21086003)(106356001)(2906002)(53936002)(8676002)(6666003)(50226002)(81166006)(81156014)(33026002)(69596002)(76176011)(36756003)(478600001)(118296001); 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:KRHdgaLoMAiYVqg0wXSbMZzh1XASWDqPhllMMJ9Lg?= =?us-ascii?Q?eM5LlhKHXZLX8dLNCvaqyBtnLlO4FrFzsfXQIRDxWKoB1+bKRnyNHyhmvWQF?= =?us-ascii?Q?La31V1X5LSEAAx1MDKE82mpTES0FY4HGEO2z0EeGhmvePU58utiWlnRvDqY4?= =?us-ascii?Q?skjCuVuhA57a1e0GeUh/mRG46ewOizdJbMBSAZfnywQs6zOyXgJdwUW5wKsf?= =?us-ascii?Q?P3WRZGfp6mIE2lu+pnpKUlim2OYUCSSq1gJoeY5LOebh12ZdRnrEUZzBXpW4?= =?us-ascii?Q?yf/jpTYZyb0UWOWPCra95wgV+Wgn5/CCg4Av+467XQDPb+u3PgUjMRyiQzwZ?= =?us-ascii?Q?7DY/c5b73ShxCMAhTKjG/OOmt6m2F2jLivwKcqhdzQbRHqwhr3kfzT2UHZ85?= =?us-ascii?Q?tRWC/FgCGMuz/TPKI+VbWIdREFq2Y8OHVM8R57ZYwqW7vUDZe5jptId+wB1J?= =?us-ascii?Q?1u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Ak8PJuZ9y5ILqbhGyZlTc7lHfFCAgkx26s=; 5:/zIgmDFMor0dKgjan1MZMcKz2alBlJ9qf2kwoQqSBDixMys3gIlOZpeyyT9JG3aAaWr2uhk6To60jmZwAQmRJOJi/dHpWcmNG7kzmBN2ZX7UszAzAtYk7i5meTQurJQv7j4KPMAP3kjoppEg551mjtlGKPUjaLz/pWMjOhF7+Zw=; 24:9poCTqRr8h/2Xq/69Wtt6vQ8C7AWjSk8JAOLQ5sU1ccVnv2XIDcCMNlnpzFYORMODuEoNrPKa56U6x45ojigYhpgr9RQDaPrUfgpOrMj+Ok=; 7:B5hi3sFcgj/YkBctlgbU4PXtlDCCED8/ROyZxPyRqj+lj8oFZUXuWgA6SgysR5o31RvvcL9sdxG12Puws1TNajpM09tBe7qToOo2lj7oI0/JjzlPypR+s6XMs3LjGZ9lxgIBXe4f2uLnxHp60uC3rNI9FqIDx73U1Ov1fF6IhbVwf40C5qzhMbO3Q3CBbmStrWC5tuMX0DxVhRI+KSer3KQtNd6N1RTrOyEiy910q+FbhiM9wN8ZDcAZ6hvDs0tn SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:36:13.4108 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 55db84d8-e0b9-474d-eb1c-08d5415ceeb3 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 v2 36/39] examples/ptpclient: 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:36:15 -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/ptpclient/ptpclient.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c index c53dad6..a4c709e 100644 --- a/examples/ptpclient/ptpclient.c +++ b/examples/ptpclient/ptpclient.c @@ -77,7 +77,13 @@ static uint8_t ptp_enabled_ports[RTE_MAX_ETHPORTS]; static const struct rte_eth_conf port_conf_default = { - .rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN } + .rxmode = { + .max_rx_pkt_len = ETHER_MAX_LEN, + .ignore_offload_bitfield = 1, + }, + .txmode = { + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, + }, }; static const struct ether_addr ether_multicast = { @@ -216,6 +222,22 @@ static inline uint64_t timespec64_to_ns(const struct timespec *ts) if (port >= rte_eth_dev_count()) return -1; + rte_eth_dev_info_get(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", + 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); + } + /* Configure the Ethernet device. */ retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf); if (retval != 0) @@ -239,9 +261,9 @@ static inline uint64_t timespec64_to_ns(const struct timespec *ts) /* Setup txq_flags */ struct rte_eth_txconf *txconf; - rte_eth_dev_info_get(q, &dev_info); txconf = &dev_info.default_txconf; - txconf->txq_flags = 0; + txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE; + txconf->offloads = port_conf.txmode.offloads; retval = rte_eth_tx_queue_setup(port, q, nb_txd, rte_eth_dev_socket_id(port), txconf); -- 1.8.3.1