From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id F13C6A0519; Fri, 3 Jul 2020 16:37:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 72D681DC27; Fri, 3 Jul 2020 16:37:43 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 7CD761DB1A for ; Fri, 3 Jul 2020 12:28:53 +0200 (CEST) IronPort-SDR: EX8jNGbvxXmqnpHdohYrq4GG1tWsE/o5hTzonQ/OeqZbjn29GiODeelgfKsieQnlJObTzaMF6m Bx0EPUtT3o2A== X-IronPort-AV: E=McAfee;i="6000,8403,9670"; a="208641900" X-IronPort-AV: E=Sophos;i="5.75,307,1589266800"; d="scan'208";a="208641900" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2020 03:28:52 -0700 IronPort-SDR: 5jmvzgPKt7dReCLCCOAYwG2QHbnYQeLO26zS+R9XDRhqmtBQr39mf048y6K1SHpCVevGBbXUqD UR9t9PtggTuQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,308,1589266800"; d="scan'208";a="304548475" Received: from silpixa00400380.ir.intel.com ([10.237.213.188]) by fmsmga004.fm.intel.com with ESMTP; 03 Jul 2020 03:28:51 -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 11:28:23 +0100 Message-Id: <20200703102829.52581-3-gordon.noonan@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200703102829.52581-1-gordon.noonan@intel.com> References: <20200703102829.52581-1-gordon.noonan@intel.com> X-Mailman-Approved-At: Fri, 03 Jul 2020 16:37:41 +0200 Subject: [dpdk-dev] [PATCH RFC 2/8] net/iavf: support 64 queues 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 Enlarge max queue number from 16 to 64 by using "large" vc ops. Signed-off-by: Qi Zhang --- drivers/net/iavf/iavf.h | 4 ++-- drivers/net/iavf/iavf_vchnl.c | 35 ++++++++++++++++++----------------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index 9be8a2381..039517af9 100644 --- a/drivers/net/iavf/iavf.h +++ b/drivers/net/iavf/iavf.h @@ -19,7 +19,7 @@ #define IAVF_FRAME_SIZE_MAX 9728 #define IAVF_QUEUE_BASE_ADDR_UNIT 128 -#define IAVF_MAX_NUM_QUEUES 16 +#define IAVF_MAX_NUM_QUEUES 64 #define IAVF_NUM_MACADDR_MAX 64 @@ -138,7 +138,7 @@ struct iavf_info { uint16_t nb_msix; /* number of MSI-X interrupts on Rx */ uint16_t msix_base; /* msix vector base from */ /* queue bitmask for each vector */ - uint16_t rxq_map[IAVF_MAX_MSIX_VECTORS]; + uint64_t rxq_map[IAVF_MAX_MSIX_VECTORS]; struct iavf_flow_list flow_list; rte_spinlock_t flow_ops_lock; struct iavf_parser_list rss_parser_list; diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index 33acea54a..2b28d0577 100644 --- a/drivers/net/iavf/iavf_vchnl.c +++ b/drivers/net/iavf/iavf_vchnl.c @@ -383,7 +383,8 @@ iavf_get_vf_resource(struct iavf_adapter *adapter) caps = IAVF_BASIC_OFFLOAD_CAPS | VIRTCHNL_VF_CAP_ADV_LINK_SPEED | VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC | VIRTCHNL_VF_OFFLOAD_FDIR_PF | - VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF; + VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF | + VIRTCHNL_VF_OFFLOAD_LARGE_VF; args.in_args = (uint8_t *)∩︀ args.in_args_size = sizeof(caps); @@ -450,7 +451,7 @@ int iavf_enable_queues(struct iavf_adapter *adapter) { struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter); - struct virtchnl_queue_select queue_select; + struct virtchnl_large_queue_select queue_select; struct iavf_cmd_info args; int err; @@ -460,7 +461,7 @@ iavf_enable_queues(struct iavf_adapter *adapter) queue_select.rx_queues = BIT(adapter->eth_dev->data->nb_rx_queues) - 1; queue_select.tx_queues = BIT(adapter->eth_dev->data->nb_tx_queues) - 1; - args.ops = VIRTCHNL_OP_ENABLE_QUEUES; + args.ops = VIRTCHNL_OP_ENABLE_LARGE_QUEUES; args.in_args = (u8 *)&queue_select; args.in_args_size = sizeof(queue_select); args.out_buffer = vf->aq_resp; @@ -468,7 +469,7 @@ iavf_enable_queues(struct iavf_adapter *adapter) err = iavf_execute_vf_cmd(adapter, &args); if (err) { PMD_DRV_LOG(ERR, - "Failed to execute command of OP_ENABLE_QUEUES"); + "Failed to execute command of OP_ENABLE_LARGE_QUEUES"); return err; } return 0; @@ -478,7 +479,7 @@ int iavf_disable_queues(struct iavf_adapter *adapter) { struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter); - struct virtchnl_queue_select queue_select; + struct virtchnl_large_queue_select queue_select; struct iavf_cmd_info args; int err; @@ -488,7 +489,7 @@ iavf_disable_queues(struct iavf_adapter *adapter) queue_select.rx_queues = BIT(adapter->eth_dev->data->nb_rx_queues) - 1; queue_select.tx_queues = BIT(adapter->eth_dev->data->nb_tx_queues) - 1; - args.ops = VIRTCHNL_OP_DISABLE_QUEUES; + args.ops = VIRTCHNL_OP_DISABLE_LARGE_QUEUES; args.in_args = (u8 *)&queue_select; args.in_args_size = sizeof(queue_select); args.out_buffer = vf->aq_resp; @@ -496,7 +497,7 @@ iavf_disable_queues(struct iavf_adapter *adapter) err = iavf_execute_vf_cmd(adapter, &args); if (err) { PMD_DRV_LOG(ERR, - "Failed to execute command of OP_DISABLE_QUEUES"); + "Failed to execute command of OP_DISABLE_LARGE_QUEUES"); return err; } return 0; @@ -507,7 +508,7 @@ iavf_switch_queue(struct iavf_adapter *adapter, uint16_t qid, bool rx, bool on) { struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter); - struct virtchnl_queue_select queue_select; + struct virtchnl_large_queue_select queue_select; struct iavf_cmd_info args; int err; @@ -519,9 +520,9 @@ iavf_switch_queue(struct iavf_adapter *adapter, uint16_t qid, queue_select.tx_queues |= 1 << qid; if (on) - args.ops = VIRTCHNL_OP_ENABLE_QUEUES; + args.ops = VIRTCHNL_OP_ENABLE_LARGE_QUEUES; else - args.ops = VIRTCHNL_OP_DISABLE_QUEUES; + args.ops = VIRTCHNL_OP_DISABLE_LARGE_QUEUES; args.in_args = (u8 *)&queue_select; args.in_args_size = sizeof(queue_select); args.out_buffer = vf->aq_resp; @@ -529,7 +530,7 @@ iavf_switch_queue(struct iavf_adapter *adapter, uint16_t qid, err = iavf_execute_vf_cmd(adapter, &args); if (err) PMD_DRV_LOG(ERR, "Failed to execute command of %s", - on ? "OP_ENABLE_QUEUES" : "OP_DISABLE_QUEUES"); + on ? "OP_ENABLE_LARGE_QUEUES" : "OP_DISABLE_LARGE_QUEUES"); return err; } @@ -686,13 +687,13 @@ int iavf_config_irq_map(struct iavf_adapter *adapter) { struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter); - struct virtchnl_irq_map_info *map_info; - struct virtchnl_vector_map *vecmap; + struct virtchnl_large_irq_map_info *map_info; + struct virtchnl_large_vector_map *vecmap; struct iavf_cmd_info args; int len, i, err; - len = sizeof(struct virtchnl_irq_map_info) + - sizeof(struct virtchnl_vector_map) * vf->nb_msix; + len = sizeof(struct virtchnl_large_irq_map_info) + + sizeof(struct virtchnl_large_vector_map) * vf->nb_msix; map_info = rte_zmalloc("map_info", len, 0); if (!map_info) @@ -708,14 +709,14 @@ iavf_config_irq_map(struct iavf_adapter *adapter) vecmap->rxq_map = vf->rxq_map[vf->msix_base + i]; } - args.ops = VIRTCHNL_OP_CONFIG_IRQ_MAP; + args.ops = VIRTCHNL_OP_CONFIG_LARGE_IRQ_MAP; args.in_args = (u8 *)map_info; args.in_args_size = len; args.out_buffer = vf->aq_resp; args.out_size = IAVF_AQ_BUF_SZ; err = iavf_execute_vf_cmd(adapter, &args); if (err) - PMD_DRV_LOG(ERR, "fail to execute command OP_CONFIG_IRQ_MAP"); + PMD_DRV_LOG(ERR, "fail to execute command OP_CONFIG_LARGE_IRQ_MAP"); rte_free(map_info); return err; -- 2.17.1