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 921E7426AE; Tue, 3 Oct 2023 13:52:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5B4444067C; Tue, 3 Oct 2023 13:52:39 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 5BF1A4067C for ; Tue, 3 Oct 2023 13:52:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696333957; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=s0YAOEvHfAaWfeDmvkfBuNnFOcGWUKk5CJkmS43eCJ4=; b=dd+Qrdd73kk3xL579tV6GqxR65OJ27CFuAMgp1T/Kqn+6TgSZIcBw9uQDtlB3rKAysEo/c MlGGP4aU+JAZJ973LQ4UebfJ5KHMxFKnadWeSr5Lf94NZIIEFCyIP5u3RWsJgLlAh1tGzk h48psza2NSmxwEA5xZf+DabFXF66ePE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-385-VQLYBm0yMdy6oquRQ0vfSg-1; Tue, 03 Oct 2023 07:52:31 -0400 X-MC-Unique: VQLYBm0yMdy6oquRQ0vfSg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6643F185A79C; Tue, 3 Oct 2023 11:52:31 +0000 (UTC) Received: from [10.39.208.36] (unknown [10.39.208.36]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 49D3340C2013; Tue, 3 Oct 2023 11:52:30 +0000 (UTC) Message-ID: <3fc8f63e-a242-35e5-1563-9df30d258f73@redhat.com> Date: Tue, 3 Oct 2023 13:52:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 To: Nicolas Chautru , dev@dpdk.org Cc: hemant.agrawal@nxp.com, david.marchand@redhat.com, hernan.vargas@intel.com References: <20230929163516.3636499-1-nicolas.chautru@intel.com> <20230929163516.3636499-3-nicolas.chautru@intel.com> From: Maxime Coquelin Subject: Re: [PATCH v3 02/12] baseband/acc: add FFT window width in the VRB PMD In-Reply-To: <20230929163516.3636499-3-nicolas.chautru@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 On 9/29/23 18:35, Nicolas Chautru wrote: > 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 > --- > drivers/baseband/acc/acc_common.h | 3 +++ > drivers/baseband/acc/rte_vrb_pmd.c | 29 +++++++++++++++++++++++++++++ > 2 files changed, 32 insertions(+) > > diff --git a/drivers/baseband/acc/acc_common.h b/drivers/baseband/acc/acc_common.h > index 5bb00746c3..7d24c644c0 100644 > --- a/drivers/baseband/acc/acc_common.h > +++ b/drivers/baseband/acc/acc_common.h > @@ -512,6 +512,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 +560,7 @@ 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[RTE_BBDEV_MAX_FFT_WIN]; /* FFT windowing width. */ > }; > > /* 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..c5a74bae11 100644 > --- a/drivers/baseband/acc/rte_vrb_pmd.c > +++ b/drivers/baseband/acc/rte_vrb_pmd.c > @@ -298,6 +298,34 @@ vrb_device_status(struct rte_bbdev *dev) > return reg; > } > > +/* Request device FFT windowing information. */ > +static inline void > +vrb_device_fft_win(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) > +{ > + 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) { O is not a possible value? Might not be a big deal as it would just perform reading of 16 x 2 registers every time .info_get() is called, just wondering. > + for (win = 0; win < RTE_BBDEV_MAX_FFT_WIN; win++) { > + vrb_vf2pf(d, ACC_VF2PF_FFT_WIN_REQUEST | win); That looks broken, as extending RTE_BBDEV_MAX_FFT_WIN to support other devices may break this implementation. To me, it tends to show how this fft_window_width array is more device specific than generic. > + 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; > + } > + } > + > + for (win = 0; win < RTE_BBDEV_MAX_FFT_WIN; win++) > + dev_info->fft_window_width[win] = d->fft_window_width[win]; > +} > + > /* Checks PF Info Ring to find the interrupt cause and handles it accordingly. */ > static inline void > vrb_check_ir(struct acc_device *acc_dev) > @@ -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); > + vrb_device_fft_win(dev, dev_info); > > /* Exposed number of queues. */ > dev_info->num_queues[RTE_BBDEV_OP_NONE] = 0;