DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nicolas Chautru <nicolas.chautru@intel.com>
To: dev@dpdk.org, thomas@monjalon.net, gakhil@marvell.com,
	hemant.agrawal@nxp.com, trix@redhat.com
Cc: maxime.coquelin@redhat.com, mdr@ashroe.eu,
	bruce.richardson@intel.com, david.marchand@redhat.com,
	stephen@networkplumber.org,
	Nicolas Chautru <nicolas.chautru@intel.com>
Subject: [PATCH v1 09/10] baseband/acc200: add device status and vf2pf comms
Date: Thu,  7 Jul 2022 17:01:42 -0700	[thread overview]
Message-ID: <1657238503-143836-10-git-send-email-nicolas.chautru@intel.com> (raw)
In-Reply-To: <1657238503-143836-1-git-send-email-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 | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/drivers/baseband/acc200/rte_acc200_pmd.c b/drivers/baseband/acc200/rte_acc200_pmd.c
index ecfbc7a..856ea1c 100644
--- a/drivers/baseband/acc200/rte_acc200_pmd.c
+++ b/drivers/baseband/acc200/rte_acc200_pmd.c
@@ -262,6 +262,31 @@
 			acc200_conf->q_fft.aq_depth_log2);
 }
 
+static inline void
+acc200_vf2pf(struct acc200_device *d, unsigned int payload)
+{
+	acc200_reg_write(d, HWVfHiVfToPfDbellVf, payload);
+}
+
+/* Request device status information */
+static inline uint32_t
+acc200_device_status(struct rte_bbdev *dev)
+{
+	struct acc200_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, ACC200_VF2PF_STATUS_REQUEST);
+	reg = acc200_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 = acc200_reg_read(d, HWVfHiPfToVfDbellVf);
+		time_out++;
+	}
+	/* printf("DevStatus %x %s %d\n", reg, rte_bbdev_device_status_str(reg), time_out); */
+	return reg;
+}
+
 static void
 free_base_addresses(void **base_addrs, int size)
 {
@@ -704,6 +729,7 @@
 
 	/* Mark as configured properly */
 	d->configured = true;
+	acc200_vf2pf(d, ACC200_VF2PF_USING_VF);
 
 	rte_bbdev_log_debug(
 			"ACC200 (%s) configured  sw_rings = %p, sw_rings_iova = %#"
@@ -1214,6 +1240,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


  parent reply	other threads:[~2022-07-08  0:17 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-08  0:01 [PATCH v1 00/10] baseband/acc200 Nicolas Chautru
2022-07-08  0:01 ` [PATCH v1 01/10] baseband/acc200: introduce PMD for ACC200 Nicolas Chautru
2022-09-12  1:08   ` [PATCH v2 00/11] baseband/acc200 Nic Chautru
2022-09-12  1:08     ` [PATCH v2 01/11] baseband/acc100: refactory to segregate common code Nic Chautru
2022-09-12 15:19       ` Bruce Richardson
2022-09-12  1:08     ` [PATCH v2 02/11] baseband/acc200: introduce PMD for ACC200 Nic Chautru
2022-09-12 15:41       ` Bruce Richardson
2022-09-12  1:08     ` [PATCH v2 03/11] baseband/acc200: add HW register definitions Nic Chautru
2022-09-12  1:08     ` [PATCH v2 04/11] baseband/acc200: add info get function Nic Chautru
2022-09-12  1:08     ` [PATCH v2 05/11] baseband/acc200: add queue configuration Nic Chautru
2022-09-12  1:08     ` [PATCH v2 06/11] baseband/acc200: add LDPC processing functions Nic Chautru
2022-09-12  1:08     ` [PATCH v2 07/11] baseband/acc200: add LTE " Nic Chautru
2022-09-12  1:08     ` [PATCH v2 08/11] baseband/acc200: add support for FFT operations Nic Chautru
2022-09-12  1:08     ` [PATCH v2 09/11] baseband/acc200: support interrupt Nic Chautru
2022-09-12  1:08     ` [PATCH v2 10/11] baseband/acc200: add device status and vf2pf comms Nic Chautru
2022-09-12  1:08     ` [PATCH v2 11/11] baseband/acc200: add PF configure companion function Nic Chautru
2022-07-08  0:01 ` [PATCH v1 02/10] baseband/acc200: add HW register definitions Nicolas Chautru
2022-07-08  0:01 ` [PATCH v1 03/10] baseband/acc200: add info get function Nicolas Chautru
2022-07-08  0:01 ` [PATCH v1 04/10] baseband/acc200: add queue configuration Nicolas Chautru
2022-07-08  0:01 ` [PATCH v1 05/10] baseband/acc200: add LDPC processing functions Nicolas Chautru
2022-07-08  0:01 ` [PATCH v1 06/10] baseband/acc200: add LTE " Nicolas Chautru
2022-07-08  0:01 ` [PATCH v1 07/10] baseband/acc200: add support for FFT operations Nicolas Chautru
2022-07-08  0:01 ` [PATCH v1 08/10] baseband/acc200: support interrupt Nicolas Chautru
2022-07-08  0:01 ` Nicolas Chautru [this message]
2022-07-08  0:01 ` [PATCH v1 10/10] baseband/acc200: add PF configure companion function Nicolas Chautru
2022-07-12 13:48 ` [PATCH v1 00/10] baseband/acc200 Maxime Coquelin
2022-07-14 18:49   ` Vargas, Hernan
2022-07-17 13:08     ` Tom Rix
2022-07-22 18:29       ` Vargas, Hernan
2022-07-22 20:19         ` Tom Rix
2022-08-15 17:52           ` Chautru, Nicolas
2022-08-30  7:44   ` Maxime Coquelin
2022-08-30 19:45     ` Chautru, Nicolas
2022-08-31 16:43       ` Maxime Coquelin
2022-08-31 19:20         ` Thomas Monjalon
2022-08-31 19:26       ` Tom Rix
2022-08-31 22:37         ` Chautru, Nicolas
2022-09-01  0:28           ` Tom Rix
2022-09-01  1:26             ` Chautru, Nicolas
2022-09-01 13:49               ` Tom Rix
2022-09-01 20:34                 ` Chautru, Nicolas
2022-09-06 12:51                   ` Tom Rix
2022-09-14 10:35                     ` Thomas Monjalon
2022-09-14 11:50                       ` Maxime Coquelin
2022-09-14 13:19                         ` Bruce Richardson
2022-09-14 13:27                           ` Maxime Coquelin
2022-09-14 13:44                           ` [EXT] " Akhil Goyal
2022-09-14 14:23                             ` Thomas Monjalon
2022-09-14 19:57                               ` Chautru, Nicolas
2022-09-14 20:08                                 ` 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=1657238503-143836-10-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=gakhil@marvell.com \
    --cc=hemant.agrawal@nxp.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 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).