DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ice: fix wrong Tx function selection
@ 2019-04-19  3:03 Leyi Rong
  2019-04-19  3:03 ` Leyi Rong
  2019-04-19  3:41 ` Zhang, Qi Z
  0 siblings, 2 replies; 4+ messages in thread
From: Leyi Rong @ 2019-04-19  3:03 UTC (permalink / raw)
  To: wenzhuo.lu, qi.z.zhang; +Cc: dev, Leyi Rong

Add ice_set_tx_function_flag() to configure tx_simple_allowed properly.

Fixes: 6eac0b7fde95 ("net/ice: support advance Rx/Tx")

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
---
 drivers/net/ice/ice_rxtx.c | 22 ++++++++++++++++++++++
 drivers/net/ice/ice_rxtx.h |  2 ++
 2 files changed, 24 insertions(+)

diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 8ef6a2ff6..ace766b1d 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -885,6 +885,7 @@ ice_tx_queue_setup(struct rte_eth_dev *dev,
 	txq->q_set = TRUE;
 	dev->data->tx_queues[queue_idx] = txq;
 	txq->tx_rel_mbufs = _ice_tx_queue_release_mbufs;
+	ice_set_tx_function_flag(dev, txq);
 
 	return 0;
 }
@@ -2305,6 +2306,27 @@ ice_set_rx_function(struct rte_eth_dev *dev)
 	}
 }
 
+void __attribute__((cold))
+ice_set_tx_function_flag(struct rte_eth_dev *dev, struct ice_tx_queue *txq)
+{
+	struct ice_adapter *ad =
+		ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
+
+	/* Use a simple Tx queue if possible (only fast free is allowed) */
+	ad->tx_simple_allowed =
+		(txq->offloads ==
+		(txq->offloads & DEV_TX_OFFLOAD_MBUF_FAST_FREE) &&
+		txq->tx_rs_thresh >= ICE_TX_MAX_BURST);
+
+	if (ad->tx_simple_allowed)
+		PMD_INIT_LOG(DEBUG, "Simple Tx can be enabled on Tx queue %u.",
+			     txq->queue_id);
+	else
+		PMD_INIT_LOG(DEBUG,
+			     "Simple Tx can NOT be enabled on Tx queue %u.",
+			     txq->queue_id);
+}
+
 /*********************************************************************
  *
  *  TX prep functions
diff --git a/drivers/net/ice/ice_rxtx.h b/drivers/net/ice/ice_rxtx.h
index 64e9f20dd..9040e3ff4 100644
--- a/drivers/net/ice/ice_rxtx.h
+++ b/drivers/net/ice/ice_rxtx.h
@@ -158,6 +158,8 @@ uint16_t ice_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 void ice_set_rx_function(struct rte_eth_dev *dev);
 uint16_t ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 		       uint16_t nb_pkts);
+void ice_set_tx_function_flag(struct rte_eth_dev *dev,
+			      struct ice_tx_queue *txq);
 void ice_set_tx_function(struct rte_eth_dev *dev);
 uint32_t ice_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 void ice_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
-- 
2.17.1

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

* [dpdk-dev] [PATCH] net/ice: fix wrong Tx function selection
  2019-04-19  3:03 [dpdk-dev] [PATCH] net/ice: fix wrong Tx function selection Leyi Rong
@ 2019-04-19  3:03 ` Leyi Rong
  2019-04-19  3:41 ` Zhang, Qi Z
  1 sibling, 0 replies; 4+ messages in thread
From: Leyi Rong @ 2019-04-19  3:03 UTC (permalink / raw)
  To: wenzhuo.lu, qi.z.zhang; +Cc: dev, Leyi Rong

Add ice_set_tx_function_flag() to configure tx_simple_allowed properly.

Fixes: 6eac0b7fde95 ("net/ice: support advance Rx/Tx")

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
---
 drivers/net/ice/ice_rxtx.c | 22 ++++++++++++++++++++++
 drivers/net/ice/ice_rxtx.h |  2 ++
 2 files changed, 24 insertions(+)

diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 8ef6a2ff6..ace766b1d 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -885,6 +885,7 @@ ice_tx_queue_setup(struct rte_eth_dev *dev,
 	txq->q_set = TRUE;
 	dev->data->tx_queues[queue_idx] = txq;
 	txq->tx_rel_mbufs = _ice_tx_queue_release_mbufs;
+	ice_set_tx_function_flag(dev, txq);
 
 	return 0;
 }
@@ -2305,6 +2306,27 @@ ice_set_rx_function(struct rte_eth_dev *dev)
 	}
 }
 
+void __attribute__((cold))
+ice_set_tx_function_flag(struct rte_eth_dev *dev, struct ice_tx_queue *txq)
+{
+	struct ice_adapter *ad =
+		ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
+
+	/* Use a simple Tx queue if possible (only fast free is allowed) */
+	ad->tx_simple_allowed =
+		(txq->offloads ==
+		(txq->offloads & DEV_TX_OFFLOAD_MBUF_FAST_FREE) &&
+		txq->tx_rs_thresh >= ICE_TX_MAX_BURST);
+
+	if (ad->tx_simple_allowed)
+		PMD_INIT_LOG(DEBUG, "Simple Tx can be enabled on Tx queue %u.",
+			     txq->queue_id);
+	else
+		PMD_INIT_LOG(DEBUG,
+			     "Simple Tx can NOT be enabled on Tx queue %u.",
+			     txq->queue_id);
+}
+
 /*********************************************************************
  *
  *  TX prep functions
diff --git a/drivers/net/ice/ice_rxtx.h b/drivers/net/ice/ice_rxtx.h
index 64e9f20dd..9040e3ff4 100644
--- a/drivers/net/ice/ice_rxtx.h
+++ b/drivers/net/ice/ice_rxtx.h
@@ -158,6 +158,8 @@ uint16_t ice_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 void ice_set_rx_function(struct rte_eth_dev *dev);
 uint16_t ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 		       uint16_t nb_pkts);
+void ice_set_tx_function_flag(struct rte_eth_dev *dev,
+			      struct ice_tx_queue *txq);
 void ice_set_tx_function(struct rte_eth_dev *dev);
 uint32_t ice_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 void ice_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH] net/ice: fix wrong Tx function selection
  2019-04-19  3:03 [dpdk-dev] [PATCH] net/ice: fix wrong Tx function selection Leyi Rong
  2019-04-19  3:03 ` Leyi Rong
@ 2019-04-19  3:41 ` Zhang, Qi Z
  2019-04-19  3:41   ` Zhang, Qi Z
  1 sibling, 1 reply; 4+ messages in thread
From: Zhang, Qi Z @ 2019-04-19  3:41 UTC (permalink / raw)
  To: Rong, Leyi, Lu, Wenzhuo; +Cc: dev



> -----Original Message-----
> From: Rong, Leyi
> Sent: Friday, April 19, 2019 11:04 AM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Rong, Leyi <leyi.rong@intel.com>
> Subject: [PATCH] net/ice: fix wrong Tx function selection
> 
> Add ice_set_tx_function_flag() to configure tx_simple_allowed properly.
> 
> Fixes: 6eac0b7fde95 ("net/ice: support advance Rx/Tx")
> 
> Signed-off-by: Leyi Rong <leyi.rong@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

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

* Re: [dpdk-dev] [PATCH] net/ice: fix wrong Tx function selection
  2019-04-19  3:41 ` Zhang, Qi Z
@ 2019-04-19  3:41   ` Zhang, Qi Z
  0 siblings, 0 replies; 4+ messages in thread
From: Zhang, Qi Z @ 2019-04-19  3:41 UTC (permalink / raw)
  To: Rong, Leyi, Lu, Wenzhuo; +Cc: dev



> -----Original Message-----
> From: Rong, Leyi
> Sent: Friday, April 19, 2019 11:04 AM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Rong, Leyi <leyi.rong@intel.com>
> Subject: [PATCH] net/ice: fix wrong Tx function selection
> 
> Add ice_set_tx_function_flag() to configure tx_simple_allowed properly.
> 
> Fixes: 6eac0b7fde95 ("net/ice: support advance Rx/Tx")
> 
> Signed-off-by: Leyi Rong <leyi.rong@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

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

end of thread, other threads:[~2019-04-19  3:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-19  3:03 [dpdk-dev] [PATCH] net/ice: fix wrong Tx function selection Leyi Rong
2019-04-19  3:03 ` Leyi Rong
2019-04-19  3:41 ` Zhang, Qi Z
2019-04-19  3:41   ` Zhang, Qi Z

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).