DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/3] support reading NPA/SSO PF function
@ 2021-08-15 23:11 Tomasz Duszynski
  2021-08-15 23:12 ` [dpdk-dev] [PATCH 1/3] raw/cnxk_bphy: fix device lookup Tomasz Duszynski
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Tomasz Duszynski @ 2021-08-15 23:11 UTC (permalink / raw)
  To: dev; +Cc: Tomasz Duszynski

This series adds support for retrieving NPA/SSO PF function
which is then used by a baseband PSM job scheduler block
to access NPA/SSO.

While at it also push out some device removal fix.

Tomasz Duszynski (3):
  raw/cnxk_bphy: fix device lookup
  common/cnxk: support reading NPA/SSO PF function
  raw/cnxk_bphy: support reading NPA/SSO PF function

 drivers/common/cnxk/roc_bphy.c       | 12 +++++++
 drivers/common/cnxk/roc_bphy.h       |  2 ++
 drivers/common/cnxk/version.map      |  2 ++
 drivers/raw/cnxk_bphy/cnxk_bphy.c    | 19 +++++++++--
 drivers/raw/cnxk_bphy/rte_pmd_bphy.h | 50 ++++++++++++++++++++++++++++
 5 files changed, 83 insertions(+), 2 deletions(-)

--
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev] [PATCH 1/3] raw/cnxk_bphy: fix device lookup
  2021-08-15 23:11 [dpdk-dev] [PATCH 0/3] support reading NPA/SSO PF function Tomasz Duszynski
@ 2021-08-15 23:12 ` Tomasz Duszynski
  2021-09-28 13:20   ` Jerin Jacob
  2021-08-15 23:12 ` [dpdk-dev] [PATCH 2/3] common/cnxk: support reading NPA/SSO PF function Tomasz Duszynski
  2021-08-15 23:12 ` [dpdk-dev] [PATCH 3/3] raw/cnxk_bphy: " Tomasz Duszynski
  2 siblings, 1 reply; 5+ messages in thread
From: Tomasz Duszynski @ 2021-08-15 23:12 UTC (permalink / raw)
  To: dev, Jakub Palider, Tomasz Duszynski; +Cc: Jerin Jacob Kollanukkaran

Name needs to be prepared before the lookup otherwise
PMD will not be released.

Fixes: 24d9c5d59d5d ("raw/cnxk_bphy: add baseband PHY skeleton driver")

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
---
 drivers/raw/cnxk_bphy/cnxk_bphy.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy.c b/drivers/raw/cnxk_bphy/cnxk_bphy.c
index 9cb3f8d332..8a0d2224c0 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy.c
@@ -306,14 +306,13 @@ bphy_rawdev_remove(struct rte_pci_device *pci_dev)
 		return -EINVAL;
 	}
 
+	bphy_rawdev_get_name(name, pci_dev);
 	rawdev = rte_rawdev_pmd_get_named_dev(name);
 	if (rawdev == NULL) {
 		plt_err("invalid device name (%s)", name);
 		return -EINVAL;
 	}
 
-	bphy_rawdev_get_name(name, pci_dev);
-
 	return rte_rawdev_pmd_release(rawdev);
 }
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev] [PATCH 2/3] common/cnxk: support reading NPA/SSO PF function
  2021-08-15 23:11 [dpdk-dev] [PATCH 0/3] support reading NPA/SSO PF function Tomasz Duszynski
  2021-08-15 23:12 ` [dpdk-dev] [PATCH 1/3] raw/cnxk_bphy: fix device lookup Tomasz Duszynski
@ 2021-08-15 23:12 ` Tomasz Duszynski
  2021-08-15 23:12 ` [dpdk-dev] [PATCH 3/3] raw/cnxk_bphy: " Tomasz Duszynski
  2 siblings, 0 replies; 5+ messages in thread
From: Tomasz Duszynski @ 2021-08-15 23:12 UTC (permalink / raw)
  To: dev, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori,
	Satha Rao, Ray Kinsella
  Cc: Tomasz Duszynski, Jerin Jacob Kollanukkaran

Add support for reading NPA/SSO pf_func which will be used
by a PSM to access NPA/SSO. PSM is a hardware block capable
of dispatching jobs to different blocks within a baseband
module.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
---
 drivers/common/cnxk/roc_bphy.c  | 12 ++++++++++++
 drivers/common/cnxk/roc_bphy.h  |  2 ++
 drivers/common/cnxk/version.map |  2 ++
 3 files changed, 16 insertions(+)

diff --git a/drivers/common/cnxk/roc_bphy.c b/drivers/common/cnxk/roc_bphy.c
index 77606d6465..12234c5dcc 100644
--- a/drivers/common/cnxk/roc_bphy.c
+++ b/drivers/common/cnxk/roc_bphy.c
@@ -38,3 +38,15 @@ roc_bphy_dev_fini(struct roc_bphy *roc_bphy)
 
 	return 0;
 }
+
+uint16_t
+roc_bphy_npa_pf_func_get(void)
+{
+	return idev_npa_pffunc_get();
+}
+
+uint16_t
+roc_bphy_sso_pf_func_get(void)
+{
+	return idev_sso_pffunc_get();
+}
diff --git a/drivers/common/cnxk/roc_bphy.h b/drivers/common/cnxk/roc_bphy.h
index 0579c6c443..0032829c8d 100644
--- a/drivers/common/cnxk/roc_bphy.h
+++ b/drivers/common/cnxk/roc_bphy.h
@@ -13,5 +13,7 @@ struct roc_bphy {
 
 int __roc_api roc_bphy_dev_init(struct roc_bphy *roc_bphy);
 int __roc_api roc_bphy_dev_fini(struct roc_bphy *roc_bphy);
+__roc_api uint16_t roc_bphy_npa_pf_func_get(void);
+__roc_api uint16_t roc_bphy_sso_pf_func_get(void);
 
 #endif /* _ROC_BPHY_ */
diff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map
index 2cbcc4b93a..bcbeaf5e7e 100644
--- a/drivers/common/cnxk/version.map
+++ b/drivers/common/cnxk/version.map
@@ -46,6 +46,8 @@ INTERNAL {
 	roc_bphy_irq_handler_set;
 	roc_bphy_irq_stack_get;
 	roc_bphy_irq_stack_remove;
+	roc_bphy_npa_pf_func_get;
+	roc_bphy_sso_pf_func_get;
 	roc_clk_freq_get;
 	roc_cpt_afs_print;
 	roc_cpt_dev_clear;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev] [PATCH 3/3] raw/cnxk_bphy: support reading NPA/SSO PF function
  2021-08-15 23:11 [dpdk-dev] [PATCH 0/3] support reading NPA/SSO PF function Tomasz Duszynski
  2021-08-15 23:12 ` [dpdk-dev] [PATCH 1/3] raw/cnxk_bphy: fix device lookup Tomasz Duszynski
  2021-08-15 23:12 ` [dpdk-dev] [PATCH 2/3] common/cnxk: support reading NPA/SSO PF function Tomasz Duszynski
@ 2021-08-15 23:12 ` Tomasz Duszynski
  2 siblings, 0 replies; 5+ messages in thread
From: Tomasz Duszynski @ 2021-08-15 23:12 UTC (permalink / raw)
  To: dev, Jakub Palider, Tomasz Duszynski; +Cc: Jerin Jacob Kollanukkaran

Add support for reading NPA/SSO pf_func which will be used
by a PSM to access NPA/SSO. PSM is a hardware block capable
of dispatching jobs to different blocks within a baseband
module.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
---
 drivers/raw/cnxk_bphy/cnxk_bphy.c    | 16 +++++++++
 drivers/raw/cnxk_bphy/rte_pmd_bphy.h | 50 ++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+)

diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy.c b/drivers/raw/cnxk_bphy/cnxk_bphy.c
index 8a0d2224c0..8e7b714ba1 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy.c
@@ -67,6 +67,14 @@ bphy_rawdev_selftest(uint16_t dev_id)
 		goto err_desc;
 	}
 
+	ret = rte_pmd_bphy_npa_pf_func_get(dev_id);
+	if (ret == 0)
+		plt_warn("NPA pf_func is invalid");
+
+	ret = rte_pmd_bphy_sso_pf_func_get(dev_id);
+	if (ret == 0)
+		plt_warn("SSO pf_func is invalid");
+
 	ret = rte_pmd_bphy_intr_init(dev_id);
 	if (ret) {
 		plt_err("intr init failed");
@@ -190,6 +198,14 @@ cnxk_bphy_irq_enqueue_bufs(struct rte_rawdev *dev,
 	case CNXK_BPHY_IRQ_MSG_TYPE_MEM_GET:
 		bphy_dev->queues[queue].rsp = &bphy_dev->mem;
 		break;
+	case CNXK_BPHY_MSG_TYPE_NPA_PF_FUNC:
+		bphy_dev->queues[queue].rsp =
+			(void *)(size_t)roc_bphy_npa_pf_func_get();
+		break;
+	case CNXK_BPHY_MSG_TYPE_SSO_PF_FUNC:
+		bphy_dev->queues[queue].rsp =
+			(void *)(size_t)roc_bphy_sso_pf_func_get();
+		break;
 	default:
 		ret = -EINVAL;
 	}
diff --git a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
index d459c3a862..bcd165f41c 100644
--- a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
+++ b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
@@ -114,6 +114,8 @@ enum cnxk_bphy_irq_msg_type {
 	CNXK_BPHY_IRQ_MSG_TYPE_REGISTER,
 	CNXK_BPHY_IRQ_MSG_TYPE_UNREGISTER,
 	CNXK_BPHY_IRQ_MSG_TYPE_MEM_GET,
+	CNXK_BPHY_MSG_TYPE_NPA_PF_FUNC,
+	CNXK_BPHY_MSG_TYPE_SSO_PF_FUNC,
 };
 
 struct cnxk_bphy_irq_msg {
@@ -232,4 +234,52 @@ rte_pmd_bphy_intr_mem_get(uint16_t dev_id)
 	return buf.buf_addr;
 }
 
+static __rte_always_inline uint16_t
+rte_pmd_bphy_npa_pf_func_get(uint16_t dev_id)
+{
+	struct cnxk_bphy_irq_msg msg = {
+		.type = CNXK_BPHY_MSG_TYPE_NPA_PF_FUNC,
+	};
+	struct rte_rawdev_buf *bufs[1];
+	struct rte_rawdev_buf buf;
+	int ret;
+
+	buf.buf_addr = &msg;
+	bufs[0] = &buf;
+
+	ret = rte_rawdev_enqueue_buffers(dev_id, bufs, 1, CNXK_BPHY_DEF_QUEUE);
+	if (ret)
+		return 0;
+
+	ret = rte_rawdev_dequeue_buffers(dev_id, bufs, 1, CNXK_BPHY_DEF_QUEUE);
+	if (ret)
+		return 0;
+
+	return (uint16_t)(size_t)buf.buf_addr;
+}
+
+static __rte_always_inline uint16_t
+rte_pmd_bphy_sso_pf_func_get(uint16_t dev_id)
+{
+	struct cnxk_bphy_irq_msg msg = {
+		.type = CNXK_BPHY_MSG_TYPE_SSO_PF_FUNC,
+	};
+	struct rte_rawdev_buf *bufs[1];
+	struct rte_rawdev_buf buf;
+	int ret;
+
+	buf.buf_addr = &msg;
+	bufs[0] = &buf;
+
+	ret = rte_rawdev_enqueue_buffers(dev_id, bufs, 1, CNXK_BPHY_DEF_QUEUE);
+	if (ret)
+		return 0;
+
+	ret = rte_rawdev_dequeue_buffers(dev_id, bufs, 1, CNXK_BPHY_DEF_QUEUE);
+	if (ret)
+		return 0;
+
+	return (uint16_t)(size_t)buf.buf_addr;
+}
+
 #endif /* _CNXK_BPHY_H_ */
-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH 1/3] raw/cnxk_bphy: fix device lookup
  2021-08-15 23:12 ` [dpdk-dev] [PATCH 1/3] raw/cnxk_bphy: fix device lookup Tomasz Duszynski
@ 2021-09-28 13:20   ` Jerin Jacob
  0 siblings, 0 replies; 5+ messages in thread
From: Jerin Jacob @ 2021-09-28 13:20 UTC (permalink / raw)
  To: Tomasz Duszynski, Ferruh Yigit
  Cc: dpdk-dev, Jakub Palider, Jerin Jacob Kollanukkaran

On Mon, Aug 16, 2021 at 4:43 AM Tomasz Duszynski <tduszynski@marvell.com> wrote:
>
> Name needs to be prepared before the lookup otherwise
> PMD will not be released.
>
> Fixes: 24d9c5d59d5d ("raw/cnxk_bphy: add baseband PHY skeleton driver")
>
> Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
> Reviewed-by: Jerin Jacob Kollanukkaran <jerinj@marvell.com>


Series applied to dpdk-next-net-mrvl/for-next-net. Thanks.


> ---
>  drivers/raw/cnxk_bphy/cnxk_bphy.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy.c b/drivers/raw/cnxk_bphy/cnxk_bphy.c
> index 9cb3f8d332..8a0d2224c0 100644
> --- a/drivers/raw/cnxk_bphy/cnxk_bphy.c
> +++ b/drivers/raw/cnxk_bphy/cnxk_bphy.c
> @@ -306,14 +306,13 @@ bphy_rawdev_remove(struct rte_pci_device *pci_dev)
>                 return -EINVAL;
>         }
>
> +       bphy_rawdev_get_name(name, pci_dev);
>         rawdev = rte_rawdev_pmd_get_named_dev(name);
>         if (rawdev == NULL) {
>                 plt_err("invalid device name (%s)", name);
>                 return -EINVAL;
>         }
>
> -       bphy_rawdev_get_name(name, pci_dev);
> -
>         return rte_rawdev_pmd_release(rawdev);
>  }
>
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-09-28 13:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-15 23:11 [dpdk-dev] [PATCH 0/3] support reading NPA/SSO PF function Tomasz Duszynski
2021-08-15 23:12 ` [dpdk-dev] [PATCH 1/3] raw/cnxk_bphy: fix device lookup Tomasz Duszynski
2021-09-28 13:20   ` Jerin Jacob
2021-08-15 23:12 ` [dpdk-dev] [PATCH 2/3] common/cnxk: support reading NPA/SSO PF function Tomasz Duszynski
2021-08-15 23:12 ` [dpdk-dev] [PATCH 3/3] raw/cnxk_bphy: " Tomasz Duszynski

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).