From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CC2ECA0508; Wed, 13 Apr 2022 11:13:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 040634284A; Wed, 13 Apr 2022 11:12:28 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id A113142833 for ; Wed, 13 Apr 2022 11:12:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649841143; x=1681377143; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NIbIicjzmCp9S2UjNaODMmdaSeJOBCRfYx5rHYYnZyc=; b=P6flAPzMMcsdFcHaTwC0kcOwSeIjh01CI6MlDgvLlMvdFYPXnl968P8y Ca2nrL/hdK5gVHFH+WWbo+uK/gfiy2lhp5Nh/MFZ/OtwHSlc0p/q+ufqt 1XYjXhS7fWBVNYLwf1gjvLnMdS9A4p4HnDlAi/Lne4Z+2ZTi81LoBpfvl b8ee+Z019XrWYuah1MssO9LdTnCFN/d51ke/2ZFYax2STAn+bsX9nKOvh nMWve5yUauzYsWEsomUc/DmrRWKVYYxl758EKi+YT69HxK3uDAN94qAXD u/hL3lTxKrxM0i/XMIsq7JWdbwrUMdq/QRW8jTr7PYCxaEf56/JK1nbrM w==; X-IronPort-AV: E=McAfee;i="6400,9594,10315"; a="262058410" X-IronPort-AV: E=Sophos;i="5.90,256,1643702400"; d="scan'208";a="262058410" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2022 02:12:22 -0700 X-IronPort-AV: E=Sophos;i="5.90,256,1643702400"; d="scan'208";a="552122876" Received: from intel-cd-odc-kevin.cd.intel.com ([10.240.178.195]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2022 02:12:20 -0700 From: Kevin Liu To: dev@dpdk.org Cc: qiming.yang@intel.com, qi.z.zhang@intel.com, stevex.yang@intel.com, Kevin Liu Subject: [PATCH v3 17/22] net/ice: enable multiple queues configurations for large VF Date: Wed, 13 Apr 2022 17:10:25 +0000 Message-Id: <20220413171030.2231163-18-kevinx.liu@intel.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220413171030.2231163-1-kevinx.liu@intel.com> References: <20220413160932.2074781-1-kevinx.liu@intel.com> <20220413171030.2231163-1-kevinx.liu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Steve Yang Since the adminq buffer size has a 4K limitation, the current virtchnl command VIRTCHNL_OP_CONFIG_VSI_QUEUES cannot send the message only once to configure up to 256 queues. In this patch, we send the messages multiple times to make sure that the buffer size is less than 4K each time. Signed-off-by: Steve Yang Signed-off-by: Kevin Liu --- drivers/net/ice/ice_dcf.c | 11 ++++++----- drivers/net/ice/ice_dcf.h | 3 ++- drivers/net/ice/ice_dcf_ethdev.c | 20 ++++++++++++++++++-- drivers/net/ice/ice_dcf_ethdev.h | 1 + 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c index 7091658841..7004c00f1c 100644 --- a/drivers/net/ice/ice_dcf.c +++ b/drivers/net/ice/ice_dcf.c @@ -949,7 +949,8 @@ ice_dcf_init_rss(struct ice_dcf_hw *hw) #define IAVF_RXDID_COMMS_OVS_1 22 int -ice_dcf_configure_queues(struct ice_dcf_hw *hw) +ice_dcf_configure_queues(struct ice_dcf_hw *hw, + uint16_t num_queue_pairs, uint16_t index) { struct ice_rx_queue **rxq = (struct ice_rx_queue **)hw->eth_dev->data->rx_queues; @@ -962,16 +963,16 @@ ice_dcf_configure_queues(struct ice_dcf_hw *hw) int err; size = sizeof(*vc_config) + - sizeof(vc_config->qpair[0]) * hw->num_queue_pairs; + sizeof(vc_config->qpair[0]) * num_queue_pairs; vc_config = rte_zmalloc("cfg_queue", size, 0); if (!vc_config) return -ENOMEM; vc_config->vsi_id = hw->vsi_res->vsi_id; - vc_config->num_queue_pairs = hw->num_queue_pairs; + vc_config->num_queue_pairs = num_queue_pairs; - for (i = 0, vc_qp = vc_config->qpair; - i < hw->num_queue_pairs; + for (i = index, vc_qp = vc_config->qpair; + i < index + num_queue_pairs; i++, vc_qp++) { vc_qp->txq.vsi_id = hw->vsi_res->vsi_id; vc_qp->txq.queue_id = i; diff --git a/drivers/net/ice/ice_dcf.h b/drivers/net/ice/ice_dcf.h index 05ea91d2a5..e36428a92a 100644 --- a/drivers/net/ice/ice_dcf.h +++ b/drivers/net/ice/ice_dcf.h @@ -129,7 +129,8 @@ void ice_dcf_uninit_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw); int ice_dcf_configure_rss_key(struct ice_dcf_hw *hw); int ice_dcf_configure_rss_lut(struct ice_dcf_hw *hw); int ice_dcf_init_rss(struct ice_dcf_hw *hw); -int ice_dcf_configure_queues(struct ice_dcf_hw *hw); +int ice_dcf_configure_queues(struct ice_dcf_hw *hw, + uint16_t num_queue_pairs, uint16_t index); int ice_dcf_request_queues(struct ice_dcf_hw *hw, uint16_t num); int ice_dcf_get_max_rss_queue_region(struct ice_dcf_hw *hw); int ice_dcf_config_irq_map(struct ice_dcf_hw *hw); diff --git a/drivers/net/ice/ice_dcf_ethdev.c b/drivers/net/ice/ice_dcf_ethdev.c index a43c5a320d..78df82d5b5 100644 --- a/drivers/net/ice/ice_dcf_ethdev.c +++ b/drivers/net/ice/ice_dcf_ethdev.c @@ -513,6 +513,8 @@ ice_dcf_dev_start(struct rte_eth_dev *dev) struct rte_intr_handle *intr_handle = dev->intr_handle; struct ice_adapter *ad = &dcf_ad->parent; struct ice_dcf_hw *hw = &dcf_ad->real_hw; + uint16_t num_queue_pairs; + uint16_t index = 0; int ret; if (hw->resetting) { @@ -531,6 +533,7 @@ ice_dcf_dev_start(struct rte_eth_dev *dev) hw->num_queue_pairs = RTE_MAX(dev->data->nb_rx_queues, dev->data->nb_tx_queues); + num_queue_pairs = hw->num_queue_pairs; ret = ice_dcf_init_rx_queues(dev); if (ret) { @@ -546,7 +549,20 @@ ice_dcf_dev_start(struct rte_eth_dev *dev) } } - ret = ice_dcf_configure_queues(hw); + /* If needed, send configure queues msg multiple times to make the + * adminq buffer length smaller than the 4K limitation. + */ + while (num_queue_pairs > ICE_DCF_CFG_Q_NUM_PER_BUF) { + if (ice_dcf_configure_queues(hw, + ICE_DCF_CFG_Q_NUM_PER_BUF, index) != 0) { + PMD_DRV_LOG(ERR, "configure queues failed"); + goto err_queue; + } + num_queue_pairs -= ICE_DCF_CFG_Q_NUM_PER_BUF; + index += ICE_DCF_CFG_Q_NUM_PER_BUF; + } + + ret = ice_dcf_configure_queues(hw, num_queue_pairs, index); if (ret) { PMD_DRV_LOG(ERR, "Fail to config queues"); return ret; @@ -586,7 +602,7 @@ ice_dcf_dev_start(struct rte_eth_dev *dev) dev->data->dev_link.link_status = RTE_ETH_LINK_UP; - +err_queue: return 0; } diff --git a/drivers/net/ice/ice_dcf_ethdev.h b/drivers/net/ice/ice_dcf_ethdev.h index 4a08d32e0c..2fac1e5b21 100644 --- a/drivers/net/ice/ice_dcf_ethdev.h +++ b/drivers/net/ice/ice_dcf_ethdev.h @@ -22,6 +22,7 @@ #define ICE_DCF_ETH_MAX_LEN (RTE_ETHER_MTU + ICE_DCF_ETH_OVERHEAD) #define ICE_DCF_MAX_NUM_QUEUES_DFLT 16 #define ICE_DCF_MAX_NUM_QUEUES_LV 256 +#define ICE_DCF_CFG_Q_NUM_PER_BUF 32 struct ice_dcf_queue { uint64_t dummy; -- 2.33.1