From: Nic Chautru <nicolas.chautru@intel.com>
To: dev@dpdk.org, thomas@monjalon.net
Cc: maxime.coquelin@redhat.com, trix@redhat.com, mdr@ashroe.eu,
bruce.richardson@intel.com, hemant.agrawal@nxp.com,
david.marchand@redhat.com, stephen@networkplumber.org,
hernan.vargas@intel.com,
Nicolas Chautru <nicolas.chautru@intel.com>
Subject: [PATCH v3 10/13] baseband/acc200: add device status and vf2pf comms
Date: Thu, 15 Sep 2022 18:35:03 -0700 [thread overview]
Message-ID: <1663292106-45320-11-git-send-email-nicolas.chautru@intel.com> (raw)
In-Reply-To: <1663292106-45320-1-git-send-email-nicolas.chautru@intel.com>
From: Nicolas Chautru <nicolas.chautru@intel.com>
Add support to expose the device status seen from the
host through v2pf mailbox communication.
Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
---
drivers/baseband/acc200/rte_acc200_pmd.c | 61 +++++++++++++++++++++++---------
1 file changed, 44 insertions(+), 17 deletions(-)
diff --git a/drivers/baseband/acc200/rte_acc200_pmd.c b/drivers/baseband/acc200/rte_acc200_pmd.c
index 8fe5704..a969679 100644
--- a/drivers/baseband/acc200/rte_acc200_pmd.c
+++ b/drivers/baseband/acc200/rte_acc200_pmd.c
@@ -201,23 +201,47 @@
rte_bbdev_log_debug(
"%s Config LLR SIGN IN/OUT %s %s QG %u %u %u %u %u AQ %u %u %u %u %u Len %u %u %u %u %u\n",
(d->pf_device) ? "PF" : "VF",
- (acc_conf->input_pos_llr_1_bit) ? "POS" : "NEG",
- (acc_conf->output_pos_llr_1_bit) ? "POS" : "NEG",
- acc_conf->q_ul_4g.num_qgroups,
- acc_conf->q_dl_4g.num_qgroups,
- acc_conf->q_ul_5g.num_qgroups,
- acc_conf->q_dl_5g.num_qgroups,
- acc_conf->q_fft.num_qgroups,
- acc_conf->q_ul_4g.num_aqs_per_groups,
- acc_conf->q_dl_4g.num_aqs_per_groups,
- acc_conf->q_ul_5g.num_aqs_per_groups,
- acc_conf->q_dl_5g.num_aqs_per_groups,
- acc_conf->q_fft.num_aqs_per_groups,
- acc_conf->q_ul_4g.aq_depth_log2,
- acc_conf->q_dl_4g.aq_depth_log2,
- acc_conf->q_ul_5g.aq_depth_log2,
- acc_conf->q_dl_5g.aq_depth_log2,
- acc_conf->q_fft.aq_depth_log2);
+ (acc200_conf->input_pos_llr_1_bit) ? "POS" : "NEG",
+ (acc200_conf->output_pos_llr_1_bit) ? "POS" : "NEG",
+ acc200_conf->q_ul_4g.num_qgroups,
+ acc200_conf->q_dl_4g.num_qgroups,
+ acc200_conf->q_ul_5g.num_qgroups,
+ acc200_conf->q_dl_5g.num_qgroups,
+ acc200_conf->q_fft.num_qgroups,
+ acc200_conf->q_ul_4g.num_aqs_per_groups,
+ acc200_conf->q_dl_4g.num_aqs_per_groups,
+ acc200_conf->q_ul_5g.num_aqs_per_groups,
+ acc200_conf->q_dl_5g.num_aqs_per_groups,
+ acc200_conf->q_fft.num_aqs_per_groups,
+ acc200_conf->q_ul_4g.aq_depth_log2,
+ acc200_conf->q_dl_4g.aq_depth_log2,
+ acc200_conf->q_ul_5g.aq_depth_log2,
+ acc200_conf->q_dl_5g.aq_depth_log2,
+ acc200_conf->q_fft.aq_depth_log2);
+}
+
+static inline void
+acc200_vf2pf(struct acc_device *d, unsigned int payload)
+{
+ acc_reg_write(d, HWVfHiVfToPfDbellVf, payload);
+}
+
+/* Request device status information */
+static inline uint32_t
+acc200_device_status(struct rte_bbdev *dev)
+{
+ struct acc_device *d = dev->data->dev_private;
+ uint32_t reg, time_out = 0;
+ if (d->pf_device)
+ return RTE_BBDEV_DEV_NOT_SUPPORTED;
+ acc200_vf2pf(d, ACC_VF2PF_STATUS_REQUEST);
+ reg = acc_reg_read(d, HWVfHiPfToVfDbellVf);
+ while ((time_out < ACC200_STATUS_TO) && (reg == RTE_BBDEV_DEV_NOSTATUS)) {
+ usleep(ACC200_STATUS_WAIT); /*< Wait or VF->PF->VF Comms */
+ reg = acc_reg_read(d, HWVfHiPfToVfDbellVf);
+ time_out++;
+ }
+ return reg;
}
/* Checks PF Info Ring to find the interrupt cause and handles it accordingly */
@@ -537,6 +561,7 @@
/* Mark as configured properly */
d->configured = true;
+ acc200_vf2pf(d, ACC_VF2PF_USING_VF);
rte_bbdev_log_debug(
"ACC200 (%s) configured sw_rings = %p, sw_rings_iova = %#"
@@ -1047,6 +1072,8 @@
/* Read and save the populated config from ACC200 registers */
fetch_acc200_config(dev);
+ /* Check the status of device */
+ dev_info->device_status = acc200_device_status(dev);
/* Exposed number of queues */
dev_info->num_queues[RTE_BBDEV_OP_NONE] = 0;
--
1.8.3.1
next prev parent reply other threads:[~2022-09-16 1:36 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-16 1:34 From: Nic Chautru <nicolas.chautru@intel.com> Nic Chautru
2022-09-16 1:34 ` [PATCH v3 01/13] baseband/acc100: refactor to segregate common code Nic Chautru
2022-09-21 7:13 ` Maxime Coquelin
2022-09-21 21:25 ` Chautru, Nicolas
2022-09-16 1:34 ` [PATCH v3 02/13] baseband/acc200: introduce PMD for ACC200 Nic Chautru
2022-09-21 7:17 ` Maxime Coquelin
2022-09-21 23:34 ` Chautru, Nicolas
2022-09-16 1:34 ` [PATCH v3 03/13] baseband/acc200: add HW register definitions Nic Chautru
2022-09-16 1:34 ` [PATCH v3 04/13] baseband/acc200: add info get function Nic Chautru
2022-09-16 1:34 ` [PATCH v3 05/13] baseband/acc200: add queue configuration Nic Chautru
2022-09-16 1:34 ` [PATCH v3 06/13] baseband/acc200: add LDPC processing functions Nic Chautru
2022-09-16 1:35 ` [PATCH v3 07/13] baseband/acc200: add LTE " Nic Chautru
2022-09-16 1:35 ` [PATCH v3 08/13] baseband/acc200: add support for FFT operations Nic Chautru
2022-09-16 1:35 ` [PATCH v3 09/13] baseband/acc200: support interrupt Nic Chautru
2022-09-16 1:35 ` Nic Chautru [this message]
2022-09-16 1:35 ` [PATCH v3 11/13] baseband/acc200: add PF configure companion function Nic Chautru
2022-09-16 1:35 ` [PATCH v3 12/13] baseband/acc: rename and merge directories into acc Nic Chautru
2022-09-16 1:35 ` [PATCH v3 13/13] baseband/acc: simplify meson dependency Nic Chautru
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1663292106-45320-11-git-send-email-nicolas.chautru@intel.com \
--to=nicolas.chautru@intel.com \
--cc=bruce.richardson@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=hemant.agrawal@nxp.com \
--cc=hernan.vargas@intel.com \
--cc=maxime.coquelin@redhat.com \
--cc=mdr@ashroe.eu \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
--cc=trix@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.