DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/3] Rename field name for RX/TX queue start/stop
@ 2014-07-22  7:47 Ouyang Changchun
  2014-07-22  7:47 ` [dpdk-dev] [PATCH 1/3] ether: Update field name and description for queue start Ouyang Changchun
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Ouyang Changchun @ 2014-07-22  7:47 UTC (permalink / raw)
  To: dev

This patch series include 3 things:
1) Rename the field name from start_rx_per_q to rx_enable_queue in
struct rte_eth_rxconf, and do same thing for TX.
This patch also update description for field rx_enable_queue and tx_enable_queue.
2) According to 1), update field name from start_rx_per_q to rx_enable_queue in struct igb_rx_queue
 in ixgbe PMD, do same thing for TX.
3) Update its reference in sample vhost.

Ouyang Changchun (3):
  rename field from start_rx_per_q to rx_enable_queue, and update
    description for it.
  rename field name from start_rx_per_q to rx_enable_queue in ixgbe PMD.
  use new field name of rx_enable_queue in user space vhost sample.

 examples/vhost/main.c             |  4 ++--
 lib/librte_ether/rte_ethdev.h     | 16 ++++++++++++++--
 lib/librte_pmd_ixgbe/ixgbe_rxtx.c |  8 ++++----
 lib/librte_pmd_ixgbe/ixgbe_rxtx.h |  4 ++--
 4 files changed, 22 insertions(+), 10 deletions(-)

-- 
1.8.4.2

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

* [dpdk-dev] [PATCH 1/3] ether: Update field name and description for queue start
  2014-07-22  7:47 [dpdk-dev] [PATCH 0/3] Rename field name for RX/TX queue start/stop Ouyang Changchun
@ 2014-07-22  7:47 ` Ouyang Changchun
  2014-07-22 17:43   ` Stephen Hemminger
  2014-07-22  7:47 ` [dpdk-dev] [PATCH 2/3] ixgbe: Rename field name for queue start in ixgbe PMD Ouyang Changchun
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Ouyang Changchun @ 2014-07-22  7:47 UTC (permalink / raw)
  To: dev

Rename the field name from start_rx_per_q to rx_enable_queue in
struct rte_eth_rxconf, and do same thing for TX.
 
This patch also update description for field rx_enable_queue and tx_enable_queue.

Signed-off-by: Ouyang Changchun <changchun.ouyang@intel.com>
---
 lib/librte_ether/rte_ethdev.h | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 50df654..a452810 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -604,7 +604,16 @@ struct rte_eth_rxconf {
 	struct rte_eth_thresh rx_thresh; /**< RX ring threshold registers. */
 	uint16_t rx_free_thresh; /**< Drives the freeing of RX descriptors. */
 	uint8_t rx_drop_en; /**< Drop packets if no descriptors are available. */
-	uint8_t start_rx_per_q; /**< start rx per queue. */
+	/**< If rx_enable_queue is true, rte_eth_dev_rx_queue_start must be
+		invocated after rte_eth_dev_start's invocation to start RX for
+		one queue, and rte_eth_dev_rx_queue_start instead of
+		rte_eth_dev_start is responsible for allocating mbuf from
+		mempool and setup the DMA physical address. It is useful in
+		such scenario: buffer address is not available at the point of
+		rte_eth_dev_start's invocation but available later, e.g. in
+		VHOST zero copy case, the buffer address to be setup DMA
+		address is available only after one VM startup. */
+	uint8_t rx_enable_queue;
 };
 
 #define ETH_TXQ_FLAGS_NOMULTSEGS 0x0001 /**< nb_segs=1 for all mbufs */
@@ -625,7 +634,10 @@ struct rte_eth_txconf {
 	uint16_t tx_rs_thresh; /**< Drives the setting of RS bit on TXDs. */
 	uint16_t tx_free_thresh; /**< Drives the freeing of TX buffers. */
 	uint32_t txq_flags; /**< Set flags for the Tx queue */
-	uint8_t start_tx_per_q; /**< start tx per queue. */
+	/**< If tx_enable_queue is true, rte_eth_dev_tx_queue_start must be
+		invocated after rte_eth_dev_start's invocation to start TX for
+		one queue. Refer to start_rx_per_q for the use case. */
+	uint8_t tx_enable_queue;
 };
 
 /**
-- 
1.8.4.2

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

* [dpdk-dev] [PATCH 2/3] ixgbe: Rename field name for queue start in ixgbe PMD
  2014-07-22  7:47 [dpdk-dev] [PATCH 0/3] Rename field name for RX/TX queue start/stop Ouyang Changchun
  2014-07-22  7:47 ` [dpdk-dev] [PATCH 1/3] ether: Update field name and description for queue start Ouyang Changchun
@ 2014-07-22  7:47 ` Ouyang Changchun
  2014-07-22  7:47 ` [dpdk-dev] [PATCH 3/3] vhost: Update reference in user space vhost sample Ouyang Changchun
  2014-07-22  9:37 ` [dpdk-dev] [PATCH 0/3] Rename field name for RX/TX queue start/stop Thomas Monjalon
  3 siblings, 0 replies; 9+ messages in thread
From: Ouyang Changchun @ 2014-07-22  7:47 UTC (permalink / raw)
  To: dev

According to field name change in struct rte_eth_rxconf, update field name from
start_rx_per_q to rx_enable_queue in struct igb_rx_queue in ixgbe PMD, do same thing for TX.

Signed-off-by: Ouyang Changchun <changchun.ouyang@intel.com>
---
 lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 8 ++++----
 lib/librte_pmd_ixgbe/ixgbe_rxtx.h | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
index dfc2076..2872fad 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
@@ -1846,7 +1846,7 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
 	txq->port_id = dev->data->port_id;
 	txq->txq_flags = tx_conf->txq_flags;
 	txq->ops = &def_txq_ops;
-	txq->start_tx_per_q = tx_conf->start_tx_per_q;
+	txq->tx_enable_queue = tx_conf->tx_enable_queue;
 
 	/*
 	 * Modification to set VFTDT for virtual function if vf is detected
@@ -2091,7 +2091,7 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	rxq->crc_len = (uint8_t) ((dev->data->dev_conf.rxmode.hw_strip_crc) ?
 							0 : ETHER_CRC_LEN);
 	rxq->drop_en = rx_conf->rx_drop_en;
-	rxq->start_rx_per_q = rx_conf->start_rx_per_q;
+	rxq->rx_enable_queue = rx_conf->rx_enable_queue;
 
 	/*
 	 * Allocate RX ring hardware descriptors. A memzone large enough to
@@ -3652,13 +3652,13 @@ ixgbe_dev_rxtx_start(struct rte_eth_dev *dev)
 
 	for (i = 0; i < dev->data->nb_tx_queues; i++) {
 		txq = dev->data->tx_queues[i];
-		if (!txq->start_tx_per_q)
+		if (!txq->tx_enable_queue)
 			ixgbe_dev_tx_queue_start(dev, i);
 	}
 
 	for (i = 0; i < dev->data->nb_rx_queues; i++) {
 		rxq = dev->data->rx_queues[i];
-		if (!rxq->start_rx_per_q)
+		if (!rxq->rx_enable_queue)
 			ixgbe_dev_rx_queue_start(dev, i);
 	}
 
diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.h b/lib/librte_pmd_ixgbe/ixgbe_rxtx.h
index 64c0695..d6d856e 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.h
+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.h
@@ -135,7 +135,7 @@ struct igb_rx_queue {
 	uint8_t             port_id;  /**< Device port identifier. */
 	uint8_t             crc_len;  /**< 0 if CRC stripped, 4 otherwise. */
 	uint8_t             drop_en;  /**< If not 0, set SRRCTL.Drop_En. */
-	uint8_t             start_rx_per_q;
+	uint8_t             rx_enable_queue;
 #ifdef RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC
 	/** need to alloc dummy mbuf, for wraparound when scanning hw ring */
 	struct rte_mbuf fake_mbuf;
@@ -200,7 +200,7 @@ struct igb_tx_queue {
 	/** Hardware context0 history. */
 	struct ixgbe_advctx_info ctx_cache[IXGBE_CTX_NUM];
 	struct ixgbe_txq_ops *ops;          /**< txq ops */
-	uint8_t             start_tx_per_q;
+	uint8_t             tx_enable_queue;
 };
 
 struct ixgbe_txq_ops {
-- 
1.8.4.2

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

* [dpdk-dev] [PATCH 3/3] vhost: Update reference in user space vhost sample
  2014-07-22  7:47 [dpdk-dev] [PATCH 0/3] Rename field name for RX/TX queue start/stop Ouyang Changchun
  2014-07-22  7:47 ` [dpdk-dev] [PATCH 1/3] ether: Update field name and description for queue start Ouyang Changchun
  2014-07-22  7:47 ` [dpdk-dev] [PATCH 2/3] ixgbe: Rename field name for queue start in ixgbe PMD Ouyang Changchun
@ 2014-07-22  7:47 ` Ouyang Changchun
  2014-07-22  9:37 ` [dpdk-dev] [PATCH 0/3] Rename field name for RX/TX queue start/stop Thomas Monjalon
  3 siblings, 0 replies; 9+ messages in thread
From: Ouyang Changchun @ 2014-07-22  7:47 UTC (permalink / raw)
  To: dev

Update the reference from start_rx_per_q to rx_enable_queue in sample vhost.

Signed-off-by: Ouyang Changchun <changchun.ouyang@intel.com>
---
 examples/vhost/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 193aa25..2eea431 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -2984,9 +2984,9 @@ MAIN(int argc, char *argv[])
 		char pool_name[RTE_MEMPOOL_NAMESIZE];
 		char ring_name[RTE_MEMPOOL_NAMESIZE];
 
-		rx_conf_default.start_rx_per_q = (uint8_t)zero_copy;
+		rx_conf_default.rx_enable_queue = (uint8_t)zero_copy;
 		rx_conf_default.rx_drop_en = 0;
-		tx_conf_default.start_tx_per_q = (uint8_t)zero_copy;
+		tx_conf_default.tx_enable_queue = (uint8_t)zero_copy;
 		nb_mbuf = num_rx_descriptor
 			+ num_switching_cores * MBUF_CACHE_SIZE_ZCP
 			+ num_switching_cores * MAX_PKT_BURST;
-- 
1.8.4.2

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

* Re: [dpdk-dev] [PATCH 0/3] Rename field name for RX/TX queue start/stop
  2014-07-22  7:47 [dpdk-dev] [PATCH 0/3] Rename field name for RX/TX queue start/stop Ouyang Changchun
                   ` (2 preceding siblings ...)
  2014-07-22  7:47 ` [dpdk-dev] [PATCH 3/3] vhost: Update reference in user space vhost sample Ouyang Changchun
@ 2014-07-22  9:37 ` Thomas Monjalon
  2014-07-22  9:52   ` Chen, Jing D
  2014-07-28  4:34   ` Ouyang, Changchun
  3 siblings, 2 replies; 9+ messages in thread
From: Thomas Monjalon @ 2014-07-22  9:37 UTC (permalink / raw)
  To: Ouyang Changchun; +Cc: dev

Hi,

2014-07-22 15:47, Ouyang Changchun:
> This patch series include 3 things:
> 1) Rename the field name from start_rx_per_q to rx_enable_queue in
> struct rte_eth_rxconf, and do same thing for TX.
> This patch also update description for field rx_enable_queue and tx_enable_queue.
> 2) According to 1), update field name from start_rx_per_q to rx_enable_queue in struct igb_rx_queue
>  in ixgbe PMD, do same thing for TX.
> 3) Update its reference in sample vhost.

In order to be atomic (and do not break git bisect), you should submit
it in one patch.
Title would be "ethdev: rename queue enabler field" or something like that.
But the most important in such change is to explain why you make it.

Thanks
-- 
Thomas

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

* Re: [dpdk-dev] [PATCH 0/3] Rename field name for RX/TX queue start/stop
  2014-07-22  9:37 ` [dpdk-dev] [PATCH 0/3] Rename field name for RX/TX queue start/stop Thomas Monjalon
@ 2014-07-22  9:52   ` Chen, Jing D
  2014-07-23  1:07     ` Ouyang, Changchun
  2014-07-28  4:34   ` Ouyang, Changchun
  1 sibling, 1 reply; 9+ messages in thread
From: Chen, Jing D @ 2014-07-22  9:52 UTC (permalink / raw)
  To: Thomas Monjalon, Ouyang, Changchun; +Cc: dev

Hi Thomas,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon
> Sent: Tuesday, July 22, 2014 5:38 PM
> To: Ouyang, Changchun
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 0/3] Rename field name for RX/TX queue
> start/stop
> 
> Hi,
> 
> 2014-07-22 15:47, Ouyang Changchun:
> > This patch series include 3 things:
> > 1) Rename the field name from start_rx_per_q to rx_enable_queue in
> > struct rte_eth_rxconf, and do same thing for TX.
> > This patch also update description for field rx_enable_queue and
> tx_enable_queue.
> > 2) According to 1), update field name from start_rx_per_q to
> rx_enable_queue in struct igb_rx_queue
> >  in ixgbe PMD, do same thing for TX.
> > 3) Update its reference in sample vhost.
> 
> In order to be atomic (and do not break git bisect), you should submit
> it in one patch.
> Title would be "ethdev: rename queue enabler field" or something like that.
> But the most important in such change is to explain why you make it.
> 
> Thanks
> --
> Thomas

The reason adding this patch is that "start_rx_per_q" and "start_tx_per_q" has requirement in NIC driver in some cases. The implication includes:
1. don't fill mbuf address in RX ring in later dev start function call.
2. don't try to switch this rx/tx queues on in later dev start function call.  Instead, application will call rte_eth_dev_rx/tx_queue_start/stop to control
    this queue.

If the NIC driver tried to support these 2 options, it will have to satisfy above 2 conditions. But the problem is that the 2 fields definition don't have
a word to claim on their requirement. So, we needs this patch and add comments. 
As for renaming, it's not so important. Just for better understanding. 



 

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

* Re: [dpdk-dev] [PATCH 1/3] ether: Update field name and description for queue start
  2014-07-22  7:47 ` [dpdk-dev] [PATCH 1/3] ether: Update field name and description for queue start Ouyang Changchun
@ 2014-07-22 17:43   ` Stephen Hemminger
  0 siblings, 0 replies; 9+ messages in thread
From: Stephen Hemminger @ 2014-07-22 17:43 UTC (permalink / raw)
  To: Ouyang Changchun; +Cc: dev

On Tue, 22 Jul 2014 15:47:30 +0800
Ouyang Changchun <changchun.ouyang@intel.com> wrote:

> +	/**< If rx_enable_queue is true, rte_eth_dev_rx_queue_start must be
> +		invocated after rte_eth_dev_start's invocation to start RX for
> +		one queue, and rte_eth_dev_rx_queue_start instead of
> +		rte_eth_dev_start is responsible for allocating mbuf from
> +		mempool and setup the DMA physical address. It is useful in
> +		such scenario: buffer address is not available at the point of
> +		rte_eth_dev_start's invocation but available later, e.g. in
> +		VHOST zero copy case, the buffer address to be setup DMA
> +		address is available only after one VM startup. */

Good documentation about semantics is really valuable as long as it
kept up to date. In this case, the comment stands out which is not
a good thing.

An explanation this long belongs in documentation not in code.
Alternatively, if it is this hard to explain maybe it isn't the right design :-)

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

* Re: [dpdk-dev] [PATCH 0/3] Rename field name for RX/TX queue start/stop
  2014-07-22  9:52   ` Chen, Jing D
@ 2014-07-23  1:07     ` Ouyang, Changchun
  0 siblings, 0 replies; 9+ messages in thread
From: Ouyang, Changchun @ 2014-07-23  1:07 UTC (permalink / raw)
  To: Chen, Jing D, Thomas Monjalon; +Cc: dev

Yes, Mark(Jing Chen) has mentioned some reasons as below,
Basically the comments/description for 2 fields(start_rx_per_q and start_tx_per_q) is not clear, so we need add more.
As for renaming, Mark has strong recommending to replace old one with new one.
Both Huawei and I agree with the new name, from my respective, both(old and new one) are readable enough.  

Thanks,
Changchun

-----Original Message-----
From: Chen, Jing D 
Sent: Tuesday, July 22, 2014 5:52 PM
To: Thomas Monjalon; Ouyang, Changchun
Cc: dev@dpdk.org
Subject: RE: [dpdk-dev] [PATCH 0/3] Rename field name for RX/TX queue start/stop

Hi Thomas,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon
> Sent: Tuesday, July 22, 2014 5:38 PM
> To: Ouyang, Changchun
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 0/3] Rename field name for RX/TX queue 
> start/stop
> 
> Hi,
> 
> 2014-07-22 15:47, Ouyang Changchun:
> > This patch series include 3 things:
> > 1) Rename the field name from start_rx_per_q to rx_enable_queue in 
> > struct rte_eth_rxconf, and do same thing for TX.
> > This patch also update description for field rx_enable_queue and
> tx_enable_queue.
> > 2) According to 1), update field name from start_rx_per_q to
> rx_enable_queue in struct igb_rx_queue
> >  in ixgbe PMD, do same thing for TX.
> > 3) Update its reference in sample vhost.
> 
> In order to be atomic (and do not break git bisect), you should submit 
> it in one patch.
> Title would be "ethdev: rename queue enabler field" or something like that.
> But the most important in such change is to explain why you make it.
> 
> Thanks
> --
> Thomas

The reason adding this patch is that "start_rx_per_q" and "start_tx_per_q" has requirement in NIC driver in some cases. The implication includes:
1. don't fill mbuf address in RX ring in later dev start function call.
2. don't try to switch this rx/tx queues on in later dev start function call.  Instead, application will call rte_eth_dev_rx/tx_queue_start/stop to control
    this queue.

If the NIC driver tried to support these 2 options, it will have to satisfy above 2 conditions. But the problem is that the 2 fields definition don't have a word to claim on their requirement. So, we needs this patch and add comments. 
As for renaming, it's not so important. Just for better understanding. 



 

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

* Re: [dpdk-dev] [PATCH 0/3] Rename field name for RX/TX queue start/stop
  2014-07-22  9:37 ` [dpdk-dev] [PATCH 0/3] Rename field name for RX/TX queue start/stop Thomas Monjalon
  2014-07-22  9:52   ` Chen, Jing D
@ 2014-07-28  4:34   ` Ouyang, Changchun
  1 sibling, 0 replies; 9+ messages in thread
From: Ouyang, Changchun @ 2014-07-28  4:34 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

Hi Thomas,
I have generated patch v2 to resolve this according to your comments.
Pls see attachment.
Thanks and regards,
Changchun

-----Original Message-----
From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] 
Sent: Tuesday, July 22, 2014 5:38 PM
To: Ouyang, Changchun
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 0/3] Rename field name for RX/TX queue start/stop

Hi,

2014-07-22 15:47, Ouyang Changchun:
> This patch series include 3 things:
> 1) Rename the field name from start_rx_per_q to rx_enable_queue in 
> struct rte_eth_rxconf, and do same thing for TX.
> This patch also update description for field rx_enable_queue and tx_enable_queue.
> 2) According to 1), update field name from start_rx_per_q to 
> rx_enable_queue in struct igb_rx_queue  in ixgbe PMD, do same thing for TX.
> 3) Update its reference in sample vhost.

In order to be atomic (and do not break git bisect), you should submit it in one patch.
Title would be "ethdev: rename queue enabler field" or something like that.
But the most important in such change is to explain why you make it.

Thanks
--
Thomas

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

end of thread, other threads:[~2014-07-28  4:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-22  7:47 [dpdk-dev] [PATCH 0/3] Rename field name for RX/TX queue start/stop Ouyang Changchun
2014-07-22  7:47 ` [dpdk-dev] [PATCH 1/3] ether: Update field name and description for queue start Ouyang Changchun
2014-07-22 17:43   ` Stephen Hemminger
2014-07-22  7:47 ` [dpdk-dev] [PATCH 2/3] ixgbe: Rename field name for queue start in ixgbe PMD Ouyang Changchun
2014-07-22  7:47 ` [dpdk-dev] [PATCH 3/3] vhost: Update reference in user space vhost sample Ouyang Changchun
2014-07-22  9:37 ` [dpdk-dev] [PATCH 0/3] Rename field name for RX/TX queue start/stop Thomas Monjalon
2014-07-22  9:52   ` Chen, Jing D
2014-07-23  1:07     ` Ouyang, Changchun
2014-07-28  4:34   ` Ouyang, Changchun

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