From: Raslan Darawsheh Date: Thu, 18 Oct 2018 10:17:27 +0000 (+0300) Subject: net/tap: add queue and port ids in queue structures X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=48b9dcd62a96bb4d9bd81077bf9d628391c25f3f;p=dpdk.git net/tap: add queue and port ids in queue structures Port and queue ids are added to easily map the file descriptors stored in each process private. Signed-off-by: Raslan Darawsheh Reviewed-by: Ferruh Yigit --- diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 77f26940b6..4d1ac23afd 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 44e2773f8b..4502e24d3e 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 {