[Intel-wired-lan] [PATCH RFC net-next 28/34] idpf: add relative queue id member to idpf_queue

Alexander Lobakin aleksander.lobakin at intel.com
Sat Dec 23 02:55:48 UTC 2023


From: Michal Kubiak <michal.kubiak at intel.com>

Relative queue id is one of the required fields of the Tx queue
description in VC 2.0 for splitq mode.
In the current VC implementation all Tx queues are configured
together, so the relative queue id (the index of the Tx queue
in the queue group) can be computed on the fly.

However, such a solution is not flexible because it is not easy to
configure a single Tx queue. So, instead, introduce a new structure
member in 'idpf_queue' dedicated to storing the relative queue id.
Then send that value over the VC.

This patch is the first step in making the existing VC API more flexible
to allow configuration of single queues.

Signed-off-by: Michal Kubiak <michal.kubiak at intel.com>
Signed-off-by: Alexander Lobakin <aleksander.lobakin at intel.com>
---
 drivers/net/ethernet/intel/idpf/idpf_txrx.c     | 1 +
 drivers/net/ethernet/intel/idpf/idpf_txrx.h     | 2 ++
 drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 3 ++-
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
index 99c9b889507b..3dc21731df2f 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
@@ -1276,6 +1276,7 @@ static int idpf_txq_group_alloc(struct idpf_vport *vport, u16 num_txq)
 			q->tx_min_pkt_len = idpf_get_min_tx_pkt_len(adapter);
 			q->vport = vport;
 			q->txq_grp = tx_qgrp;
+			q->relative_q_id = j;
 
 			if (!flow_sch_en)
 				continue;
diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.h b/drivers/net/ethernet/intel/idpf/idpf_txrx.h
index fa21feddd204..f32d854fe850 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_txrx.h
+++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.h
@@ -665,6 +665,8 @@ struct idpf_queue {
 
 	dma_addr_t dma;
 	unsigned int size;
+
+	u32 relative_q_id;
 } ____cacheline_internodealigned_in_smp;
 
 /**
diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
index 59b8bbebead7..49a96af52343 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
@@ -1491,7 +1491,8 @@ static int idpf_send_config_tx_queues_msg(struct idpf_vport *vport)
 
 				qi[k].tx_compl_queue_id =
 					cpu_to_le16(tx_qgrp->complq->q_id);
-				qi[k].relative_queue_id = cpu_to_le16(j);
+				qi[k].relative_queue_id =
+					cpu_to_le16(q->relative_q_id);
 
 				if (test_bit(__IDPF_Q_FLOW_SCH_EN, q->flags))
 					qi[k].sched_mode =
-- 
2.43.0



More information about the Intel-wired-lan mailing list