* [PATCH v0 1/1] dma/cnxk: support dma queue priority configuration
@ 2024-10-03 13:19 Vamsi Krishna
2024-10-03 13:56 ` Jerin Jacob
0 siblings, 1 reply; 3+ messages in thread
From: Vamsi Krishna @ 2024-10-03 13:19 UTC (permalink / raw)
To: fengchengwen
Cc: dev, thomas, kevin.laatz, bruce.richardson, jerinj, Vamsi Attunuru
From: Vamsi Attunuru <vattunuru@marvell.com>
Allow configuration of dpi dma queue priority through dpi
dev open mbox request.
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
---
Depends-on: patch-144960 ("dmadev: support priority configuration")
drivers/common/cnxk/roc_dpi.c | 2 ++
drivers/common/cnxk/roc_dpi.h | 1 +
drivers/common/cnxk/roc_dpi_priv.h | 2 ++
drivers/dma/cnxk/cnxk_dmadev.c | 6 ++++++
drivers/dma/cnxk/cnxk_dmadev.h | 1 +
5 files changed, 12 insertions(+)
diff --git a/drivers/common/cnxk/roc_dpi.c b/drivers/common/cnxk/roc_dpi.c
index 892685d185..71edfcbf9b 100644
--- a/drivers/common/cnxk/roc_dpi.c
+++ b/drivers/common/cnxk/roc_dpi.c
@@ -95,6 +95,7 @@ roc_dpi_configure(struct roc_dpi *roc_dpi, uint32_t chunk_sz, uint64_t aura, uin
mbox_msg.u[1] = 0;
/* DPI PF driver expects vfid starts from index 0 */
mbox_msg.s.vfid = roc_dpi->vfid;
+ mbox_msg.s.pri = roc_dpi->priority;
mbox_msg.s.cmd = DPI_QUEUE_OPEN;
mbox_msg.s.csize = chunk_sz;
mbox_msg.s.aura = aura;
@@ -137,6 +138,7 @@ roc_dpi_configure_v2(struct roc_dpi *roc_dpi, uint32_t chunk_sz, uint64_t aura,
mbox_msg.u[1] = 0;
/* DPI PF driver expects vfid starts from index 0 */
mbox_msg.s.vfid = roc_dpi->vfid;
+ mbox_msg.s.pri = roc_dpi->priority;
mbox_msg.s.cmd = DPI_QUEUE_OPEN_V2;
mbox_msg.s.csize = chunk_sz / 8;
mbox_msg.s.aura = aura;
diff --git a/drivers/common/cnxk/roc_dpi.h b/drivers/common/cnxk/roc_dpi.h
index 7b4f9d4f4f..3a11559df9 100644
--- a/drivers/common/cnxk/roc_dpi.h
+++ b/drivers/common/cnxk/roc_dpi.h
@@ -9,6 +9,7 @@ struct roc_dpi {
struct plt_pci_device *pci_dev;
uint8_t *rbase;
uint16_t vfid;
+ uint8_t priority;
} __plt_cache_aligned;
int __roc_api roc_dpi_dev_init(struct roc_dpi *roc_dpi, uint8_t offset);
diff --git a/drivers/common/cnxk/roc_dpi_priv.h b/drivers/common/cnxk/roc_dpi_priv.h
index 844e5f37ee..1f975915f7 100644
--- a/drivers/common/cnxk/roc_dpi_priv.h
+++ b/drivers/common/cnxk/roc_dpi_priv.h
@@ -38,6 +38,8 @@ typedef union dpi_mbox_msg_t {
uint64_t wqecs : 1;
/* WQE queue DMA completion status offset */
uint64_t wqecsoff : 8;
+ /* Priority */
+ uint64_t pri : 1;
} s;
} dpi_mbox_msg_t;
diff --git a/drivers/dma/cnxk/cnxk_dmadev.c b/drivers/dma/cnxk/cnxk_dmadev.c
index 2d5307b22e..9437c48a82 100644
--- a/drivers/dma/cnxk/cnxk_dmadev.c
+++ b/drivers/dma/cnxk/cnxk_dmadev.c
@@ -20,6 +20,10 @@ cnxk_dmadev_info_get(const struct rte_dma_dev *dev, struct rte_dma_info *dev_inf
RTE_DMA_CAPA_DEV_TO_MEM | RTE_DMA_CAPA_DEV_TO_DEV |
RTE_DMA_CAPA_OPS_COPY | RTE_DMA_CAPA_OPS_COPY_SG |
RTE_DMA_CAPA_M2D_AUTO_FREE;
+ if (roc_model_is_cn10k()) {
+ dev_info->dev_capa |= RTE_DMA_CAPA_PRI_POLICY_SP;
+ dev_info->nb_priorities = CNXK_DPI_MAX_PRI;
+ }
dev_info->max_desc = CNXK_DPI_MAX_DESC;
dev_info->min_desc = CNXK_DPI_MIN_DESC;
dev_info->max_sges = CNXK_DPI_MAX_POINTER;
@@ -107,6 +111,8 @@ cnxk_dmadev_configure(struct rte_dma_dev *dev, const struct rte_dma_conf *conf,
*/
cnxk_dmadev_vchan_free(dpivf, RTE_DMA_ALL_VCHAN);
dpivf->num_vchans = conf->nb_vchans;
+ if (roc_model_is_cn10k())
+ dpivf->rdpi.priority = conf->priority;
return 0;
}
diff --git a/drivers/dma/cnxk/cnxk_dmadev.h b/drivers/dma/cnxk/cnxk_dmadev.h
index 15af1d64dc..64c9a94c0d 100644
--- a/drivers/dma/cnxk/cnxk_dmadev.h
+++ b/drivers/dma/cnxk/cnxk_dmadev.h
@@ -28,6 +28,7 @@
((s).var - 1))
#define CNXK_DPI_MAX_DESC 32768
#define CNXK_DPI_MIN_DESC 2
+#define CNXK_DPI_MAX_PRI 2
#define CNXK_DPI_MAX_VCHANS_PER_QUEUE 4
#define CNXK_DPI_QUEUE_BUF_SIZE 16256
#define CNXK_DPI_QUEUE_BUF_SIZE_V2 130944
--
2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v0 1/1] dma/cnxk: support dma queue priority configuration
2024-10-03 13:19 [PATCH v0 1/1] dma/cnxk: support dma queue priority configuration Vamsi Krishna
@ 2024-10-03 13:56 ` Jerin Jacob
2024-10-03 15:51 ` [EXTERNAL] " Vamsi Krishna Attunuru
0 siblings, 1 reply; 3+ messages in thread
From: Jerin Jacob @ 2024-10-03 13:56 UTC (permalink / raw)
To: Vamsi Krishna
Cc: fengchengwen, dev, thomas, kevin.laatz, bruce.richardson, jerinj
On Thu, Oct 3, 2024 at 7:19 PM Vamsi Krishna <vattunuru@marvell.com> wrote:
>
> From: Vamsi Attunuru <vattunuru@marvell.com>
>
> Allow configuration of dpi dma queue priority through dpi
> dev open mbox request.
dpi-> DPI
dma -> DMA
dpi dev open mbox request-> mailbox request.
>
> Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
> ---
> Depends-on: patch-144960 ("dmadev: support priority configuration")
>
> drivers/common/cnxk/roc_dpi.c | 2 ++
> drivers/common/cnxk/roc_dpi.h | 1 +
> drivers/common/cnxk/roc_dpi_priv.h | 2 ++
> drivers/dma/cnxk/cnxk_dmadev.c | 6 ++++++
> drivers/dma/cnxk/cnxk_dmadev.h | 1 +
> 5 files changed, 12 insertions(+)
>
> diff --git a/drivers/common/cnxk/roc_dpi.c b/drivers/common/cnxk/roc_dpi.c
> index 892685d185..71edfcbf9b 100644
> --- a/drivers/common/cnxk/roc_dpi.c
> +++ b/drivers/common/cnxk/roc_dpi.c
> @@ -95,6 +95,7 @@ roc_dpi_configure(struct roc_dpi *roc_dpi, uint32_t chunk_sz, uint64_t aura, uin
> mbox_msg.u[1] = 0;
> /* DPI PF driver expects vfid starts from index 0 */
> mbox_msg.s.vfid = roc_dpi->vfid;
> + mbox_msg.s.pri = roc_dpi->priority;
> mbox_msg.s.cmd = DPI_QUEUE_OPEN;
> mbox_msg.s.csize = chunk_sz;
> mbox_msg.s.aura = aura;
> @@ -137,6 +138,7 @@ roc_dpi_configure_v2(struct roc_dpi *roc_dpi, uint32_t chunk_sz, uint64_t aura,
> mbox_msg.u[1] = 0;
> /* DPI PF driver expects vfid starts from index 0 */
> mbox_msg.s.vfid = roc_dpi->vfid;
> + mbox_msg.s.pri = roc_dpi->priority;
> mbox_msg.s.cmd = DPI_QUEUE_OPEN_V2;
> mbox_msg.s.csize = chunk_sz / 8;
> mbox_msg.s.aura = aura;
> diff --git a/drivers/common/cnxk/roc_dpi.h b/drivers/common/cnxk/roc_dpi.h
> index 7b4f9d4f4f..3a11559df9 100644
> --- a/drivers/common/cnxk/roc_dpi.h
> +++ b/drivers/common/cnxk/roc_dpi.h
> @@ -9,6 +9,7 @@ struct roc_dpi {
> struct plt_pci_device *pci_dev;
> uint8_t *rbase;
> uint16_t vfid;
> + uint8_t priority;
> } __plt_cache_aligned;
>
> int __roc_api roc_dpi_dev_init(struct roc_dpi *roc_dpi, uint8_t offset);
> diff --git a/drivers/common/cnxk/roc_dpi_priv.h b/drivers/common/cnxk/roc_dpi_priv.h
> index 844e5f37ee..1f975915f7 100644
> --- a/drivers/common/cnxk/roc_dpi_priv.h
> +++ b/drivers/common/cnxk/roc_dpi_priv.h
> @@ -38,6 +38,8 @@ typedef union dpi_mbox_msg_t {
> uint64_t wqecs : 1;
> /* WQE queue DMA completion status offset */
> uint64_t wqecsoff : 8;
> + /* Priority */
> + uint64_t pri : 1;
> } s;
> } dpi_mbox_msg_t;
>
> diff --git a/drivers/dma/cnxk/cnxk_dmadev.c b/drivers/dma/cnxk/cnxk_dmadev.c
> index 2d5307b22e..9437c48a82 100644
> --- a/drivers/dma/cnxk/cnxk_dmadev.c
> +++ b/drivers/dma/cnxk/cnxk_dmadev.c
> @@ -20,6 +20,10 @@ cnxk_dmadev_info_get(const struct rte_dma_dev *dev, struct rte_dma_info *dev_inf
> RTE_DMA_CAPA_DEV_TO_MEM | RTE_DMA_CAPA_DEV_TO_DEV |
> RTE_DMA_CAPA_OPS_COPY | RTE_DMA_CAPA_OPS_COPY_SG |
> RTE_DMA_CAPA_M2D_AUTO_FREE;
> + if (roc_model_is_cn10k()) {
Add new to roc_feature_dpi_has_priority() to support in CN20K like
other features.
> + dev_info->dev_capa |= RTE_DMA_CAPA_PRI_POLICY_SP;
> + dev_info->nb_priorities = CNXK_DPI_MAX_PRI;
> + }
> dev_info->max_desc = CNXK_DPI_MAX_DESC;
> dev_info->min_desc = CNXK_DPI_MIN_DESC;
> dev_info->max_sges = CNXK_DPI_MAX_POINTER;
> @@ -107,6 +111,8 @@ cnxk_dmadev_configure(struct rte_dma_dev *dev, const struct rte_dma_conf *conf,
> */
> cnxk_dmadev_vchan_free(dpivf, RTE_DMA_ALL_VCHAN);
> dpivf->num_vchans = conf->nb_vchans;
> + if (roc_model_is_cn10k())
> + dpivf->rdpi.priority = conf->priority;
>
> return 0;
> }
> diff --git a/drivers/dma/cnxk/cnxk_dmadev.h b/drivers/dma/cnxk/cnxk_dmadev.h
> index 15af1d64dc..64c9a94c0d 100644
> --- a/drivers/dma/cnxk/cnxk_dmadev.h
> +++ b/drivers/dma/cnxk/cnxk_dmadev.h
> @@ -28,6 +28,7 @@
> ((s).var - 1))
> #define CNXK_DPI_MAX_DESC 32768
> #define CNXK_DPI_MIN_DESC 2
> +#define CNXK_DPI_MAX_PRI 2
if it is different for CN20k, Use _CN10K_ after DPI or so.
With that change:
Acked-by: Jerin Jacob <jerinj@marvell.com>
> #define CNXK_DPI_MAX_VCHANS_PER_QUEUE 4
> #define CNXK_DPI_QUEUE_BUF_SIZE 16256
> #define CNXK_DPI_QUEUE_BUF_SIZE_V2 130944
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [EXTERNAL] Re: [PATCH v0 1/1] dma/cnxk: support dma queue priority configuration
2024-10-03 13:56 ` Jerin Jacob
@ 2024-10-03 15:51 ` Vamsi Krishna Attunuru
0 siblings, 0 replies; 3+ messages in thread
From: Vamsi Krishna Attunuru @ 2024-10-03 15:51 UTC (permalink / raw)
To: Jerin Jacob
Cc: fengchengwen, dev, thomas, kevin.laatz, bruce.richardson, Jerin Jacob
>-----Original Message-----
>From: Jerin Jacob <jerinjacobk@gmail.com>
>Sent: Thursday, October 3, 2024 7:26 PM
>To: Vamsi Krishna Attunuru <vattunuru@marvell.com>
>Cc: fengchengwen@huawei.com; dev@dpdk.org; thomas@monjalon.net;
>kevin.laatz@intel.com; bruce.richardson@intel.com; Jerin Jacob
><jerinj@marvell.com>
>Subject: [EXTERNAL] Re: [PATCH v0 1/1] dma/cnxk: support dma queue
>priority configuration
>
>On Thu, Oct 3, 2024 at 7: 19 PM Vamsi Krishna <vattunuru@ marvell. com>
>wrote: > > From: Vamsi Attunuru <vattunuru@ marvell. com> > > Allow
>configuration of dpi dma queue priority through dpi > dev open mbox
>request. dpi->
>On Thu, Oct 3, 2024 at 7:19 PM Vamsi Krishna <vattunuru@marvell.com>
>wrote:
>>
>> From: Vamsi Attunuru <vattunuru@marvell.com>
>>
>> Allow configuration of dpi dma queue priority through dpi dev open
>> mbox request.
>
>dpi-> DPI
>dma -> DMA
>
>dpi dev open mbox request-> mailbox request.
Ack.
>
>>
>> Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
>> ---
>> Depends-on: patch-144960 ("dmadev: support priority configuration")
>>
>> drivers/common/cnxk/roc_dpi.c | 2 ++
>> drivers/common/cnxk/roc_dpi.h | 1 +
>> drivers/common/cnxk/roc_dpi_priv.h | 2 ++
>> drivers/dma/cnxk/cnxk_dmadev.c | 6 ++++++
>> drivers/dma/cnxk/cnxk_dmadev.h | 1 +
>> 5 files changed, 12 insertions(+)
>>
>> diff --git a/drivers/common/cnxk/roc_dpi.c
>> b/drivers/common/cnxk/roc_dpi.c index 892685d185..71edfcbf9b 100644
>> --- a/drivers/common/cnxk/roc_dpi.c
>> +++ b/drivers/common/cnxk/roc_dpi.c
>> @@ -95,6 +95,7 @@ roc_dpi_configure(struct roc_dpi *roc_dpi, uint32_t
>chunk_sz, uint64_t aura, uin
>> mbox_msg.u[1] = 0;
>> /* DPI PF driver expects vfid starts from index 0 */
>> mbox_msg.s.vfid = roc_dpi->vfid;
>> + mbox_msg.s.pri = roc_dpi->priority;
>> mbox_msg.s.cmd = DPI_QUEUE_OPEN;
>> mbox_msg.s.csize = chunk_sz;
>> mbox_msg.s.aura = aura;
>> @@ -137,6 +138,7 @@ roc_dpi_configure_v2(struct roc_dpi *roc_dpi,
>uint32_t chunk_sz, uint64_t aura,
>> mbox_msg.u[1] = 0;
>> /* DPI PF driver expects vfid starts from index 0 */
>> mbox_msg.s.vfid = roc_dpi->vfid;
>> + mbox_msg.s.pri = roc_dpi->priority;
>> mbox_msg.s.cmd = DPI_QUEUE_OPEN_V2;
>> mbox_msg.s.csize = chunk_sz / 8;
>> mbox_msg.s.aura = aura;
>> diff --git a/drivers/common/cnxk/roc_dpi.h
>> b/drivers/common/cnxk/roc_dpi.h index 7b4f9d4f4f..3a11559df9 100644
>> --- a/drivers/common/cnxk/roc_dpi.h
>> +++ b/drivers/common/cnxk/roc_dpi.h
>> @@ -9,6 +9,7 @@ struct roc_dpi {
>> struct plt_pci_device *pci_dev;
>> uint8_t *rbase;
>> uint16_t vfid;
>> + uint8_t priority;
>> } __plt_cache_aligned;
>>
>> int __roc_api roc_dpi_dev_init(struct roc_dpi *roc_dpi, uint8_t
>> offset); diff --git a/drivers/common/cnxk/roc_dpi_priv.h
>> b/drivers/common/cnxk/roc_dpi_priv.h
>> index 844e5f37ee..1f975915f7 100644
>> --- a/drivers/common/cnxk/roc_dpi_priv.h
>> +++ b/drivers/common/cnxk/roc_dpi_priv.h
>> @@ -38,6 +38,8 @@ typedef union dpi_mbox_msg_t {
>> uint64_t wqecs : 1;
>> /* WQE queue DMA completion status offset */
>> uint64_t wqecsoff : 8;
>> + /* Priority */
>> + uint64_t pri : 1;
>> } s;
>> } dpi_mbox_msg_t;
>>
>> diff --git a/drivers/dma/cnxk/cnxk_dmadev.c
>> b/drivers/dma/cnxk/cnxk_dmadev.c index 2d5307b22e..9437c48a82 100644
>> --- a/drivers/dma/cnxk/cnxk_dmadev.c
>> +++ b/drivers/dma/cnxk/cnxk_dmadev.c
>> @@ -20,6 +20,10 @@ cnxk_dmadev_info_get(const struct rte_dma_dev
>*dev, struct rte_dma_info *dev_inf
>> RTE_DMA_CAPA_DEV_TO_MEM |
>RTE_DMA_CAPA_DEV_TO_DEV |
>> RTE_DMA_CAPA_OPS_COPY |
>RTE_DMA_CAPA_OPS_COPY_SG |
>> RTE_DMA_CAPA_M2D_AUTO_FREE;
>> + if (roc_model_is_cn10k()) {
>
>Add new to roc_feature_dpi_has_priority() to support in CN20K like other
>features.
Sure, will add new roc api.
>
>
>> + dev_info->dev_capa |= RTE_DMA_CAPA_PRI_POLICY_SP;
>> + dev_info->nb_priorities = CNXK_DPI_MAX_PRI;
>> + }
>> dev_info->max_desc = CNXK_DPI_MAX_DESC;
>> dev_info->min_desc = CNXK_DPI_MIN_DESC;
>> dev_info->max_sges = CNXK_DPI_MAX_POINTER; @@ -107,6 +111,8
>@@
>> cnxk_dmadev_configure(struct rte_dma_dev *dev, const struct
>rte_dma_conf *conf,
>> */
>> cnxk_dmadev_vchan_free(dpivf, RTE_DMA_ALL_VCHAN);
>> dpivf->num_vchans = conf->nb_vchans;
>> + if (roc_model_is_cn10k())
>> + dpivf->rdpi.priority = conf->priority;
>>
>> return 0;
>> }
>> diff --git a/drivers/dma/cnxk/cnxk_dmadev.h
>> b/drivers/dma/cnxk/cnxk_dmadev.h index 15af1d64dc..64c9a94c0d 100644
>> --- a/drivers/dma/cnxk/cnxk_dmadev.h
>> +++ b/drivers/dma/cnxk/cnxk_dmadev.h
>> @@ -28,6 +28,7 @@
>> ((s).var - 1))
>> #define CNXK_DPI_MAX_DESC 32768
>> #define CNXK_DPI_MIN_DESC 2
>> +#define CNXK_DPI_MAX_PRI 2
>
>if it is different for CN20k, Use _CN10K_ after DPI or so.
Sure, will define accordingly.
>
>With that change:
>
>Acked-by: Jerin Jacob <jerinj@marvell.com>
>
>
>> #define CNXK_DPI_MAX_VCHANS_PER_QUEUE 4
>> #define CNXK_DPI_QUEUE_BUF_SIZE 16256
>> #define CNXK_DPI_QUEUE_BUF_SIZE_V2 130944
>> --
>> 2.34.1
>>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-03 15:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-03 13:19 [PATCH v0 1/1] dma/cnxk: support dma queue priority configuration Vamsi Krishna
2024-10-03 13:56 ` Jerin Jacob
2024-10-03 15:51 ` [EXTERNAL] " Vamsi Krishna Attunuru
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).