From patchwork Thu Oct 5 19:48:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chautru, Nicolas" X-Patchwork-Id: 132334 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3CBB6426C5; Thu, 5 Oct 2023 21:56:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4645B40685; Thu, 5 Oct 2023 21:56:10 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 75E0F402CF for ; Thu, 5 Oct 2023 21:56:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696535766; x=1728071766; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sj0gDtBYL9FOKE2NXUn6F5cjlzMny3HlfRIT9X87dTY=; b=eZGKJbMh/trBUGFtktbBKELnQMJkEb4i5bUZs5bSfMACxGNNn3MsaXCM iqv1f2/BoYASb8tHQcwHjk7EmcaN34CPWzB6Y67D5ICDvdYPHQ5Sr9G0+ KmJRCa7cYIo/Jk8XvsoupSxXUpopXCCV6Qu41+WZ2xLXNK3QSXwKAIPmX DXZi7fCgkrDHC+0Iahf63LGUYLhgksKmgpZfEa8Zcc/rL4nuZZiq6UxnV 2Idt6h7yGPQBBrMjtyGiBe48b6DSyO7dkKqCmUDWQZS5GVkIRLMUhGsKL 9CQJln41HzE+eEf6ShsC3FCPN2fChKcJ4GmO62q4SbphxIRplKPcUNZvj Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="386432636" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="386432636" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2023 12:56:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="755600273" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="755600273" Received: from spr-npg-bds1-eec2.sn.intel.com (HELO spr-npg-bds1-eec2..) ([10.233.181.123]) by fmsmga007.fm.intel.com with ESMTP; 05 Oct 2023 12:56:04 -0700 From: Nicolas Chautru To: dev@dpdk.org, maxime.coquelin@redhat.com Cc: hemant.agrawal@nxp.com, david.marchand@redhat.com, hernan.vargas@intel.com, Nicolas Chautru Subject: [PATCH v5 02/12] baseband/acc: add FFT window width in the VRB PMD Date: Thu, 5 Oct 2023 19:48:57 +0000 Message-Id: <20231005194907.557517-3-nicolas.chautru@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231005194907.557517-1-nicolas.chautru@intel.com> References: <20231005194907.557517-1-nicolas.chautru@intel.com> MIME-Version: 1.0 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 This allows to expose the FFT window width being introduced in previous commit based on what is configured dynamically on the device platform. Signed-off-by: Nicolas Chautru Reviewed-by: Maxime Coquelin --- drivers/baseband/acc/acc_common.h | 6 +++++ drivers/baseband/acc/rte_vrb_pmd.c | 41 +++++++++++++++++++++++++----- 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/drivers/baseband/acc/acc_common.h b/drivers/baseband/acc/acc_common.h index 5bb00746c3..afece863bc 100644 --- a/drivers/baseband/acc/acc_common.h +++ b/drivers/baseband/acc/acc_common.h @@ -131,6 +131,8 @@ #define ACC_LIM_31 20 /* 0.31 */ #define ACC_MAX_E (128 * 1024 - 2) +#define ACC_MAX_FFT_WIN 16 + /* Helper macro for logging */ #define rte_acc_log(level, fmt, ...) \ rte_log(RTE_LOG_ ## level, RTE_LOG_NOTICE, fmt "\n", \ @@ -512,6 +514,8 @@ struct acc_deq_intr_details { enum { ACC_VF2PF_STATUS_REQUEST = 1, ACC_VF2PF_USING_VF = 2, + ACC_VF2PF_LUT_VER_REQUEST = 3, + ACC_VF2PF_FFT_WIN_REQUEST = 4, }; @@ -558,6 +562,8 @@ struct acc_device { queue_offset_fun_t queue_offset; /* Device specific queue offset */ uint16_t num_qgroups; uint16_t num_aqs; + uint16_t fft_window_width[ACC_MAX_FFT_WIN]; /* FFT windowing size. */ + }; /* Structure associated with each queue. */ diff --git a/drivers/baseband/acc/rte_vrb_pmd.c b/drivers/baseband/acc/rte_vrb_pmd.c index 9e5a73c9c7..b86e814f8f 100644 --- a/drivers/baseband/acc/rte_vrb_pmd.c +++ b/drivers/baseband/acc/rte_vrb_pmd.c @@ -183,6 +183,37 @@ vrb_check_device_enable(struct rte_bbdev *dev) return false; } +static inline void +vrb_vf2pf(struct acc_device *d, unsigned int payload) +{ + acc_reg_write(d, d->reg_addr->vf2pf_doorbell, payload); +} + +/* Request device FFT windowing information. */ +static inline void +vrb_device_fft_win(struct rte_bbdev *dev) +{ + struct acc_device *d = dev->data->dev_private; + uint32_t reg, time_out = 0, win; + + if (d->pf_device) + return; + + /* Check from the device the first time. */ + if (d->fft_window_width[0] == 0) { + for (win = 0; win < ACC_MAX_FFT_WIN; win++) { + vrb_vf2pf(d, ACC_VF2PF_FFT_WIN_REQUEST | win); + reg = acc_reg_read(d, d->reg_addr->pf2vf_doorbell); + while ((time_out < ACC_STATUS_TO) && (reg == RTE_BBDEV_DEV_NOSTATUS)) { + usleep(ACC_STATUS_WAIT); /*< Wait or VF->PF->VF Comms. */ + reg = acc_reg_read(d, d->reg_addr->pf2vf_doorbell); + time_out++; + } + d->fft_window_width[win] = reg; + } + } +} + /* Fetch configuration enabled for the PF/VF using MMIO Read (slow). */ static inline void fetch_acc_config(struct rte_bbdev *dev) @@ -206,6 +237,8 @@ fetch_acc_config(struct rte_bbdev *dev) return; } + vrb_device_fft_win(dev); + d->ddr_size = 0; /* Single VF Bundle by VF. */ @@ -271,12 +304,6 @@ fetch_acc_config(struct rte_bbdev *dev) acc_conf->q_fft.aq_depth_log2); } -static inline void -vrb_vf2pf(struct acc_device *d, unsigned int payload) -{ - acc_reg_write(d, d->reg_addr->vf2pf_doorbell, payload); -} - /* Request device status information. */ static inline uint32_t vrb_device_status(struct rte_bbdev *dev) @@ -1085,6 +1112,7 @@ vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) RTE_BBDEV_LDPC_MAX_CODE_BLOCKS, .num_buffers_dst = RTE_BBDEV_LDPC_MAX_CODE_BLOCKS, + .fft_windows_num = ACC_MAX_FFT_WIN, } }, RTE_BBDEV_END_OF_CAPABILITIES_LIST() @@ -1100,6 +1128,7 @@ vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) fetch_acc_config(dev); /* Check the status of device. */ dev_info->device_status = vrb_device_status(dev); + dev_info->fft_window_width = d->fft_window_width; /* Exposed number of queues. */ dev_info->num_queues[RTE_BBDEV_OP_NONE] = 0;