From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40083.outbound.protection.outlook.com [40.107.4.83]) by dpdk.org (Postfix) with ESMTP id 211AB1B1CE for ; Mon, 16 Apr 2018 08:02:22 +0200 (CEST) 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=TKebfTWzhAAq0C2IEY8UVpKLBIBWDO0XEZuni3etE18=; b=mPYgr+hVc8H78aOdKcPt8nqSG/fGsTea3Zll8YNr8LGWDZIOQSHm6vnOJ8gnzoALqHOGU5H9MKkE5+cyZD9RLOjxtUt3xSCpp9ierFLhL6QlaIIIHqdwc97Y+ooNyFpA9e/ysBI8e14gblIhcWNDtADwwz3GDlIg+kwJEYYgW5Q= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (141.226.120.58) by VI1PR05MB4431.eurprd05.prod.outlook.com (2603:10a6:803:42::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.675.14; Mon, 16 Apr 2018 06:02:19 +0000 From: Shahaf Shuler To: thomas@monjalon.net, ferruh.yigit@intel.com Cc: dev@dpdk.org Date: Mon, 16 Apr 2018 09:02:03 +0300 Message-Id: <20180416060203.57358-1-shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [141.226.120.58] X-ClientProxiedBy: AM5PR0402CA0015.eurprd04.prod.outlook.com (2603:10a6:203:90::25) To VI1PR05MB4431.eurprd05.prod.outlook.com (2603:10a6:803:42::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB4431; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4431; 3:3fufEEmgPUMZ/B885pB4IWbjdWkZetiL5bY2elwDohdRENIYzlsSNW/rvH0KH9XoCSDvJvRCkXb+PW3sYfDp+CFQ+NzPgh4WjqZweo7K/hPa5q5LlCT6MxZx3LtisQhP6Z5MZMWPpXi4wlWVYEG52H9aSPBmcL1nhDyOD8+1Z+5Qa98a2RXdnBTo1dZIvSEBCfJYmL6XOqEqxDkqXYHJRfA4ddWqiKXfGZc4xiUcjcQWe5oaCJwIr6sqih8A7Au/; 25:ofrXyG9ANRPwY0VJnsFx3HAzbW7DQzgVw4ei4w9IhKHYvdyk5NlmB7I7d4xjQndFsux6FRvLRFus/GIBtV8QJnHQTeza8VgnlxIb0j/7XRSEm1uWga+Kx+IJPv4beM1aaiSmnl3OD8Vlq0k66NebPv5QWEfvCs1mdOODQp7MUP1MtA5y1a8inw0Tp0SMhl2hE0iSRbsmH4Jo+jgYjGKGoSHo18t/qtsPRDkbNsN+bqZ2jJiwtYjxX0XepUfJTY6YRj2yZaOATzVObBRyZBkVYVVQvAg8yLkigxAgu5cNNKAHs0uxtZ5Id0P/Pbg3vT7FFxeBRVXcu0YFuq3fwPWh4Q==; 31:LZKPQ4DqbMn8R8ohN5/JtRKTo6JUuB4aHV1Dcc8EAfD04Mg4PrvLqZF3PpU9JPF7vvcRi+YmkiQg6tHUaRmbAQnocUiyk1JQjTfPyACvkXxN6Oi/Rd6hBBimLAnS+cg2mYLg+9MdOwWZ4z5lKS6LsmlL93qQIhL4E531eh4CvS0njQ7YARWRN/kOWQwQoB75610iwS2N05sO2apU7JdBCzN57krDcwF40BilYz0OrLo= X-MS-TrafficTypeDiagnostic: VI1PR05MB4431: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4431; 20:oE3sCuyIb5RdmQKBqFxSZ/Q6fZkQXNPsBuK/hN7n/uwsVIoExR9BzdjgQKf4MYF/aQ2eqXQcZg+n5vk6fMG/+JH5Q0j71JvcGNy/Wdwg/V0pM8NDU6YVOgcybQN1WMT9cMnlIt5ym2AsTgpWEt7H0BMjuCUO9a975wP/msHtRctH9zOvQwj6N5CX6CpYNLM5d6OKss+47vSqpgcloDYgExZiC83gzNI4VMzybakq6Lrx7ys3pOmGu1i+SkZwUuHjrketatQWr+8xbF4ZtOyPWMVqTLmSTX5KSSIFWDIvI5LTTrK01iOC59df5+LcCqON9Qgq8eaC2mbAqppyt1So1Ud2JytwbhFIa85Pj4wq2YAqRpEE5r5ZtROkRHhLCiaHyj1MKGAr72P7yh+ABSjrBn1mwnZN2EhQ4j01ZABi4eklK+qLgedzFVeZQmrfsFMzVOLsQ3xklMVLwGcyWBj8O05USKGIHTRrSl5XC7Sa9NtrHfRMCGAbLjgnLDt6jdr9; 4:rvlZp0Y7mHmpiJCR8yZUXZQ3xiza/+oAlBiILts6wA4M9Dhv4sT03meU1A4kv49wkEGwBQiJWJyagDS0fUM6hHGcpg1CMvV5AeI8gqKTJR84aZmiKBZTS6zYDlhzzW6reVb44ShbkcIpVj3XcDjECX9TMSEOul73exehaoKBWgTnM11tzAWNMe1a0ej7b9gLHn3cbCYknj23u+XRFRAJzn7ESxVaZogWn9D2KoJz2lwe6lWY9OYrqbgAlRoJhbHhrLgUoVzfsEJoMpJQcm4Wf8751ikzptnorodrhgBSoH/C+pd5dGsHd04OK3kuGL0O X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192374486261705); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231232)(944501327)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:VI1PR05MB4431; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB4431; X-Forefront-PRVS: 0644578634 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(346002)(396003)(39380400002)(39860400002)(376002)(189003)(199004)(36756003)(86362001)(106356001)(316002)(69596002)(16586007)(59450400001)(105586002)(48376002)(50466002)(7696005)(6666003)(52116002)(51416003)(21086003)(386003)(81166006)(26005)(81156014)(53936002)(50226002)(47776003)(68736007)(55016002)(478600001)(66066001)(6116002)(3846002)(25786009)(8936002)(8676002)(2906002)(1076002)(4326008)(486006)(1857600001)(305945005)(186003)(575784001)(16526019)(5660300001)(476003)(7736002)(2616005)(956004)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4431; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR05MB4431; 23:XbHXFEoXL7uJaZmwEYT+m5nh87BPno6p6cltxkH0C?= =?us-ascii?Q?xD4nt+gtOKhD0m0zzyoVzZdcaQrfdhuZnYmX21Wuyy+gjIbfuSnia5BcGckN?= =?us-ascii?Q?PGP2t975V6oaQnYukTnRo/3zaet4NAYxPB7UUzUGzgvED6wxTiK+PMTOax85?= =?us-ascii?Q?A9PYhnc6szODJ1qeAzkvGkVqWwDw91MHL/reAzk3swT6HT6Xo0ZoTqNP2zuO?= =?us-ascii?Q?JkCqFDbnNLFRgKeKCnH0Ly4DNoMUP7CqiKzQ65/pZZ5/WlVTqCBeSGmSaK2a?= =?us-ascii?Q?TmuWekVi6UdEj4bPIM/T+e/gD2paQLpDAgmHR2+Qn/u1v/P7Yun8hxtRYwfv?= =?us-ascii?Q?3/c4x/35H8vGo+HukR2pCtuKEn3zs+9lHBSzWhoXHifwif5BrFycUNN1qw+D?= =?us-ascii?Q?K/z6Wz5AFMSdl8adAzHrZn+TMomtMR8nXrpLm419yfI53sTghGetcF+KFfzd?= =?us-ascii?Q?vWxcc+ZlnpxgvymJ/CliCdoM/PRNvdlEBMEluEqYmCimcSGA8OWOOFjGWDor?= =?us-ascii?Q?EdKH1RNFxQRQJzsaesNbTOGgHOTzZCPQra7d3ph7O4DnpuL98US1FURPDZCo?= =?us-ascii?Q?AgREWI4w57iUV9tAnpGwupvCc7WNbrX2TBF31Qg7cxlnnVe2aBD5cxamPhr/?= =?us-ascii?Q?NVuELt2sruTI0SLXEn0Q6zaJCn7Ek7OZ4I2Q/muUArKT12u8m1ghwNKN3Fjv?= =?us-ascii?Q?mQ9Vcx3q59jDalf0K2TxTTLybecNKLdzXyttVyqvVMkzlXAHBBhzo5yzumQb?= =?us-ascii?Q?6oKKltssSw2wpOsyhdxLu/ZP9l4SYIW53x4TsRDMZ4dU5KbLWWOqZTgyuHFl?= =?us-ascii?Q?O7qpehhEy00VNshr4D2HE9wKhXrldWhYGtgTCoqyzqhd17kzIP6o9Ro3lgpG?= =?us-ascii?Q?4J5NEXAaLkBSDyb0YzpUdBXZLGFeM1BTAGi1RdxdhDFWSTIVCoixlY2uxvPv?= =?us-ascii?Q?irn1w+qdlAQf5ZmO3TvMt7698RHsU/cVpiWcewEeBYgMExi+hw73s6wfxfPT?= =?us-ascii?Q?IK62qH0TOwI/lg2LGQpG867WAgVV2kTBj7rssf/2Os4vOc9aq1cybTt7Lufy?= =?us-ascii?Q?IpW7OtAtctUsbjxDE7Iwngjh7JW9o4u1XoxlSLBcJeKkIKcn9zRLKkMu6OH/?= =?us-ascii?Q?BUxo1mysaGZ7XEwd1jqnpV1hTB5x70P5F5L1Wwio3olT+74E0q04jfZOCWYO?= =?us-ascii?Q?1pnJlHKN3Z1OROsl7591cUHsPERaZTzKDNLeKhfmNXI2av+Pe1cPFz/ZA=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Antispam-Message-Info: /twXZEMmKSzDMKzAVGLU68Vbl7ujPij/z9Zh/GztNGilq8C7NmjZbFOfCCKp06ptmWzL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WpZPENLOix3GDKKxXQNdCZ87gkLucA6xIm1zccUVd1XREg2TLYxRto6uAW77ypMKBmgJh+iR4gyRK2SLFednK6qf4wksAZY7g4BMNT/x+u8i2DegYRt+xktQX7uFO8adxIAzYREIpdHX2W7poRlK4MOeP7CkAyBzVVBfSPceSts65PlIyH7M2Xxpq X-MS-Office365-Filtering-Correlation-Id: b6828ae5-b923-4b3d-815c-08d5a35f9d5c X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Apr 2018 06:02:19.5255 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b6828ae5-b923-4b3d-815c-08d5a35f9d5c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4431 Subject: [dpdk-dev] [PATCH] ethdev: remove new to old offloads API helpers 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: Mon, 16 Apr 2018 06:02:23 -0000 According to commit 315ee8374e0e ("doc: reduce initial offload API rework scope to drivers") All PMDs should have moved to the new offloads API. Therefore it is safe to remove the new->old convert helps. The old->new helpers will remain to support application which still use the old API. Signed-off-by: Shahaf Shuler --- lib/librte_ether/rte_ethdev.c | 100 +----------------------------------------- 1 file changed, 2 insertions(+), 98 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 3c049ef43c..e568b8ba91 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -964,60 +964,6 @@ rte_eth_convert_rx_offload_bitfield(const struct rte_eth_rxmode *rxmode, *rx_offloads = offloads; } -/** - * A conversion function from rxmode offloads API. - */ -static void -rte_eth_convert_rx_offloads(const uint64_t rx_offloads, - struct rte_eth_rxmode *rxmode) -{ - - if (rx_offloads & DEV_RX_OFFLOAD_HEADER_SPLIT) - rxmode->header_split = 1; - else - rxmode->header_split = 0; - if (rx_offloads & DEV_RX_OFFLOAD_CHECKSUM) - rxmode->hw_ip_checksum = 1; - else - rxmode->hw_ip_checksum = 0; - if (rx_offloads & DEV_RX_OFFLOAD_VLAN_FILTER) - rxmode->hw_vlan_filter = 1; - else - rxmode->hw_vlan_filter = 0; - if (rx_offloads & DEV_RX_OFFLOAD_VLAN_STRIP) - rxmode->hw_vlan_strip = 1; - else - rxmode->hw_vlan_strip = 0; - if (rx_offloads & DEV_RX_OFFLOAD_VLAN_EXTEND) - rxmode->hw_vlan_extend = 1; - else - rxmode->hw_vlan_extend = 0; - if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) - rxmode->jumbo_frame = 1; - else - rxmode->jumbo_frame = 0; - if (rx_offloads & DEV_RX_OFFLOAD_CRC_STRIP) - rxmode->hw_strip_crc = 1; - else - rxmode->hw_strip_crc = 0; - if (rx_offloads & DEV_RX_OFFLOAD_SCATTER) - rxmode->enable_scatter = 1; - else - rxmode->enable_scatter = 0; - if (rx_offloads & DEV_RX_OFFLOAD_TCP_LRO) - rxmode->enable_lro = 1; - else - rxmode->enable_lro = 0; - if (rx_offloads & DEV_RX_OFFLOAD_TIMESTAMP) - rxmode->hw_timestamp = 1; - else - rxmode->hw_timestamp = 0; - if (rx_offloads & DEV_RX_OFFLOAD_SECURITY) - rxmode->security = 1; - else - rxmode->security = 0; -} - const char * __rte_experimental rte_eth_dev_rx_offload_name(uint64_t offload) { @@ -1108,13 +1054,9 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, * Convert between the offloads API to enable PMDs to support * only one of them. */ - if (dev_conf->rxmode.ignore_offload_bitfield == 0) { + if (dev_conf->rxmode.ignore_offload_bitfield == 0) rte_eth_convert_rx_offload_bitfield( &dev_conf->rxmode, &local_conf.rxmode.offloads); - } else { - rte_eth_convert_rx_offloads(dev_conf->rxmode.offloads, - &local_conf.rxmode); - } /* Copy the dev_conf parameter into the dev structure */ memcpy(&dev->data->dev_conf, &local_conf, sizeof(dev->data->dev_conf)); @@ -1566,30 +1508,6 @@ rte_eth_convert_txq_flags(const uint32_t txq_flags, uint64_t *tx_offloads) *tx_offloads = offloads; } -/** - * A conversion function from offloads API. - */ -static void -rte_eth_convert_txq_offloads(const uint64_t tx_offloads, uint32_t *txq_flags) -{ - uint32_t flags = 0; - - if (!(tx_offloads & DEV_TX_OFFLOAD_MULTI_SEGS)) - flags |= ETH_TXQ_FLAGS_NOMULTSEGS; - if (!(tx_offloads & DEV_TX_OFFLOAD_VLAN_INSERT)) - flags |= ETH_TXQ_FLAGS_NOVLANOFFL; - if (!(tx_offloads & DEV_TX_OFFLOAD_SCTP_CKSUM)) - flags |= ETH_TXQ_FLAGS_NOXSUMSCTP; - if (!(tx_offloads & DEV_TX_OFFLOAD_UDP_CKSUM)) - flags |= ETH_TXQ_FLAGS_NOXSUMUDP; - if (!(tx_offloads & DEV_TX_OFFLOAD_TCP_CKSUM)) - flags |= ETH_TXQ_FLAGS_NOXSUMTCP; - if (tx_offloads & DEV_TX_OFFLOAD_MBUF_FAST_FREE) - flags |= (ETH_TXQ_FLAGS_NOREFCOUNT | ETH_TXQ_FLAGS_NOMULTMEMP); - - *txq_flags = flags; -} - int rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, uint16_t nb_tx_desc, unsigned int socket_id, @@ -1654,12 +1572,7 @@ rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, * only one of them. */ local_conf = *tx_conf; - if (tx_conf->txq_flags & ETH_TXQ_FLAGS_IGNORE) { - rte_eth_convert_txq_offloads(tx_conf->offloads, - &local_conf.txq_flags); - /* Keep the ignore flag. */ - local_conf.txq_flags |= ETH_TXQ_FLAGS_IGNORE; - } else { + if (!(tx_conf->txq_flags & ETH_TXQ_FLAGS_IGNORE)) { rte_eth_convert_txq_flags(tx_conf->txq_flags, &local_conf.offloads); } @@ -2632,19 +2545,10 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) return ret; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->vlan_offload_set, -ENOTSUP); - - /* - * Convert to the offload bitfield API just in case the underlying PMD - * still supporting it. - */ - rte_eth_convert_rx_offloads(dev->data->dev_conf.rxmode.offloads, - &dev->data->dev_conf.rxmode); ret = (*dev->dev_ops->vlan_offload_set)(dev, mask); if (ret) { /* hit an error restore original values */ dev->data->dev_conf.rxmode.offloads = orig_offloads; - rte_eth_convert_rx_offloads(dev->data->dev_conf.rxmode.offloads, - &dev->data->dev_conf.rxmode); } return eth_err(port_id, ret); -- 2.12.0