DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ethdev: remove new to old offloads API helpers
@ 2018-04-16  6:02 Shahaf Shuler
  2018-04-16  7:28 ` Thomas Monjalon
  2018-04-17  8:33 ` [dpdk-dev] [PATCH v2] " Shahaf Shuler
  0 siblings, 2 replies; 6+ messages in thread
From: Shahaf Shuler @ 2018-04-16  6:02 UTC (permalink / raw)
  To: thomas, ferruh.yigit; +Cc: dev

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 <shahafs@mellanox.com>
---
 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] ethdev: remove new to old offloads API helpers
  2018-04-16  6:02 [dpdk-dev] [PATCH] ethdev: remove new to old offloads API helpers Shahaf Shuler
@ 2018-04-16  7:28 ` Thomas Monjalon
  2018-04-17  8:33 ` [dpdk-dev] [PATCH v2] " Shahaf Shuler
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2018-04-16  7:28 UTC (permalink / raw)
  To: Shahaf Shuler; +Cc: ferruh.yigit, dev

16/04/2018 08:02, Shahaf Shuler:
> 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 <shahafs@mellanox.com>
> ---
>  lib/librte_ether/rte_ethdev.c | 100 +-----------------------------------------
>  1 file changed, 2 insertions(+), 98 deletions(-)

I think you missed removing the deprecation notice part.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH v2] ethdev: remove new to old offloads API helpers
  2018-04-16  6:02 [dpdk-dev] [PATCH] ethdev: remove new to old offloads API helpers Shahaf Shuler
  2018-04-16  7:28 ` Thomas Monjalon
@ 2018-04-17  8:33 ` Shahaf Shuler
  2018-04-17 11:23   ` Ferruh Yigit
  1 sibling, 1 reply; 6+ messages in thread
From: Shahaf Shuler @ 2018-04-17  8:33 UTC (permalink / raw)
  To: thomas, ferruh.yigit; +Cc: dev

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 <shahafs@mellanox.com>
---

On v2:
 - Remove the deprecation notice as well.

---
 doc/guides/rel_notes/deprecation.rst |   4 --
 lib/librte_ether/rte_ethdev.c        | 100 +----------------------------------
 2 files changed, 2 insertions(+), 102 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index fd9def20c2..93747bf244 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -73,10 +73,6 @@ Deprecation Notices
   In the new API, offloads are divided into per-port and per-queue offloads.
   Offloads are disabled by default and enabled per application request.
 
-  The old ethdev - drivers offload interface will be deprecated on 18.05.
-  This includes:
-  - removal of the conversion in ethdev from new offloading API to old API for drivers.
-
   In later releases the old offloading API will be deprecated, which will include:
   - removal of ``ETH_TXQ_FLAGS_NO*`` flags.
   - removal of ``txq_flags`` field from ``rte_eth_txconf`` struct.
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] ethdev: remove new to old offloads API helpers
  2018-04-17  8:33 ` [dpdk-dev] [PATCH v2] " Shahaf Shuler
@ 2018-04-17 11:23   ` Ferruh Yigit
  2018-04-17 11:53     ` Thomas Monjalon
  0 siblings, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2018-04-17 11:23 UTC (permalink / raw)
  To: Shahaf Shuler, thomas; +Cc: dev

On 4/17/2018 9:33 AM, Shahaf Shuler wrote:
> 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 <shahafs@mellanox.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] ethdev: remove new to old offloads API helpers
  2018-04-17 11:23   ` Ferruh Yigit
@ 2018-04-17 11:53     ` Thomas Monjalon
  2018-04-17 13:45       ` Ferruh Yigit
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Monjalon @ 2018-04-17 11:53 UTC (permalink / raw)
  To: Shahaf Shuler; +Cc: dev, Ferruh Yigit

17/04/2018 13:23, Ferruh Yigit:
> On 4/17/2018 9:33 AM, Shahaf Shuler wrote:
> > 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 <shahafs@mellanox.com>
> 
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Acked-by: Thomas Monjalon <thomas@monjalon.net>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] ethdev: remove new to old offloads API helpers
  2018-04-17 11:53     ` Thomas Monjalon
@ 2018-04-17 13:45       ` Ferruh Yigit
  0 siblings, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2018-04-17 13:45 UTC (permalink / raw)
  To: Thomas Monjalon, Shahaf Shuler; +Cc: dev

On 4/17/2018 12:53 PM, Thomas Monjalon wrote:
> 17/04/2018 13:23, Ferruh Yigit:
>> On 4/17/2018 9:33 AM, Shahaf Shuler wrote:
>>> 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 <shahafs@mellanox.com>
>>
>> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
> 
> Acked-by: Thomas Monjalon <thomas@monjalon.net>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-04-17 13:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-16  6:02 [dpdk-dev] [PATCH] ethdev: remove new to old offloads API helpers Shahaf Shuler
2018-04-16  7:28 ` Thomas Monjalon
2018-04-17  8:33 ` [dpdk-dev] [PATCH v2] " Shahaf Shuler
2018-04-17 11:23   ` Ferruh Yigit
2018-04-17 11:53     ` Thomas Monjalon
2018-04-17 13:45       ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).