DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 20/25] net/cpfl: updating cpfl based on latest base driver
@ 2024-05-28  7:36 Soumyadeep Hore
  2024-05-28  7:36 ` [PATCH 21/25] common/idpf: defining ethernet address length macro Soumyadeep Hore
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Soumyadeep Hore @ 2024-05-28  7:36 UTC (permalink / raw)
  To: jingjing.wu; +Cc: dev

Based on latest implemenation of struct VIRTCHNL_QUEUE_TYPE_RX
in virtchnl2.h, qg_info field is removed and its members are
added in the above mentioned structure. Hence updating the same.

Signed-off-by: Soumyadeep Hore <soumyadeep.hore@intel.com>
---
 drivers/net/cpfl/cpfl_ethdev.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c
index 7e718e9e19..e707043bf7 100644
--- a/drivers/net/cpfl/cpfl_ethdev.c
+++ b/drivers/net/cpfl/cpfl_ethdev.c
@@ -2393,18 +2393,18 @@ cpfl_p2p_q_grps_add(struct idpf_vport *vport,
 	int ret;
 
 	p2p_queue_grps_info->vport_id = vport->vport_id;
-	p2p_queue_grps_info->qg_info.num_queue_groups = CPFL_P2P_NB_QUEUE_GRPS;
-	p2p_queue_grps_info->qg_info.groups[0].num_rx_q = CPFL_MAX_P2P_NB_QUEUES;
-	p2p_queue_grps_info->qg_info.groups[0].num_rx_bufq = CPFL_P2P_NB_RX_BUFQ;
-	p2p_queue_grps_info->qg_info.groups[0].num_tx_q = CPFL_MAX_P2P_NB_QUEUES;
-	p2p_queue_grps_info->qg_info.groups[0].num_tx_complq = CPFL_P2P_NB_TX_COMPLQ;
-	p2p_queue_grps_info->qg_info.groups[0].qg_id.queue_group_id = CPFL_P2P_QUEUE_GRP_ID;
-	p2p_queue_grps_info->qg_info.groups[0].qg_id.queue_group_type = VIRTCHNL2_QUEUE_GROUP_P2P;
-	p2p_queue_grps_info->qg_info.groups[0].rx_q_grp_info.rss_lut_size = 0;
-	p2p_queue_grps_info->qg_info.groups[0].tx_q_grp_info.tx_tc = 0;
-	p2p_queue_grps_info->qg_info.groups[0].tx_q_grp_info.priority = 0;
-	p2p_queue_grps_info->qg_info.groups[0].tx_q_grp_info.is_sp = 0;
-	p2p_queue_grps_info->qg_info.groups[0].tx_q_grp_info.pir_weight = 0;
+	p2p_queue_grps_info->num_queue_groups = CPFL_P2P_NB_QUEUE_GRPS;
+	p2p_queue_grps_info->groups[0].num_rx_q = CPFL_MAX_P2P_NB_QUEUES;
+	p2p_queue_grps_info->groups[0].num_rx_bufq = CPFL_P2P_NB_RX_BUFQ;
+	p2p_queue_grps_info->groups[0].num_tx_q = CPFL_MAX_P2P_NB_QUEUES;
+	p2p_queue_grps_info->groups[0].num_tx_complq = CPFL_P2P_NB_TX_COMPLQ;
+	p2p_queue_grps_info->groups[0].qg_id.queue_group_id = CPFL_P2P_QUEUE_GRP_ID;
+	p2p_queue_grps_info->groups[0].qg_id.queue_group_type = VIRTCHNL2_QUEUE_GROUP_P2P;
+	p2p_queue_grps_info->groups[0].rx_q_grp_info.rss_lut_size = 0;
+	p2p_queue_grps_info->groups[0].tx_q_grp_info.tx_tc = 0;
+	p2p_queue_grps_info->groups[0].tx_q_grp_info.priority = 0;
+	p2p_queue_grps_info->groups[0].tx_q_grp_info.is_sp = 0;
+	p2p_queue_grps_info->groups[0].tx_q_grp_info.pir_weight = 0;
 
 	ret = idpf_vc_queue_grps_add(vport, p2p_queue_grps_info, p2p_q_vc_out_info);
 	if (ret != 0) {
@@ -2423,13 +2423,13 @@ cpfl_p2p_queue_info_init(struct cpfl_vport *cpfl_vport,
 	struct virtchnl2_queue_reg_chunks *vc_chunks_out;
 	int i, type;
 
-	if (p2p_q_vc_out_info->qg_info.groups[0].qg_id.queue_group_type !=
+	if (p2p_q_vc_out_info->groups[0].qg_id.queue_group_type !=
 	    VIRTCHNL2_QUEUE_GROUP_P2P) {
 		PMD_DRV_LOG(ERR, "Add queue group response mismatch.");
 		return -EINVAL;
 	}
 
-	vc_chunks_out = &p2p_q_vc_out_info->qg_info.groups[0].chunks;
+	vc_chunks_out = &p2p_q_vc_out_info->groups[0].chunks;
 
 	for (i = 0; i < vc_chunks_out->num_chunks; i++) {
 		type = vc_chunks_out->chunks[i].type;
-- 
2.43.0


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

* [PATCH 21/25] common/idpf: defining ethernet address length macro
  2024-05-28  7:36 [PATCH 20/25] net/cpfl: updating cpfl based on latest base driver Soumyadeep Hore
@ 2024-05-28  7:36 ` Soumyadeep Hore
  2024-05-28  7:36 ` [PATCH 22/25] common/idpf: increasing size of xn index Soumyadeep Hore
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Soumyadeep Hore @ 2024-05-28  7:36 UTC (permalink / raw)
  To: jingjing.wu; +Cc: dev

Introducing ETH_ALEN macro for mac address length.
this definition is used in idpf_xn.c and was missing
previously.

Signed-off-by: Soumyadeep Hore <soumyadeep.hore@intel.com>
---
 drivers/common/idpf/idpf_common_device.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/common/idpf/idpf_common_device.h b/drivers/common/idpf/idpf_common_device.h
index bfa927a5ff..031e4bd09d 100644
--- a/drivers/common/idpf/idpf_common_device.h
+++ b/drivers/common/idpf/idpf_common_device.h
@@ -31,6 +31,8 @@
 
 #define IDPF_DFLT_INTERVAL	16
 
+#define ETH_ALEN 6
+
 #define IDPF_RX_MAX_PTYPE_PROTO_IDS	32
 #define IDPF_RX_MAX_PTYPE_SZ	(sizeof(struct virtchnl2_ptype) +	\
 				 (sizeof(uint16_t) *			\
-- 
2.43.0


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

* [PATCH 22/25] common/idpf: increasing size of xn index
  2024-05-28  7:36 [PATCH 20/25] net/cpfl: updating cpfl based on latest base driver Soumyadeep Hore
  2024-05-28  7:36 ` [PATCH 21/25] common/idpf: defining ethernet address length macro Soumyadeep Hore
@ 2024-05-28  7:36 ` Soumyadeep Hore
  2024-05-28  7:36 ` [PATCH 23/25] common/idpf: redefining idpf vc queue switch Soumyadeep Hore
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Soumyadeep Hore @ 2024-05-28  7:36 UTC (permalink / raw)
  To: jingjing.wu; +Cc: dev

Increasing size of xn_index in idpf_xn.c from u8 to u16
for fixing compilation warning.

Signed-off-by: Soumyadeep Hore <soumyadeep.hore@intel.com>
---
 drivers/common/idpf/base/idpf_xn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/common/idpf/base/idpf_xn.c b/drivers/common/idpf/base/idpf_xn.c
index 5492564903..07625db3ba 100644
--- a/drivers/common/idpf/base/idpf_xn.c
+++ b/drivers/common/idpf/base/idpf_xn.c
@@ -128,7 +128,7 @@ static int idpf_ctlq_xn_process_recv(struct idpf_ctlq_xn_recv_params *params, st
 	IDPF_IOVEC recv_buf;
 	u16 msg_cookie;
 	void *payload;
-	u8 xn_index;
+	u16 xn_index;
 	int status;
 	int ret;
 
-- 
2.43.0


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

* [PATCH 23/25] common/idpf: redefining idpf vc queue switch
  2024-05-28  7:36 [PATCH 20/25] net/cpfl: updating cpfl based on latest base driver Soumyadeep Hore
  2024-05-28  7:36 ` [PATCH 21/25] common/idpf: defining ethernet address length macro Soumyadeep Hore
  2024-05-28  7:36 ` [PATCH 22/25] common/idpf: increasing size of xn index Soumyadeep Hore
@ 2024-05-28  7:36 ` Soumyadeep Hore
  2024-05-28  7:36 ` [PATCH 24/25] net/idpf: updating idpf vc queue switch in idpf Soumyadeep Hore
  2024-05-28  7:36 ` [PATCH 25/25] net/cpfl: updating idpf vc queue switch in cpfl Soumyadeep Hore
  4 siblings, 0 replies; 6+ messages in thread
From: Soumyadeep Hore @ 2024-05-28  7:36 UTC (permalink / raw)
  To: jingjing.wu; +Cc: dev

unint32_t type has been introduced in the function idpf_vc_queue_switch().
This helps in providing right queue type while calling the function.

Signed-off-by: Soumyadeep Hore <soumyadeep.hore@intel.com>
---
 drivers/common/idpf/idpf_common_virtchnl.c | 8 ++------
 drivers/common/idpf/idpf_common_virtchnl.h | 2 +-
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/common/idpf/idpf_common_virtchnl.c b/drivers/common/idpf/idpf_common_virtchnl.c
index f00202f43c..de511da788 100644
--- a/drivers/common/idpf/idpf_common_virtchnl.c
+++ b/drivers/common/idpf/idpf_common_virtchnl.c
@@ -769,15 +769,11 @@ idpf_vc_ena_dis_one_queue(struct idpf_vport *vport, uint16_t qid,
 
 int
 idpf_vc_queue_switch(struct idpf_vport *vport, uint16_t qid,
-		     bool rx, bool on)
+		     bool rx, bool on, uint32_t type)
 {
-	uint32_t type;
 	int err, queue_id;
 
-	/* switch txq/rxq */
-	type = rx ? VIRTCHNL2_QUEUE_TYPE_RX : VIRTCHNL2_QUEUE_TYPE_TX;
-
-	if (type == VIRTCHNL2_QUEUE_TYPE_RX)
+	if (rx)
 		queue_id = vport->chunks_info.rx_start_qid + qid;
 	else
 		queue_id = vport->chunks_info.tx_start_qid + qid;
diff --git a/drivers/common/idpf/idpf_common_virtchnl.h b/drivers/common/idpf/idpf_common_virtchnl.h
index 73446ded86..d6555978d5 100644
--- a/drivers/common/idpf/idpf_common_virtchnl.h
+++ b/drivers/common/idpf/idpf_common_virtchnl.h
@@ -31,7 +31,7 @@ int idpf_vc_cmd_execute(struct idpf_adapter *adapter,
 			struct idpf_cmd_info *args);
 __rte_internal
 int idpf_vc_queue_switch(struct idpf_vport *vport, uint16_t qid,
-			 bool rx, bool on);
+			 bool rx, bool on, uint32_t type);
 __rte_internal
 int idpf_vc_queues_ena_dis(struct idpf_vport *vport, bool enable);
 __rte_internal
-- 
2.43.0


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

* [PATCH 24/25] net/idpf: updating idpf vc queue switch in idpf
  2024-05-28  7:36 [PATCH 20/25] net/cpfl: updating cpfl based on latest base driver Soumyadeep Hore
                   ` (2 preceding siblings ...)
  2024-05-28  7:36 ` [PATCH 23/25] common/idpf: redefining idpf vc queue switch Soumyadeep Hore
@ 2024-05-28  7:36 ` Soumyadeep Hore
  2024-05-28  7:36 ` [PATCH 25/25] net/cpfl: updating idpf vc queue switch in cpfl Soumyadeep Hore
  4 siblings, 0 replies; 6+ messages in thread
From: Soumyadeep Hore @ 2024-05-28  7:36 UTC (permalink / raw)
  To: jingjing.wu; +Cc: dev

unint32_t type has been introduced in the function idpf_vc_queue_switch().
This helps in providing right queue type while calling the function.

Signed-off-by: Soumyadeep Hore <soumyadeep.hore@intel.com>
---
 drivers/net/idpf/idpf_rxtx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/idpf/idpf_rxtx.c b/drivers/net/idpf/idpf_rxtx.c
index 64f2235580..61d6a0b42c 100644
--- a/drivers/net/idpf/idpf_rxtx.c
+++ b/drivers/net/idpf/idpf_rxtx.c
@@ -595,7 +595,7 @@ idpf_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 	}
 
 	/* Ready to switch the queue on */
-	err = idpf_vc_queue_switch(vport, rx_queue_id, true, true);
+	err = idpf_vc_queue_switch(vport, rx_queue_id, true, true, VIRTCHNL2_QUEUE_TYPE_RX);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Failed to switch RX queue %u on",
 			    rx_queue_id);
@@ -646,7 +646,7 @@ idpf_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)
 	}
 
 	/* Ready to switch the queue on */
-	err = idpf_vc_queue_switch(vport, tx_queue_id, false, true);
+	err = idpf_vc_queue_switch(vport, tx_queue_id, false, true, VIRTCHNL2_QUEUE_TYPE_TX);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Failed to switch TX queue %u on",
 			    tx_queue_id);
@@ -669,7 +669,7 @@ idpf_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 	if (rx_queue_id >= dev->data->nb_rx_queues)
 		return -EINVAL;
 
-	err = idpf_vc_queue_switch(vport, rx_queue_id, true, false);
+	err = idpf_vc_queue_switch(vport, rx_queue_id, true, false, VIRTCHNL2_QUEUE_TYPE_RX);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Failed to switch RX queue %u off",
 			    rx_queue_id);
@@ -701,7 +701,7 @@ idpf_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)
 	if (tx_queue_id >= dev->data->nb_tx_queues)
 		return -EINVAL;
 
-	err = idpf_vc_queue_switch(vport, tx_queue_id, false, false);
+	err = idpf_vc_queue_switch(vport, tx_queue_id, false, false, VIRTCHNL2_QUEUE_TYPE_TX);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Failed to switch TX queue %u off",
 			    tx_queue_id);
-- 
2.43.0


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

* [PATCH 25/25] net/cpfl: updating idpf vc queue switch in cpfl
  2024-05-28  7:36 [PATCH 20/25] net/cpfl: updating cpfl based on latest base driver Soumyadeep Hore
                   ` (3 preceding siblings ...)
  2024-05-28  7:36 ` [PATCH 24/25] net/idpf: updating idpf vc queue switch in idpf Soumyadeep Hore
@ 2024-05-28  7:36 ` Soumyadeep Hore
  4 siblings, 0 replies; 6+ messages in thread
From: Soumyadeep Hore @ 2024-05-28  7:36 UTC (permalink / raw)
  To: jingjing.wu; +Cc: dev

unint32_t type has been introduced in the function idpf_vc_queue_switch().
This helps in providing right queue type while calling the function.

Signed-off-by: Soumyadeep Hore <soumyadeep.hore@intel.com>
---
 drivers/net/cpfl/cpfl_ethdev.c | 8 ++++----
 drivers/net/cpfl/cpfl_rxtx.c   | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c
index e707043bf7..350a301ee9 100644
--- a/drivers/net/cpfl/cpfl_ethdev.c
+++ b/drivers/net/cpfl/cpfl_ethdev.c
@@ -1907,7 +1907,7 @@ cpfl_stop_cfgqs(struct cpfl_adapter_ext *adapter)
 	int i, ret;
 
 	for (i = 0; i < CPFL_TX_CFGQ_NUM; i++) {
-		ret = idpf_vc_queue_switch(&adapter->ctrl_vport.base, i, false, false);
+		ret = idpf_vc_queue_switch(&adapter->ctrl_vport.base, i, false, false, VIRTCHNL2_QUEUE_TYPE_CONFIG_TX);
 		if (ret) {
 			PMD_DRV_LOG(ERR, "Fail to disable Tx config queue.");
 			return ret;
@@ -1915,7 +1915,7 @@ cpfl_stop_cfgqs(struct cpfl_adapter_ext *adapter)
 	}
 
 	for (i = 0; i < CPFL_RX_CFGQ_NUM; i++) {
-		ret = idpf_vc_queue_switch(&adapter->ctrl_vport.base, i, true, false);
+		ret = idpf_vc_queue_switch(&adapter->ctrl_vport.base, i, true, false, VIRTCHNL2_QUEUE_TYPE_CONFIG_RX);
 		if (ret) {
 			PMD_DRV_LOG(ERR, "Fail to disable Rx config queue.");
 			return ret;
@@ -1943,7 +1943,7 @@ cpfl_start_cfgqs(struct cpfl_adapter_ext *adapter)
 	}
 
 	for (i = 0; i < CPFL_TX_CFGQ_NUM; i++) {
-		ret = idpf_vc_queue_switch(&adapter->ctrl_vport.base, i, false, true);
+		ret = idpf_vc_queue_switch(&adapter->ctrl_vport.base, i, false, true, VIRTCHNL2_QUEUE_TYPE_CONFIG_TX);
 		if (ret) {
 			PMD_DRV_LOG(ERR, "Fail to enable Tx config queue.");
 			return ret;
@@ -1951,7 +1951,7 @@ cpfl_start_cfgqs(struct cpfl_adapter_ext *adapter)
 	}
 
 	for (i = 0; i < CPFL_RX_CFGQ_NUM; i++) {
-		ret = idpf_vc_queue_switch(&adapter->ctrl_vport.base, i, true, true);
+		ret = idpf_vc_queue_switch(&adapter->ctrl_vport.base, i, true, true, VIRTCHNL2_QUEUE_TYPE_CONFIG_RX);
 		if (ret) {
 			PMD_DRV_LOG(ERR, "Fail to enable Rx config queue.");
 			return ret;
diff --git a/drivers/net/cpfl/cpfl_rxtx.c b/drivers/net/cpfl/cpfl_rxtx.c
index ab8bec4645..7b3349d745 100644
--- a/drivers/net/cpfl/cpfl_rxtx.c
+++ b/drivers/net/cpfl/cpfl_rxtx.c
@@ -1200,7 +1200,7 @@ cpfl_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 	}
 
 	/* Ready to switch the queue on */
-	err = idpf_vc_queue_switch(vport, rx_queue_id, true, true);
+	err = idpf_vc_queue_switch(vport, rx_queue_id, true, true, VIRTCHNL2_QUEUE_TYPE_RX);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Failed to switch RX queue %u on",
 			    rx_queue_id);
@@ -1252,7 +1252,7 @@ cpfl_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)
 	}
 
 	/* Ready to switch the queue on */
-	err = idpf_vc_queue_switch(vport, tx_queue_id, false, true);
+	err = idpf_vc_queue_switch(vport, tx_queue_id, false, true, VIRTCHNL2_QUEUE_TYPE_TX);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Failed to switch TX queue %u on",
 			    tx_queue_id);
@@ -1283,7 +1283,7 @@ cpfl_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 						     rx_queue_id - cpfl_vport->nb_data_txq,
 						     true, false);
 	else
-		err = idpf_vc_queue_switch(vport, rx_queue_id, true, false);
+		err = idpf_vc_queue_switch(vport, rx_queue_id, true, false, VIRTCHNL2_QUEUE_TYPE_RX);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Failed to switch RX queue %u off",
 			    rx_queue_id);
@@ -1331,7 +1331,7 @@ cpfl_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)
 						     tx_queue_id - cpfl_vport->nb_data_txq,
 						     false, false);
 	else
-		err = idpf_vc_queue_switch(vport, tx_queue_id, false, false);
+		err = idpf_vc_queue_switch(vport, tx_queue_id, false, false, VIRTCHNL2_QUEUE_TYPE_TX);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Failed to switch TX queue %u off",
 			    tx_queue_id);
-- 
2.43.0


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

end of thread, other threads:[~2024-05-28  8:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-28  7:36 [PATCH 20/25] net/cpfl: updating cpfl based on latest base driver Soumyadeep Hore
2024-05-28  7:36 ` [PATCH 21/25] common/idpf: defining ethernet address length macro Soumyadeep Hore
2024-05-28  7:36 ` [PATCH 22/25] common/idpf: increasing size of xn index Soumyadeep Hore
2024-05-28  7:36 ` [PATCH 23/25] common/idpf: redefining idpf vc queue switch Soumyadeep Hore
2024-05-28  7:36 ` [PATCH 24/25] net/idpf: updating idpf vc queue switch in idpf Soumyadeep Hore
2024-05-28  7:36 ` [PATCH 25/25] net/cpfl: updating idpf vc queue switch in cpfl Soumyadeep Hore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).