DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 0/5] centralize deferred start checks
@ 2024-12-13 21:48 Stephen Hemminger
  2024-12-13 21:48 ` [PATCH 1/5] ethdev: check that device supports deferred start Stephen Hemminger
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Stephen Hemminger @ 2024-12-13 21:48 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Recent zxdh driver review raised the question of why should
drivers have to check rx_conf for deferred start support.
This can be better handled across all drivers at ethdev level.

Stephen Hemminger (5):
  ethdev: check that device supports deferred start
  net/dpaa: remove unnecessary deferred start check
  net/dpaa2: remove unneeded deferred start check
  net/enetfec: remove unneeded deferred start check
  net/virtio: remove unneeded deferred start check

 drivers/net/dpaa/dpaa_ethdev.c    | 10 ----------
 drivers/net/dpaa2/dpaa2_ethdev.c  | 14 --------------
 drivers/net/enetfec/enet_ethdev.c | 12 ------------
 drivers/net/virtio/virtio_rxtx.c  | 10 ----------
 lib/ethdev/rte_ethdev.c           | 10 ++++++++++
 5 files changed, 10 insertions(+), 46 deletions(-)

-- 
2.45.2


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

* [PATCH 1/5] ethdev: check that device supports deferred start
  2024-12-13 21:48 [PATCH 0/5] centralize deferred start checks Stephen Hemminger
@ 2024-12-13 21:48 ` Stephen Hemminger
  2024-12-13 21:48 ` [PATCH 2/5] net/dpaa: remove unnecessary deferred start check Stephen Hemminger
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2024-12-13 21:48 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko

The check for supporting deferred start should be handled at
the ethdev level for all devices.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/ethdev/rte_ethdev.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 6413c54e3b..7768058f6d 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -2264,6 +2264,11 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
 	if (rx_conf != NULL)
 		rx_offloads |= rx_conf->offloads;
 
+	/* Deferred start requires that device supports queue start */
+	if (rx_conf != NULL && rx_conf->rx_deferred_start &&
+	    *dev->dev_ops->rx_queue_start == NULL)
+		return -ENOTSUP;
+
 	/* Ensure that we have one and only one source of Rx buffers */
 	if ((mp != NULL) +
 	    (rx_conf != NULL && rx_conf->rx_nseg > 0) +
@@ -2575,6 +2580,11 @@ rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id,
 		return -EINVAL;
 	}
 
+	/* Deferred start requires that device supports queue start */
+	if (tx_conf != NULL && tx_conf->tx_deferred_start &&
+	    *dev->dev_ops->tx_queue_start == NULL)
+		return -ENOTSUP;
+
 	ret = rte_eth_dev_info_get(port_id, &dev_info);
 	if (ret != 0)
 		return ret;
-- 
2.45.2


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

* [PATCH 2/5] net/dpaa: remove unnecessary deferred start check
  2024-12-13 21:48 [PATCH 0/5] centralize deferred start checks Stephen Hemminger
  2024-12-13 21:48 ` [PATCH 1/5] ethdev: check that device supports deferred start Stephen Hemminger
@ 2024-12-13 21:48 ` Stephen Hemminger
  2024-12-13 21:48 ` [PATCH 3/5] net/dpaa2: remove unneeded " Stephen Hemminger
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2024-12-13 21:48 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena

This check is now done in ethdev layer.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/dpaa/dpaa_ethdev.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index e8d34e5898..ce4bbbb8f0 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -1089,11 +1089,6 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 		return -rte_errno;
 	}
 
-	/* Rx deferred start is not supported */
-	if (rx_conf->rx_deferred_start) {
-		DPAA_PMD_ERR("%p:Rx deferred start not supported", (void *)dev);
-		return -EINVAL;
-	}
 	rxq->nb_desc = UINT16_MAX;
 	rxq->offloads = rx_conf->offloads;
 
@@ -1399,11 +1394,6 @@ int dpaa_eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 
 	PMD_INIT_FUNC_TRACE();
 
-	/* Tx deferred start is not supported */
-	if (tx_conf->tx_deferred_start) {
-		DPAA_PMD_ERR("%p:Tx deferred start not supported", (void *)dev);
-		return -EINVAL;
-	}
 	txq->nb_desc = UINT16_MAX;
 	txq->offloads = tx_conf->offloads;
 
-- 
2.45.2


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

* [PATCH 3/5] net/dpaa2: remove unneeded deferred start check
  2024-12-13 21:48 [PATCH 0/5] centralize deferred start checks Stephen Hemminger
  2024-12-13 21:48 ` [PATCH 1/5] ethdev: check that device supports deferred start Stephen Hemminger
  2024-12-13 21:48 ` [PATCH 2/5] net/dpaa: remove unnecessary deferred start check Stephen Hemminger
@ 2024-12-13 21:48 ` Stephen Hemminger
  2024-12-13 21:48 ` [PATCH 4/5] net/enetfec: " Stephen Hemminger
  2024-12-13 21:48 ` [PATCH 5/5] net/virtio: " Stephen Hemminger
  4 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2024-12-13 21:48 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena

Already checked in ethdev now.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/dpaa2/dpaa2_ethdev.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index a9bce854c3..8624bba0ce 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -726,13 +726,6 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev,
 		DPAA2_PMD_WARN("To use Normal buffers, run 'export DPNI_NORMAL_BUF=1' before running dynamic_dpl.sh script");
 	}
 
-	/* Rx deferred start is not supported */
-	if (rx_conf->rx_deferred_start) {
-		DPAA2_PMD_ERR("%s:Rx deferred start not supported",
-			dev->data->name);
-		return -EINVAL;
-	}
-
 	if (!priv->bp_list || priv->bp_list->mp != mb_pool) {
 		if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
 			ret = rte_dpaa2_bpid_info_init(mb_pool);
@@ -889,13 +882,6 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,
 
 	PMD_INIT_FUNC_TRACE();
 
-	/* Tx deferred start is not supported */
-	if (tx_conf->tx_deferred_start) {
-		DPAA2_PMD_ERR("%s:Tx deferred start not supported",
-			dev->data->name);
-		return -EINVAL;
-	}
-
 	dpaa2_q->nb_desc = UINT16_MAX;
 	dpaa2_q->offloads = tx_conf->offloads;
 
-- 
2.45.2


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

* [PATCH 4/5] net/enetfec: remove unneeded deferred start check
  2024-12-13 21:48 [PATCH 0/5] centralize deferred start checks Stephen Hemminger
                   ` (2 preceding siblings ...)
  2024-12-13 21:48 ` [PATCH 3/5] net/dpaa2: remove unneeded " Stephen Hemminger
@ 2024-12-13 21:48 ` Stephen Hemminger
  2024-12-13 21:48 ` [PATCH 5/5] net/virtio: " Stephen Hemminger
  4 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2024-12-13 21:48 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Apeksha Gupta, Sachin Saxena

Already checked in ethdev now.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/enetfec/enet_ethdev.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/drivers/net/enetfec/enet_ethdev.c b/drivers/net/enetfec/enet_ethdev.c
index 91c0f60490..d8c81f4a70 100644
--- a/drivers/net/enetfec/enet_ethdev.c
+++ b/drivers/net/enetfec/enet_ethdev.c
@@ -377,12 +377,6 @@ enetfec_tx_queue_setup(struct rte_eth_dev *dev,
 		sizeof(struct bufdesc);
 	unsigned int dsize_log2 = rte_fls_u64(dsize) - 1;
 
-	/* Tx deferred start is not supported */
-	if (tx_conf->tx_deferred_start) {
-		ENETFEC_PMD_ERR("Tx deferred start not supported");
-		return -EINVAL;
-	}
-
 	/* allocate transmit queue */
 	txq = rte_zmalloc(NULL, sizeof(*txq), RTE_CACHE_LINE_SIZE);
 	if (txq == NULL) {
@@ -456,12 +450,6 @@ enetfec_rx_queue_setup(struct rte_eth_dev *dev,
 			sizeof(struct bufdesc);
 	unsigned int dsize_log2 = rte_fls_u64(dsize) - 1;
 
-	/* Rx deferred start is not supported */
-	if (rx_conf->rx_deferred_start) {
-		ENETFEC_PMD_ERR("Rx deferred start not supported");
-		return -EINVAL;
-	}
-
 	if (queue_idx >= ENETFEC_MAX_Q) {
 		ENETFEC_PMD_ERR("Invalid queue id %" PRIu16 ", max %d",
 			queue_idx, ENETFEC_MAX_Q);
-- 
2.45.2


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

* [PATCH 5/5] net/virtio: remove unneeded deferred start check
  2024-12-13 21:48 [PATCH 0/5] centralize deferred start checks Stephen Hemminger
                   ` (3 preceding siblings ...)
  2024-12-13 21:48 ` [PATCH 4/5] net/enetfec: " Stephen Hemminger
@ 2024-12-13 21:48 ` Stephen Hemminger
  4 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2024-12-13 21:48 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Maxime Coquelin, Chenbo Xia

Already checked in ethdev now.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/virtio/virtio_rxtx.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index b67f063b31..6ae3a6eb12 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -654,11 +654,6 @@ virtio_dev_rx_queue_setup(struct rte_eth_dev *dev,
 
 	PMD_INIT_FUNC_TRACE();
 
-	if (rx_conf->rx_deferred_start) {
-		PMD_INIT_LOG(ERR, "Rx deferred start is not supported");
-		return -EINVAL;
-	}
-
 	buf_size = virtio_rx_mem_pool_buf_size(mp);
 	if (!virtio_rx_check_scatter(hw->max_rx_pkt_len, buf_size,
 				     hw->rx_ol_scatter, &error)) {
@@ -819,11 +814,6 @@ virtio_dev_tx_queue_setup(struct rte_eth_dev *dev,
 
 	PMD_INIT_FUNC_TRACE();
 
-	if (tx_conf->tx_deferred_start) {
-		PMD_INIT_LOG(ERR, "Tx deferred start is not supported");
-		return -EINVAL;
-	}
-
 	if (nb_desc == 0 || nb_desc > vq->vq_nentries)
 		nb_desc = vq->vq_nentries;
 	vq->vq_free_cnt = RTE_MIN(vq->vq_free_cnt, nb_desc);
-- 
2.45.2


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

end of thread, other threads:[~2024-12-13 21:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-13 21:48 [PATCH 0/5] centralize deferred start checks Stephen Hemminger
2024-12-13 21:48 ` [PATCH 1/5] ethdev: check that device supports deferred start Stephen Hemminger
2024-12-13 21:48 ` [PATCH 2/5] net/dpaa: remove unnecessary deferred start check Stephen Hemminger
2024-12-13 21:48 ` [PATCH 3/5] net/dpaa2: remove unneeded " Stephen Hemminger
2024-12-13 21:48 ` [PATCH 4/5] net/enetfec: " Stephen Hemminger
2024-12-13 21:48 ` [PATCH 5/5] net/virtio: " Stephen Hemminger

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