DPDK patches and discussions
 help / color / mirror / Atom feed
From: Gordon@dpdk.org, Noonan@dpdk.org, gordon.noonan@intel.com
To: dev@dpdk.org
Cc: gordon.noonan@intel.com, Qi Zhang <qi.z.zhang@intel.com>
Subject: [dpdk-dev] [PATCH RFC 3/8] common/iavf: add large vsi queue config
Date: Fri,  3 Jul 2020 11:28:24 +0100	[thread overview]
Message-ID: <20200703102829.52581-4-gordon.noonan@intel.com> (raw)
In-Reply-To: <20200703102829.52581-1-gordon.noonan@intel.com>

From: Qi Zhang <qi.z.zhang@intel.com>

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/common/iavf/virtchnl.h | 54 ++++++++++++++++++++++++++++++++++
 drivers/net/iavf/iavf_vchnl.c  |  6 ++--
 2 files changed, 57 insertions(+), 3 deletions(-)

diff --git a/drivers/common/iavf/virtchnl.h b/drivers/common/iavf/virtchnl.h
index 5b0455fb4..caac3468e 100644
--- a/drivers/common/iavf/virtchnl.h
+++ b/drivers/common/iavf/virtchnl.h
@@ -143,6 +143,7 @@ enum virtchnl_ops {
 	VIRTCHNL_OP_ENABLE_LARGE_QUEUES = 50,
 	VIRTCHNL_OP_DISABLE_LARGE_QUEUES = 51,
 	VIRTCHNL_OP_CONFIG_LARGE_IRQ_MAP = 52,
+	VIRTCHNL_OP_CONFIG_LARGE_VSI_QUEUES = 53,
 };
 
 /* These macros are used to generate compilation errors if a structure/union
@@ -303,6 +304,17 @@ struct virtchnl_txq_info {
 
 VIRTCHNL_CHECK_STRUCT_LEN(24, virtchnl_txq_info);
 
+struct virtchnl_txq_info_2 {
+	u16 vsi_id;
+	u16 queue_id;
+	u16 ring_len;		/* number of descriptors, multiple of 8 */
+	u16 reserved;
+	u64 dma_ring_addr;
+};
+
+VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_txq_info_2);
+
+
 /* VIRTCHNL_OP_CONFIG_RX_QUEUE
  * VF sends this message to set up parameters for one RX queue.
  * External data buffer contains one instance of virtchnl_rxq_info.
@@ -353,6 +365,15 @@ struct virtchnl_queue_pair_info {
 
 VIRTCHNL_CHECK_STRUCT_LEN(64, virtchnl_queue_pair_info);
 
+struct virtchnl_large_queue_pair_info {
+	/* NOTE: vsi_id and queue_id should be identical for both queues. */
+	struct virtchnl_txq_info_2 txq;
+	struct virtchnl_rxq_info rxq;
+};
+
+VIRTCHNL_CHECK_STRUCT_LEN(56, virtchnl_large_queue_pair_info);
+
+
 struct virtchnl_vsi_queue_config_info {
 	u16 vsi_id;
 	u16 num_queue_pairs;
@@ -362,6 +383,16 @@ struct virtchnl_vsi_queue_config_info {
 
 VIRTCHNL_CHECK_STRUCT_LEN(72, virtchnl_vsi_queue_config_info);
 
+struct virtchnl_large_vsi_queue_config_info {
+	u16 vsi_id;
+	u16 num_queue_pairs;
+	u32 pad;
+	struct virtchnl_large_queue_pair_info qpair[1];
+};
+
+VIRTCHNL_CHECK_STRUCT_LEN(64, virtchnl_large_vsi_queue_config_info);
+
+
 /* VIRTCHNL_OP_REQUEST_QUEUES
  * VF sends this message to request the PF to allocate additional queues to
  * this VF.  Each VF gets a guaranteed number of queues on init but asking for
@@ -809,6 +840,11 @@ enum virtchnl_vector_limits {
 	VIRTCHNL_OP_CONFIG_LARGE_IRQ_MAP_MAX		=
 		((u16)(~0) - sizeof(struct virtchnl_large_irq_map_info)) /
 		sizeof(struct virtchnl_large_vector_map),
+
+	VIRTCHNL_OP_CONFIG_LARGE_VSI_QUEUES_MAX	=
+		((u16)(~0) - sizeof(struct virtchnl_large_vsi_queue_config_info)) /
+		sizeof(struct virtchnl_large_queue_pair_info),
+
 };
 
 /* VF reset states - these are written into the RSTAT register:
@@ -1185,6 +1221,24 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,
 					     virtchnl_queue_pair_info));
 		}
 		break;
+	case VIRTCHNL_OP_CONFIG_LARGE_VSI_QUEUES:
+		valid_len = sizeof(struct virtchnl_large_vsi_queue_config_info);
+		if (msglen >= valid_len) {
+			struct virtchnl_large_vsi_queue_config_info *vqc =
+			    (struct virtchnl_large_vsi_queue_config_info *)msg;
+
+			if (vqc->num_queue_pairs == 0 || vqc->num_queue_pairs >
+			    VIRTCHNL_OP_CONFIG_LARGE_VSI_QUEUES_MAX) {
+				err_msg_format = true;
+				break;
+			}
+
+			valid_len += (vqc->num_queue_pairs *
+				      sizeof(struct
+					     virtchnl_large_queue_pair_info));
+		}
+		break;
+
 	case VIRTCHNL_OP_CONFIG_IRQ_MAP:
 		valid_len = sizeof(struct virtchnl_irq_map_info);
 		if (msglen >= valid_len) {
diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index 2b28d0577..f9db0b3d0 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -606,8 +606,8 @@ iavf_configure_queues(struct iavf_adapter *adapter)
 	struct iavf_tx_queue **txq =
 		(struct iavf_tx_queue **)adapter->eth_dev->data->tx_queues;
 	struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter);
-	struct virtchnl_vsi_queue_config_info *vc_config;
-	struct virtchnl_queue_pair_info *vc_qp;
+	struct virtchnl_large_vsi_queue_config_info *vc_config;
+	struct virtchnl_large_queue_pair_info *vc_qp;
 	struct iavf_cmd_info args;
 	uint16_t i, size;
 	int err;
@@ -668,7 +668,7 @@ iavf_configure_queues(struct iavf_adapter *adapter)
 	}
 
 	memset(&args, 0, sizeof(args));
-	args.ops = VIRTCHNL_OP_CONFIG_VSI_QUEUES;
+	args.ops = VIRTCHNL_OP_CONFIG_LARGE_VSI_QUEUES;
 	args.in_args = (uint8_t *)vc_config;
 	args.in_args_size = size;
 	args.out_buffer = vf->aq_resp;
-- 
2.17.1


  parent reply	other threads:[~2020-07-03 14:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-03 10:28 [dpdk-dev] [PATCH RFC 0/8] net/iavf: Enable 256 queues Gordon, Noonan, gordon.noonan
2020-07-03 10:28 ` [dpdk-dev] [PATCH RFC 1/8] common/iavf: add large queue VC ops Gordon, Noonan, gordon.noonan
2020-07-03 10:28 ` [dpdk-dev] [PATCH RFC 2/8] net/iavf: support 64 queues Gordon, Noonan, gordon.noonan
2020-07-03 10:28 ` Gordon, Noonan, gordon.noonan [this message]
2020-07-03 10:28 ` [dpdk-dev] [PATCH RFC 4/8] net/iavf: support > 256 lut table size Gordon, Noonan, gordon.noonan
2020-07-03 10:28 ` [dpdk-dev] [PATCH RFC 5/8] Support dst ip only for RSS Gordon, Noonan, gordon.noonan
2020-07-03 10:28 ` [dpdk-dev] [PATCH RFC 6/8] ICE: Enable advanced RSS for PPPoE Gordon, Noonan, gordon.noonan
2020-07-03 10:28 ` [dpdk-dev] [PATCH RFC 7/8] Update/Add support for RSS on 5 Tuple Flows for GTPU encapsulated packets (AVF) Gordon, Noonan, gordon.noonan
2020-07-03 10:28 ` [dpdk-dev] [PATCH RFC 8/8] net/iavf: fix gtpu ip udp issue Gordon, Noonan, gordon.noonan
2020-07-03 11:16 [dpdk-dev] [PATCH RFC 0/8] net/iavf: Enable 256 queues Gordon, Noonan, gordon.noonan
2020-07-03 11:16 ` [dpdk-dev] [PATCH RFC 3/8] common/iavf: add large vsi queue config Gordon, Noonan, gordon.noonan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200703102829.52581-4-gordon.noonan@intel.com \
    --to=gordon@dpdk.org \
    --cc=Noonan@dpdk.org \
    --cc=dev@dpdk.org \
    --cc=gordon.noonan@intel.com \
    --cc=qi.z.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).