net/idpf: optimize Tx/Rx qeue mode code
PATCH 1/1 net/idpf: optimize Tx/Rx qeue mode code
This patch update queue mode info in struct idpf_adapter. Using is_rx_singleq_model to diffentiate rx_singq and rx_splitq explicitly, instead of deducing it from pointer values.
--- drivers/common/idpf/idpf_common_device.c | 4 ++-- drivers/common/idpf/idpf_common_device.h | 4 ++-- drivers/common/idpf/idpf_common_rxtx.c | 2 +- drivers/common/idpf/idpf_common_rxtx.h | 4 ++++ drivers/net/idpf/idpf_ethdev.c | 4 ++-- drivers/net/idpf/idpf_rxtx.c | 6 +++--- 6 files changed, 14 insertions(+), 10 deletions(-)
drivers/common/idpf/idpf_common_device.c +2 -2
@@ -623,7 +623,7 @@ idpf_vport_info_init(struct idpf_vport *vport,struct idpf_adapter *adapter = vport->adapter; vport_info->vport_type =rte_cpu_to_le_16 (VIRTCHNL2_VPORT_TYPE_DEFAULT ); -if (adapter->txq_model ==0 ) { +if (!adapter->is_tx_singleq_model) { vport_info->txq_model =rte_cpu_to_le_16 (VIRTCHNL2_QUEUE_MODEL_SPLIT ); vport_info->num_tx_q =
@@ -636,7 +636,7 @@ idpf_vport_info_init(struct idpf_vport *vport, vport_info->num_tx_q =rte_cpu_to_le_16 (IDPF_DEFAULT_TXQ_NUM ); vport_info->num_tx_complq =0 ; } -if (adapter->rxq_model ==0 ) { +if (!adapter->is_rx_singleq_model) { vport_info->rxq_model =rte_cpu_to_le_16 (VIRTCHNL2_QUEUE_MODEL_SPLIT ); vport_info->num_rx_q =rte_cpu_to_le_16 (IDPF_DEFAULT_RXQ_NUM );
drivers/common/idpf/idpf_common_device.h +2 -2
@@ -43,8 +43,8 @@ struct idpf_adapter { uint32_t ptype_tbl[IDPF_MAX_PKT_TYPE] __rte_cache_min_aligned; -uint32_t txq_model;/* 0 - split queue model, non-0 - single queue model */ -uint32_t rxq_model;/* 0 - split queue model, non-0 - single queue model */ +bool is_tx_singleq_model;/* true - single queue model, false - split queue model */ +bool is_rx_singleq_model;/* true - single queue model, false - split queue model */ /* For timestamp */ uint64_t time_hw;
drivers/common/idpf/idpf_common_rxtx.c +1 -1
@@ -309,7 +309,7 @@ idpf_qc_rx_queue_release(void *rxq)return ;/* Split queue */ -if (q->bufq1 !=NULL && q->bufq2 !=NULL ) { +if (!q->adapter->is_rx_singleq_model) { q->bufq1->ops->release_mbufs (q->bufq1);rte_free (q->bufq1->sw_ring);rte_memzone_free (q->bufq1->mz);
drivers/common/idpf/idpf_common_rxtx.h +4 -0
@@ -90,6 +90,10 @@#define PF_GLTSYN_SHTIME_L_5 (PF_TIMESYNC_BAR4_BASE + 0x138)#define PF_GLTSYN_SHTIME_H_5 (PF_TIMESYNC_BAR4_BASE + 0x13C) +enum idpf_rx_split_bufq_id { +IDPF_SPLIT_BUFQ1_ID =1 , +IDPF_SPLIT_BUFQ2_ID =2 +};struct idpf_rx_stats {uint64_t mbuf_alloc_failed; };
drivers/net/idpf/idpf_ethdev.c +2 -2
@@ -993,12 +993,12 @@ idpf_parse_devargs(struct rte_pci_device *pci_dev, struct idpf_adapter_ext *adap goto bail; ret =rte_kvargs_process (kvlist,IDPF_TX_SINGLE_Q , &parse_bool, - &adapter->base.txq_model); + &adapter->base.is_tx_singleq_model);if (ret !=0 ) goto bail; ret =rte_kvargs_process (kvlist,IDPF_RX_SINGLE_Q , &parse_bool, - &adapter->base.rxq_model); + &adapter->base.is_rx_singleq_model);if (ret !=0 ) goto bail;
drivers/net/idpf/idpf_rxtx.c +3 -3
@@ -189,9 +189,9 @@ idpf_rx_split_bufq_setup(struct rte_eth_dev *dev, struct idpf_rx_queue *rxq, bufq->ops = &def_rxq_ops; bufq->q_set = true; -if (bufq_id ==1 ) { +if (bufq_id ==IDPF_SPLIT_BUFQ1_ID ) { rxq->bufq1 = bufq; - }else if (bufq_id ==2 ) { + }else if (bufq_id ==IDPF_SPLIT_BUFQ2_ID ) { rxq->bufq2 = bufq; }else {PMD_INIT_LOG (ERR ,"Invalid buffer queue index." );
@@ -536,7 +536,7 @@ idpf_rx_queue_init(struct rte_eth_dev *dev, uint16_t rx_queue_id)return -EIO ; } -if (rxq->bufq1 ==NULL ) { +if (rxq->adapter->is_rx_singleq_model) {/* Single queue */ err =idpf_qc_single_rxq_mbufs_alloc (rxq);if (err !=0 ) {
Signature · 1 line
2.34.1
PATCH v2 1/1 net/idpf: refine Rx/Tx queue model info
This patch updates queue mode info in struct idpf_adapter. Using is_rx_singleq_model to diffentiate rx_singq and rx_splitq explicitly, instead of deducing it from pointer values.
--- drivers/common/idpf/idpf_common_device.c | 4 ++-- drivers/common/idpf/idpf_common_device.h | 4 ++-- drivers/common/idpf/idpf_common_rxtx.c | 2 +- drivers/common/idpf/idpf_common_rxtx.h | 5 +++++ drivers/net/idpf/idpf_ethdev.c | 4 ++-- drivers/net/idpf/idpf_rxtx.c | 6 +++--- 6 files changed, 15 insertions(+), 10 deletions(-)
drivers/common/idpf/idpf_common_device.c +2 -2
@@ -623,7 +623,7 @@ idpf_vport_info_init(struct idpf_vport *vport,struct idpf_adapter *adapter = vport->adapter; vport_info->vport_type =rte_cpu_to_le_16 (VIRTCHNL2_VPORT_TYPE_DEFAULT ); -if (adapter->txq_model ==0 ) { +if (!adapter->is_tx_singleq) { vport_info->txq_model =rte_cpu_to_le_16 (VIRTCHNL2_QUEUE_MODEL_SPLIT ); vport_info->num_tx_q =
@@ -636,7 +636,7 @@ idpf_vport_info_init(struct idpf_vport *vport, vport_info->num_tx_q =rte_cpu_to_le_16 (IDPF_DEFAULT_TXQ_NUM ); vport_info->num_tx_complq =0 ; } -if (adapter->rxq_model ==0 ) { +if (!adapter->is_rx_singleq) { vport_info->rxq_model =rte_cpu_to_le_16 (VIRTCHNL2_QUEUE_MODEL_SPLIT ); vport_info->num_rx_q =rte_cpu_to_le_16 (IDPF_DEFAULT_RXQ_NUM );
drivers/common/idpf/idpf_common_device.h +2 -2
@@ -43,8 +43,8 @@ struct idpf_adapter { uint32_t ptype_tbl[IDPF_MAX_PKT_TYPE] __rte_cache_min_aligned; -uint32_t txq_model;/* 0 - split queue model, non-0 - single queue model */ -uint32_t rxq_model;/* 0 - split queue model, non-0 - single queue model */ +bool is_tx_singleq;/* true - single queue model, false - split queue model */ +bool is_rx_singleq;/* true - single queue model, false - split queue model */ /* For timestamp */ uint64_t time_hw;
drivers/common/idpf/idpf_common_rxtx.c +1 -1
@@ -309,7 +309,7 @@ idpf_qc_rx_queue_release(void *rxq)return ;/* Split queue */ -if (q->bufq1 !=NULL && q->bufq2 !=NULL ) { +if (!q->adapter->is_rx_singleq) { q->bufq1->ops->release_mbufs (q->bufq1);rte_free (q->bufq1->sw_ring);rte_memzone_free (q->bufq1->mz);
drivers/common/idpf/idpf_common_rxtx.h +5 -0
@@ -90,6 +90,11 @@#define PF_GLTSYN_SHTIME_L_5 (PF_TIMESYNC_BAR4_BASE + 0x138)#define PF_GLTSYN_SHTIME_H_5 (PF_TIMESYNC_BAR4_BASE + 0x13C) +enum idpf_rx_split_bufq_id { +IDPF_RX_SPLIT_BUFQ1_ID =1 , +IDPF_RX_SPLIT_BUFQ2_ID =2 +}; +struct idpf_rx_stats {uint64_t mbuf_alloc_failed; };
drivers/net/idpf/idpf_ethdev.c +2 -2
@@ -993,12 +993,12 @@ idpf_parse_devargs(struct rte_pci_device *pci_dev, struct idpf_adapter_ext *adap goto bail; ret =rte_kvargs_process (kvlist,IDPF_TX_SINGLE_Q , &parse_bool, - &adapter->base.txq_model); + &adapter->base.is_tx_singleq);if (ret !=0 ) goto bail; ret =rte_kvargs_process (kvlist,IDPF_RX_SINGLE_Q , &parse_bool, - &adapter->base.rxq_model); + &adapter->base.is_rx_singleq);if (ret !=0 ) goto bail;
drivers/net/idpf/idpf_rxtx.c +3 -3
@@ -189,9 +189,9 @@ idpf_rx_split_bufq_setup(struct rte_eth_dev *dev, struct idpf_rx_queue *rxq, bufq->ops = &def_rxq_ops; bufq->q_set = true; -if (bufq_id ==1 ) { +if (bufq_id ==IDPF_RX_SPLIT_BUFQ1_ID ) { rxq->bufq1 = bufq; - }else if (bufq_id ==2 ) { + }else if (bufq_id ==IDPF_RX_SPLIT_BUFQ2_ID ) { rxq->bufq2 = bufq; }else {PMD_INIT_LOG (ERR ,"Invalid buffer queue index." );
@@ -536,7 +536,7 @@ idpf_rx_queue_init(struct rte_eth_dev *dev, uint16_t rx_queue_id)return -EIO ; } -if (rxq->bufq1 ==NULL ) { +if (rxq->adapter->is_rx_singleq) {/* Single queue */ err =idpf_qc_single_rxq_mbufs_alloc (rxq);if (err !=0 ) {
Signature · 1 line
2.34.1
RE: [PATCH v2] net/idpf: refine Rx/Tx queue model info
Quoted 90 lines
-----Original Message-----
From: Mingxia Liu <[email protected]>
Sent: Thursday, March 2, 2023 3:27 AM
To: [email protected]
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Liu, Mingxia <[email protected]>
Subject: [PATCH v2] net/idpf: refine Rx/Tx queue model infoThis patch updates queue mode info in struct
idpf_adapter. Usingis_rx_singleq_modelto diffentiaterx_singqandrx_splitqexplicitly, instead of deducing it from pointer values.Signed-off-by Mingxia Liu <[email protected]>--- drivers/common/idpf/idpf_common_device.c | 4 ++-- drivers/common/idpf/idpf_common_device.h | 4 ++-- drivers/common/idpf/idpf_common_rxtx.c | 2 +- drivers/common/idpf/idpf_common_rxtx.h | 5 +++++ drivers/net/idpf/idpf_ethdev.c | 4 ++-- drivers/net/idpf/idpf_rxtx.c | 6 +++--- 6 files changed, 15 insertions(+), 10 deletions(-)drivers/common/idpf/idpf_common_device.c +1
-1@@ -623,7 +623,7 @@ idpf_vport_info_init(struct idpf_vport *vport,struct idpf_adapter *adapter = vport->adapter; vport_info->vport_type =rte_cpu_to_le_16 (VIRTCHNL2_VPORT_TYPE_DEFAULT ); -if (adapter->txq_model ==0 ) { +if (!adapter->is_tx_singleq) { vport_info->txq_model =rte_cpu_to_le_16 (VIRTCHNL2_QUEUE_MODEL_SPLIT );drivers/common/idpf/idpf_common_device.c +1
-1vport_info->num_tx_q =@@ -636,7 +636,7 @@ idpf_vport_info_init(struct idpf_vport *vport, vport_info->num_tx_q =rte_cpu_to_le_16 (IDPF_DEFAULT_TXQ_NUM ); vport_info->num_tx_complq =0 ; } -if (adapter->rxq_model ==0 ) { +if (!adapter->is_rx_singleq) { vport_info->rxq_model =rte_cpu_to_le_16 (VIRTCHNL2_QUEUE_MODEL_SPLIT );
vport_info->num_rx_q=rte_cpu_to_le_16(IDPF_DEFAULT_RXQ_NUM);drivers/common/idpf/idpf_common_device.h +0
-1@@ -43,8 +43,8 @@ struct idpf_adapter { uint32_t ptype_tbl[IDPF_MAX_PKT_TYPE] __rte_cache_min_aligned; -uint32_t txq_model;/* 0 - split queue model, non-0 - single queue model */
drivers/common/idpf/idpf_common_device.h +0
-1-uint32_t rxq_model;/* 0 - split queue model, non-0 - single queue model */
drivers/common/idpf/idpf_common_device.h +1
-0+bool is_tx_singleq;/* true - single queue model, false - split queue model */
drivers/common/idpf/idpf_common_device.h +2
-0+bool is_rx_singleq;/* true - single queue model, false - split queue +model */ /* For timestamp */ uint64_t time_hw;drivers/common/idpf/idpf_common_rxtx.c +1
-1@@ -309,7 +309,7 @@ idpf_qc_rx_queue_release(void *rxq)return ;/* Split queue */ -if (q->bufq1 !=NULL && q->bufq2 !=NULL ) { +if (!q->adapter->is_rx_singleq) { q->bufq1->ops->release_mbufs (q->bufq1);rte_free (q->bufq1->sw_ring);rte_memzone_free (q->bufq1->mz);drivers/common/idpf/idpf_common_rxtx.h +0
-0
drivers/common/idpf/idpf_common_rxtx.h line 96
Quoted 7 lines
drivers/common/idpf/idpf_common_rxtx.h +4
-0@@ -90,6 +90,11 @@#define PF_GLTSYN_SHTIME_L_5 (PF_TIMESYNC_BAR4_BASE + 0x138)#define PF_GLTSYN_SHTIME_H_5 (PF_TIMESYNC_BAR4_BASE + 0x13C) +enum idpf_rx_split_bufq_id { +IDPF_RX_SPLIT_BUFQ1_ID =1 , +IDPF_RX_SPLIT_BUFQ2_ID =2 +};
enum type never be referenced,
it's not necessary, #define should be ok.
Re: [PATCH v2] net/idpf: refine Rx/Tx queue model info
Quoted 93 lines · Qi Z
Quoted 93 lines
-----Original Message-----
From: Mingxia Liu <[email protected]>
Sent: Thursday, March 2, 2023 3:27 AM
To: [email protected]
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Liu, Mingxia <[email protected]>
Subject: [PATCH v2] net/idpf: refine Rx/Tx queue model infoThis patch updates queue mode info in struct
idpf_adapter. Usingis_rx_singleq_modelto diffentiaterx_singqandrx_splitqexplicitly, instead of deducing it from pointer values.Signed-off-by Mingxia Liu <[email protected]>--- drivers/common/idpf/idpf_common_device.c | 4 ++-- drivers/common/idpf/idpf_common_device.h | 4 ++-- drivers/common/idpf/idpf_common_rxtx.c | 2 +- drivers/common/idpf/idpf_common_rxtx.h | 5 +++++ drivers/net/idpf/idpf_ethdev.c | 4 ++-- drivers/net/idpf/idpf_rxtx.c | 6 +++--- 6 files changed, 15 insertions(+), 10 deletions(-)drivers/common/idpf/idpf_common_device.c +1
-1@@ -623,7 +623,7 @@ idpf_vport_info_init(struct idpf_vport *vport,struct idpf_adapter *adapter = vport->adapter; vport_info->vport_type =rte_cpu_to_le_16 (VIRTCHNL2_VPORT_TYPE_DEFAULT ); -if (adapter->txq_model ==0 ) { +if (!adapter->is_tx_singleq) { vport_info->txq_model =rte_cpu_to_le_16 (VIRTCHNL2_QUEUE_MODEL_SPLIT );drivers/common/idpf/idpf_common_device.c +1
-1vport_info->num_tx_q =@@ -636,7 +636,7 @@ idpf_vport_info_init(struct idpf_vport *vport, vport_info->num_tx_q =rte_cpu_to_le_16 (IDPF_DEFAULT_TXQ_NUM ); vport_info->num_tx_complq =0 ; } -if (adapter->rxq_model ==0 ) { +if (!adapter->is_rx_singleq) { vport_info->rxq_model =rte_cpu_to_le_16 (VIRTCHNL2_QUEUE_MODEL_SPLIT );
vport_info->num_rx_q=rte_cpu_to_le_16(IDPF_DEFAULT_RXQ_NUM);drivers/common/idpf/idpf_common_device.h +0
-1@@ -43,8 +43,8 @@ struct idpf_adapter { uint32_t ptype_tbl[IDPF_MAX_PKT_TYPE] __rte_cache_min_aligned; -uint32_t txq_model;/* 0 - split queue model, non-0 - single queue model */
drivers/common/idpf/idpf_common_device.h +0
-1-uint32_t rxq_model;/* 0 - split queue model, non-0 - single queue model */
drivers/common/idpf/idpf_common_device.h +1
-0+bool is_tx_singleq;/* true - single queue model, false - split queue model */
drivers/common/idpf/idpf_common_device.h +2
-0+bool is_rx_singleq;/* true - single queue model, false - split queue +model */ /* For timestamp */ uint64_t time_hw;drivers/common/idpf/idpf_common_rxtx.c +1
-1@@ -309,7 +309,7 @@ idpf_qc_rx_queue_release(void *rxq)return ;/* Split queue */ -if (q->bufq1 !=NULL && q->bufq2 !=NULL ) { +if (!q->adapter->is_rx_singleq) { q->bufq1->ops->release_mbufs (q->bufq1);rte_free (q->bufq1->sw_ring);rte_memzone_free (q->bufq1->mz);drivers/common/idpf/idpf_common_rxtx.h +0
-0@@ -90,6 +90,11 @@#define PF_GLTSYN_SHTIME_L_5 (PF_TIMESYNC_BAR4_BASE + 0x138)#define PF_GLTSYN_SHTIME_H_5 (PF_TIMESYNC_BAR4_BASE + 0x13C)
Quoted 8 lines
drivers/common/idpf/idpf_common_rxtx.h line 96
Quoted 4 lines
drivers/common/idpf/idpf_common_rxtx.h +4
-0+enum idpf_rx_split_bufq_id { +IDPF_RX_SPLIT_BUFQ1_ID =1 , +IDPF_RX_SPLIT_BUFQ2_ID =2 +};enum type never be referenced,
it's not necessary, #define should be ok.
Hi Qi,
Is it OK if I merge this patch directly to next-net (when it get your ack), because of v8 CPFL dependency?
Otherwise it may cause issues in main if next-net pulled before next-net-intel.
RE: [PATCH v2] net/idpf: refine Rx/Tx queue model info
Quoted 114 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Thursday, March 2, 2023 6:07 PM
To: Zhang, Qi Z <[email protected]>; Liu, Mingxia <[email protected]>; [email protected]
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Subject: Re: [PATCH v2] net/idpf: refine Rx/Tx queue model infoQuoted 94 lines · Qi Z
Quoted 94 lines
-----Original Message-----
From: Mingxia Liu <[email protected]>
Sent: Thursday, March 2, 2023 3:27 AM
To: [email protected]
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Liu, Mingxia <[email protected]>
Subject: [PATCH v2] net/idpf: refine Rx/Tx queue model infoThis patch updates queue mode info in struct
idpf_adapter. Usingis_rx_singleq_modelto diffentiaterx_singqandrx_splitqexplicitly, instead of deducing it from pointer values.Signed-off-by Mingxia Liu <[email protected]>--- drivers/common/idpf/idpf_common_device.c | 4 ++-- drivers/common/idpf/idpf_common_device.h | 4 ++-- drivers/common/idpf/idpf_common_rxtx.c | 2 +- drivers/common/idpf/idpf_common_rxtx.h | 5 +++++ drivers/net/idpf/idpf_ethdev.c | 4 ++-- drivers/net/idpf/idpf_rxtx.c | 6 +++--- 6 files changed, 15 insertions(+), 10 deletions(-)drivers/common/idpf/idpf_common_device.c +1
-1@@ -623,7 +623,7 @@ idpf_vport_info_init(struct idpf_vport *vport,struct idpf_adapter *adapter = vport->adapter; vport_info->vport_type =rte_cpu_to_le_16 (VIRTCHNL2_VPORT_TYPE_DEFAULT ); -if (adapter->txq_model ==0 ) { +if (!adapter->is_tx_singleq) { vport_info->txq_model =rte_cpu_to_le_16 (VIRTCHNL2_QUEUE_MODEL_SPLIT );drivers/common/idpf/idpf_common_device.c +1
-1vport_info->num_tx_q =@@ -636,7 +636,7 @@ idpf_vport_info_init(struct idpf_vport *vport, vport_info->num_tx_q =rte_cpu_to_le_16 (IDPF_DEFAULT_TXQ_NUM ); vport_info->num_tx_complq =0 ; } -if (adapter->rxq_model ==0 ) { +if (!adapter->is_rx_singleq) { vport_info->rxq_model =rte_cpu_to_le_16 (VIRTCHNL2_QUEUE_MODEL_SPLIT );
vport_info->num_rx_q=rte_cpu_to_le_16(IDPF_DEFAULT_RXQ_NUM);drivers/common/idpf/idpf_common_device.h +0
-1@@ -43,8 +43,8 @@ struct idpf_adapter { uint32_t ptype_tbl[IDPF_MAX_PKT_TYPE] __rte_cache_min_aligned; -uint32_t txq_model;/* 0 - split queue model, non-0 - single queue model */
drivers/common/idpf/idpf_common_device.h +0
-1-uint32_t rxq_model;/* 0 - split queue model, non-0 - single queue model */
drivers/common/idpf/idpf_common_device.h +2
-0+bool is_tx_singleq;/* true - single queue model, false - split +queue model */
drivers/common/idpf/idpf_common_device.h +2
-0+bool is_rx_singleq;/* true - single queue model, false - split +queue model */ /* For timestamp */ uint64_t time_hw;drivers/common/idpf/idpf_common_rxtx.c +1
-1@@ -309,7 +309,7 @@ idpf_qc_rx_queue_release(void *rxq)return ;/* Split queue */ -if (q->bufq1 !=NULL && q->bufq2 !=NULL ) { +if (!q->adapter->is_rx_singleq) { q->bufq1->ops->release_mbufs (q->bufq1);rte_free (q->bufq1->sw_ring);rte_memzone_free (q->bufq1->mz);drivers/common/idpf/idpf_common_rxtx.h +0
-0@@ -90,6 +90,11 @@#define PF_GLTSYN_SHTIME_L_5 (PF_TIMESYNC_BAR4_BASE + 0x138)#define PF_GLTSYN_SHTIME_H_5 (PF_TIMESYNC_BAR4_BASE + 0x13C)Quoted 8 lines
drivers/common/idpf/idpf_common_rxtx.h line 96
Quoted 4 lines
drivers/common/idpf/idpf_common_rxtx.h +4
-0+enum idpf_rx_split_bufq_id { +IDPF_RX_SPLIT_BUFQ1_ID =1 , +IDPF_RX_SPLIT_BUFQ2_ID =2 +};enum type never be referenced,
it's not necessary, #define should be ok.
Quoted 6 lines
Hi Qi,
Is it OK if I merge this patch directly to next-net (when it get your ack), because of v8 CPFL dependency?
Otherwise it may cause issues in main if next-net pulled before next-net-intel.
Yes, please. thanks
RE: [PATCH v2] net/idpf: refine Rx/Tx queue model info
Quoted 131 lines
-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: Thursday, March 2, 2023 6:28 PM
To: Ferruh Yigit <[email protected]>; Liu, Mingxia <[email protected]>; [email protected]
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Subject: RE: [PATCH v2] net/idpf: refine Rx/Tx queue model infoQuoted 42 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Thursday, March 2, 2023 6:07 PM
To: Zhang, Qi Z <[email protected]>; Liu, Mingxia <[email protected]>; [email protected]
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Subject: Re: [PATCH v2] net/idpf: refine Rx/Tx queue model infoQuoted 32 lines · Qi Z
Quoted 32 lines
-----Original Message-----
From: Mingxia Liu <[email protected]>
Sent: Thursday, March 2, 2023 3:27 AM
To: [email protected]
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Liu, Mingxia <[email protected]>
Subject: [PATCH v2] net/idpf: refine Rx/Tx queue model infoThis patch updates queue mode info in struct
idpf_adapter. Usingis_rx_singleq_modelto diffentiaterx_singqandrx_splitqexplicitly, instead of deducing it from pointer values.Signed-off-by Mingxia Liu <[email protected]>--- drivers/common/idpf/idpf_common_device.c | 4 ++-- drivers/common/idpf/idpf_common_device.h | 4 ++-- drivers/common/idpf/idpf_common_rxtx.c | 2 +- drivers/common/idpf/idpf_common_rxtx.h | 5 +++++ drivers/net/idpf/idpf_ethdev.c | 4 ++-- drivers/net/idpf/idpf_rxtx.c | 6 +++--- 6 files changed, 15 insertions(+), 10 deletions(-)drivers/common/idpf/idpf_common_device.c +0
-0@@ -623,7 +623,7 @@ idpf_vport_info_init(struct idpf_vport *vport,struct idpf_adapter *adapter = vport->adapter;Quoted 6 lines
Quoted 6 lines
drivers/common/idpf/idpf_common_device.c idpf_vport_info_init(struct idpf_vport *vport,
Quoted 6 lines
drivers/common/idpf/idpf_common_device.c +1
-1vport_info->vport_type =rte_cpu_to_le_16 (VIRTCHNL2_VPORT_TYPE_DEFAULT ); -if (adapter->txq_model ==0 ) { +if (!adapter->is_tx_singleq) { vport_info->txq_model =rte_cpu_to_le_16(VIRTCHNL2_QUEUE_MODEL_SPLIT);Quoted 10 lines
Quoted 10 lines
drivers/common/idpf/idpf_common_device.c idpf_vport_info_init(struct idpf_vport *vport, · line 642
Quoted 10 lines
drivers/common/idpf/idpf_common_device.c +1
-1vport_info->num_tx_q =@@ -636,7 +636,7 @@ idpf_vport_info_init(struct idpf_vport *vport, vport_info->num_tx_q =rte_cpu_to_le_16 (IDPF_DEFAULT_TXQ_NUM ); vport_info->num_tx_complq =0 ; } -if (adapter->rxq_model ==0 ) { +if (!adapter->is_rx_singleq) { vport_info->rxq_model =rte_cpu_to_le_16(VIRTCHNL2_QUEUE_MODEL_SPLIT);Quoted 10 lines
Quoted 10 lines
drivers/common/idpf/idpf_common_device.h struct idpf_adapter { · line 44
Quoted 10 lines
vport_info->num_rx_q=rte_cpu_to_le_16(IDPF_DEFAULT_RXQ_NUM);drivers/common/idpf/idpf_common_device.h +0
-0@@ -43,8 +43,8 @@ struct idpf_adapter {uint32_t ptype_tbl[IDPF_MAX_PKT_TYPE ]
__rte_cache_min_aligned;Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
drivers/common/idpf/idpf_common_device.h +0
-1-uint32_t txq_model;/* 0 - split queue model, non-0 - single queue model */
drivers/common/idpf/idpf_common_device.h +0
-1-uint32_t rxq_model;/* 0 - split queue model, non-0 - single queue model */
drivers/common/idpf/idpf_common_device.h +2
-0+bool is_tx_singleq;/* true - single queue model, false - split +queue model */
drivers/common/idpf/idpf_common_device.h +2
-0+bool is_rx_singleq;/* true - single queue model, false - split +queue model */ /* For timestamp */ uint64_t time_hw;drivers/common/idpf/idpf_common_rxtx.c +0
-0@@ -309,7 +309,7 @@ idpf_qc_rx_queue_release(void *rxq)return ;Quoted 13 lines
Quoted 5 lines
Quoted 5 lines
drivers/common/idpf/idpf_common_rxtx.c +1
-1/* Split queue */ -if (q->bufq1 !=NULL && q->bufq2 !=NULL ) { +if (!q->adapter->is_rx_singleq) { q->bufq1->ops->release_mbufs (q->bufq1);rte_free (q->bufq1->sw_ring);Quoted 8 lines
drivers/common/idpf/idpf_common_rxtx.h line 90
Quoted 8 lines
drivers/common/idpf/idpf_common_rxtx.c +0
-0rte_memzone_free (q->bufq1->mz);drivers/common/idpf/idpf_common_rxtx.h +0
-0@@ -90,6 +90,11 @@#define PF_GLTSYN_SHTIME_L_5 (PF_TIMESYNC_BAR4_BASE +
0x138)Quoted 1 line
Quoted 1 line
drivers/common/idpf/idpf_common_rxtx.h line 91
Quoted 1 line
drivers/common/idpf/idpf_common_rxtx.h +0
-0#define PF_GLTSYN_SHTIME_H_5 (PF_TIMESYNC_BAR4_BASE +
0x13C)Quoted 10 lines
Quoted 9 lines
drivers/common/idpf/idpf_common_rxtx.h line 96
Quoted 5 lines
drivers/common/idpf/idpf_common_rxtx.h +4
-0+enum idpf_rx_split_bufq_id { +IDPF_RX_SPLIT_BUFQ1_ID =1 , +IDPF_RX_SPLIT_BUFQ2_ID =2 +};enum type never be referenced,
it's not necessary, #define should be ok.
Quoted 8 lines
Quoted 6 lines
Hi Qi,
Is it OK if I merge this patch directly to next-net (when it get your ack), because of v8 CPFL dependency?
Otherwise it may cause issues in main if next-net pulled before next-net-intel.Yes, please. Thanks
[Liu, Mingxia] updated, changed enum type to #define.
PATCH v3 1/1 net/idpf: refine Rx/Tx queue model info
In reply to Mingxia LiuThis patch updates queue mode info in struct idpf_adapter. Using is_rx_singleq_model to diffentiate rx_singq and rx_splitq explicitly, instead of deducing it from pointer values.
--- drivers/common/idpf/idpf_common_device.c | 4 ++-- drivers/common/idpf/idpf_common_device.h | 4 ++-- drivers/common/idpf/idpf_common_rxtx.c | 2 +- drivers/common/idpf/idpf_common_rxtx.h | 3 +++ drivers/net/idpf/idpf_ethdev.c | 4 ++-- drivers/net/idpf/idpf_rxtx.c | 6 +++--- 6 files changed, 13 insertions(+), 10 deletions(-)
drivers/common/idpf/idpf_common_device.c +2 -2
@@ -623,7 +623,7 @@ idpf_vport_info_init(struct idpf_vport *vport,struct idpf_adapter *adapter = vport->adapter; vport_info->vport_type =rte_cpu_to_le_16 (VIRTCHNL2_VPORT_TYPE_DEFAULT ); -if (adapter->txq_model ==0 ) { +if (!adapter->is_tx_singleq) { vport_info->txq_model =rte_cpu_to_le_16 (VIRTCHNL2_QUEUE_MODEL_SPLIT ); vport_info->num_tx_q =
@@ -636,7 +636,7 @@ idpf_vport_info_init(struct idpf_vport *vport, vport_info->num_tx_q =rte_cpu_to_le_16 (IDPF_DEFAULT_TXQ_NUM ); vport_info->num_tx_complq =0 ; } -if (adapter->rxq_model ==0 ) { +if (!adapter->is_rx_singleq) { vport_info->rxq_model =rte_cpu_to_le_16 (VIRTCHNL2_QUEUE_MODEL_SPLIT ); vport_info->num_rx_q =rte_cpu_to_le_16 (IDPF_DEFAULT_RXQ_NUM );
drivers/common/idpf/idpf_common_device.h +2 -2
@@ -43,8 +43,8 @@ struct idpf_adapter { uint32_t ptype_tbl[IDPF_MAX_PKT_TYPE] __rte_cache_min_aligned; -uint32_t txq_model;/* 0 - split queue model, non-0 - single queue model */ -uint32_t rxq_model;/* 0 - split queue model, non-0 - single queue model */ +bool is_tx_singleq;/* true - single queue model, false - split queue model */ +bool is_rx_singleq;/* true - single queue model, false - split queue model */ /* For timestamp */ uint64_t time_hw;
drivers/common/idpf/idpf_common_rxtx.c +1 -1
@@ -309,7 +309,7 @@ idpf_qc_rx_queue_release(void *rxq)return ;/* Split queue */ -if (q->bufq1 !=NULL && q->bufq2 !=NULL ) { +if (!q->adapter->is_rx_singleq) { q->bufq1->ops->release_mbufs (q->bufq1);rte_free (q->bufq1->sw_ring);rte_memzone_free (q->bufq1->mz);
drivers/common/idpf/idpf_common_rxtx.h +3 -0
@@ -90,6 +90,9 @@#define PF_GLTSYN_SHTIME_L_5 (PF_TIMESYNC_BAR4_BASE + 0x138)#define PF_GLTSYN_SHTIME_H_5 (PF_TIMESYNC_BAR4_BASE + 0x13C) +#define IDPF_RX_SPLIT_BUFQ1_ID 1 +#define IDPF_RX_SPLIT_BUFQ2_ID 2 +struct idpf_rx_stats {uint64_t mbuf_alloc_failed; };
drivers/net/idpf/idpf_ethdev.c +2 -2
@@ -993,12 +993,12 @@ idpf_parse_devargs(struct rte_pci_device *pci_dev, struct idpf_adapter_ext *adap goto bail; ret =rte_kvargs_process (kvlist,IDPF_TX_SINGLE_Q , &parse_bool, - &adapter->base.txq_model); + &adapter->base.is_tx_singleq);if (ret !=0 ) goto bail; ret =rte_kvargs_process (kvlist,IDPF_RX_SINGLE_Q , &parse_bool, - &adapter->base.rxq_model); + &adapter->base.is_rx_singleq);if (ret !=0 ) goto bail;
drivers/net/idpf/idpf_rxtx.c +3 -3
@@ -189,9 +189,9 @@ idpf_rx_split_bufq_setup(struct rte_eth_dev *dev, struct idpf_rx_queue *rxq, bufq->ops = &def_rxq_ops; bufq->q_set = true; -if (bufq_id ==1 ) { +if (bufq_id ==IDPF_RX_SPLIT_BUFQ1_ID ) { rxq->bufq1 = bufq; - }else if (bufq_id ==2 ) { + }else if (bufq_id ==IDPF_RX_SPLIT_BUFQ2_ID ) { rxq->bufq2 = bufq; }else {PMD_INIT_LOG (ERR ,"Invalid buffer queue index." );
@@ -536,7 +536,7 @@ idpf_rx_queue_init(struct rte_eth_dev *dev, uint16_t rx_queue_id)return -EIO ; } -if (rxq->bufq1 ==NULL ) { +if (rxq->adapter->is_rx_singleq) {/* Single queue */ err =idpf_qc_single_rxq_mbufs_alloc (rxq);if (err !=0 ) {
Signature · 1 line
2.34.1
Re: [PATCH v3] net/idpf: refine Rx/Tx queue model info
Quoted 5 lines · Mingxia Liu
This patch updates queue mode info in struct
idpf_adapter. Usingis_rx_singleq_modelto diffentiaterx_singqandrx_splitqexplicitly, instead of deducing it from pointer values.Signed-off-by Mingxia Liu <[email protected]>
Moving ack from previous version:
Applied to dpdk-next-net/main, thanks.
RE: [PATCH v2] net/idpf: refine Rx/Tx queue model info
In reply to Mingxia LiuQuoted 10 lines
-----Original Message-----
From: Liu, Mingxia <[email protected]>
Sent: Thursday, March 2, 2023 3:27 AM
To: [email protected]
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Liu, Mingxia <[email protected]>
Subject: [PATCH v2] net/idpf: refine Rx/Tx queue model info
Quoted 5 lines
This patch updates queue mode info in struct
idpf_adapter. Usingis_rx_singleq_modelto diffentiaterx_singqandrx_splitqexplicitly, instead of deducing it from pointer values.Signed-off-by Mingxia Liu <[email protected]>