DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nicolas Chautru <nicolas.chautru@intel.com>
To: dev@dpdk.org, gakhil@marvell.com, maxime.coquelin@redhat.com
Cc: 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,
	Nic Chautru <nicolas.chautru@intel.com>
Subject: [PATCH v9 12/14] baseband/acc: add device status and vf2pf comms
Date: Fri,  7 Oct 2022 14:38:49 -0700	[thread overview]
Message-ID: <20221007213851.31524-13-nicolas.chautru@intel.com> (raw)
In-Reply-To: <20221007213851.31524-1-nicolas.chautru@intel.com>

From: Nic Chautru <nicolas.chautru@intel.com>

Added support to expose the device status seen from the
host through v2pf mailbox communication.

Signed-off-by: Nic Chautru <nicolas.chautru@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/baseband/acc/rte_acc200_pmd.c | 30 +++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/drivers/baseband/acc/rte_acc200_pmd.c b/drivers/baseband/acc/rte_acc200_pmd.c
index 99ac07ff01..fe032efc83 100644
--- a/drivers/baseband/acc/rte_acc200_pmd.c
+++ b/drivers/baseband/acc/rte_acc200_pmd.c
@@ -211,6 +211,33 @@ fetch_acc200_config(struct rte_bbdev *dev)
 			acc_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. */
 static inline void
 acc200_check_ir(struct acc_device *acc200_dev)
@@ -484,6 +511,7 @@ acc200_setup_queues(struct rte_bbdev *dev, uint16_t num_queues, int socket_id)
 
 	/* 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 = %#"
@@ -1010,6 +1038,8 @@ acc200_dev_info_get(struct rte_bbdev *dev,
 
 	/* 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;
-- 
2.37.1


  parent reply	other threads:[~2022-10-07 21:40 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-07 21:38 [PATCH v9 00/14] bbdev ACC200 PMD Nicolas Chautru
2022-10-07 21:38 ` [PATCH v9 01/14] baseband/acc100: remove unused registers Nicolas Chautru
2022-10-07 21:38 ` [PATCH v9 02/14] baseband/acc100: refactor to segregate common code Nicolas Chautru
2022-10-07 21:38 ` [PATCH v9 03/14] baseband/acc: rename directory from acc100 to acc Nicolas Chautru
2022-10-07 21:38 ` [PATCH v9 04/14] baseband/acc: introduce PMD for ACC200 Nicolas Chautru
2022-10-07 21:38 ` [PATCH v9 05/14] baseband/acc: add HW register definitions " Nicolas Chautru
2022-10-07 21:38 ` [PATCH v9 06/14] baseband/acc: add info get function " Nicolas Chautru
2022-10-07 21:38 ` [PATCH v9 07/14] baseband/acc: add queue configuration " Nicolas Chautru
2022-10-07 21:38 ` [PATCH v9 08/14] baseband/acc: add LDPC processing functions Nicolas Chautru
2022-10-07 21:38 ` [PATCH v9 09/14] baseband/acc: add LTE " Nicolas Chautru
2022-10-10  9:47   ` Maxime Coquelin
2022-10-10 17:33     ` Chautru, Nicolas
2022-10-10 18:08       ` Akhil Goyal
2022-10-11 21:24         ` Chautru, Nicolas
2022-10-07 21:38 ` [PATCH v9 10/14] baseband/acc: add support for FFT operations Nicolas Chautru
2022-10-10  9:50   ` Maxime Coquelin
2022-10-07 21:38 ` [PATCH v9 11/14] baseband/acc: support interrupt Nicolas Chautru
2022-10-10  9:53   ` Maxime Coquelin
2022-10-07 21:38 ` Nicolas Chautru [this message]
2022-10-07 21:38 ` [PATCH v9 13/14] baseband/acc: add PF configure companion function Nicolas Chautru
2022-10-10 10:02   ` Maxime Coquelin
2022-10-10 10:08     ` [EXT] " Akhil Goyal
2022-10-10 17:10       ` Chautru, Nicolas
2022-10-10 18:12         ` Akhil Goyal
2022-10-11 21:18           ` Chautru, Nicolas
2022-10-12  7:19             ` Maxime Coquelin
2022-10-13  1:02               ` Chautru, Nicolas
2022-10-13  1:30                 ` Chautru, Nicolas
2022-10-13  7:21                   ` Akhil Goyal
2022-10-07 21:38 ` [PATCH v9 14/14] baseband/acc: simplify meson dependency Nicolas Chautru
2022-10-10 10:03   ` Maxime Coquelin

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=20221007213851.31524-13-nicolas.chautru@intel.com \
    --to=nicolas.chautru@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=hernan.vargas@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=mdr@ashroe.eu \
    --cc=stephen@networkplumber.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).