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 615E5A0508; Thu, 7 Apr 2022 05:01:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C3822428D4; Thu, 7 Apr 2022 04:59:51 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id D674A428D1 for ; Thu, 7 Apr 2022 04:59:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649300390; x=1680836390; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BXykvfiigE4sMKMZH2fNyM24dHMztkFA7gCGMyrg/jQ=; b=NX1TvtOfj2j5f8RfT2zvq9QMuVoGEYCrCA8U5dl8X1rxW8Y3EucezCzc DipeLSfsSE0kkl9ULXji8fKnGcG1RJAbop/u95BjGiCjFiwjQoQQ6gblJ knCiUoYPSn9iN1OR86W+zSGjIOjD+MK8m2cDF00PcOrc55RTUtegJ8ioB NtNuDC7IBeIBNokGcHC0CDR5ZAWf/xuCKGghfX5zFfZz3dt0ByX+jxlg3 0m/vkctK2+l1CK3/F2ZN1O/kJx1rGC0tddt+FuCH8vocFhivWuCHJEzau 1C1KJzCGwvxGPHxpec8dLY/1zTwe3J6VekqN3nB5xefcokYT4d84nD5Hm w==; X-IronPort-AV: E=McAfee;i="6200,9189,10309"; a="248738500" X-IronPort-AV: E=Sophos;i="5.90,241,1643702400"; d="scan'208";a="248738500" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2022 19:59:49 -0700 X-IronPort-AV: E=Sophos;i="5.90,241,1643702400"; d="scan'208";a="570850822" Received: from intel-cd-odc-kevin.cd.intel.com ([10.240.178.195]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2022 19:59:47 -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 34/39] net/ice: enable multiple queues configurations for large VF Date: Thu, 7 Apr 2022 10:57:01 +0000 Message-Id: <20220407105706.18889-35-kevinx.liu@intel.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220407105706.18889-1-kevinx.liu@intel.com> References: <20220407105706.18889-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 8807308bb2..7a0a9a3534 100644 --- a/drivers/net/ice/ice_dcf.c +++ b/drivers/net/ice/ice_dcf.c @@ -950,7 +950,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; @@ -963,16 +964,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 8efa3e5b23..1f45881315 100644 --- a/drivers/net/ice/ice_dcf.h +++ b/drivers/net/ice/ice_dcf.h @@ -131,7 +131,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 4ffc10b0de..211a2510fa 100644 --- a/drivers/net/ice/ice_dcf_ethdev.c +++ b/drivers/net/ice/ice_dcf_ethdev.c @@ -514,6 +514,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) { @@ -532,6 +534,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) { @@ -547,7 +550,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; @@ -587,7 +603,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