From: Amit Prakash Shukla <amitprakashs@marvell.com>
To: Nithin Dabilpuram <ndabilpuram@marvell.com>,
Kiran Kumar K <kirankumark@marvell.com>,
Sunil Kumar Kori <skori@marvell.com>,
Satha Rao <skoteshwar@marvell.com>,
Vamsi Attunuru <vattunuru@marvell.com>
Cc: <dev@dpdk.org>, <jerinj@marvell.com>, <pbhagavatula@marvell.com>,
<anoobj@marvell.com>, <asasidharan@marvell.com>,
Amit Prakash Shukla <amitprakashs@marvell.com>
Subject: [PATCH v5 1/3] common/cnxk: dma result to an offset of the event
Date: Mon, 4 Mar 2024 02:38:06 +0530 [thread overview]
Message-ID: <20240303210808.614845-1-amitprakashs@marvell.com> (raw)
In-Reply-To: <20240301173202.2782112-1-amitprakashs@marvell.com>
Adds support to configure writing result to offset of the DMA
response event.
Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>
---
v5:
- Fixed checkpatch warning.
v4:
- Fixed compilation error.
- Updated release notes.
v3:
- Rebased and fixed compilation error.
v2:
- Added dual workslot enqueue support.
- Fixed compilation error.
drivers/common/cnxk/roc_dpi.c | 6 +++++-
drivers/common/cnxk/roc_dpi.h | 2 +-
drivers/common/cnxk/roc_dpi_priv.h | 4 ++++
drivers/common/cnxk/roc_idev.c | 20 ++++++++++++++++++++
drivers/common/cnxk/roc_idev_priv.h | 3 +++
drivers/dma/cnxk/cnxk_dmadev.c | 2 +-
6 files changed, 34 insertions(+), 3 deletions(-)
diff --git a/drivers/common/cnxk/roc_dpi.c b/drivers/common/cnxk/roc_dpi.c
index c241168294..1ee777d779 100644
--- a/drivers/common/cnxk/roc_dpi.c
+++ b/drivers/common/cnxk/roc_dpi.c
@@ -83,6 +83,9 @@ roc_dpi_configure(struct roc_dpi *roc_dpi, uint32_t chunk_sz, uint64_t aura, uin
mbox_msg.s.aura = aura;
mbox_msg.s.sso_pf_func = idev_sso_pffunc_get();
mbox_msg.s.npa_pf_func = idev_npa_pffunc_get();
+ mbox_msg.s.wqecsoff = idev_dma_cs_offset_get();
+ if (mbox_msg.s.wqecsoff)
+ mbox_msg.s.wqecs = 1;
rc = send_msg_to_pf(&pci_dev->addr, (const char *)&mbox_msg,
sizeof(dpi_mbox_msg_t));
@@ -94,7 +97,7 @@ roc_dpi_configure(struct roc_dpi *roc_dpi, uint32_t chunk_sz, uint64_t aura, uin
}
int
-roc_dpi_dev_init(struct roc_dpi *roc_dpi)
+roc_dpi_dev_init(struct roc_dpi *roc_dpi, uint8_t offset)
{
struct plt_pci_device *pci_dev = roc_dpi->pci_dev;
uint16_t vfid;
@@ -103,6 +106,7 @@ roc_dpi_dev_init(struct roc_dpi *roc_dpi)
vfid = ((pci_dev->addr.devid & 0x1F) << 3) | (pci_dev->addr.function & 0x7);
vfid -= 1;
roc_dpi->vfid = vfid;
+ idev_dma_cs_offset_set(offset);
return 0;
}
diff --git a/drivers/common/cnxk/roc_dpi.h b/drivers/common/cnxk/roc_dpi.h
index 4ebde5b8a6..978e2badb2 100644
--- a/drivers/common/cnxk/roc_dpi.h
+++ b/drivers/common/cnxk/roc_dpi.h
@@ -11,7 +11,7 @@ struct roc_dpi {
uint16_t vfid;
} __plt_cache_aligned;
-int __roc_api roc_dpi_dev_init(struct roc_dpi *roc_dpi);
+int __roc_api roc_dpi_dev_init(struct roc_dpi *roc_dpi, uint8_t offset);
int __roc_api roc_dpi_dev_fini(struct roc_dpi *roc_dpi);
int __roc_api roc_dpi_configure(struct roc_dpi *dpi, uint32_t chunk_sz, uint64_t aura,
diff --git a/drivers/common/cnxk/roc_dpi_priv.h b/drivers/common/cnxk/roc_dpi_priv.h
index 518a3e7351..52962c8bc0 100644
--- a/drivers/common/cnxk/roc_dpi_priv.h
+++ b/drivers/common/cnxk/roc_dpi_priv.h
@@ -31,6 +31,10 @@ typedef union dpi_mbox_msg_t {
uint64_t sso_pf_func : 16;
/* NPA PF function */
uint64_t npa_pf_func : 16;
+ /* WQE queue DMA completion status enable */
+ uint64_t wqecs : 1;
+ /* WQE queue DMA completion status offset */
+ uint64_t wqecsoff : 8;
} s;
} dpi_mbox_msg_t;
diff --git a/drivers/common/cnxk/roc_idev.c b/drivers/common/cnxk/roc_idev.c
index 48df3518b0..d0307c666c 100644
--- a/drivers/common/cnxk/roc_idev.c
+++ b/drivers/common/cnxk/roc_idev.c
@@ -301,6 +301,26 @@ idev_sso_set(struct roc_sso *sso)
__atomic_store_n(&idev->sso, sso, __ATOMIC_RELEASE);
}
+void
+idev_dma_cs_offset_set(uint8_t offset)
+{
+ struct idev_cfg *idev = idev_get_cfg();
+
+ if (idev != NULL)
+ idev->dma_cs_offset = offset;
+}
+
+uint8_t
+idev_dma_cs_offset_get(void)
+{
+ struct idev_cfg *idev = idev_get_cfg();
+
+ if (idev != NULL)
+ return idev->dma_cs_offset;
+
+ return 0;
+}
+
uint64_t
roc_idev_nix_inl_meta_aura_get(void)
{
diff --git a/drivers/common/cnxk/roc_idev_priv.h b/drivers/common/cnxk/roc_idev_priv.h
index 8dc1cb25bf..6628b18152 100644
--- a/drivers/common/cnxk/roc_idev_priv.h
+++ b/drivers/common/cnxk/roc_idev_priv.h
@@ -43,6 +43,7 @@ struct idev_cfg {
struct idev_nix_inl_rx_inj_cfg inl_rx_inj_cfg;
plt_spinlock_t nix_inl_dev_lock;
plt_spinlock_t npa_dev_lock;
+ uint8_t dma_cs_offset;
};
/* Generic */
@@ -61,6 +62,8 @@ void idev_sso_pffunc_set(uint16_t sso_pf_func);
uint16_t idev_sso_pffunc_get(void);
struct roc_sso *idev_sso_get(void);
void idev_sso_set(struct roc_sso *sso);
+void idev_dma_cs_offset_set(uint8_t offset);
+uint8_t idev_dma_cs_offset_get(void);
/* idev lmt */
uint16_t idev_lmt_pffunc_get(void);
diff --git a/drivers/dma/cnxk/cnxk_dmadev.c b/drivers/dma/cnxk/cnxk_dmadev.c
index 1e7f49792c..48ab09cc38 100644
--- a/drivers/dma/cnxk/cnxk_dmadev.c
+++ b/drivers/dma/cnxk/cnxk_dmadev.c
@@ -592,7 +592,7 @@ cnxk_dmadev_probe(struct rte_pci_driver *pci_drv __rte_unused, struct rte_pci_de
rdpi = &dpivf->rdpi;
rdpi->pci_dev = pci_dev;
- rc = roc_dpi_dev_init(rdpi);
+ rc = roc_dpi_dev_init(rdpi, 0);
if (rc < 0)
goto err_out_free;
--
2.34.1
next prev parent reply other threads:[~2024-03-03 21:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-08 8:28 [PATCH " Amit Prakash Shukla
2023-12-08 8:28 ` [PATCH 2/3] dma/cnxk: support for DMA event enqueue dequeue Amit Prakash Shukla
2023-12-08 8:28 ` [PATCH 3/3] event/cnxk: support DMA event functions Amit Prakash Shukla
2024-02-09 19:43 ` [PATCH v2 1/3] common/cnxk: dma result to an offset of the event Amit Prakash Shukla
2024-02-09 19:43 ` [PATCH v2 2/3] dma/cnxk: support for DMA event enqueue dequeue Amit Prakash Shukla
2024-02-09 19:43 ` [PATCH v2 3/3] event/cnxk: support DMA event functions Amit Prakash Shukla
2024-02-25 15:22 ` [PATCH v2 1/3] common/cnxk: dma result to an offset of the event Jerin Jacob
2024-02-26 9:43 ` [PATCH v3 " Amit Prakash Shukla
2024-02-26 9:43 ` [PATCH v3 2/3] dma/cnxk: support for DMA event enqueue dequeue Amit Prakash Shukla
2024-02-26 9:43 ` [PATCH v3 3/3] event/cnxk: support DMA event functions Amit Prakash Shukla
2024-02-29 16:52 ` Jerin Jacob
2024-03-01 17:32 ` [PATCH v4 1/3] common/cnxk: dma result to an offset of the event Amit Prakash Shukla
2024-03-01 17:32 ` [PATCH v4 2/3] dma/cnxk: support for DMA event enqueue dequeue Amit Prakash Shukla
2024-03-03 15:39 ` Jerin Jacob
2024-03-01 17:32 ` [PATCH v4 3/3] event/cnxk: support DMA event functions Amit Prakash Shukla
2024-03-03 21:08 ` Amit Prakash Shukla [this message]
2024-03-03 21:08 ` [PATCH v5 2/3] dma/cnxk: support for DMA event enqueue dequeue Amit Prakash Shukla
2024-03-03 21:08 ` [PATCH v5 3/3] event/cnxk: support DMA event functions Amit Prakash Shukla
2024-03-04 9:54 ` Jerin Jacob
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=20240303210808.614845-1-amitprakashs@marvell.com \
--to=amitprakashs@marvell.com \
--cc=anoobj@marvell.com \
--cc=asasidharan@marvell.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=kirankumark@marvell.com \
--cc=ndabilpuram@marvell.com \
--cc=pbhagavatula@marvell.com \
--cc=skori@marvell.com \
--cc=skoteshwar@marvell.com \
--cc=vattunuru@marvell.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).