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 C07BFA0093; Tue, 23 Aug 2022 07:25:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 57D4D427F6; Tue, 23 Aug 2022 07:24:52 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id AC0F3427EC for ; Tue, 23 Aug 2022 07:24:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661232291; x=1692768291; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=Lg21sk7WwAa4CwaYlMhDdhlRhVL+rg6motdShcLYfKI=; b=YsRW+9pBC73HPIE3wbnATr/c/dlkXd8jVfNYt/9IRZuM5hHb7xlsapUx ERGEm8nwf3zq6rbQRU8DjkpWmuqNuSaA4XiZ7UsSg2lb24aOHgA0uZ6wW QiQML0WNStgu2scTGIo1GeseJOe30E4OdXlgz0Z5w9o0bsPPc52+9YeqN Gpg2hAIrRj7dGEBckkVNgjnwl/i42vk+RYlfl8ucR4DNBVn34w2Pn1h/Q 2Yw26PA+Qh+TO92k2fRYlE3pdKe96GMBcbhLxeeN398114JTlVphTyUr1 PT8RmUsgax7MhWivPBujfNR8ZHfnYXFANinw2WD39hHf9bRGmsOrDEm25 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10447"; a="355325306" X-IronPort-AV: E=Sophos;i="5.93,256,1654585200"; d="scan'208";a="355325306" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2022 22:24:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,256,1654585200"; d="scan'208";a="669864746" Received: from dpdk-dipei.sh.intel.com ([10.67.110.251]) by fmsmga008.fm.intel.com with ESMTP; 22 Aug 2022 22:24:49 -0700 From: Andy Pei To: dev@dpdk.org Cc: chenbo.xia@intel.com, rosen.xu@intel.com, wei.huang@intel.com, gang.cao@intel.com, maxime.coquelin@redhat.com, Huang Wei Subject: [PATCH 4/8] vdpa/ifc: write queue count to MQ register Date: Tue, 23 Aug 2022 12:35:01 +0800 Message-Id: <1661229305-240952-5-git-send-email-andy.pei@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1661229305-240952-1-git-send-email-andy.pei@intel.com> References: <1661229305-240952-1-git-send-email-andy.pei@intel.com> 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 Write queue count to IFCVF_MQ_OFFSET register to enable multi queue feature. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- drivers/vdpa/ifc/base/ifcvf.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/vdpa/ifc/base/ifcvf.c b/drivers/vdpa/ifc/base/ifcvf.c index 34c8226..1b50df6 100644 --- a/drivers/vdpa/ifc/base/ifcvf.c +++ b/drivers/vdpa/ifc/base/ifcvf.c @@ -198,6 +198,19 @@ IFCVF_WRITE_REG32(val >> 32, hi); } +STATIC void +ifcvf_enable_multiqueue(struct ifcvf_hw *hw, u16 nr_queue_pair) +{ + u8 *mq_cfg; + + if (hw->device_type == IFCVF_NET) + nr_queue_pair = (nr_queue_pair + 1) / 2; + + mq_cfg = hw->mq_cfg; + if (mq_cfg) + *(u32 *)mq_cfg = nr_queue_pair; +} + STATIC int ifcvf_hw_enable(struct ifcvf_hw *hw) { @@ -215,6 +228,7 @@ return -1; } + ifcvf_enable_multiqueue(hw, hw->nr_vring); for (i = 0; i < hw->nr_vring; i++) { IFCVF_WRITE_REG16(i, &cfg->queue_select); io_write64_twopart(hw->vring[i].desc, &cfg->queue_desc_lo, -- 1.8.3.1