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 7BA7AA034E; Sun, 7 Jun 2020 14:37:16 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8070F1BFA1; Sun, 7 Jun 2020 14:37:15 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 1B6181BF93 for ; Sun, 7 Jun 2020 14:37:12 +0200 (CEST) IronPort-SDR: HLK7QaOj1ofQ6DHHEsWhuTcQnR8i9/WXN3oH6g3MM5K5RbuhrGwRzidD26KA9FdzD/jESr0lT1 PTCCPa69Itbw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2020 05:37:12 -0700 IronPort-SDR: zOsdCIz+QrAl6zQD27tzdDdrDSF3iY/TXwdmQdfbyqfq0f27ehwJBPggvJGqQZs/+OnUg/b+01 m7TstLgdtq8Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,484,1583222400"; d="scan'208";a="270239298" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.116.183]) by orsmga003.jf.intel.com with ESMTP; 07 Jun 2020 05:37:09 -0700 Date: Sun, 7 Jun 2020 20:28:56 +0800 From: Ye Xiaolong To: Ting Xu , Qiming Yang Cc: dev@dpdk.org, qi.z.zhang@intel.com, qiming.yang@intel.com, john.mcnamara@intel.com, marko.kovacevic@intel.com Message-ID: <20200607122856.GB7883@intel.com> References: <20200605201737.33766-1-ting.xu@intel.com> <20200605201737.33766-10-ting.xu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200605201737.33766-10-ting.xu@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v1 09/12] net/ice: add queue start and stop for DCF 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" On 06/05, Ting Xu wrote: >From: Qi Zhang > >Add queue start and stop in DCF. Support queue enable and disable >through virtual channel. Add support for Rx queue mbufs allocation >and queue reset. There is one i40e patch [1] from qiming to correct the queue behavior as "when one queue fails to start, all following queues start action should be skipped and previous started queues should be cleaned, and for queue stop case, one queue stop failure shouldn't skip following queues stop action", I think it applies to this patch as well, add Qiming for more comments. [1] https://patches.dpdk.org/patch/70362/ > >Signed-off-by: Qi Zhang >--- > drivers/net/ice/ice_dcf.c | 57 ++++++ > drivers/net/ice/ice_dcf.h | 3 +- > drivers/net/ice/ice_dcf_ethdev.c | 309 +++++++++++++++++++++++++++++++ > 3 files changed, 368 insertions(+), 1 deletion(-) > >diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c >index d864ae894..56b8c0d25 100644 >--- a/drivers/net/ice/ice_dcf.c >+++ b/drivers/net/ice/ice_dcf.c >@@ -940,3 +940,60 @@ ice_dcf_config_irq_map(struct ice_dcf_hw *hw) > rte_free(map_info); > return err; > } >+ >+int >+ice_dcf_switch_queue(struct ice_dcf_hw *hw, uint16_t qid, bool rx, bool on) >+{ >+ struct virtchnl_queue_select queue_select; >+ struct dcf_virtchnl_cmd args; >+ int err; >+ >+ memset(&queue_select, 0, sizeof(queue_select)); >+ queue_select.vsi_id = hw->vsi_res->vsi_id; >+ if (rx) >+ queue_select.rx_queues |= 1 << qid; >+ else >+ queue_select.tx_queues |= 1 << qid; >+ >+ memset(&args, 0, sizeof(args)); >+ if (on) >+ args.v_op = VIRTCHNL_OP_ENABLE_QUEUES; >+ else >+ args.v_op = VIRTCHNL_OP_DISABLE_QUEUES; >+ >+ args.req_msg = (u8 *)&queue_select; >+ args.req_msglen = sizeof(queue_select); >+ >+ err = ice_dcf_execute_virtchnl_cmd(hw, &args); >+ if (err) >+ PMD_DRV_LOG(ERR, "Failed to execute command of %s", >+ on ? "OP_ENABLE_QUEUES" : "OP_DISABLE_QUEUES"); >+ return err; >+} >+ >+int >+ice_dcf_disable_queues(struct ice_dcf_hw *hw) >+{ >+ struct virtchnl_queue_select queue_select; >+ struct dcf_virtchnl_cmd args; >+ int err; >+ >+ memset(&queue_select, 0, sizeof(queue_select)); >+ queue_select.vsi_id = hw->vsi_res->vsi_id; >+ >+ queue_select.rx_queues = BIT(hw->eth_dev->data->nb_rx_queues) - 1; >+ queue_select.tx_queues = BIT(hw->eth_dev->data->nb_tx_queues) - 1; >+ >+ memset(&args, 0, sizeof(args)); >+ args.v_op = VIRTCHNL_OP_DISABLE_QUEUES; >+ args.req_msg = (u8 *)&queue_select; >+ args.req_msglen = sizeof(queue_select); >+ >+ err = ice_dcf_execute_virtchnl_cmd(hw, &args); >+ if (err) { >+ PMD_DRV_LOG(ERR, >+ "Failed to execute command of OP_DISABLE_QUEUES"); >+ return err; >+ } >+ return 0; Better to align with above ice_dcf_switch_queue, one 'return err' in the end is enough. Thanks, Xiaolong