From patchwork Fri Jul 3 11:16:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gordon@dpdk.org, Noonan@dpdk.org, gordon.noonan@intel.com X-Patchwork-Id: 73031 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B712EA0519; Fri, 3 Jul 2020 16:39:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8D0C01DC7D; Fri, 3 Jul 2020 16:37:59 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id E31F71D8CF for ; Fri, 3 Jul 2020 13:17:14 +0200 (CEST) IronPort-SDR: h1iaqFVc8iUTWnA74MsCFQ6GoJFFfwaEaHZupgyJ6ptJgaA7bWWNGjWqiNipesd4uEm6jp4MSj 3aC+qZn9f7Ew== X-IronPort-AV: E=McAfee;i="6000,8403,9670"; a="146220546" X-IronPort-AV: E=Sophos;i="5.75,308,1589266800"; d="scan'208";a="146220546" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2020 04:17:14 -0700 IronPort-SDR: q/nY6ehPM85UD6vLWO7O1MsEDGzsKIm8/zn3UAjUTIxA/qYftYMSvtNEPp/rMURZnpi1TyC+BT 6HJl2dK9NMjg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,308,1589266800"; d="scan'208";a="321780314" Received: from silpixa00400380.ir.intel.com ([10.237.213.188]) by FMSMGA003.fm.intel.com with ESMTP; 03 Jul 2020 04:17:13 -0700 From: Gordon@dpdk.org, Noonan@dpdk.org, gordon.noonan@intel.com To: dev@dpdk.org Cc: gordon.noonan@intel.com, Qi Zhang Date: Fri, 3 Jul 2020 12:16:39 +0100 Message-Id: <20200703111644.73351-4-gordon.noonan@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200703111644.73351-1-gordon.noonan@intel.com> References: <20200703111644.73351-1-gordon.noonan@intel.com> X-Mailman-Approved-At: Fri, 03 Jul 2020 16:37:41 +0200 Subject: [dpdk-dev] [PATCH RFC 3/8] common/iavf: add large vsi queue config X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Qi Zhang Signed-off-by: Qi Zhang --- 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;