This series of patches adds support for secondary queue set in nicvf thunderx
driver
There are two types of VFs:
- Primary VF
- Secondary VF
Each port consist of a primary VF and n secondary VF(s). Each VF provides 8
Tx/Rx queues to a port. In case port is configured to use more than 8 queues,
then it requires one (or more) secondary VF. Each secondary VF adds additional
8 queues to the queue set.
During PMD driver initialization, the primary VF's are enumerated by checking the
specific flag (see READY message). They are at the beginning of VF list (the remain
ones are secondary VF's).
The primary VFs are used as master queue sets. Secondary VFs provide
additional queue sets for primary ones. If a port is configured for more then
8 queues then it will request for additional queues from secondary VFs.
Secondary VFs cannot be shared between primary VFs.
Primary VFs are present on the tail of the 'Network devices using kernel
driver' list, secondary VFs are on the remaining tail of the list.
The VNIC driver in the multiqueue setup works differently than other drivers
like `ixgbe`. We need to bind separately each specific queue set device with
the ``tools/dpdk-devbind.py`` utility.
Depending on the hardware used, the kernel driver sets a threshold ``vf_id``.
VFs that try to attach with an id below or equal to this boundary are
considered primary VFs. VFs that try to attach with an id above this boundary
are considered secondary VFs.
This patchset also contains other cleanups and improvements like fixing
erroneous checksum calculation and preparing the thunderx driver for the multi
queue set feature support.
These changes base on the following pending patches:
[dpdk-dev,1/3] net/thunderx: remove generic passx references from the driver
http://dpdk.org/dev/patchwork/patch/14963/
[dpdk-dev,2/3] net/thunderx: introduce cqe_rx2 HW capability flag
http://dpdk.org/dev/patchwork/patch/14964/
[dpdk-dev,3/3] net/thunderx: add 81xx SoC support
http://dpdk.org/dev/patchwork/patch/14965/
Kamil Rytarowski (13):
net/thunderx: cleanup the driver before adding new features
net/thunderx: correct transmit checksum handling
net/thunderx/base: add family of functions to store qsets
net/thunderx/base: add secondary queue set support
net/thunderx: add family of functions to store DPDK qsets
net/thunderx: add secondary queue set in interrupt functions
net/thunderx: fix multiprocess support in stats
net/thunderx: add helper utils for secondary qset support
net/thunderx: add secondary qset support in dev stop/close
net/thunderx: add secondary qset support in device start
net/thunderx: add secondary qset support in device configure
net/thunderx: add final bits for secondary queue support
net/thunderx: document secondary queue set support
doc/guides/nics/thunderx.rst | 114 ++++-
drivers/net/thunderx/Makefile | 2 +
drivers/net/thunderx/base/nicvf_bsvf.c | 72 +++
drivers/net/thunderx/base/nicvf_bsvf.h | 76 +++
drivers/net/thunderx/base/nicvf_hw.c | 10 +-
drivers/net/thunderx/base/nicvf_hw.h | 6 +-
drivers/net/thunderx/base/nicvf_hw_defs.h | 1 +
drivers/net/thunderx/base/nicvf_mbox.c | 34 +-
drivers/net/thunderx/base/nicvf_mbox.h | 21 +-
drivers/net/thunderx/nicvf_ethdev.c | 753 +++++++++++++++++++++---------
drivers/net/thunderx/nicvf_ethdev.h | 39 ++
drivers/net/thunderx/nicvf_rxtx.c | 14 +-
drivers/net/thunderx/nicvf_struct.h | 6 +-
drivers/net/thunderx/nicvf_svf.c | 78 ++++
drivers/net/thunderx/nicvf_svf.h | 66 +++
15 files changed, 1046 insertions(+), 246 deletions(-)
create mode 100644 drivers/net/thunderx/base/nicvf_bsvf.c
create mode 100644 drivers/net/thunderx/base/nicvf_bsvf.h
create mode 100644 drivers/net/thunderx/nicvf_svf.c
create mode 100644 drivers/net/thunderx/nicvf_svf.h
--
1.9.1
@@ -1087,9 +1084,9 @@ nicvf_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx,PMD_DRV_LOG(WARNING,"socket_id expected %d, configured %d",socket_id,nic->node);-/* Mempool memory should be contiguous */-if(mp->nb_mem_chunks!=1){-PMD_INIT_LOG(ERR,"Non contiguous mempool, check huge page sz");+/* Mempool memory must be contiguous */+if(mp->flags&MEMPOOL_F_NO_PHYS_CONTIG){+PMD_INIT_LOG(ERR,"Mempool memory must be contiguous");return-EINVAL;}
@@ -1212,15 +1209,16 @@ nicvf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)}staticnicvf_phys_addr_t-rbdr_rte_mempool_get(void*opaque)+rbdr_rte_mempool_get(void*dev,void*opaque){uint16_tqidx;uintptr_tmbuf;structnicvf_rxq*rxq;-structnicvf*nic=nicvf_pmd_priv((structrte_eth_dev*)opaque);+structrte_eth_dev*eth_dev=(structrte_eth_dev*)dev;+structnicvf*nic__rte_unused=(structnicvf*)opaque;-for(qidx=0;qidx<nic->eth_dev->data->nb_rx_queues;qidx++){-rxq=nic->eth_dev->data->rx_queues[qidx];+for(qidx=0;qidx<eth_dev->data->nb_rx_queues;qidx++){+rxq=eth_dev->data->rx_queues[qidx];/* Maintain equal buffer count across all pools */if(rxq->precharge_cnt>=rxq->qlen_mask)continue;
@@ -1354,8 +1352,8 @@ nicvf_dev_start(struct rte_eth_dev *dev)}/* Fill rte_mempool buffers in RBDR pool and precharge it */-ret=nicvf_qset_rbdr_precharge(nic,0,rbdr_rte_mempool_get,-dev,total_rxq_desc);+ret=nicvf_qset_rbdr_precharge(dev,nic,0,rbdr_rte_mempool_get,+total_rxq_desc);if(ret){PMD_INIT_LOG(ERR,"Failed to fill rbdr %d",ret);gotoqset_rbdr_reclaim;
@@ -1721,12 +1719,6 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev)gotomalloc_fail;}-ret=nicvf_mbox_get_rss_size(nic);-if(ret){-PMD_INIT_LOG(ERR,"Failed to get rss table size");-gotomalloc_fail;-}-PMD_INIT_LOG(INFO,"Port %d (%x:%x) mac=%02x:%02x:%02x:%02x:%02x:%02x",eth_dev->data->port_id,nic->vendor_id,nic->device_id,nic->mac_addr[0],nic->mac_addr[1],nic->mac_addr[2],
From: Kamil Rytarowski <redacted>
The symbols PKT_TX_TCP_CKSUM and PKT_TX_UDP_CKSUM are not bits on a
bitmask. Set l3_offset always for TX offloads, not just for PKT_TX_IP_CKSUM
being true.
Fixes: 1c421f18e095 ("net/thunderx: add single and multi-segment Tx")
Signed-off-by: Maciej Czekaj <redacted>
Signed-off-by: Kamil Rytarowski <redacted>
Signed-off-by: Zyta Szpak <redacted>
Signed-off-by: Slawomir Rosek <redacted>
Signed-off-by: Radoslaw Biernacki <redacted>
Signed-off-by: Jerin Jacob <redacted>
---
drivers/net/thunderx/nicvf_rxtx.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
@@ -314,11 +324,33 @@ nicvf_mbox_qset_config(struct nicvf *nic, struct pf_qs_cfg *qs_cfg)/* Send a mailbox msg to PF to config Qset */mbx.msg.msg=NIC_MBOX_MSG_QS_CFG;mbx.qs.num=nic->vf_id;+mbx.qs.sqs_count=nic->sqs_count;mbx.qs.cfg=qs_cfg->value;returnnicvf_mbox_send_msg_to_pf(nic,&mbx);}int+nicvf_mbox_request_sqs(structnicvf*nic)+{+structnic_mbxmbx={.msg={0}};+size_ti;++assert_if_secondary(nic);+assert(nic->sqs_count>0);+assert(nic->sqs_count<=MAX_SQS_PER_VF);++mbx.sqs_alloc.msg=NIC_MBOX_MSG_ALLOC_SQS;+mbx.sqs_alloc.spec=1;+mbx.sqs_alloc.qs_count=nic->sqs_count;++/* Set no of Rx/Tx queues in each of the SQsets */+for(i=0;i<nic->sqs_count;i++)+mbx.sqs_alloc.svf[i]=nic->snicvf[i]->vf_id;++returnnicvf_mbox_send_msg_to_pf(nic,&mbx);+}++intnicvf_mbox_rq_drop_config(structnicvf*nic,uint16_tqidx,boolenable){structnic_mbxmbx={.msg={0}};
From: Kamil Rytarowski <redacted>
In case of the multiprocess mode a shared nicvf struct between processes
cannot point with the eth_dev pointer to master device, therefore remove it
allong with references to it refactoring the code where needed.
Fixes: 7413feee662d ("net/thunderx: add device start/stop and close")
Signed-off-by: Maciej Czekaj <redacted>
Signed-off-by: Kamil Rytarowski <redacted>
Signed-off-by: Zyta Szpak <redacted>
Signed-off-by: Slawomir Rosek <redacted>
Signed-off-by: Radoslaw Biernacki <redacted>
Signed-off-by: Jerin Jacob <redacted>
---
drivers/net/thunderx/nicvf_ethdev.c | 69 ++++++++++++++++++-------------------
drivers/net/thunderx/nicvf_rxtx.c | 3 +-
drivers/net/thunderx/nicvf_struct.h | 1 -
3 files changed, 36 insertions(+), 37 deletions(-)
@@ -497,14 +497,14 @@ nicvf_dev_rss_hash_update(struct rte_eth_dev *dev,}staticint-nicvf_qset_cq_alloc(structnicvf*nic,structnicvf_rxq*rxq,uint16_tqidx,-uint32_tdesc_cnt)+nicvf_qset_cq_alloc(structrte_eth_dev*dev,structnicvf*nic,+structnicvf_rxq*rxq,uint16_tqidx,uint32_tdesc_cnt){conststructrte_memzone*rz;uint32_tring_size=CMP_QUEUE_SZ_MAX*sizeof(unioncq_entry_t);-rz=rte_eth_dma_zone_reserve(nic->eth_dev,"cq_ring",qidx,ring_size,-NICVF_CQ_BASE_ALIGN_BYTES,nic->node);+rz=rte_eth_dma_zone_reserve(dev,"cq_ring",qidx,ring_size,+NICVF_CQ_BASE_ALIGN_BYTES,nic->node);if(rz==NULL){PMD_INIT_LOG(ERR,"Failed to allocate mem for cq hw ring");return-ENOMEM;
@@ -520,13 +520,13 @@ nicvf_qset_cq_alloc(struct nicvf *nic, struct nicvf_rxq *rxq, uint16_t qidx,}staticint-nicvf_qset_sq_alloc(structnicvf*nic,structnicvf_txq*sq,uint16_tqidx,-uint32_tdesc_cnt)+nicvf_qset_sq_alloc(structrte_eth_dev*dev,structnicvf*nic,+structnicvf_txq*sq,uint16_tqidx,uint32_tdesc_cnt){conststructrte_memzone*rz;uint32_tring_size=SND_QUEUE_SZ_MAX*sizeof(unionsq_entry_t);-rz=rte_eth_dma_zone_reserve(nic->eth_dev,"sq",qidx,ring_size,+rz=rte_eth_dma_zone_reserve(dev,"sq",qidx,ring_size,NICVF_SQ_BASE_ALIGN_BYTES,nic->node);if(rz==NULL){PMD_INIT_LOG(ERR,"Failed allocate mem for sq hw ring");
@@ -915,7 +916,7 @@ nicvf_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx,return-ENOMEM;}-if(nicvf_qset_sq_alloc(nic,txq,qidx,nb_desc)){+if(nicvf_qset_sq_alloc(dev,nic,txq,qidx,nb_desc)){PMD_INIT_LOG(ERR,"Failed to allocate mem for sq %d",qidx);nicvf_dev_tx_queue_release(txq);return-ENOMEM;
@@ -1316,12 +1316,12 @@ nicvf_dev_start(struct rte_eth_dev *dev)/* Check the level of buffers in the pool */total_rxq_desc=0;-for(qidx=0;qidx<nic->eth_dev->data->nb_rx_queues;qidx++){+for(qidx=0;qidx<dev->data->nb_rx_queues;qidx++){rxq=dev->data->rx_queues[qidx];/* Count total numbers of rxq descs */total_rxq_desc+=rxq->qlen_mask+1;exp_buffs=RTE_MEMPOOL_CACHE_MAX_SIZE+rxq->rx_free_thresh;-exp_buffs*=nic->eth_dev->data->nb_rx_queues;+exp_buffs*=dev->data->nb_rx_queues;if(rte_mempool_avail_count(rxq->pool)<exp_buffs){PMD_INIT_LOG(ERR,"Buff shortage in pool=%s (%d/%d)",rxq->pool->name,
@@ -1347,7 +1347,7 @@ nicvf_dev_start(struct rte_eth_dev *dev)/* Allocate RBDR and RBDR ring desc */nb_rbdr_desc=nicvf_qsize_rbdr_roundup(total_rxq_desc);-ret=nicvf_qset_rbdr_alloc(nic,nb_rbdr_desc,rbdrsz);+ret=nicvf_qset_rbdr_alloc(dev,nic,nb_rbdr_desc,rbdrsz);if(ret){PMD_INIT_LOG(ERR,"Failed to allocate memory for rbdr alloc");gotoqset_reclaim;
@@ -1494,7 +1494,7 @@ nicvf_dev_stop(struct rte_eth_dev *dev)/* Move all charged buffers in RBDR back to pool */if(nic->rbdr!=NULL)-nicvf_rbdr_release_mbufs(nic);+nicvf_rbdr_release_mbufs(dev,nic);/* Reclaim CPI configuration */if(!nic->sqs_mode){
@@ -1460,32 +1487,74 @@ qset_reclaim:}staticvoid-nicvf_dev_stop(structrte_eth_dev*dev)+nicvf_dev_stop_cleanup(structrte_eth_dev*dev,boolcleanup){+size_ti;intret;-uint16_tqidx;structnicvf*nic=nicvf_pmd_priv(dev);PMD_INIT_FUNC_TRACE();-/* Let PF make the BGX's RX and TX switches to OFF position */-nicvf_mbox_shutdown(nic);+/* Teardown secondary vf first */+for(i=0;i<nic->sqs_count;i++){+if(!nic->snicvf[i])+continue;++nicvf_vf_stop(dev,nic->snicvf[i],cleanup);+}++/* Stop the primary VF now */+nicvf_vf_stop(dev,nic,cleanup);/* Disable loopback */ret=nicvf_loopback_config(nic,0);if(ret)PMD_INIT_LOG(ERR,"Failed to disable loopback %d",ret);+/* Reclaim CPI configuration */+ret=nicvf_mbox_config_cpi(nic,0);+if(ret)+PMD_INIT_LOG(ERR,"Failed to reclaim CPI config %d",ret);+}++staticvoid+nicvf_dev_stop(structrte_eth_dev*dev)+{+PMD_INIT_FUNC_TRACE();++nicvf_dev_stop_cleanup(dev,false);+}++staticvoid+nicvf_vf_stop(structrte_eth_dev*dev,structnicvf*nic,boolcleanup)+{+intret;+uint16_tqidx;+uint16_ttx_start,tx_end;+uint16_trx_start,rx_end;++PMD_INIT_FUNC_TRACE();++if(cleanup){+/* Let PF make the BGX's RX and TX switches to OFF position */+nicvf_mbox_shutdown(nic);+}+/* Disable VLAN Strip */nicvf_vlan_hw_strip(nic,0);-/* Reclaim sq */-for(qidx=0;qidx<dev->data->nb_tx_queues;qidx++)-nicvf_stop_tx_queue(dev,qidx);+/* Get queue ranges for this VF */+nicvf_tx_range(dev,nic,&tx_start,&tx_end);++for(qidx=tx_start;qidx<=tx_end;qidx++)+nicvf_vf_stop_tx_queue(dev,nic,qidx%MAX_SND_QUEUES_PER_QS);++/* Get queue ranges for this VF */+nicvf_rx_range(dev,nic,&rx_start,&rx_end);/* Reclaim rq */-for(qidx=0;qidx<dev->data->nb_rx_queues;qidx++)-nicvf_stop_rx_queue(dev,qidx);+for(qidx=rx_start;qidx<=rx_end;qidx++)+nicvf_vf_stop_rx_queue(dev,nic,qidx%MAX_RCV_QUEUES_PER_QS);/* Reclaim RBDR */ret=nicvf_qset_rbdr_reclaim(nic,0);
@@ -1267,25 +1292,25 @@ rbdr_rte_mempool_get(void *dev, void *opaque)}staticint-nicvf_dev_start(structrte_eth_dev*dev)+nicvf_vf_start(structrte_eth_dev*dev,structnicvf*nic,uint32_trbdrsz){intret;uint16_tqidx;-uint32_tbuffsz=0,rbdrsz=0;uint32_ttotal_rxq_desc,nb_rbdr_desc,exp_buffs;uint64_tmbuf_phys_off=0;structnicvf_rxq*rxq;-structrte_pktmbuf_pool_private*mbp_priv;structrte_mbuf*mbuf;-structnicvf*nic=nicvf_pmd_priv(dev);-structrte_eth_rxmode*rx_conf=&dev->data->dev_conf.rxmode;-uint16_tmtu;+uint16_trx_start,rx_end;+uint16_ttx_start,tx_end;PMD_INIT_FUNC_TRACE();/* Userspace process exited without proper shutdown in last run */if(nicvf_qset_rbdr_active(nic,0))-nicvf_dev_stop(dev);+nicvf_vf_stop(dev,nic,false);++/* Get queue ranges for this VF */+nicvf_rx_range(dev,nic,&rx_start,&rx_end);/**ThunderxnicvfPMDcansupportmorethanonepoolperportonlywhen
@@ -1300,32 +1325,15 @@ nicvf_dev_start(struct rte_eth_dev *dev)**/-/* Validate RBDR buff size */-for(qidx=0;qidx<dev->data->nb_rx_queues;qidx++){-rxq=dev->data->rx_queues[qidx];-mbp_priv=rte_mempool_get_priv(rxq->pool);-buffsz=mbp_priv->mbuf_data_room_size-RTE_PKTMBUF_HEADROOM;-if(buffsz%128){-PMD_INIT_LOG(ERR,"rxbuf size must be multiply of 128");-return-EINVAL;-}-if(rbdrsz==0)-rbdrsz=buffsz;-if(rbdrsz!=buffsz){-PMD_INIT_LOG(ERR,"buffsz not same, qid=%d (%d/%d)",-qidx,rbdrsz,buffsz);-return-EINVAL;-}-}-/* Validate mempool attributes */-for(qidx=0;qidx<dev->data->nb_rx_queues;qidx++){+for(qidx=rx_start;qidx<=rx_end;qidx++){rxq=dev->data->rx_queues[qidx];rxq->mbuf_phys_off=nicvf_mempool_phy_offset(rxq->pool);mbuf=rte_pktmbuf_alloc(rxq->pool);if(mbuf==NULL){-PMD_INIT_LOG(ERR,"Failed allocate mbuf qid=%d pool=%s",-qidx,rxq->pool->name);+PMD_INIT_LOG(ERR,"Failed allocate mbuf VF%d qid=%d "+"pool=%s",+nic->vf_id,qidx,rxq->pool->name);return-ENOMEM;}rxq->mbuf_phys_off-=nicvf_mbuff_meta_length(mbuf);
@@ -1335,15 +1343,16 @@ nicvf_dev_start(struct rte_eth_dev *dev)if(mbuf_phys_off==0)mbuf_phys_off=rxq->mbuf_phys_off;if(mbuf_phys_off!=rxq->mbuf_phys_off){-PMD_INIT_LOG(ERR,"pool params not same,%s %"PRIx64,-rxq->pool->name,mbuf_phys_off);+PMD_INIT_LOG(ERR,"pool params not same,%s VF%d %"+PRIx64,rxq->pool->name,nic->vf_id,+mbuf_phys_off);return-EINVAL;}}/* Check the level of buffers in the pool */total_rxq_desc=0;-for(qidx=0;qidx<dev->data->nb_rx_queues;qidx++){+for(qidx=rx_start;qidx<=rx_end;qidx++){rxq=dev->data->rx_queues[qidx];/* Count total numbers of rxq descs */total_rxq_desc+=rxq->qlen_mask+1;
@@ -1361,14 +1370,16 @@ nicvf_dev_start(struct rte_eth_dev *dev)/* Check RBDR desc overflow */ret=nicvf_qsize_rbdr_roundup(total_rxq_desc);if(ret==0){-PMD_INIT_LOG(ERR,"Reached RBDR desc limit, reduce nr desc");+PMD_INIT_LOG(ERR,"Reached RBDR desc limit, reduce nr desc "+"VF%d",nic->vf_id);return-ENOMEM;}/* Enable qset */ret=nicvf_qset_config(nic);if(ret){-PMD_INIT_LOG(ERR,"Failed to enable qset %d",ret);+PMD_INIT_LOG(ERR,"Failed to enable qset %d VF%d",ret,+nic->vf_id);returnret;}
@@ -1376,14 +1387,16 @@ nicvf_dev_start(struct rte_eth_dev *dev)nb_rbdr_desc=nicvf_qsize_rbdr_roundup(total_rxq_desc);ret=nicvf_qset_rbdr_alloc(dev,nic,nb_rbdr_desc,rbdrsz);if(ret){-PMD_INIT_LOG(ERR,"Failed to allocate memory for rbdr alloc");+PMD_INIT_LOG(ERR,"Failed to allocate memory for rbdr alloc "+"VF%d",nic->vf_id);gotoqset_reclaim;}/* Enable and configure RBDR registers */ret=nicvf_qset_rbdr_config(nic,0);if(ret){-PMD_INIT_LOG(ERR,"Failed to configure rbdr %d",ret);+PMD_INIT_LOG(ERR,"Failed to configure rbdr %d VF%d",ret,+nic->vf_id);gotoqset_rbdr_free;}
@@ -1391,52 +1404,127 @@ nicvf_dev_start(struct rte_eth_dev *dev)ret=nicvf_qset_rbdr_precharge(dev,nic,0,rbdr_rte_mempool_get,total_rxq_desc);if(ret){-PMD_INIT_LOG(ERR,"Failed to fill rbdr %d",ret);+PMD_INIT_LOG(ERR,"Failed to fill rbdr %d VF%d",ret,+nic->vf_id);gotoqset_rbdr_reclaim;}-PMD_DRV_LOG(INFO,"Filled %d out of %d entries in RBDR",-nic->rbdr->tail,nb_rbdr_desc);+PMD_DRV_LOG(INFO,"Filled %d out of %d entries in RBDR VF%d",+nic->rbdr->tail,nb_rbdr_desc,nic->vf_id);++/* Configure VLAN Strip */+nicvf_vlan_hw_strip(nic,dev->data->dev_conf.rxmode.hw_vlan_strip);++/* Get queue ranges for this VF */+nicvf_tx_range(dev,nic,&tx_start,&tx_end);++/* Configure TX queues */+for(qidx=tx_start;qidx<=tx_end;qidx++){+ret=nicvf_vf_start_tx_queue(dev,nic,+qidx%MAX_SND_QUEUES_PER_QS);+if(ret)+gotostart_txq_error;+}/* Configure RX queues */-for(qidx=0;qidx<dev->data->nb_rx_queues;qidx++){-ret=nicvf_start_rx_queue(dev,qidx);+for(qidx=rx_start;qidx<=rx_end;qidx++){+ret=nicvf_vf_start_rx_queue(dev,nic,+qidx%MAX_RCV_QUEUES_PER_QS);if(ret)gotostart_rxq_error;}-/* Configure VLAN Strip */-nicvf_vlan_hw_strip(nic,dev->data->dev_conf.rxmode.hw_vlan_strip);--/* Configure TX queues */-for(qidx=0;qidx<dev->data->nb_tx_queues;qidx++){-ret=nicvf_start_tx_queue(dev,qidx);+if(!nic->sqs_mode){+/* Configure CPI algorithm */+ret=nicvf_configure_cpi(dev);if(ret)gotostart_txq_error;++ret=nicvf_mbox_get_rss_size(nic);+if(ret){+PMD_INIT_LOG(ERR,"Failed to get rss table size");+gotoqset_rss_error;+}++/* Configure RSS */+ret=nicvf_configure_rss(dev);+if(ret)+gotoqset_rss_error;}-/* Configure CPI algorithm */-ret=nicvf_configure_cpi(dev);-if(ret)-gotostart_txq_error;+/* Done; Let PF make the BGX's RX and TX switches to ON position */+nicvf_mbox_cfg_done(nic);+return0;-/* Configure RSS */-ret=nicvf_configure_rss(dev);-if(ret)-gotoqset_rss_error;+qset_rss_error:+nicvf_rss_term(nic);+start_rxq_error:+for(qidx=rx_start;qidx<=rx_end;qidx++)+nicvf_vf_stop_rx_queue(dev,nic,qidx%MAX_RCV_QUEUES_PER_QS);+start_txq_error:+for(qidx=tx_start;qidx<=tx_end;qidx++)+nicvf_vf_stop_tx_queue(dev,nic,qidx%MAX_SND_QUEUES_PER_QS);+qset_rbdr_reclaim:+nicvf_qset_rbdr_reclaim(nic,0);+nicvf_rbdr_release_mbufs(dev,nic);+qset_rbdr_free:+if(nic->rbdr){+rte_free(nic->rbdr);+nic->rbdr=NULL;+}+qset_reclaim:+nicvf_qset_reclaim(nic);+returnret;+}++staticint+nicvf_dev_start(structrte_eth_dev*dev)+{+uint16_tqidx;+intret;+size_ti;+structnicvf*nic=nicvf_pmd_priv(dev);+structrte_eth_rxmode*rx_conf=&dev->data->dev_conf.rxmode;+uint16_tmtu;+uint32_tbuffsz=0,rbdrsz=0;+structrte_pktmbuf_pool_private*mbp_priv;+structnicvf_rxq*rxq;++PMD_INIT_FUNC_TRACE();++/* This function must be called for a primary device */+assert_if_secondary(nic);++/* Validate RBDR buff size */+for(qidx=0;qidx<dev->data->nb_rx_queues;qidx++){+rxq=dev->data->rx_queues[qidx];+mbp_priv=rte_mempool_get_priv(rxq->pool);+buffsz=mbp_priv->mbuf_data_room_size-RTE_PKTMBUF_HEADROOM;+if(buffsz%128){+PMD_INIT_LOG(ERR,"rxbuf size must be multiply of 128");+return-EINVAL;+}+if(rbdrsz==0)+rbdrsz=buffsz;+if(rbdrsz!=buffsz){+PMD_INIT_LOG(ERR,"buffsz not same, qidx=%d (%d/%d)",+qidx,rbdrsz,buffsz);+return-EINVAL;+}+}/* Configure loopback */ret=nicvf_loopback_config(nic,dev->data->dev_conf.lpbk_mode);if(ret){PMD_INIT_LOG(ERR,"Failed to configure loopback %d",ret);-gotoqset_rss_error;+returnret;}/* Reset all statistics counters attached to this port */ret=nicvf_mbox_reset_stat_counters(nic,0x3FFF,0x1F,0xFFFF,0xFFFF);if(ret){PMD_INIT_LOG(ERR,"Failed to reset stat counters %d",ret);-gotoqset_rss_error;+returnret;}/* Setup scatter mode if needed by jumbo */
@@ -1457,33 +1545,23 @@ nicvf_dev_start(struct rte_eth_dev *dev)return-EBUSY;}+ret=nicvf_vf_start(dev,nic,rbdrsz);+if(ret!=0)+returnret;++for(i=0;i<nic->sqs_count;i++){+assert(nic->snicvf[i]);++ret=nicvf_vf_start(dev,nic->snicvf[i],rbdrsz);+if(ret!=0)+returnret;+}+/* Configure callbacks based on scatter mode */nicvf_set_tx_function(dev);nicvf_set_rx_function(dev);-/* Done; Let PF make the BGX's RX and TX switches to ON position */-nicvf_mbox_cfg_done(nic);return0;--qset_rss_error:-nicvf_rss_term(nic);-start_txq_error:-for(qidx=0;qidx<dev->data->nb_tx_queues;qidx++)-nicvf_vf_stop_tx_queue(dev,nic,qidx);-start_rxq_error:-for(qidx=0;qidx<dev->data->nb_rx_queues;qidx++)-nicvf_vf_stop_rx_queue(dev,nic,qidx);-qset_rbdr_reclaim:-nicvf_qset_rbdr_reclaim(nic,0);-nicvf_rbdr_release_mbufs(dev,nic);-qset_rbdr_free:-if(nic->rbdr){-rte_free(nic->rbdr);-nic->rbdr=NULL;-}-qset_reclaim:-nicvf_qset_reclaim(nic);-returnret;}staticvoid
@@ -507,7 +512,8 @@ nicvf_qset_cq_alloc(struct rte_eth_dev *dev, struct nicvf *nic,conststructrte_memzone*rz;uint32_tring_size=CMP_QUEUE_SZ_MAX*sizeof(unioncq_entry_t);-rz=rte_eth_dma_zone_reserve(dev,"cq_ring",qidx,ring_size,+rz=rte_eth_dma_zone_reserve(dev,"cq_ring",+nicvf_netdev_qidx(nic,qidx),ring_size,NICVF_CQ_BASE_ALIGN_BYTES,nic->node);if(rz==NULL){PMD_INIT_LOG(ERR,"Failed to allocate mem for cq hw ring");
@@ -530,8 +536,9 @@ nicvf_qset_sq_alloc(struct rte_eth_dev *dev, struct nicvf *nic,conststructrte_memzone*rz;uint32_tring_size=SND_QUEUE_SZ_MAX*sizeof(unionsq_entry_t);-rz=rte_eth_dma_zone_reserve(dev,"sq",qidx,ring_size,-NICVF_SQ_BASE_ALIGN_BYTES,nic->node);+rz=rte_eth_dma_zone_reserve(dev,"sq",+nicvf_netdev_qidx(nic,qidx),ring_size,+NICVF_SQ_BASE_ALIGN_BYTES,nic->node);if(rz==NULL){PMD_INIT_LOG(ERR,"Failed allocate mem for sq hw ring");return-ENOMEM;
@@ -563,8 +570,9 @@ nicvf_qset_rbdr_alloc(struct rte_eth_dev *dev, struct nicvf *nic,}ring_size=sizeof(structrbdr_entry_t)*RBDR_QUEUE_SZ_MAX;-rz=rte_eth_dma_zone_reserve(dev,"rbdr",0,ring_size,-NICVF_RBDR_BASE_ALIGN_BYTES,nic->node);+rz=rte_eth_dma_zone_reserve(dev,"rbdr",+nicvf_netdev_qidx(nic,0),ring_size,+NICVF_RBDR_BASE_ALIGN_BYTES,nic->node);if(rz==NULL){PMD_INIT_LOG(ERR,"Failed to allocate mem for rbdr desc ring");return-ENOMEM;
@@ -1678,12 +1686,37 @@ nicvf_dev_close(struct rte_eth_dev *dev)}staticint+nicvf_request_sqs(structnicvf*nic)+{+size_ti;++assert_if_secondary(nic);+assert(nic->sqs_count>0);+assert(nic->sqs_count<=MAX_SQS_PER_VF);++/* Set no of Rx/Tx queues in each of the SQsets */+for(i=0;i<nic->sqs_count;i++){+if(nicvf_svf_empty())+rte_panic("Cannot assign sufficient number of "+"secondary queues to primary VF%"PRIu8"\n",+nic->vf_id);++nic->snicvf[i]=nicvf_svf_pop();+nic->snicvf[i]->sqs_id=i;+}++returnnicvf_mbox_request_sqs(nic);+}++staticintnicvf_dev_configure(structrte_eth_dev*dev){-structrte_eth_conf*conf=&dev->data->dev_conf;+structrte_eth_dev_data*data=dev->data;+structrte_eth_conf*conf=&data->dev_conf;structrte_eth_rxmode*rxmode=&conf->rxmode;structrte_eth_txmode*txmode=&conf->txmode;structnicvf*nic=nicvf_pmd_priv(dev);+uint8_tcqcount;PMD_INIT_FUNC_TRACE();
@@ -1748,6 +1781,26 @@ nicvf_dev_configure(struct rte_eth_dev *dev)return-EINVAL;}+assert_if_secondary(nic);+NICVF_STATIC_ASSERT(MAX_RCV_QUEUES_PER_QS==MAX_SND_QUEUES_PER_QS);+cqcount=RTE_MAX(data->nb_tx_queues,data->nb_rx_queues);+if(cqcount>MAX_RCV_QUEUES_PER_QS){+nic->sqs_count=RTE_ALIGN_CEIL(cqcount,MAX_RCV_QUEUES_PER_QS);+nic->sqs_count=(nic->sqs_count/MAX_RCV_QUEUES_PER_QS)-1;+}else{+nic->sqs_count=0;+}++assert(nic->sqs_count<=MAX_SQS_PER_VF);++if(nic->sqs_count>0){+if(nicvf_request_sqs(nic)){+rte_panic("Cannot assign sufficient number of "+"secondary queues to PORT%d VF%"PRIu8"\n",+dev->data->port_id,nic->vf_id);+}+}+PMD_INIT_LOG(DEBUG,"Configured ethdev port%d hwcap=0x%"PRIx64,dev->data->port_id,nicvf_hw_cap(nic));
@@ -236,9 +236,15 @@ nicvf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)structnicvf_hw_tx_qstatstx_qstats;structnicvf_hw_statsport_stats;structnicvf*nic=nicvf_pmd_priv(dev);+uint16_trx_start,rx_end;+uint16_ttx_start,tx_end;+size_ti;++/* RX queue indices for the first VF */+nicvf_rx_range(dev,nic,&rx_start,&rx_end);/* Reading per RX ring stats */-for(qidx=0;qidx<dev->data->nb_rx_queues;qidx++){+for(qidx=rx_start;qidx<=rx_end;qidx++){if(qidx==RTE_ETHDEV_QUEUE_STAT_CNTRS)break;
@@ -247,8 +253,11 @@ nicvf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)stats->q_ipackets[qidx]=rx_qstats.q_rx_packets;}+/* TX queue indices for the first VF */+nicvf_tx_range(dev,nic,&tx_start,&tx_end);+/* Reading per TX ring stats */-for(qidx=0;qidx<dev->data->nb_tx_queues;qidx++){+for(qidx=tx_start;qidx<=tx_end;qidx++){if(qidx==RTE_ETHDEV_QUEUE_STAT_CNTRS)break;
@@ -257,6 +266,40 @@ nicvf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)stats->q_opackets[qidx]=tx_qstats.q_tx_packets;}+for(i=0;i<nic->sqs_count;i++){+structnicvf*snic=nic->snicvf[i];++if(snic==NULL)+break;++/* RX queue indices for a secondary VF */+nicvf_rx_range(dev,snic,&rx_start,&rx_end);++/* Reading per RX ring stats */+for(qidx=rx_start;qidx<=rx_end;qidx++){+if(qidx==RTE_ETHDEV_QUEUE_STAT_CNTRS)+break;++nicvf_hw_get_rx_qstats(snic,&rx_qstats,+qidx%MAX_RCV_QUEUES_PER_QS);+stats->q_ibytes[qidx]=rx_qstats.q_rx_bytes;+stats->q_ipackets[qidx]=rx_qstats.q_rx_packets;+}++/* TX queue indices for a secondary VF */+nicvf_tx_range(dev,snic,&tx_start,&tx_end);+/* Reading per TX ring stats */+for(qidx=tx_start;qidx<=tx_end;qidx++){+if(qidx==RTE_ETHDEV_QUEUE_STAT_CNTRS)+break;++nicvf_hw_get_tx_qstats(snic,&tx_qstats,+qidx%MAX_SND_QUEUES_PER_QS);+stats->q_obytes[qidx]=tx_qstats.q_tx_bytes;+stats->q_opackets[qidx]=tx_qstats.q_tx_packets;+}+}+nicvf_hw_get_stats(nic,&port_stats);stats->ibytes=port_stats.rx_bytes;stats->ipackets=port_stats.rx_ucast_frames;
@@ -322,13 +365,36 @@ nicvf_dev_stats_reset(struct rte_eth_dev *dev)inti;uint16_trxqs=0,txqs=0;structnicvf*nic=nicvf_pmd_priv(dev);+uint16_trx_start,rx_end;+uint16_ttx_start,tx_end;-for(i=0;i<dev->data->nb_rx_queues;i++)+/* Reset all primary nic counters */+nicvf_rx_range(dev,nic,&rx_start,&rx_end);+for(i=rx_start;i<=rx_end;i++)rxqs|=(0x3<<(i*2));-for(i=0;i<dev->data->nb_tx_queues;i++)++nicvf_tx_range(dev,nic,&tx_start,&tx_end);+for(i=tx_start;i<=tx_end;i++)txqs|=(0x3<<(i*2));nicvf_mbox_reset_stat_counters(nic,0x3FFF,0x1F,rxqs,txqs);++/* Reset secondary nic queue counters */+for(i=0;i<nic->sqs_count;i++){+structnicvf*snic=nic->snicvf[i];+if(snic==NULL)+break;++nicvf_rx_range(dev,snic,&rx_start,&rx_end);+for(i=rx_start;i<=rx_end;i++)+rxqs|=(0x3<<((i%MAX_CMP_QUEUES_PER_QS)*2));++nicvf_tx_range(dev,snic,&tx_start,&tx_end);+for(i=tx_start;i<=tx_end;i++)+txqs|=(0x3<<((i%MAX_SND_QUEUES_PER_QS)*2));++nicvf_mbox_reset_stat_counters(snic,0,0,rxqs,txqs);+}}/* Promiscuous mode enabled by default in LMAC to VF 1:1 map configuration */
@@ -596,14 +662,18 @@ nicvf_qset_rbdr_alloc(struct rte_eth_dev *dev, struct nicvf *nic,}staticvoid-nicvf_rbdr_release_mbuf(structrte_eth_dev*dev,structnicvf*nic__rte_unused,+nicvf_rbdr_release_mbuf(structrte_eth_dev*dev,structnicvf*nic,nicvf_phys_addr_tphy){uint16_tqidx;void*obj;structnicvf_rxq*rxq;+uint16_trx_start,rx_end;-for(qidx=0;qidx<dev->data->nb_rx_queues;qidx++){+/* Get queue ranges for this VF */+nicvf_rx_range(dev,nic,&rx_start,&rx_end);++for(qidx=rx_start;qidx<=rx_end;qidx++){rxq=dev->data->rx_queues[qidx];if(rxq->precharge_cnt){obj=(void*)nicvf_mbuff_phy2virt(phy,
@@ -1284,9 +1377,13 @@ rbdr_rte_mempool_get(void *dev, void *opaque)uintptr_tmbuf;structnicvf_rxq*rxq;structrte_eth_dev*eth_dev=(structrte_eth_dev*)dev;-structnicvf*nic__rte_unused=(structnicvf*)opaque;+structnicvf*nic=(structnicvf*)opaque;+uint16_trx_start,rx_end;++/* Get queue ranges for this VF */+nicvf_rx_range(eth_dev,nic,&rx_start,&rx_end);-for(qidx=0;qidx<eth_dev->data->nb_rx_queues;qidx++){+for(qidx=rx_start;qidx<=rx_end;qidx++){rxq=eth_dev->data->rx_queues[qidx];/* Maintain equal buffer count across all pools */if(rxq->precharge_cnt>=rxq->qlen_mask)
@@ -1852,7 +1949,9 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev)/* Setup callbacks for secondary process */nicvf_set_tx_function(eth_dev);nicvf_set_rx_function(eth_dev);-return0;+/* If nic == NULL than it is secondary function+*soethdevneedtobereleasedbycaller*/+returnnic!=NULL?0:ENOTSUP;}pci_dev=eth_dev->pci_dev;
@@ -1898,10 +1997,21 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev)}if(nic->sqs_mode){-PMD_INIT_LOG(INFO,"Unsupported SQS VF detected, Detaching...");-/* Detach port by returning Positive error number */-ret=ENOTSUP;-gotoalarm_fail;+/* Push nic to stack of secondary vfs */+nicvf_svf_push(nic);++/* Steal nic pointer from the device for further reuse */+eth_dev->data->dev_private=NULL;++nicvf_periodic_alarm_stop(nicvf_interrupt,eth_dev);+ret=nicvf_periodic_alarm_start(nicvf_vf_interrupt,nic);+if(ret){+PMD_INIT_LOG(ERR,"Failed to start period alarm");+gotofail;+}++/* Detach port by returning postive error number */+returnENOTSUP;}eth_dev->data->mac_addrs=rte_zmalloc("mac_addr",ETHER_ADDR_LEN,0);
@@ -56,6 +56,7 @@ Features of the ThunderX PMD are:- VLAN stripping- SR-IOV VF- NUMA support+- Multi queue set support (up to 96 queues (12 queue sets)) per port Supported ThunderX SoCs -----------------------
@@ -322,6 +323,112 @@ This section provides instructions to configure SR-IOV with Linux OS.#. Refer to section :ref:`Running testpmd <thunderx_testpmd_example>` for instruction how to launch ``testpmd`` application.+Multiple Queue Set per DPDK port configuration+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~++There are two types of VFs:++- Primary VF+- Secondary VF++Each port consist of a primary VF and n secondary VF(s). Each VF provides 8 Tx/Rx queues to a port.+In case port is configured to use more than 8 queues, then it requires one (or more)+secondary VF. Each secondary VF adds additional 8 queues to the queue set.++During PMD driver initialization, the primary VF's are enumerated by checking the+specific flag (see sqs message in DPDK boot log - sqs indicates secondary queue set).+They are at the beginning of VF list (the remain ones are secondary VF's).++The primary VFs are used as master queue sets. Secondary VFs provid+additional queue sets for primary ones. If a port is configured for more then+8 queues than it will request for additional queues from secondary VFs.++Secondary VFs cannot be shared between primary VFs.++Primary VFs are present on the beginning of the 'Network devices using kernel+driver' list, secondary VFs are on the remaining on the remaining part of the list.++ ..note::++ The VNIC driver in the multiqueue setup works differently than other drivers like `ixgbe`.+ We need to bind separately each specific queue set device with the ``tools/dpdk-devbind.py`` utility.++ ..note::++ Depending on the hardware used, the kernel driver sets a threshold ``vf_id``. VFs that try to attached with an id below or equal to+ this boundary are considered primary VFs. VFs that try to attach with an id above this boundary are considered secondary VFs.+++Example device binding+~~~~~~~~~~~~~~~~~~~~~~++If a system has three interfaces, a total of 18 VF devices will be created+on a non-NUMA machine.++ ..note::++ NUMA systems have 12 VFs per port and non-NUMA 6 VFs per port.++ ..code-block:: console++ # tools/dpdk-devbind.py --status++ Network devices using DPDK-compatible driver+ ============================================+ <none>++ Network devices using kernel driver+ ===================================+ 0000:01:10.0 'Device a026' if= drv=thunder-BGX unused=vfio-pci,uio_pci_generic+ 0000:01:10.1 'Device a026' if= drv=thunder-BGX unused=vfio-pci,uio_pci_generic+ 0002:01:00.0 'Device a01e' if= drv=thunder-nic unused=vfio-pci,uio_pci_generic+ 0002:01:00.1 'Device 0011' if=eth0 drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:00.2 'Device 0011' if=eth1 drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:00.3 'Device 0011' if=eth2 drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:00.4 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:00.5 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:00.6 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:00.7 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:01.0 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:01.1 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:01.2 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:01.3 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:01.4 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:01.5 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:01.6 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:01.7 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:02.0 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:02.1 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:02.2 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic++ Other network devices+ =====================+ 0002:00:03.0 'Device a01f' unused=vfio-pci,uio_pci_generic+++We want to bind two physical interfaces with 24 queues each device, we attach two primary VFs+and four secondary queues. In our example we choose two 10G interfaces eth1 (0002:01:00.2) and eth2 (0002:01:00.3).+We will chose four secondary queue sets from the ending of the list (0002:01:01.7-0002:01:02.2).+++#. Bind two primary VFs to the ``vfio-pci`` driver:++ ..code-block:: console++ tools/dpdk-devbind.py -b vfio-pci 0002:01:00.2+ tools/dpdk-devbind.py -b vfio-pci 0002:01:00.3++#. Bind four primary VFs to the ``vfio-pci`` driver:++ ..code-block:: console++ tools/dpdk-devbind.py -b vfio-pci 0002:01:01.7+ tools/dpdk-devbind.py -b vfio-pci 0002:01:02.0+ tools/dpdk-devbind.py -b vfio-pci 0002:01:02.1+ tools/dpdk-devbind.py -b vfio-pci 0002:01:02.2++The nicvf thunderx driver will make use of attached secondary VFs automatically during the interface configuration stage.+ Limitations -----------
@@ -346,10 +453,3 @@ Maximum packet segments The ThunderX SoC family NICs support up to 12 segments per packet when working in scatter/gather mode. So, setting MTU will result with ``EINVAL`` when the frame size does not fit in the maximum number of segments.--Limited VFs-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--The ThunderX SoC family NICs has 128VFs and each VF has 8/8 queues-for RX/TX respectively. Current driver implementation has one to one mapping-between physical port and VF hence only limited VFs can be used.
ping
W dniu 26.08.2016 o 18:53, Kamil Rytarowski pisze:
This series of patches adds support for secondary queue set in nicvf thunderx
driver
There are two types of VFs:
- Primary VF
- Secondary VF
Each port consist of a primary VF and n secondary VF(s). Each VF provides 8
Tx/Rx queues to a port. In case port is configured to use more than 8 queues,
then it requires one (or more) secondary VF. Each secondary VF adds additional
8 queues to the queue set.
During PMD driver initialization, the primary VF's are enumerated by checking the
specific flag (see READY message). They are at the beginning of VF list (the remain
ones are secondary VF's).
The primary VFs are used as master queue sets. Secondary VFs provide
additional queue sets for primary ones. If a port is configured for more then
8 queues then it will request for additional queues from secondary VFs.
Secondary VFs cannot be shared between primary VFs.
Primary VFs are present on the tail of the 'Network devices using kernel
driver' list, secondary VFs are on the remaining tail of the list.
The VNIC driver in the multiqueue setup works differently than other drivers
like `ixgbe`. We need to bind separately each specific queue set device with
the ``tools/dpdk-devbind.py`` utility.
Depending on the hardware used, the kernel driver sets a threshold ``vf_id``.
VFs that try to attach with an id below or equal to this boundary are
considered primary VFs. VFs that try to attach with an id above this boundary
are considered secondary VFs.
This patchset also contains other cleanups and improvements like fixing
erroneous checksum calculation and preparing the thunderx driver for the multi
queue set feature support.
These changes base on the following pending patches:
[dpdk-dev,1/3] net/thunderx: remove generic passx references from the driver
http://dpdk.org/dev/patchwork/patch/14963/
[dpdk-dev,2/3] net/thunderx: introduce cqe_rx2 HW capability flag
http://dpdk.org/dev/patchwork/patch/14964/
[dpdk-dev,3/3] net/thunderx: add 81xx SoC support
http://dpdk.org/dev/patchwork/patch/14965/
Kamil Rytarowski (13):
net/thunderx: cleanup the driver before adding new features
net/thunderx: correct transmit checksum handling
net/thunderx/base: add family of functions to store qsets
net/thunderx/base: add secondary queue set support
net/thunderx: add family of functions to store DPDK qsets
net/thunderx: add secondary queue set in interrupt functions
net/thunderx: fix multiprocess support in stats
net/thunderx: add helper utils for secondary qset support
net/thunderx: add secondary qset support in dev stop/close
net/thunderx: add secondary qset support in device start
net/thunderx: add secondary qset support in device configure
net/thunderx: add final bits for secondary queue support
net/thunderx: document secondary queue set support
doc/guides/nics/thunderx.rst | 114 ++++-
drivers/net/thunderx/Makefile | 2 +
drivers/net/thunderx/base/nicvf_bsvf.c | 72 +++
drivers/net/thunderx/base/nicvf_bsvf.h | 76 +++
drivers/net/thunderx/base/nicvf_hw.c | 10 +-
drivers/net/thunderx/base/nicvf_hw.h | 6 +-
drivers/net/thunderx/base/nicvf_hw_defs.h | 1 +
drivers/net/thunderx/base/nicvf_mbox.c | 34 +-
drivers/net/thunderx/base/nicvf_mbox.h | 21 +-
drivers/net/thunderx/nicvf_ethdev.c | 753 +++++++++++++++++++++---------
drivers/net/thunderx/nicvf_ethdev.h | 39 ++
drivers/net/thunderx/nicvf_rxtx.c | 14 +-
drivers/net/thunderx/nicvf_struct.h | 6 +-
drivers/net/thunderx/nicvf_svf.c | 78 ++++
drivers/net/thunderx/nicvf_svf.h | 66 +++
15 files changed, 1046 insertions(+), 246 deletions(-)
create mode 100644 drivers/net/thunderx/base/nicvf_bsvf.c
create mode 100644 drivers/net/thunderx/base/nicvf_bsvf.h
create mode 100644 drivers/net/thunderx/nicvf_svf.c
create mode 100644 drivers/net/thunderx/nicvf_svf.h
ping
W dniu 12.09.2016 o 12:59, Kamil Rytarowski pisze:
ping
W dniu 26.08.2016 o 18:53, Kamil Rytarowski pisze:
quoted
This series of patches adds support for secondary queue set in nicvf thunderx
driver
There are two types of VFs:
- Primary VF
- Secondary VF
Each port consist of a primary VF and n secondary VF(s). Each VF provides 8
Tx/Rx queues to a port. In case port is configured to use more than 8 queues,
then it requires one (or more) secondary VF. Each secondary VF adds additional
8 queues to the queue set.
During PMD driver initialization, the primary VF's are enumerated by checking the
specific flag (see READY message). They are at the beginning of VF list (the remain
ones are secondary VF's).
The primary VFs are used as master queue sets. Secondary VFs provide
additional queue sets for primary ones. If a port is configured for more then
8 queues then it will request for additional queues from secondary VFs.
Secondary VFs cannot be shared between primary VFs.
Primary VFs are present on the tail of the 'Network devices using kernel
driver' list, secondary VFs are on the remaining tail of the list.
The VNIC driver in the multiqueue setup works differently than other drivers
like `ixgbe`. We need to bind separately each specific queue set device with
the ``tools/dpdk-devbind.py`` utility.
Depending on the hardware used, the kernel driver sets a threshold ``vf_id``.
VFs that try to attach with an id below or equal to this boundary are
considered primary VFs. VFs that try to attach with an id above this boundary
are considered secondary VFs.
This patchset also contains other cleanups and improvements like fixing
erroneous checksum calculation and preparing the thunderx driver for the multi
queue set feature support.
These changes base on the following pending patches:
[dpdk-dev,1/3] net/thunderx: remove generic passx references from the driver
http://dpdk.org/dev/patchwork/patch/14963/
[dpdk-dev,2/3] net/thunderx: introduce cqe_rx2 HW capability flag
http://dpdk.org/dev/patchwork/patch/14964/
[dpdk-dev,3/3] net/thunderx: add 81xx SoC support
http://dpdk.org/dev/patchwork/patch/14965/
Kamil Rytarowski (13):
net/thunderx: cleanup the driver before adding new features
net/thunderx: correct transmit checksum handling
net/thunderx/base: add family of functions to store qsets
net/thunderx/base: add secondary queue set support
net/thunderx: add family of functions to store DPDK qsets
net/thunderx: add secondary queue set in interrupt functions
net/thunderx: fix multiprocess support in stats
net/thunderx: add helper utils for secondary qset support
net/thunderx: add secondary qset support in dev stop/close
net/thunderx: add secondary qset support in device start
net/thunderx: add secondary qset support in device configure
net/thunderx: add final bits for secondary queue support
net/thunderx: document secondary queue set support
doc/guides/nics/thunderx.rst | 114 ++++-
drivers/net/thunderx/Makefile | 2 +
drivers/net/thunderx/base/nicvf_bsvf.c | 72 +++
drivers/net/thunderx/base/nicvf_bsvf.h | 76 +++
drivers/net/thunderx/base/nicvf_hw.c | 10 +-
drivers/net/thunderx/base/nicvf_hw.h | 6 +-
drivers/net/thunderx/base/nicvf_hw_defs.h | 1 +
drivers/net/thunderx/base/nicvf_mbox.c | 34 +-
drivers/net/thunderx/base/nicvf_mbox.h | 21 +-
drivers/net/thunderx/nicvf_ethdev.c | 753 +++++++++++++++++++++---------
drivers/net/thunderx/nicvf_ethdev.h | 39 ++
drivers/net/thunderx/nicvf_rxtx.c | 14 +-
drivers/net/thunderx/nicvf_struct.h | 6 +-
drivers/net/thunderx/nicvf_svf.c | 78 ++++
drivers/net/thunderx/nicvf_svf.h | 66 +++
15 files changed, 1046 insertions(+), 246 deletions(-)
create mode 100644 drivers/net/thunderx/base/nicvf_bsvf.c
create mode 100644 drivers/net/thunderx/base/nicvf_bsvf.h
create mode 100644 drivers/net/thunderx/nicvf_svf.c
create mode 100644 drivers/net/thunderx/nicvf_svf.h
@@ -1087,9 +1084,9 @@ nicvf_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx,PMD_DRV_LOG(WARNING,"socket_id expected %d, configured %d",socket_id,nic->node);-/* Mempool memory should be contiguous */-if(mp->nb_mem_chunks!=1){-PMD_INIT_LOG(ERR,"Non contiguous mempool, check huge page sz");+/* Mempool memory must be contiguous */+if(mp->flags&MEMPOOL_F_NO_PHYS_CONTIG){
If you need continuous memory, this check is not enough.
Not having this flag doesn't guaranties that memory is continuous, this
flag can be set but still can have multiple mem_chunks. And there is no
guarantee that mem_chunks are continuous.
quoted hunk
+ PMD_INIT_LOG(ERR, "Mempool memory must be contiguous"); return -EINVAL; }
@@ -1354,8 +1352,8 @@ nicvf_dev_start(struct rte_eth_dev *dev) } /* Fill rte_mempool buffers in RBDR pool and precharge it */- ret = nicvf_qset_rbdr_precharge(nic, 0, rbdr_rte_mempool_get,- dev, total_rxq_desc);+ ret = nicvf_qset_rbdr_precharge(dev, nic, 0, rbdr_rte_mempool_get,+ total_rxq_desc); if (ret) { PMD_INIT_LOG(ERR, "Failed to fill rbdr %d", ret); goto qset_rbdr_reclaim;
@@ -1721,12 +1719,6 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev) goto malloc_fail; }- ret = nicvf_mbox_get_rss_size(nic);- if (ret) {- PMD_INIT_LOG(ERR, "Failed to get rss table size");- goto malloc_fail;- }-
Is removing mbox_get_rss_size() mentioned in commit log?
From: Kamil Rytarowski <redacted>
In case of the multiprocess mode a shared nicvf struct between processes
cannot point with the eth_dev pointer to master device, therefore remove it
allong with references to it refactoring the code where needed.
Patch subject says fix multiprocess support in stat, but it seems doing
more than just for stats fix.
Overall eliminates private_data->eht_dev link.
I guess this is because eth_dev->data is shared for primary and
secondary processes, and this makes impossible to use separate
private_data for primary and secondaries.
So this patch looks like keeping separate copy of private_data (nic) and
using eth_dev and nic structs for functions instead of using
eth_dev->data->private_data.
If above correct, can you please updated patch subject?
Also another approach can be allocating "data" independently and
overwrite eth_dev->data with this per each process, this also makes
eth_dev->data->private_data usable for each process.
From: Mcnamara, John <hidden> Date: 2016-09-26 20:17:05
-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Kamil Rytarowski
Sent: Friday, August 26, 2016 5:54 PM
To: dev@dpdk.org
Cc: maciej.czekaj@caviumnetworks.com; zyta.szpak@semihalf.com;
slawomir.rosek@semihalf.com; rad@semihalf.com;
jerin.jacob@caviumnetworks.com; Kamil Rytarowski
[off-list ref]
Subject: [dpdk-dev] [PATCH 13/13] net/thunderx: document secondary queue
set support
There are some whitespace errors in the docs:
Applying patch #15435 using 'git am'
Description: [dpdk-dev,13/13] net/thunderx: document secondary queue set support
Applying: net/thunderx: document secondary queue set support
.git/rebase-apply/patch:70: trailing whitespace.
.git/rebase-apply/patch:74: trailing whitespace.
.git/rebase-apply/patch:98: trailing whitespace.
Some other minor comments below.
quoted hunk
Supported ThunderX SoCs
-----------------------
@@ -322,6 +323,112 @@ This section provides instructions to configure SR-
IOV with Linux OS.
#. Refer to section :ref:`Running testpmd <thunderx_testpmd_example>` for
instruction
how to launch ``testpmd`` application.
+Multiple Queue Set per DPDK port configuration
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+There are two types of VFs:
+
+- Primary VF
+- Secondary VF
+
+Each port consist of a primary VF and n secondary VF(s). Each VF provides
s/consist/consists/
8 Tx/Rx queues to a port.
+In case port is configured to use more than 8 queues, then it requires
+one (or more) secondary VF. Each secondary VF adds additional 8 queues to
the queue set.
There are a few missing definite and indefinite articles missing in the text.
+
+During PMD driver initialization, the primary VF's are enumerated by
+checking the specific flag (see sqs message in DPDK boot log - sqs
indicates secondary queue set).
+They are at the beginning of VF list (the remain ones are secondary
VF's).
+
+The primary VFs are used as master queue sets. Secondary VFs provid
s/provid/provide/
+additional queue sets for primary ones. If a port is configured for
+more then
+8 queues than it will request for additional queues from secondary VFs.
+
+Secondary VFs cannot be shared between primary VFs.
+
+Primary VFs are present on the beginning of the 'Network devices using
+kernel driver' list, secondary VFs are on the remaining on the remaining
part of the list.
+
+ .. note::
+
This note and the following one are indented too far. They should be aligned with the margin.
...
quoted hunk
+Example device binding+~~~~~~~~~~~~~~~~~~~~~~++If a system has three interfaces, a total of 18 VF devices will be+created on a non-NUMA machine.++ .. note::++ NUMA systems have 12 VFs per port and non-NUMA 6 VFs per port.++ .. code-block:: console
This note and code block are indented too far. They should be aligned with the margin.
@@ -1087,9 +1084,9 @@ nicvf_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx,PMD_DRV_LOG(WARNING,"socket_id expected %d, configured %d",socket_id,nic->node);-/* Mempool memory should be contiguous */-if(mp->nb_mem_chunks!=1){-PMD_INIT_LOG(ERR,"Non contiguous mempool, check huge page sz");+/* Mempool memory must be contiguous */+if(mp->flags&MEMPOOL_F_NO_PHYS_CONTIG){
If you need continuous memory, this check is not enough.
Not having this flag doesn't guaranties that memory is continuous, this
flag can be set but still can have multiple mem_chunks. And there is no
guarantee that mem_chunks are continuous.
True, we need both checks:
mp->nb_mem_chunks == 1 && !MEMPOOL_F_NO_PHYS_CONTIG.
Will fix in v2.
quoted
+ PMD_INIT_LOG(ERR, "Mempool memory must be contiguous"); return -EINVAL; }
@@ -1354,8 +1352,8 @@ nicvf_dev_start(struct rte_eth_dev *dev) } /* Fill rte_mempool buffers in RBDR pool and precharge it */- ret = nicvf_qset_rbdr_precharge(nic, 0, rbdr_rte_mempool_get,- dev, total_rxq_desc);+ ret = nicvf_qset_rbdr_precharge(dev, nic, 0, rbdr_rte_mempool_get,+ total_rxq_desc); if (ret) { PMD_INIT_LOG(ERR, "Failed to fill rbdr %d", ret); goto qset_rbdr_reclaim;
@@ -1721,12 +1719,6 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev) goto malloc_fail; }- ret = nicvf_mbox_get_rss_size(nic);- if (ret) {- PMD_INIT_LOG(ERR, "Failed to get rss table size");- goto malloc_fail;- }-
Is removing mbox_get_rss_size() mentioned in commit log?
This chage remove spare function call but is not mentioned.
Will add a comment in v2.
From: Maciej Czekaj <hidden> Date: 2016-09-29 14:35:44
On 8/26/2016 5:54 PM, Kamil Rytarowski wrote:
quoted
From: Kamil Rytarowski <redacted>
In case of the multiprocess mode a shared nicvf struct between processes
cannot point with the eth_dev pointer to master device, therefore remove it
allong with references to it refactoring the code where needed.
Patch subject says fix multiprocess support in stat, but it seems doing
more than just for stats fix.
Overall eliminates private_data->eht_dev link.
I guess this is because eth_dev->data is shared for primary and
secondary processes, and this makes impossible to use separate
private_data for primary and secondaries.
So this patch looks like keeping separate copy of private_data (nic) and
using eth_dev and nic structs for functions instead of using
eth_dev->data->private_data.
If above correct, can you please updated patch subject?
Also another approach can be allocating "data" independently and
overwrite eth_dev->data with this per each process, this also makes
eth_dev->data->private_data usable for each process.
Yes, this patch enables multi-process support for primary and secondary functions by eliminating the pointer from private struct to eth_dev.
Will extend the comment in v2.
From: Maciej Czekaj <hidden> Date: 2016-09-29 14:39:13
We will address all the issues in v2.
quoted
-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Kamil Rytarowski
Sent: Friday, August 26, 2016 5:54 PM
To: dev@dpdk.org
Cc: maciej.czekaj@caviumnetworks.com; zyta.szpak@semihalf.com;
slawomir.rosek@semihalf.com; rad@semihalf.com;
jerin.jacob@caviumnetworks.com; Kamil Rytarowski
[off-list ref]
Subject: [dpdk-dev] [PATCH 13/13] net/thunderx: document secondary queue
set support
There are some whitespace errors in the docs:
Applying patch #15435 using 'git am'
Description: [dpdk-dev,13/13] net/thunderx: document secondary queue set support
Applying: net/thunderx: document secondary queue set support
.git/rebase-apply/patch:70: trailing whitespace.
.git/rebase-apply/patch:74: trailing whitespace.
.git/rebase-apply/patch:98: trailing whitespace.
Some other minor comments below.
quoted
Supported ThunderX SoCs
-----------------------
@@ -322,6 +323,112 @@ This section provides instructions to configure SR-
IOV with Linux OS.
#. Refer to section :ref:`Running testpmd <thunderx_testpmd_example>` for
instruction
how to launch ``testpmd`` application.
+Multiple Queue Set per DPDK port configuration
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+There are two types of VFs:
+
+- Primary VF
+- Secondary VF
+
+Each port consist of a primary VF and n secondary VF(s). Each VF provides
s/consist/consists/
quoted
8 Tx/Rx queues to a port.
+In case port is configured to use more than 8 queues, then it requires
+one (or more) secondary VF. Each secondary VF adds additional 8 queues to
the queue set.
There are a few missing definite and indefinite articles missing in the text.
quoted
+
+During PMD driver initialization, the primary VF's are enumerated by
+checking the specific flag (see sqs message in DPDK boot log - sqs
indicates secondary queue set).
+They are at the beginning of VF list (the remain ones are secondary
VF's).
+
+The primary VFs are used as master queue sets. Secondary VFs provid
s/provid/provide/
quoted
+additional queue sets for primary ones. If a port is configured for
+more then
+8 queues than it will request for additional queues from secondary VFs.
+
+Secondary VFs cannot be shared between primary VFs.
+
+Primary VFs are present on the beginning of the 'Network devices using
+kernel driver' list, secondary VFs are on the remaining on the remaining
part of the list.
+
+ .. note::
+
This note and the following one are indented too far. They should be aligned with the margin.
quoted
...
quoted
+Example device binding+~~~~~~~~~~~~~~~~~~~~~~++If a system has three interfaces, a total of 18 VF devices will be+created on a non-NUMA machine.++ .. note::++ NUMA systems have 12 VFs per port and non-NUMA 6 VFs per port.++ .. code-block:: console
This note and code block are indented too far. They should be aligned with the margin.
@@ -1087,9 +1085,15 @@ nicvf_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx,PMD_DRV_LOG(WARNING,"socket_id expected %d, configured %d",socket_id,nic->node);-/* Mempool memory should be contiguous */+/* Mempool memory must be contiguous, so must be one memory segment*/if(mp->nb_mem_chunks!=1){-PMD_INIT_LOG(ERR,"Non contiguous mempool, check huge page sz");+PMD_INIT_LOG(ERR,"Non-contiguous mempool, add more huge pages");+return-EINVAL;+}++/* Mempool memory must be physically contiguous */+if(mp->flags&MEMPOOL_F_NO_PHYS_CONTIG){+PMD_INIT_LOG(ERR,"Mempool memory must be physically contiguous");return-EINVAL;}
@@ -1212,15 +1216,16 @@ nicvf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)}staticnicvf_phys_addr_t-rbdr_rte_mempool_get(void*opaque)+rbdr_rte_mempool_get(void*dev,void*opaque){uint16_tqidx;uintptr_tmbuf;structnicvf_rxq*rxq;-structnicvf*nic=nicvf_pmd_priv((structrte_eth_dev*)opaque);+structrte_eth_dev*eth_dev=(structrte_eth_dev*)dev;+structnicvf*nic__rte_unused=(structnicvf*)opaque;-for(qidx=0;qidx<nic->eth_dev->data->nb_rx_queues;qidx++){-rxq=nic->eth_dev->data->rx_queues[qidx];+for(qidx=0;qidx<eth_dev->data->nb_rx_queues;qidx++){+rxq=eth_dev->data->rx_queues[qidx];/* Maintain equal buffer count across all pools */if(rxq->precharge_cnt>=rxq->qlen_mask)continue;
@@ -1354,8 +1359,8 @@ nicvf_dev_start(struct rte_eth_dev *dev)}/* Fill rte_mempool buffers in RBDR pool and precharge it */-ret=nicvf_qset_rbdr_precharge(nic,0,rbdr_rte_mempool_get,-dev,total_rxq_desc);+ret=nicvf_qset_rbdr_precharge(dev,nic,0,rbdr_rte_mempool_get,+total_rxq_desc);if(ret){PMD_INIT_LOG(ERR,"Failed to fill rbdr %d",ret);gotoqset_rbdr_reclaim;
@@ -1721,12 +1726,6 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev)gotomalloc_fail;}-ret=nicvf_mbox_get_rss_size(nic);-if(ret){-PMD_INIT_LOG(ERR,"Failed to get rss table size");-gotomalloc_fail;-}-PMD_INIT_LOG(INFO,"Port %d (%x:%x) mac=%02x:%02x:%02x:%02x:%02x:%02x",eth_dev->data->port_id,nic->vendor_id,nic->device_id,nic->mac_addr[0],nic->mac_addr[1],nic->mac_addr[2],
This series of patches adds support for secondary queue set in nicvf thunderx
driver
There are two types of VFs:
- Primary VF
- Secondary VF
Each port consist of a primary VF and n secondary VF(s). Each VF provides 8
Tx/Rx queues to a port. In case port is configured to use more than 8 queues,
then it requires one (or more) secondary VF. Each secondary VF adds additional
8 queues to the queue set.
During PMD driver initialization, the primary VF's are enumerated by checking the
specific flag (see READY message). They are at the beginning of VF list (the remain
ones are secondary VF's).
The primary VFs are used as master queue sets. Secondary VFs provide
additional queue sets for primary ones. If a port is configured for more then
8 queues then it will request for additional queues from secondary VFs.
Secondary VFs cannot be shared between primary VFs.
Primary VFs are present on the tail of the 'Network devices using kernel
driver' list, secondary VFs are on the remaining tail of the list.
The VNIC driver in the multiqueue setup works differently than other drivers
like `ixgbe`. We need to bind separately each specific queue set device with
the ``tools/dpdk-devbind.py`` utility.
Depending on the hardware used, the kernel driver sets a threshold ``vf_id``.
VFs that try to attach with an id below or equal to this boundary are
considered primary VFs. VFs that try to attach with an id above this boundary
are considered secondary VFs.
This patchset also contains other cleanups and improvements like fixing
erroneous checksum calculation and preparing the thunderx driver for the multi
queue set feature support.
These changes base on the following pending patches:
[dpdk-dev,1/3] net/thunderx: remove generic passx references from the driver
http://dpdk.org/dev/patchwork/patch/14963/
[dpdk-dev,2/3] net/thunderx: introduce cqe_rx2 HW capability flag
http://dpdk.org/dev/patchwork/patch/14964/
[dpdk-dev,3/3] net/thunderx: add 81xx SoC support
http://dpdk.org/dev/patchwork/patch/14965/
Kamil Rytarowski (15):
net/thunderx: cleanup the driver before adding new features
net/thunderx: correct transmit checksum handling
net/thunderx/base: add family of functions to store qsets
net/thunderx/base: add secondary queue set support
net/thunderx: add family of functions to store DPDK qsets
net/thunderx: add secondary queue set in interrupt functions
net/thunderx: remove problematic private_data->eth_dev link
net/thunderx: add helper utils for secondary qset support
net/thunderx: add secondary qset support in dev stop/close
net/thunderx: add secondary qset support in device start
net/thunderx: add secondary qset support in device configure
net/thunderx: add final bits for secondary queue support
net/thunderx: document secondary queue set support
ethdev: Support VFs on the different PCI domains
net/thunderx: Bump driver version to 2.0
doc/guides/nics/thunderx.rst | 148 +++++-
drivers/net/thunderx/Makefile | 2 +
drivers/net/thunderx/base/nicvf_bsvf.c | 72 +++
drivers/net/thunderx/base/nicvf_bsvf.h | 76 +++
drivers/net/thunderx/base/nicvf_hw.c | 10 +-
drivers/net/thunderx/base/nicvf_hw.h | 6 +-
drivers/net/thunderx/base/nicvf_hw_defs.h | 1 +
drivers/net/thunderx/base/nicvf_mbox.c | 47 +-
drivers/net/thunderx/base/nicvf_mbox.h | 21 +-
drivers/net/thunderx/nicvf_ethdev.c | 780 +++++++++++++++++++++---------
drivers/net/thunderx/nicvf_ethdev.h | 41 +-
drivers/net/thunderx/nicvf_rxtx.c | 14 +-
drivers/net/thunderx/nicvf_struct.h | 6 +-
drivers/net/thunderx/nicvf_svf.c | 78 +++
drivers/net/thunderx/nicvf_svf.h | 66 +++
lib/librte_ether/rte_ethdev.c | 2 +-
16 files changed, 1097 insertions(+), 273 deletions(-)
create mode 100644 drivers/net/thunderx/base/nicvf_bsvf.c
create mode 100644 drivers/net/thunderx/base/nicvf_bsvf.h
create mode 100644 drivers/net/thunderx/nicvf_svf.c
create mode 100644 drivers/net/thunderx/nicvf_svf.h
--
1.9.1
From: Kamil Rytarowski <redacted>
The symbols PKT_TX_TCP_CKSUM and PKT_TX_UDP_CKSUM are not bits on a
bitmask. Set l3_offset always for TX offloads, not just for PKT_TX_IP_CKSUM
being true.
Fixes: 1c421f18e095 ("net/thunderx: add single and multi-segment Tx")
Signed-off-by: Maciej Czekaj <redacted>
Signed-off-by: Kamil Rytarowski <redacted>
Signed-off-by: Zyta Szpak <redacted>
Signed-off-by: Slawomir Rosek <redacted>
Signed-off-by: Radoslaw Biernacki <redacted>
Signed-off-by: Jerin Jacob <redacted>
---
drivers/net/thunderx/nicvf_rxtx.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
@@ -314,11 +337,33 @@ nicvf_mbox_qset_config(struct nicvf *nic, struct pf_qs_cfg *qs_cfg)/* Send a mailbox msg to PF to config Qset */mbx.msg.msg=NIC_MBOX_MSG_QS_CFG;mbx.qs.num=nic->vf_id;+mbx.qs.sqs_count=nic->sqs_count;mbx.qs.cfg=qs_cfg->value;returnnicvf_mbox_send_msg_to_pf(nic,&mbx);}int+nicvf_mbox_request_sqs(structnicvf*nic)+{+structnic_mbxmbx={.msg={0}};+size_ti;++assert_primary(nic);+assert(nic->sqs_count>0);+assert(nic->sqs_count<=MAX_SQS_PER_VF);++mbx.sqs_alloc.msg=NIC_MBOX_MSG_ALLOC_SQS;+mbx.sqs_alloc.spec=1;+mbx.sqs_alloc.qs_count=nic->sqs_count;++/* Set no of Rx/Tx queues in each of the SQsets */+for(i=0;i<nic->sqs_count;i++)+mbx.sqs_alloc.svf[i]=nic->snicvf[i]->vf_id;++returnnicvf_mbox_send_msg_to_pf(nic,&mbx);+}++intnicvf_mbox_rq_drop_config(structnicvf*nic,uint16_tqidx,boolenable){structnic_mbxmbx={.msg={0}};
From: Kamil Rytarowski <redacted>
In case of the multiprocess mode a shared nicvf struct between processes
cannot point with the eth_dev pointer to master device, therefore remove it
allong with references to it refactoring the code where needed.
This change fixes multiprocess issues detected in stats.
Fixes: 7413feee662d ("net/thunderx: add device start/stop and close")
Signed-off-by: Maciej Czekaj <redacted>
Signed-off-by: Kamil Rytarowski <redacted>
Signed-off-by: Zyta Szpak <redacted>
Signed-off-by: Slawomir Rosek <redacted>
Signed-off-by: Radoslaw Biernacki <redacted>
Signed-off-by: Jerin Jacob <redacted>
---
drivers/net/thunderx/nicvf_ethdev.c | 69 ++++++++++++++++++-------------------
drivers/net/thunderx/nicvf_rxtx.c | 3 +-
drivers/net/thunderx/nicvf_struct.h | 1 -
3 files changed, 36 insertions(+), 37 deletions(-)
@@ -497,14 +497,14 @@ nicvf_dev_rss_hash_update(struct rte_eth_dev *dev,}staticint-nicvf_qset_cq_alloc(structnicvf*nic,structnicvf_rxq*rxq,uint16_tqidx,-uint32_tdesc_cnt)+nicvf_qset_cq_alloc(structrte_eth_dev*dev,structnicvf*nic,+structnicvf_rxq*rxq,uint16_tqidx,uint32_tdesc_cnt){conststructrte_memzone*rz;uint32_tring_size=CMP_QUEUE_SZ_MAX*sizeof(unioncq_entry_t);-rz=rte_eth_dma_zone_reserve(nic->eth_dev,"cq_ring",qidx,ring_size,-NICVF_CQ_BASE_ALIGN_BYTES,nic->node);+rz=rte_eth_dma_zone_reserve(dev,"cq_ring",qidx,ring_size,+NICVF_CQ_BASE_ALIGN_BYTES,nic->node);if(rz==NULL){PMD_INIT_LOG(ERR,"Failed to allocate mem for cq hw ring");return-ENOMEM;
@@ -520,13 +520,13 @@ nicvf_qset_cq_alloc(struct nicvf *nic, struct nicvf_rxq *rxq, uint16_t qidx,}staticint-nicvf_qset_sq_alloc(structnicvf*nic,structnicvf_txq*sq,uint16_tqidx,-uint32_tdesc_cnt)+nicvf_qset_sq_alloc(structrte_eth_dev*dev,structnicvf*nic,+structnicvf_txq*sq,uint16_tqidx,uint32_tdesc_cnt){conststructrte_memzone*rz;uint32_tring_size=SND_QUEUE_SZ_MAX*sizeof(unionsq_entry_t);-rz=rte_eth_dma_zone_reserve(nic->eth_dev,"sq",qidx,ring_size,+rz=rte_eth_dma_zone_reserve(dev,"sq",qidx,ring_size,NICVF_SQ_BASE_ALIGN_BYTES,nic->node);if(rz==NULL){PMD_INIT_LOG(ERR,"Failed allocate mem for sq hw ring");
@@ -915,7 +916,7 @@ nicvf_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx,return-ENOMEM;}-if(nicvf_qset_sq_alloc(nic,txq,qidx,nb_desc)){+if(nicvf_qset_sq_alloc(dev,nic,txq,qidx,nb_desc)){PMD_INIT_LOG(ERR,"Failed to allocate mem for sq %d",qidx);nicvf_dev_tx_queue_release(txq);return-ENOMEM;
@@ -1323,12 +1323,12 @@ nicvf_dev_start(struct rte_eth_dev *dev)/* Check the level of buffers in the pool */total_rxq_desc=0;-for(qidx=0;qidx<nic->eth_dev->data->nb_rx_queues;qidx++){+for(qidx=0;qidx<dev->data->nb_rx_queues;qidx++){rxq=dev->data->rx_queues[qidx];/* Count total numbers of rxq descs */total_rxq_desc+=rxq->qlen_mask+1;exp_buffs=RTE_MEMPOOL_CACHE_MAX_SIZE+rxq->rx_free_thresh;-exp_buffs*=nic->eth_dev->data->nb_rx_queues;+exp_buffs*=dev->data->nb_rx_queues;if(rte_mempool_avail_count(rxq->pool)<exp_buffs){PMD_INIT_LOG(ERR,"Buff shortage in pool=%s (%d/%d)",rxq->pool->name,
@@ -1354,7 +1354,7 @@ nicvf_dev_start(struct rte_eth_dev *dev)/* Allocate RBDR and RBDR ring desc */nb_rbdr_desc=nicvf_qsize_rbdr_roundup(total_rxq_desc);-ret=nicvf_qset_rbdr_alloc(nic,nb_rbdr_desc,rbdrsz);+ret=nicvf_qset_rbdr_alloc(dev,nic,nb_rbdr_desc,rbdrsz);if(ret){PMD_INIT_LOG(ERR,"Failed to allocate memory for rbdr alloc");gotoqset_reclaim;
@@ -1501,7 +1501,7 @@ nicvf_dev_stop(struct rte_eth_dev *dev)/* Move all charged buffers in RBDR back to pool */if(nic->rbdr!=NULL)-nicvf_rbdr_release_mbufs(nic);+nicvf_rbdr_release_mbufs(dev,nic);/* Reclaim CPI configuration */if(!nic->sqs_mode){
@@ -1467,32 +1494,74 @@ qset_reclaim:}staticvoid-nicvf_dev_stop(structrte_eth_dev*dev)+nicvf_dev_stop_cleanup(structrte_eth_dev*dev,boolcleanup){+size_ti;intret;-uint16_tqidx;structnicvf*nic=nicvf_pmd_priv(dev);PMD_INIT_FUNC_TRACE();-/* Let PF make the BGX's RX and TX switches to OFF position */-nicvf_mbox_shutdown(nic);+/* Teardown secondary vf first */+for(i=0;i<nic->sqs_count;i++){+if(!nic->snicvf[i])+continue;++nicvf_vf_stop(dev,nic->snicvf[i],cleanup);+}++/* Stop the primary VF now */+nicvf_vf_stop(dev,nic,cleanup);/* Disable loopback */ret=nicvf_loopback_config(nic,0);if(ret)PMD_INIT_LOG(ERR,"Failed to disable loopback %d",ret);+/* Reclaim CPI configuration */+ret=nicvf_mbox_config_cpi(nic,0);+if(ret)+PMD_INIT_LOG(ERR,"Failed to reclaim CPI config %d",ret);+}++staticvoid+nicvf_dev_stop(structrte_eth_dev*dev)+{+PMD_INIT_FUNC_TRACE();++nicvf_dev_stop_cleanup(dev,false);+}++staticvoid+nicvf_vf_stop(structrte_eth_dev*dev,structnicvf*nic,boolcleanup)+{+intret;+uint16_tqidx;+uint16_ttx_start,tx_end;+uint16_trx_start,rx_end;++PMD_INIT_FUNC_TRACE();++if(cleanup){+/* Let PF make the BGX's RX and TX switches to OFF position */+nicvf_mbox_shutdown(nic);+}+/* Disable VLAN Strip */nicvf_vlan_hw_strip(nic,0);-/* Reclaim sq */-for(qidx=0;qidx<dev->data->nb_tx_queues;qidx++)-nicvf_stop_tx_queue(dev,qidx);+/* Get queue ranges for this VF */+nicvf_tx_range(dev,nic,&tx_start,&tx_end);++for(qidx=tx_start;qidx<=tx_end;qidx++)+nicvf_vf_stop_tx_queue(dev,nic,qidx%MAX_SND_QUEUES_PER_QS);++/* Get queue ranges for this VF */+nicvf_rx_range(dev,nic,&rx_start,&rx_end);/* Reclaim rq */-for(qidx=0;qidx<dev->data->nb_rx_queues;qidx++)-nicvf_stop_rx_queue(dev,qidx);+for(qidx=rx_start;qidx<=rx_end;qidx++)+nicvf_vf_stop_rx_queue(dev,nic,qidx%MAX_RCV_QUEUES_PER_QS);/* Reclaim RBDR */ret=nicvf_qset_rbdr_reclaim(nic,0);
@@ -1274,25 +1299,25 @@ rbdr_rte_mempool_get(void *dev, void *opaque)}staticint-nicvf_dev_start(structrte_eth_dev*dev)+nicvf_vf_start(structrte_eth_dev*dev,structnicvf*nic,uint32_trbdrsz){intret;uint16_tqidx;-uint32_tbuffsz=0,rbdrsz=0;uint32_ttotal_rxq_desc,nb_rbdr_desc,exp_buffs;uint64_tmbuf_phys_off=0;structnicvf_rxq*rxq;-structrte_pktmbuf_pool_private*mbp_priv;structrte_mbuf*mbuf;-structnicvf*nic=nicvf_pmd_priv(dev);-structrte_eth_rxmode*rx_conf=&dev->data->dev_conf.rxmode;-uint16_tmtu;+uint16_trx_start,rx_end;+uint16_ttx_start,tx_end;PMD_INIT_FUNC_TRACE();/* Userspace process exited without proper shutdown in last run */if(nicvf_qset_rbdr_active(nic,0))-nicvf_dev_stop(dev);+nicvf_vf_stop(dev,nic,false);++/* Get queue ranges for this VF */+nicvf_rx_range(dev,nic,&rx_start,&rx_end);/**ThunderxnicvfPMDcansupportmorethanonepoolperportonlywhen
@@ -1307,32 +1332,15 @@ nicvf_dev_start(struct rte_eth_dev *dev)**/-/* Validate RBDR buff size */-for(qidx=0;qidx<dev->data->nb_rx_queues;qidx++){-rxq=dev->data->rx_queues[qidx];-mbp_priv=rte_mempool_get_priv(rxq->pool);-buffsz=mbp_priv->mbuf_data_room_size-RTE_PKTMBUF_HEADROOM;-if(buffsz%128){-PMD_INIT_LOG(ERR,"rxbuf size must be multiply of 128");-return-EINVAL;-}-if(rbdrsz==0)-rbdrsz=buffsz;-if(rbdrsz!=buffsz){-PMD_INIT_LOG(ERR,"buffsz not same, qid=%d (%d/%d)",-qidx,rbdrsz,buffsz);-return-EINVAL;-}-}-/* Validate mempool attributes */-for(qidx=0;qidx<dev->data->nb_rx_queues;qidx++){+for(qidx=rx_start;qidx<=rx_end;qidx++){rxq=dev->data->rx_queues[qidx];rxq->mbuf_phys_off=nicvf_mempool_phy_offset(rxq->pool);mbuf=rte_pktmbuf_alloc(rxq->pool);if(mbuf==NULL){-PMD_INIT_LOG(ERR,"Failed allocate mbuf qid=%d pool=%s",-qidx,rxq->pool->name);+PMD_INIT_LOG(ERR,"Failed allocate mbuf VF%d qid=%d "+"pool=%s",+nic->vf_id,qidx,rxq->pool->name);return-ENOMEM;}rxq->mbuf_phys_off-=nicvf_mbuff_meta_length(mbuf);
@@ -1342,15 +1350,16 @@ nicvf_dev_start(struct rte_eth_dev *dev)if(mbuf_phys_off==0)mbuf_phys_off=rxq->mbuf_phys_off;if(mbuf_phys_off!=rxq->mbuf_phys_off){-PMD_INIT_LOG(ERR,"pool params not same,%s %"PRIx64,-rxq->pool->name,mbuf_phys_off);+PMD_INIT_LOG(ERR,"pool params not same,%s VF%d %"+PRIx64,rxq->pool->name,nic->vf_id,+mbuf_phys_off);return-EINVAL;}}/* Check the level of buffers in the pool */total_rxq_desc=0;-for(qidx=0;qidx<dev->data->nb_rx_queues;qidx++){+for(qidx=rx_start;qidx<=rx_end;qidx++){rxq=dev->data->rx_queues[qidx];/* Count total numbers of rxq descs */total_rxq_desc+=rxq->qlen_mask+1;
@@ -1368,14 +1377,16 @@ nicvf_dev_start(struct rte_eth_dev *dev)/* Check RBDR desc overflow */ret=nicvf_qsize_rbdr_roundup(total_rxq_desc);if(ret==0){-PMD_INIT_LOG(ERR,"Reached RBDR desc limit, reduce nr desc");+PMD_INIT_LOG(ERR,"Reached RBDR desc limit, reduce nr desc "+"VF%d",nic->vf_id);return-ENOMEM;}/* Enable qset */ret=nicvf_qset_config(nic);if(ret){-PMD_INIT_LOG(ERR,"Failed to enable qset %d",ret);+PMD_INIT_LOG(ERR,"Failed to enable qset %d VF%d",ret,+nic->vf_id);returnret;}
@@ -1383,14 +1394,16 @@ nicvf_dev_start(struct rte_eth_dev *dev)nb_rbdr_desc=nicvf_qsize_rbdr_roundup(total_rxq_desc);ret=nicvf_qset_rbdr_alloc(dev,nic,nb_rbdr_desc,rbdrsz);if(ret){-PMD_INIT_LOG(ERR,"Failed to allocate memory for rbdr alloc");+PMD_INIT_LOG(ERR,"Failed to allocate memory for rbdr alloc "+"VF%d",nic->vf_id);gotoqset_reclaim;}/* Enable and configure RBDR registers */ret=nicvf_qset_rbdr_config(nic,0);if(ret){-PMD_INIT_LOG(ERR,"Failed to configure rbdr %d",ret);+PMD_INIT_LOG(ERR,"Failed to configure rbdr %d VF%d",ret,+nic->vf_id);gotoqset_rbdr_free;}
@@ -1398,52 +1411,127 @@ nicvf_dev_start(struct rte_eth_dev *dev)ret=nicvf_qset_rbdr_precharge(dev,nic,0,rbdr_rte_mempool_get,total_rxq_desc);if(ret){-PMD_INIT_LOG(ERR,"Failed to fill rbdr %d",ret);+PMD_INIT_LOG(ERR,"Failed to fill rbdr %d VF%d",ret,+nic->vf_id);gotoqset_rbdr_reclaim;}-PMD_DRV_LOG(INFO,"Filled %d out of %d entries in RBDR",-nic->rbdr->tail,nb_rbdr_desc);+PMD_DRV_LOG(INFO,"Filled %d out of %d entries in RBDR VF%d",+nic->rbdr->tail,nb_rbdr_desc,nic->vf_id);++/* Configure VLAN Strip */+nicvf_vlan_hw_strip(nic,dev->data->dev_conf.rxmode.hw_vlan_strip);++/* Get queue ranges for this VF */+nicvf_tx_range(dev,nic,&tx_start,&tx_end);++/* Configure TX queues */+for(qidx=tx_start;qidx<=tx_end;qidx++){+ret=nicvf_vf_start_tx_queue(dev,nic,+qidx%MAX_SND_QUEUES_PER_QS);+if(ret)+gotostart_txq_error;+}/* Configure RX queues */-for(qidx=0;qidx<dev->data->nb_rx_queues;qidx++){-ret=nicvf_start_rx_queue(dev,qidx);+for(qidx=rx_start;qidx<=rx_end;qidx++){+ret=nicvf_vf_start_rx_queue(dev,nic,+qidx%MAX_RCV_QUEUES_PER_QS);if(ret)gotostart_rxq_error;}-/* Configure VLAN Strip */-nicvf_vlan_hw_strip(nic,dev->data->dev_conf.rxmode.hw_vlan_strip);--/* Configure TX queues */-for(qidx=0;qidx<dev->data->nb_tx_queues;qidx++){-ret=nicvf_start_tx_queue(dev,qidx);+if(!nic->sqs_mode){+/* Configure CPI algorithm */+ret=nicvf_configure_cpi(dev);if(ret)gotostart_txq_error;++ret=nicvf_mbox_get_rss_size(nic);+if(ret){+PMD_INIT_LOG(ERR,"Failed to get rss table size");+gotoqset_rss_error;+}++/* Configure RSS */+ret=nicvf_configure_rss(dev);+if(ret)+gotoqset_rss_error;}-/* Configure CPI algorithm */-ret=nicvf_configure_cpi(dev);-if(ret)-gotostart_txq_error;+/* Done; Let PF make the BGX's RX and TX switches to ON position */+nicvf_mbox_cfg_done(nic);+return0;-/* Configure RSS */-ret=nicvf_configure_rss(dev);-if(ret)-gotoqset_rss_error;+qset_rss_error:+nicvf_rss_term(nic);+start_rxq_error:+for(qidx=rx_start;qidx<=rx_end;qidx++)+nicvf_vf_stop_rx_queue(dev,nic,qidx%MAX_RCV_QUEUES_PER_QS);+start_txq_error:+for(qidx=tx_start;qidx<=tx_end;qidx++)+nicvf_vf_stop_tx_queue(dev,nic,qidx%MAX_SND_QUEUES_PER_QS);+qset_rbdr_reclaim:+nicvf_qset_rbdr_reclaim(nic,0);+nicvf_rbdr_release_mbufs(dev,nic);+qset_rbdr_free:+if(nic->rbdr){+rte_free(nic->rbdr);+nic->rbdr=NULL;+}+qset_reclaim:+nicvf_qset_reclaim(nic);+returnret;+}++staticint+nicvf_dev_start(structrte_eth_dev*dev)+{+uint16_tqidx;+intret;+size_ti;+structnicvf*nic=nicvf_pmd_priv(dev);+structrte_eth_rxmode*rx_conf=&dev->data->dev_conf.rxmode;+uint16_tmtu;+uint32_tbuffsz=0,rbdrsz=0;+structrte_pktmbuf_pool_private*mbp_priv;+structnicvf_rxq*rxq;++PMD_INIT_FUNC_TRACE();++/* This function must be called for a primary device */+assert_primary(nic);++/* Validate RBDR buff size */+for(qidx=0;qidx<dev->data->nb_rx_queues;qidx++){+rxq=dev->data->rx_queues[qidx];+mbp_priv=rte_mempool_get_priv(rxq->pool);+buffsz=mbp_priv->mbuf_data_room_size-RTE_PKTMBUF_HEADROOM;+if(buffsz%128){+PMD_INIT_LOG(ERR,"rxbuf size must be multiply of 128");+return-EINVAL;+}+if(rbdrsz==0)+rbdrsz=buffsz;+if(rbdrsz!=buffsz){+PMD_INIT_LOG(ERR,"buffsz not same, qidx=%d (%d/%d)",+qidx,rbdrsz,buffsz);+return-EINVAL;+}+}/* Configure loopback */ret=nicvf_loopback_config(nic,dev->data->dev_conf.lpbk_mode);if(ret){PMD_INIT_LOG(ERR,"Failed to configure loopback %d",ret);-gotoqset_rss_error;+returnret;}/* Reset all statistics counters attached to this port */ret=nicvf_mbox_reset_stat_counters(nic,0x3FFF,0x1F,0xFFFF,0xFFFF);if(ret){PMD_INIT_LOG(ERR,"Failed to reset stat counters %d",ret);-gotoqset_rss_error;+returnret;}/* Setup scatter mode if needed by jumbo */
@@ -1464,33 +1552,23 @@ nicvf_dev_start(struct rte_eth_dev *dev)return-EBUSY;}+ret=nicvf_vf_start(dev,nic,rbdrsz);+if(ret!=0)+returnret;++for(i=0;i<nic->sqs_count;i++){+assert(nic->snicvf[i]);++ret=nicvf_vf_start(dev,nic->snicvf[i],rbdrsz);+if(ret!=0)+returnret;+}+/* Configure callbacks based on scatter mode */nicvf_set_tx_function(dev);nicvf_set_rx_function(dev);-/* Done; Let PF make the BGX's RX and TX switches to ON position */-nicvf_mbox_cfg_done(nic);return0;--qset_rss_error:-nicvf_rss_term(nic);-start_txq_error:-for(qidx=0;qidx<dev->data->nb_tx_queues;qidx++)-nicvf_vf_stop_tx_queue(dev,nic,qidx);-start_rxq_error:-for(qidx=0;qidx<dev->data->nb_rx_queues;qidx++)-nicvf_vf_stop_rx_queue(dev,nic,qidx);-qset_rbdr_reclaim:-nicvf_qset_rbdr_reclaim(nic,0);-nicvf_rbdr_release_mbufs(dev,nic);-qset_rbdr_free:-if(nic->rbdr){-rte_free(nic->rbdr);-nic->rbdr=NULL;-}-qset_reclaim:-nicvf_qset_reclaim(nic);-returnret;}staticvoid
@@ -507,7 +512,8 @@ nicvf_qset_cq_alloc(struct rte_eth_dev *dev, struct nicvf *nic,conststructrte_memzone*rz;uint32_tring_size=CMP_QUEUE_SZ_MAX*sizeof(unioncq_entry_t);-rz=rte_eth_dma_zone_reserve(dev,"cq_ring",qidx,ring_size,+rz=rte_eth_dma_zone_reserve(dev,"cq_ring",+nicvf_netdev_qidx(nic,qidx),ring_size,NICVF_CQ_BASE_ALIGN_BYTES,nic->node);if(rz==NULL){PMD_INIT_LOG(ERR,"Failed to allocate mem for cq hw ring");
@@ -530,8 +536,9 @@ nicvf_qset_sq_alloc(struct rte_eth_dev *dev, struct nicvf *nic,conststructrte_memzone*rz;uint32_tring_size=SND_QUEUE_SZ_MAX*sizeof(unionsq_entry_t);-rz=rte_eth_dma_zone_reserve(dev,"sq",qidx,ring_size,-NICVF_SQ_BASE_ALIGN_BYTES,nic->node);+rz=rte_eth_dma_zone_reserve(dev,"sq",+nicvf_netdev_qidx(nic,qidx),ring_size,+NICVF_SQ_BASE_ALIGN_BYTES,nic->node);if(rz==NULL){PMD_INIT_LOG(ERR,"Failed allocate mem for sq hw ring");return-ENOMEM;
@@ -563,8 +570,9 @@ nicvf_qset_rbdr_alloc(struct rte_eth_dev *dev, struct nicvf *nic,}ring_size=sizeof(structrbdr_entry_t)*RBDR_QUEUE_SZ_MAX;-rz=rte_eth_dma_zone_reserve(dev,"rbdr",0,ring_size,-NICVF_RBDR_BASE_ALIGN_BYTES,nic->node);+rz=rte_eth_dma_zone_reserve(dev,"rbdr",+nicvf_netdev_qidx(nic,0),ring_size,+NICVF_RBDR_BASE_ALIGN_BYTES,nic->node);if(rz==NULL){PMD_INIT_LOG(ERR,"Failed to allocate mem for rbdr desc ring");return-ENOMEM;
@@ -1685,12 +1693,37 @@ nicvf_dev_close(struct rte_eth_dev *dev)}staticint+nicvf_request_sqs(structnicvf*nic)+{+size_ti;++assert_primary(nic);+assert(nic->sqs_count>0);+assert(nic->sqs_count<=MAX_SQS_PER_VF);++/* Set no of Rx/Tx queues in each of the SQsets */+for(i=0;i<nic->sqs_count;i++){+if(nicvf_svf_empty())+rte_panic("Cannot assign sufficient number of "+"secondary queues to primary VF%"PRIu8"\n",+nic->vf_id);++nic->snicvf[i]=nicvf_svf_pop();+nic->snicvf[i]->sqs_id=i;+}++returnnicvf_mbox_request_sqs(nic);+}++staticintnicvf_dev_configure(structrte_eth_dev*dev){-structrte_eth_conf*conf=&dev->data->dev_conf;+structrte_eth_dev_data*data=dev->data;+structrte_eth_conf*conf=&data->dev_conf;structrte_eth_rxmode*rxmode=&conf->rxmode;structrte_eth_txmode*txmode=&conf->txmode;structnicvf*nic=nicvf_pmd_priv(dev);+uint8_tcqcount;PMD_INIT_FUNC_TRACE();
@@ -1755,6 +1788,26 @@ nicvf_dev_configure(struct rte_eth_dev *dev)return-EINVAL;}+assert_primary(nic);+NICVF_STATIC_ASSERT(MAX_RCV_QUEUES_PER_QS==MAX_SND_QUEUES_PER_QS);+cqcount=RTE_MAX(data->nb_tx_queues,data->nb_rx_queues);+if(cqcount>MAX_RCV_QUEUES_PER_QS){+nic->sqs_count=RTE_ALIGN_CEIL(cqcount,MAX_RCV_QUEUES_PER_QS);+nic->sqs_count=(nic->sqs_count/MAX_RCV_QUEUES_PER_QS)-1;+}else{+nic->sqs_count=0;+}++assert(nic->sqs_count<=MAX_SQS_PER_VF);++if(nic->sqs_count>0){+if(nicvf_request_sqs(nic)){+rte_panic("Cannot assign sufficient number of "+"secondary queues to PORT%d VF%"PRIu8"\n",+dev->data->port_id,nic->vf_id);+}+}+PMD_INIT_LOG(DEBUG,"Configured ethdev port%d hwcap=0x%"PRIx64,dev->data->port_id,nicvf_hw_cap(nic));
From: Kamil Rytarowski <redacted>
Summary:
- add secondary qset support in device stats
- add support for releasing mbufs from RBDR for >8 queues
- add support for releasing mbufs from RX queues for >8 queues
- support >8 queues in tx_queue_setup
- support >8 queues in rx_queue_setup
- support up to 96 queues per device (dev_info->max_rx_queues)
- add secondary qset support in rbdr_rte_mempool_get
- support >8 queues in multiprocess mode (do not reconfigure VFs)
- setup periodic alarm accordingly for type of VFs:
* primary VF - handle events on queues and link status
* secondary VF - handle events on queues
- initialize hardware capabilities in secondary qsets
Signed-off-by: Maciej Czekaj <redacted>
Signed-off-by: Kamil Rytarowski <redacted>
Signed-off-by: Zyta Szpak <redacted>
Signed-off-by: Slawomir Rosek <redacted>
Signed-off-by: Radoslaw Biernacki <redacted>
Signed-off-by: Jerin Jacob <redacted>
---
drivers/net/thunderx/nicvf_ethdev.c | 200 ++++++++++++++++++++++++++++--------
1 file changed, 157 insertions(+), 43 deletions(-)
@@ -236,9 +236,15 @@ nicvf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)structnicvf_hw_tx_qstatstx_qstats;structnicvf_hw_statsport_stats;structnicvf*nic=nicvf_pmd_priv(dev);+uint16_trx_start,rx_end;+uint16_ttx_start,tx_end;+size_ti;++/* RX queue indices for the first VF */+nicvf_rx_range(dev,nic,&rx_start,&rx_end);/* Reading per RX ring stats */-for(qidx=0;qidx<dev->data->nb_rx_queues;qidx++){+for(qidx=rx_start;qidx<=rx_end;qidx++){if(qidx==RTE_ETHDEV_QUEUE_STAT_CNTRS)break;
@@ -247,8 +253,11 @@ nicvf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)stats->q_ipackets[qidx]=rx_qstats.q_rx_packets;}+/* TX queue indices for the first VF */+nicvf_tx_range(dev,nic,&tx_start,&tx_end);+/* Reading per TX ring stats */-for(qidx=0;qidx<dev->data->nb_tx_queues;qidx++){+for(qidx=tx_start;qidx<=tx_end;qidx++){if(qidx==RTE_ETHDEV_QUEUE_STAT_CNTRS)break;
@@ -257,6 +266,40 @@ nicvf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)stats->q_opackets[qidx]=tx_qstats.q_tx_packets;}+for(i=0;i<nic->sqs_count;i++){+structnicvf*snic=nic->snicvf[i];++if(snic==NULL)+break;++/* RX queue indices for a secondary VF */+nicvf_rx_range(dev,snic,&rx_start,&rx_end);++/* Reading per RX ring stats */+for(qidx=rx_start;qidx<=rx_end;qidx++){+if(qidx==RTE_ETHDEV_QUEUE_STAT_CNTRS)+break;++nicvf_hw_get_rx_qstats(snic,&rx_qstats,+qidx%MAX_RCV_QUEUES_PER_QS);+stats->q_ibytes[qidx]=rx_qstats.q_rx_bytes;+stats->q_ipackets[qidx]=rx_qstats.q_rx_packets;+}++/* TX queue indices for a secondary VF */+nicvf_tx_range(dev,snic,&tx_start,&tx_end);+/* Reading per TX ring stats */+for(qidx=tx_start;qidx<=tx_end;qidx++){+if(qidx==RTE_ETHDEV_QUEUE_STAT_CNTRS)+break;++nicvf_hw_get_tx_qstats(snic,&tx_qstats,+qidx%MAX_SND_QUEUES_PER_QS);+stats->q_obytes[qidx]=tx_qstats.q_tx_bytes;+stats->q_opackets[qidx]=tx_qstats.q_tx_packets;+}+}+nicvf_hw_get_stats(nic,&port_stats);stats->ibytes=port_stats.rx_bytes;stats->ipackets=port_stats.rx_ucast_frames;
@@ -322,13 +365,36 @@ nicvf_dev_stats_reset(struct rte_eth_dev *dev)inti;uint16_trxqs=0,txqs=0;structnicvf*nic=nicvf_pmd_priv(dev);+uint16_trx_start,rx_end;+uint16_ttx_start,tx_end;-for(i=0;i<dev->data->nb_rx_queues;i++)+/* Reset all primary nic counters */+nicvf_rx_range(dev,nic,&rx_start,&rx_end);+for(i=rx_start;i<=rx_end;i++)rxqs|=(0x3<<(i*2));-for(i=0;i<dev->data->nb_tx_queues;i++)++nicvf_tx_range(dev,nic,&tx_start,&tx_end);+for(i=tx_start;i<=tx_end;i++)txqs|=(0x3<<(i*2));nicvf_mbox_reset_stat_counters(nic,0x3FFF,0x1F,rxqs,txqs);++/* Reset secondary nic queue counters */+for(i=0;i<nic->sqs_count;i++){+structnicvf*snic=nic->snicvf[i];+if(snic==NULL)+break;++nicvf_rx_range(dev,snic,&rx_start,&rx_end);+for(i=rx_start;i<=rx_end;i++)+rxqs|=(0x3<<((i%MAX_CMP_QUEUES_PER_QS)*2));++nicvf_tx_range(dev,snic,&tx_start,&tx_end);+for(i=tx_start;i<=tx_end;i++)+txqs|=(0x3<<((i%MAX_SND_QUEUES_PER_QS)*2));++nicvf_mbox_reset_stat_counters(snic,0,0,rxqs,txqs);+}}/* Promiscuous mode enabled by default in LMAC to VF 1:1 map configuration */
@@ -596,14 +662,18 @@ nicvf_qset_rbdr_alloc(struct rte_eth_dev *dev, struct nicvf *nic,}staticvoid-nicvf_rbdr_release_mbuf(structrte_eth_dev*dev,structnicvf*nic__rte_unused,+nicvf_rbdr_release_mbuf(structrte_eth_dev*dev,structnicvf*nic,nicvf_phys_addr_tphy){uint16_tqidx;void*obj;structnicvf_rxq*rxq;+uint16_trx_start,rx_end;-for(qidx=0;qidx<dev->data->nb_rx_queues;qidx++){+/* Get queue ranges for this VF */+nicvf_rx_range(dev,nic,&rx_start,&rx_end);++for(qidx=rx_start;qidx<=rx_end;qidx++){rxq=dev->data->rx_queues[qidx];if(rxq->precharge_cnt){obj=(void*)nicvf_mbuff_phy2virt(phy,
@@ -1291,9 +1384,13 @@ rbdr_rte_mempool_get(void *dev, void *opaque)uintptr_tmbuf;structnicvf_rxq*rxq;structrte_eth_dev*eth_dev=(structrte_eth_dev*)dev;-structnicvf*nic__rte_unused=(structnicvf*)opaque;+structnicvf*nic=(structnicvf*)opaque;+uint16_trx_start,rx_end;++/* Get queue ranges for this VF */+nicvf_rx_range(eth_dev,nic,&rx_start,&rx_end);-for(qidx=0;qidx<eth_dev->data->nb_rx_queues;qidx++){+for(qidx=rx_start;qidx<=rx_end;qidx++){rxq=eth_dev->data->rx_queues[qidx];/* Maintain equal buffer count across all pools */if(rxq->precharge_cnt>=rxq->qlen_mask)
@@ -1856,10 +1953,16 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev)/* For secondary processes, the primary has done all the work */if(rte_eal_process_type()!=RTE_PROC_PRIMARY){-/* Setup callbacks for secondary process */-nicvf_set_tx_function(eth_dev);-nicvf_set_rx_function(eth_dev);-return0;+if(nic){+/* Setup callbacks for secondary process */+nicvf_set_tx_function(eth_dev);+nicvf_set_rx_function(eth_dev);+return0;+}else{+/* If nic == NULL than it is secondary function+*soethdevneedtobereleasedbycaller*/+returnENOTSUP;+}}pci_dev=eth_dev->pci_dev;
@@ -1904,11 +2007,28 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev));}+ret=nicvf_base_init(nic);+if(ret){+PMD_INIT_LOG(ERR,"Failed to execute nicvf_base_init");+gotomalloc_fail;+}+if(nic->sqs_mode){-PMD_INIT_LOG(INFO,"Unsupported SQS VF detected, Detaching...");-/* Detach port by returning Positive error number */-ret=ENOTSUP;-gotoalarm_fail;+/* Push nic to stack of secondary vfs */+nicvf_svf_push(nic);++/* Steal nic pointer from the device for further reuse */+eth_dev->data->dev_private=NULL;++nicvf_periodic_alarm_stop(nicvf_interrupt,eth_dev);+ret=nicvf_periodic_alarm_start(nicvf_vf_interrupt,nic);+if(ret){+PMD_INIT_LOG(ERR,"Failed to start period alarm");+gotofail;+}++/* Detach port by returning postive error number */+returnENOTSUP;}eth_dev->data->mac_addrs=rte_zmalloc("mac_addr",ETHER_ADDR_LEN,0);
@@ -56,6 +56,7 @@ Features of the ThunderX PMD are:- VLAN stripping- SR-IOV VF- NUMA support+- Multi queue set support (up to 96 queues (12 queue sets)) per port Supported ThunderX SoCs -----------------------
@@ -207,13 +208,13 @@ This section provides instructions to configure SR-IOV with Linux OS. ..code-block:: console 0002:01:00.0 Ethernet controller: Cavium Networks Device a01e (rev 01)- ...- Capabilities: [100 v1] Alternative Routing-ID Interpretation (ARI)- ...- Capabilities: [180 v1] Single Root I/O Virtualization (SR-IOV)- ...- Kernel driver in use: thunder-nic- ...+ ...+ Capabilities: [100 v1] Alternative Routing-ID Interpretation (ARI)+ ...+ Capabilities: [180 v1] Single Root I/O Virtualization (SR-IOV)+ ...+ Kernel driver in use: thunder-nic+ ... ..note::
@@ -230,18 +231,18 @@ This section provides instructions to configure SR-IOV with Linux OS. ..code-block:: console 0002:01:00.1 Ethernet controller: Cavium Networks Device 0011 (rev 01)- ...- Capabilities: [100 v1] Alternative Routing-ID Interpretation (ARI)- ...- Kernel driver in use: thunder-nicvf- ...+ ...+ Capabilities: [100 v1] Alternative Routing-ID Interpretation (ARI)+ ...+ Kernel driver in use: thunder-nicvf+ ... 0002:01:00.2 Ethernet controller: Cavium Networks Device 0011 (rev 01)- ...- Capabilities: [100 v1] Alternative Routing-ID Interpretation (ARI)- ...- Kernel driver in use: thunder-nicvf- ...+ ...+ Capabilities: [100 v1] Alternative Routing-ID Interpretation (ARI)+ ...+ Kernel driver in use: thunder-nicvf+ ... ..note::
@@ -322,6 +323,112 @@ This section provides instructions to configure SR-IOV with Linux OS.#. Refer to section :ref:`Running testpmd <thunderx_testpmd_example>` for instruction how to launch ``testpmd`` application.+Multiple Queue Set per DPDK port configuration+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~++There are two types of VFs:++- Primary VF+- Secondary VF++Each port consists of a primary VF and n secondary VF(s). Each VF provides 8 Tx/Rx queues to a port.+When a given port is configured to use more than 8 queues, it requires one (or more) secondary VF.+Each secondary VF adds 8 additional queues to the queue set.++During PMD driver initialization, the primary VF's are enumerated by checking the+specific flag (see sqs message in DPDK boot log - sqs indicates secondary queue set).+They are at the beginning of VF list (the remain ones are secondary VF's).++The primary VFs are used as master queue sets. Secondary VFs provide+additional queue sets for primary ones. If a port is configured for more then+8 queues than it will request for additional queues from secondary VFs.++Secondary VFs cannot be shared between primary VFs.++Primary VFs are present on the beginning of the 'Network devices using kernel+driver' list, secondary VFs are on the remaining on the remaining part of the list.++ ..note::++ The VNIC driver in the multiqueue setup works differently than other drivers like `ixgbe`.+ We need to bind separately each specific queue set device with the ``tools/dpdk-devbind.py`` utility.++ ..note::++ Depending on the hardware used, the kernel driver sets a threshold ``vf_id``. VFs that try to attached with an id below or equal to+ this boundary are considered primary VFs. VFs that try to attach with an id above this boundary are considered secondary VFs.+++Example device binding+~~~~~~~~~~~~~~~~~~~~~~++If a system has three interfaces, a total of 18 VF devices will be created+on a non-NUMA machine.++ ..note::++ NUMA systems have 12 VFs per port and non-NUMA 6 VFs per port.++ ..code-block:: console++ # tools/dpdk-devbind.py --status++ Network devices using DPDK-compatible driver+ ============================================+ <none>++ Network devices using kernel driver+ ===================================+ 0000:01:10.0 'Device a026' if= drv=thunder-BGX unused=vfio-pci,uio_pci_generic+ 0000:01:10.1 'Device a026' if= drv=thunder-BGX unused=vfio-pci,uio_pci_generic+ 0002:01:00.0 'Device a01e' if= drv=thunder-nic unused=vfio-pci,uio_pci_generic+ 0002:01:00.1 'Device 0011' if=eth0 drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:00.2 'Device 0011' if=eth1 drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:00.3 'Device 0011' if=eth2 drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:00.4 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:00.5 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:00.6 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:00.7 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:01.0 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:01.1 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:01.2 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:01.3 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:01.4 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:01.5 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:01.6 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:01.7 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:02.0 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:02.1 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic+ 0002:01:02.2 'Device 0011' if= drv=thunder-nicvf unused=vfio-pci,uio_pci_generic++ Other network devices+ =====================+ 0002:00:03.0 'Device a01f' unused=vfio-pci,uio_pci_generic+++We want to bind two physical interfaces with 24 queues each device, we attach two primary VFs+and four secondary queues. In our example we choose two 10G interfaces eth1 (0002:01:00.2) and eth2 (0002:01:00.3).+We will choose four secondary queue sets from the ending of the list (0002:01:01.7-0002:01:02.2).+++#. Bind two primary VFs to the ``vfio-pci`` driver:++ ..code-block:: console++ tools/dpdk-devbind.py -b vfio-pci 0002:01:00.2+ tools/dpdk-devbind.py -b vfio-pci 0002:01:00.3++#. Bind four primary VFs to the ``vfio-pci`` driver:++ ..code-block:: console++ tools/dpdk-devbind.py -b vfio-pci 0002:01:01.7+ tools/dpdk-devbind.py -b vfio-pci 0002:01:02.0+ tools/dpdk-devbind.py -b vfio-pci 0002:01:02.1+ tools/dpdk-devbind.py -b vfio-pci 0002:01:02.2++The nicvf thunderx driver will make use of attached secondary VFs automatically during the interface configuration stage.+ Limitations -----------
@@ -346,10 +453,3 @@ Maximum packet segments The ThunderX SoC family NICs support up to 12 segments per packet when working in scatter/gather mode. So, setting MTU will result with ``EINVAL`` when the frame size does not fit in the maximum number of segments.--Limited VFs-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--The ThunderX SoC family NICs has 128VFs and each VF has 8/8 queues-for RX/TX respectively. Current driver implementation has one to one mapping-between physical port and VF hence only limited VFs can be used.
It's possible to have the same numbers for bus, device id and function,
therefore we need to differentiate on domain.
This enables DPDK with multiple VFs on ThunderX 2-socket hardware.
Signed-off-by: Maciej Czekaj <redacted>
Signed-off-by: Kamil Rytarowski <redacted>
Signed-off-by: Zyta Szpak <redacted>
Signed-off-by: Slawomir Rosek <redacted>
Signed-off-by: Radoslaw Biernacki <redacted>
Signed-off-by: Jerin Jacob <redacted>
---
lib/librte_ether/rte_ethdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Hi Kamil,
On 9/30/2016 1:05 PM, Kamil Rytarowski wrote:
quoted hunk
It's possible to have the same numbers for bus, device id and function,
therefore we need to differentiate on domain.
This enables DPDK with multiple VFs on ThunderX 2-socket hardware.
Signed-off-by: Maciej Czekaj <redacted>
Signed-off-by: Kamil Rytarowski <redacted>
Signed-off-by: Zyta Szpak <redacted>
Signed-off-by: Slawomir Rosek <redacted>
Signed-off-by: Radoslaw Biernacki <redacted>
Signed-off-by: Jerin Jacob <redacted>
---
lib/librte_ether/rte_ethdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Is it possible to separate this patch from patchset, this is a ethdev
patch and it seems not directly related to the rest of the patchset?
Thanks,
ferruh
Hi Kamil,
On 9/30/2016 1:05 PM, Kamil Rytarowski wrote:
quoted
It's possible to have the same numbers for bus, device id and function,
therefore we need to differentiate on domain.
This enables DPDK with multiple VFs on ThunderX 2-socket hardware.
Signed-off-by: Maciej Czekaj <redacted>
Signed-off-by: Kamil Rytarowski <redacted>
Signed-off-by: Zyta Szpak <redacted>
Signed-off-by: Slawomir Rosek <redacted>
Signed-off-by: Radoslaw Biernacki <redacted>
Signed-off-by: Jerin Jacob <redacted>
---
lib/librte_ether/rte_ethdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Is it possible to separate this patch from patchset, this is a ethdev
patch and it seems not directly related to the rest of the patchset?
Thanks,
ferruh
This patch is directly related with secondary queue set support on ThunderX, but it can be skipped in this chain of patches and applied as a standalone diff.
Is disabling this one on patch work sufficient? Of course unless there are no more comments to produce v3 of the original patch chain "Add support for secondary queue set in nicvf thunderx driver".
Should I resubmit it as a new standalone patch?
Hi Kamil,
On 9/30/2016 1:05 PM, Kamil Rytarowski wrote:
quoted
It's possible to have the same numbers for bus, device id and function,
therefore we need to differentiate on domain.
This enables DPDK with multiple VFs on ThunderX 2-socket hardware.
Signed-off-by: Maciej Czekaj <redacted>
Signed-off-by: Kamil Rytarowski <redacted>
Signed-off-by: Zyta Szpak <redacted>
Signed-off-by: Slawomir Rosek <redacted>
Signed-off-by: Radoslaw Biernacki <redacted>
Signed-off-by: Jerin Jacob <redacted>
---
lib/librte_ether/rte_ethdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Is it possible to separate this patch from patchset, this is a ethdev
patch and it seems not directly related to the rest of the patchset?
Thanks,
ferruh
This patch is directly related with secondary queue set support on
ThunderX, but it can be skipped in this chain of patches and applied as
a standalone diff.
Is disabling this one on patch work sufficient? Of course unless there
are no more comments to produce v3 of the original patch chain "Add
support for secondary queue set in nicvf thunderx driver".
I think it is sufficient, at least I don't have any more comment for
rest of the patchset and it looks good to me.
Should I resubmit it as a new standalone patch?
Can you please resubmit just this one patch, so it can be properly reviewed.
Thanks,
ferruh
Hi Kamil,
On 9/30/2016 1:05 PM, Kamil Rytarowski wrote:
quoted
It's possible to have the same numbers for bus, device id and function,
therefore we need to differentiate on domain.
This enables DPDK with multiple VFs on ThunderX 2-socket hardware.
Signed-off-by: Maciej Czekaj <redacted>
Signed-off-by: Kamil Rytarowski <redacted>
Signed-off-by: Zyta Szpak <redacted>
Signed-off-by: Slawomir Rosek <redacted>
Signed-off-by: Radoslaw Biernacki <redacted>
Signed-off-by: Jerin Jacob <redacted>
---
lib/librte_ether/rte_ethdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Is it possible to separate this patch from patchset, this is a ethdev
patch and it seems not directly related to the rest of the patchset?
Thanks,
ferruh
This patch is directly related with secondary queue set support on
ThunderX, but it can be skipped in this chain of patches and applied as
a standalone diff.
Is disabling this one on patch work sufficient? Of course unless there
are no more comments to produce v3 of the original patch chain "Add
support for secondary queue set in nicvf thunderx driver".
I think it is sufficient, at least I don't have any more comment for
rest of the patchset and it looks good to me.
quoted
Should I resubmit it as a new standalone patch?
Can you please resubmit just this one patch, so it can be properly reviewed.
Thanks,
ferruh
Hi,
I've performed the needed actions.
This patch should be disabled in the patch-chain and has been resent as a new one.
From: Bruce Richardson <hidden> Date: 2016-10-12 15:59:15
On Fri, Sep 30, 2016 at 02:05:39PM +0200, Kamil Rytarowski wrote:
This series of patches adds support for secondary queue set in nicvf thunderx
driver
There are two types of VFs:
- Primary VF
- Secondary VF
Each port consist of a primary VF and n secondary VF(s). Each VF provides 8
Tx/Rx queues to a port. In case port is configured to use more than 8 queues,
then it requires one (or more) secondary VF. Each secondary VF adds additional
8 queues to the queue set.
During PMD driver initialization, the primary VF's are enumerated by checking the
specific flag (see READY message). They are at the beginning of VF list (the remain
ones are secondary VF's).
The primary VFs are used as master queue sets. Secondary VFs provide
additional queue sets for primary ones. If a port is configured for more then
8 queues then it will request for additional queues from secondary VFs.
Secondary VFs cannot be shared between primary VFs.
Primary VFs are present on the tail of the 'Network devices using kernel
driver' list, secondary VFs are on the remaining tail of the list.
The VNIC driver in the multiqueue setup works differently than other drivers
like `ixgbe`. We need to bind separately each specific queue set device with
the ``tools/dpdk-devbind.py`` utility.
Depending on the hardware used, the kernel driver sets a threshold ``vf_id``.
VFs that try to attach with an id below or equal to this boundary are
considered primary VFs. VFs that try to attach with an id above this boundary
are considered secondary VFs.
This patchset also contains other cleanups and improvements like fixing
erroneous checksum calculation and preparing the thunderx driver for the multi
queue set feature support.
These changes base on the following pending patches:
[dpdk-dev,1/3] net/thunderx: remove generic passx references from the driver
http://dpdk.org/dev/patchwork/patch/14963/
[dpdk-dev,2/3] net/thunderx: introduce cqe_rx2 HW capability flag
http://dpdk.org/dev/patchwork/patch/14964/
[dpdk-dev,3/3] net/thunderx: add 81xx SoC support
http://dpdk.org/dev/patchwork/patch/14965/
Kamil Rytarowski (15):
net/thunderx: cleanup the driver before adding new features
net/thunderx: correct transmit checksum handling
net/thunderx/base: add family of functions to store qsets
net/thunderx/base: add secondary queue set support
net/thunderx: add family of functions to store DPDK qsets
net/thunderx: add secondary queue set in interrupt functions
net/thunderx: remove problematic private_data->eth_dev link
net/thunderx: add helper utils for secondary qset support
net/thunderx: add secondary qset support in dev stop/close
net/thunderx: add secondary qset support in device start
net/thunderx: add secondary qset support in device configure
net/thunderx: add final bits for secondary queue support
net/thunderx: document secondary queue set support
ethdev: Support VFs on the different PCI domains
net/thunderx: Bump driver version to 2.0
Series applied to dpdk-next-net/rel_16_11, with the exception of patch 14 which
has been resubmitted as a separate ethdev patch:
http://dpdk.org/dev/patchwork/patch/16480/
/Bruce