[v5,1/3] net/tap: add queue and port ids in Rx/Tx queues structures

Message ID 1539154988-20652-1-git-send-email-rasland@mellanox.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series [v5,1/3] net/tap: add queue and port ids in Rx/Tx queues structures |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation fail Compilation issues

Commit Message

Raslan Darawsheh Oct. 10, 2018, 7:03 a.m. UTC
  Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
---
 drivers/net/tap/rte_eth_tap.c | 3 +++
 drivers/net/tap/rte_eth_tap.h | 3 +++
 2 files changed, 6 insertions(+)
  

Comments

Wiles, Keith Oct. 10, 2018, 12:50 p.m. UTC | #1
> On Oct 10, 2018, at 2:03 AM, Raslan Darawsheh <rasland@mellanox.com> wrote:
> 
> Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>

This title for the patch is the what we did not why we did it, should that be changed? To me it does not convey the reason or we would need to add a more complete comment body text to explain why we wanted the change. It is a bit of nit picking.

> ---
> drivers/net/tap/rte_eth_tap.c | 3 +++
> drivers/net/tap/rte_eth_tap.h | 3 +++
> 2 files changed, 6 insertions(+)
> 
> diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
> index ad5ae98..edfb7da 100644
> --- a/drivers/net/tap/rte_eth_tap.c
> +++ b/drivers/net/tap/rte_eth_tap.c
> @@ -1293,6 +1293,7 @@ tap_rx_queue_setup(struct rte_eth_dev *dev,
> 	rxq->mp = mp;
> 	rxq->trigger_seen = 1; /* force initial burst */
> 	rxq->in_port = dev->data->port_id;
> +	rxq->queue_id = rx_queue_id;
> 	rxq->nb_rx_desc = nb_desc;
> 	iovecs = rte_zmalloc_socket(dev->device->name, sizeof(*iovecs), 0,
> 				    socket_id);
> @@ -1359,6 +1360,8 @@ tap_tx_queue_setup(struct rte_eth_dev *dev,
> 		return -1;
> 	dev->data->tx_queues[tx_queue_id] = &internals->txq[tx_queue_id];
> 	txq = dev->data->tx_queues[tx_queue_id];
> +	txq->out_port = dev->data->port_id;
> +	txq->queue_id = tx_queue_id;
> 
> 	offloads = tx_conf->offloads | dev->data->dev_conf.txmode.offloads;
> 	txq->csum = !!(offloads &
> diff --git a/drivers/net/tap/rte_eth_tap.h b/drivers/net/tap/rte_eth_tap.h
> index 44e2773..4502e24 100644
> --- a/drivers/net/tap/rte_eth_tap.h
> +++ b/drivers/net/tap/rte_eth_tap.h
> @@ -46,6 +46,7 @@ struct rx_queue {
> 	struct rte_mempool *mp;         /* Mempool for RX packets */
> 	uint32_t trigger_seen;          /* Last seen Rx trigger value */
> 	uint16_t in_port;               /* Port ID */
> +	uint16_t queue_id;		/* queue ID*/
> 	int fd;
> 	struct pkt_stats stats;         /* Stats for this RX queue */
> 	uint16_t nb_rx_desc;            /* max number of mbufs available */
> @@ -62,6 +63,8 @@ struct tx_queue {
> 	uint16_t csum:1;                /* Enable checksum offloading */
> 	struct pkt_stats stats;         /* Stats for this TX queue */
> 	struct rte_gso_ctx gso_ctx;     /* GSO context */
> +	uint16_t out_port;              /* Port ID */
> +	uint16_t queue_id;		/* queue ID*/
> };
> 
> struct pmd_internals {
> -- 
> 2.7.4
> 

Regards,
Keith
  
Thomas Monjalon Oct. 10, 2018, 2:07 p.m. UTC | #2
10/10/2018 14:50, Wiles, Keith:
> 
> > On Oct 10, 2018, at 2:03 AM, Raslan Darawsheh <rasland@mellanox.com> wrote:
> > 
> > Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
> 
> This title for the patch is the what we did not why we did it, should that be changed? To me it does not convey the reason or we would need to add a more complete comment body text to explain why we wanted the change. It is a bit of nit picking.

I think the question "why" must be answered in the body.
  
Raslan Darawsheh Oct. 10, 2018, 2:40 p.m. UTC | #3
Hi,

Just sent a new version with the commit log reworded to answer the "why" question you mentioned.
Thx for your reviews.

Kindest regards,
Raslan Darawsheh

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Wednesday, October 10, 2018 5:08 PM
> To: Wiles, Keith <keith.wiles@intel.com>; Raslan Darawsheh
> <rasland@mellanox.com>
> Cc: dev@dpdk.org; Shahaf Shuler <shahafs@mellanox.com>; Ori Kam
> <orika@mellanox.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Subject: Re: [PATCH v5 1/3] net/tap: add queue and port ids in Rx/Tx queues
> structures
> 
> 10/10/2018 14:50, Wiles, Keith:
> >
> > > On Oct 10, 2018, at 2:03 AM, Raslan Darawsheh <rasland@mellanox.com>
> wrote:
> > >
> > > Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
> >
> > This title for the patch is the what we did not why we did it, should that be
> changed? To me it does not convey the reason or we would need to add a
> more complete comment body text to explain why we wanted the change. It
> is a bit of nit picking.
> 
> I think the question "why" must be answered in the body.
> 
>
  

Patch

diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index ad5ae98..edfb7da 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -1293,6 +1293,7 @@  tap_rx_queue_setup(struct rte_eth_dev *dev,
 	rxq->mp = mp;
 	rxq->trigger_seen = 1; /* force initial burst */
 	rxq->in_port = dev->data->port_id;
+	rxq->queue_id = rx_queue_id;
 	rxq->nb_rx_desc = nb_desc;
 	iovecs = rte_zmalloc_socket(dev->device->name, sizeof(*iovecs), 0,
 				    socket_id);
@@ -1359,6 +1360,8 @@  tap_tx_queue_setup(struct rte_eth_dev *dev,
 		return -1;
 	dev->data->tx_queues[tx_queue_id] = &internals->txq[tx_queue_id];
 	txq = dev->data->tx_queues[tx_queue_id];
+	txq->out_port = dev->data->port_id;
+	txq->queue_id = tx_queue_id;
 
 	offloads = tx_conf->offloads | dev->data->dev_conf.txmode.offloads;
 	txq->csum = !!(offloads &
diff --git a/drivers/net/tap/rte_eth_tap.h b/drivers/net/tap/rte_eth_tap.h
index 44e2773..4502e24 100644
--- a/drivers/net/tap/rte_eth_tap.h
+++ b/drivers/net/tap/rte_eth_tap.h
@@ -46,6 +46,7 @@  struct rx_queue {
 	struct rte_mempool *mp;         /* Mempool for RX packets */
 	uint32_t trigger_seen;          /* Last seen Rx trigger value */
 	uint16_t in_port;               /* Port ID */
+	uint16_t queue_id;		/* queue ID*/
 	int fd;
 	struct pkt_stats stats;         /* Stats for this RX queue */
 	uint16_t nb_rx_desc;            /* max number of mbufs available */
@@ -62,6 +63,8 @@  struct tx_queue {
 	uint16_t csum:1;                /* Enable checksum offloading */
 	struct pkt_stats stats;         /* Stats for this TX queue */
 	struct rte_gso_ctx gso_ctx;     /* GSO context */
+	uint16_t out_port;              /* Port ID */
+	uint16_t queue_id;		/* queue ID*/
 };
 
 struct pmd_internals {