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 8F44C4548C; Tue, 18 Jun 2024 13:44:37 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B8E7C42D90; Tue, 18 Jun 2024 13:42:43 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) by mails.dpdk.org (Postfix) with ESMTP id 5CE3E427D7 for ; Tue, 18 Jun 2024 13:42:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718710956; x=1750246956; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RVCfpYOjqGIUbv0nv5qR1+4Gi/7aqZ/YquKaGGoRD/Q=; b=NKpFeVHe3kOEKDktDEOlGs1jKPBnggji8QSHANnWQPSb2AREoEJg70Np 4b71Zi/kdWWbKx8Jp7hZHQOV8LdfEQv+LbJPrURu1sGk3Y5zPILIu75cd 7er+cEljBl/2kXDFINnfhYBztGRfpCW+/xitw6LVNfkarDQQSDWc9VySK /hcdxIoUdRAvZm7fmvuY4DFOcMrjXAg+Qtzlas9r9UQLX2Enisc9Wlpme 8w9WkvIygjDHadUs9QJLq03IxGhkdQ/vIfTAhZDuEpBY7es81DHREqI7C gOXY3sKIgTm1fd4QF9X3Au2Oatd9ZgrMU552xdQIIkDylMsu3bpoPaQyH A==; X-CSE-ConnectionGUID: q1zw21PySiGSCvm9/ziAUQ== X-CSE-MsgGUID: PhmwxxQgQ5qg2jZ/WHa5oQ== X-IronPort-AV: E=McAfee;i="6700,10204,11106"; a="19443369" X-IronPort-AV: E=Sophos;i="6.08,247,1712646000"; d="scan'208";a="19443369" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2024 04:42:35 -0700 X-CSE-ConnectionGUID: R88qmqzpRLWAk0TQV7ZPEA== X-CSE-MsgGUID: zGUrcWprTO2s5c/SyQPRgA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,247,1712646000"; d="scan'208";a="41621281" Received: from unknown (HELO npf-hyd-clx-03..) ([10.145.170.182]) by fmviesa009.fm.intel.com with ESMTP; 18 Jun 2024 04:42:34 -0700 From: Soumyadeep Hore To: bruce.richardson@intel.com, anatoly.burakov@intel.com Cc: dev@dpdk.org Subject: [PATCH v4 20/21] drivers: adding type to idpf vc queue switch Date: Tue, 18 Jun 2024 10:57:21 +0000 Message-ID: <20240618105722.2326987-21-soumyadeep.hore@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240618105722.2326987-1-soumyadeep.hore@intel.com> References: <20240612035257.2245824-11-soumyadeep.hore@intel.com> <20240618105722.2326987-1-soumyadeep.hore@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 Adding an argument named type to define queue type in idpf_vc_queue_switch(). This solves the issue of improper queue type in virtchnl2 message. Signed-off-by: Soumyadeep Hore --- drivers/common/idpf/idpf_common_virtchnl.c | 8 ++------ drivers/common/idpf/idpf_common_virtchnl.h | 2 +- drivers/net/cpfl/cpfl_ethdev.c | 12 ++++++++---- drivers/net/cpfl/cpfl_rxtx.c | 12 ++++++++---- drivers/net/idpf/idpf_rxtx.c | 12 ++++++++---- 5 files changed, 27 insertions(+), 19 deletions(-) diff --git a/drivers/common/idpf/idpf_common_virtchnl.c b/drivers/common/idpf/idpf_common_virtchnl.c index f00202f43c..de511da788 100644 --- a/drivers/common/idpf/idpf_common_virtchnl.c +++ b/drivers/common/idpf/idpf_common_virtchnl.c @@ -769,15 +769,11 @@ idpf_vc_ena_dis_one_queue(struct idpf_vport *vport, uint16_t qid, int idpf_vc_queue_switch(struct idpf_vport *vport, uint16_t qid, - bool rx, bool on) + bool rx, bool on, uint32_t type) { - uint32_t type; int err, queue_id; - /* switch txq/rxq */ - type = rx ? VIRTCHNL2_QUEUE_TYPE_RX : VIRTCHNL2_QUEUE_TYPE_TX; - - if (type == VIRTCHNL2_QUEUE_TYPE_RX) + if (rx) queue_id = vport->chunks_info.rx_start_qid + qid; else queue_id = vport->chunks_info.tx_start_qid + qid; diff --git a/drivers/common/idpf/idpf_common_virtchnl.h b/drivers/common/idpf/idpf_common_virtchnl.h index 73446ded86..d6555978d5 100644 --- a/drivers/common/idpf/idpf_common_virtchnl.h +++ b/drivers/common/idpf/idpf_common_virtchnl.h @@ -31,7 +31,7 @@ int idpf_vc_cmd_execute(struct idpf_adapter *adapter, struct idpf_cmd_info *args); __rte_internal int idpf_vc_queue_switch(struct idpf_vport *vport, uint16_t qid, - bool rx, bool on); + bool rx, bool on, uint32_t type); __rte_internal int idpf_vc_queues_ena_dis(struct idpf_vport *vport, bool enable); __rte_internal diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c index e707043bf7..9e2a74371e 100644 --- a/drivers/net/cpfl/cpfl_ethdev.c +++ b/drivers/net/cpfl/cpfl_ethdev.c @@ -1907,7 +1907,8 @@ cpfl_stop_cfgqs(struct cpfl_adapter_ext *adapter) int i, ret; for (i = 0; i < CPFL_TX_CFGQ_NUM; i++) { - ret = idpf_vc_queue_switch(&adapter->ctrl_vport.base, i, false, false); + ret = idpf_vc_queue_switch(&adapter->ctrl_vport.base, i, false, false, + VIRTCHNL2_QUEUE_TYPE_CONFIG_TX); if (ret) { PMD_DRV_LOG(ERR, "Fail to disable Tx config queue."); return ret; @@ -1915,7 +1916,8 @@ cpfl_stop_cfgqs(struct cpfl_adapter_ext *adapter) } for (i = 0; i < CPFL_RX_CFGQ_NUM; i++) { - ret = idpf_vc_queue_switch(&adapter->ctrl_vport.base, i, true, false); + ret = idpf_vc_queue_switch(&adapter->ctrl_vport.base, i, true, false, + VIRTCHNL2_QUEUE_TYPE_CONFIG_RX); if (ret) { PMD_DRV_LOG(ERR, "Fail to disable Rx config queue."); return ret; @@ -1943,7 +1945,8 @@ cpfl_start_cfgqs(struct cpfl_adapter_ext *adapter) } for (i = 0; i < CPFL_TX_CFGQ_NUM; i++) { - ret = idpf_vc_queue_switch(&adapter->ctrl_vport.base, i, false, true); + ret = idpf_vc_queue_switch(&adapter->ctrl_vport.base, i, false, true, + VIRTCHNL2_QUEUE_TYPE_CONFIG_TX); if (ret) { PMD_DRV_LOG(ERR, "Fail to enable Tx config queue."); return ret; @@ -1951,7 +1954,8 @@ cpfl_start_cfgqs(struct cpfl_adapter_ext *adapter) } for (i = 0; i < CPFL_RX_CFGQ_NUM; i++) { - ret = idpf_vc_queue_switch(&adapter->ctrl_vport.base, i, true, true); + ret = idpf_vc_queue_switch(&adapter->ctrl_vport.base, i, true, true, + VIRTCHNL2_QUEUE_TYPE_CONFIG_RX); if (ret) { PMD_DRV_LOG(ERR, "Fail to enable Rx config queue."); return ret; diff --git a/drivers/net/cpfl/cpfl_rxtx.c b/drivers/net/cpfl/cpfl_rxtx.c index ab8bec4645..47351ca102 100644 --- a/drivers/net/cpfl/cpfl_rxtx.c +++ b/drivers/net/cpfl/cpfl_rxtx.c @@ -1200,7 +1200,8 @@ cpfl_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id) } /* Ready to switch the queue on */ - err = idpf_vc_queue_switch(vport, rx_queue_id, true, true); + err = idpf_vc_queue_switch(vport, rx_queue_id, true, true, + VIRTCHNL2_QUEUE_TYPE_RX); if (err != 0) { PMD_DRV_LOG(ERR, "Failed to switch RX queue %u on", rx_queue_id); @@ -1252,7 +1253,8 @@ cpfl_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id) } /* Ready to switch the queue on */ - err = idpf_vc_queue_switch(vport, tx_queue_id, false, true); + err = idpf_vc_queue_switch(vport, tx_queue_id, false, true, + VIRTCHNL2_QUEUE_TYPE_TX); if (err != 0) { PMD_DRV_LOG(ERR, "Failed to switch TX queue %u on", tx_queue_id); @@ -1283,7 +1285,8 @@ cpfl_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id) rx_queue_id - cpfl_vport->nb_data_txq, true, false); else - err = idpf_vc_queue_switch(vport, rx_queue_id, true, false); + err = idpf_vc_queue_switch(vport, rx_queue_id, true, false, + VIRTCHNL2_QUEUE_TYPE_RX); if (err != 0) { PMD_DRV_LOG(ERR, "Failed to switch RX queue %u off", rx_queue_id); @@ -1331,7 +1334,8 @@ cpfl_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id) tx_queue_id - cpfl_vport->nb_data_txq, false, false); else - err = idpf_vc_queue_switch(vport, tx_queue_id, false, false); + err = idpf_vc_queue_switch(vport, tx_queue_id, false, false, + VIRTCHNL2_QUEUE_TYPE_TX); if (err != 0) { PMD_DRV_LOG(ERR, "Failed to switch TX queue %u off", tx_queue_id); diff --git a/drivers/net/idpf/idpf_rxtx.c b/drivers/net/idpf/idpf_rxtx.c index 64f2235580..858bbefe3b 100644 --- a/drivers/net/idpf/idpf_rxtx.c +++ b/drivers/net/idpf/idpf_rxtx.c @@ -595,7 +595,8 @@ idpf_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id) } /* Ready to switch the queue on */ - err = idpf_vc_queue_switch(vport, rx_queue_id, true, true); + err = idpf_vc_queue_switch(vport, rx_queue_id, true, true, + VIRTCHNL2_QUEUE_TYPE_RX); if (err != 0) { PMD_DRV_LOG(ERR, "Failed to switch RX queue %u on", rx_queue_id); @@ -646,7 +647,8 @@ idpf_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id) } /* Ready to switch the queue on */ - err = idpf_vc_queue_switch(vport, tx_queue_id, false, true); + err = idpf_vc_queue_switch(vport, tx_queue_id, false, true, + VIRTCHNL2_QUEUE_TYPE_TX); if (err != 0) { PMD_DRV_LOG(ERR, "Failed to switch TX queue %u on", tx_queue_id); @@ -669,7 +671,8 @@ idpf_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id) if (rx_queue_id >= dev->data->nb_rx_queues) return -EINVAL; - err = idpf_vc_queue_switch(vport, rx_queue_id, true, false); + err = idpf_vc_queue_switch(vport, rx_queue_id, true, false, + VIRTCHNL2_QUEUE_TYPE_RX); if (err != 0) { PMD_DRV_LOG(ERR, "Failed to switch RX queue %u off", rx_queue_id); @@ -701,7 +704,8 @@ idpf_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id) if (tx_queue_id >= dev->data->nb_tx_queues) return -EINVAL; - err = idpf_vc_queue_switch(vport, tx_queue_id, false, false); + err = idpf_vc_queue_switch(vport, tx_queue_id, false, false, + VIRTCHNL2_QUEUE_TYPE_TX); if (err != 0) { PMD_DRV_LOG(ERR, "Failed to switch TX queue %u off", tx_queue_id); -- 2.43.0