From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AFF3345BC0; Thu, 24 Oct 2024 14:17:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 78A6A40281; Thu, 24 Oct 2024 14:17:15 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 1E9354003C for ; Thu, 24 Oct 2024 14:17:13 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49O4ak7w019399; Thu, 24 Oct 2024 05:17:13 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=m PD+2YNCqOL2MS+C1tDtfyMnv1DUx+FmHgueX/bpSH8=; b=Y4AmyrsDQ5CkhzJ7/ TjvtE4bDhTYWMBy3NKaEK2KHb3IRby9oGRWAFwEY6C/TRqiyOEGry4f1WIGjakj2 Yi5/bWHcXyN7eRidaWQYU9oCwGd6jqCKZ8fO3Go6sp1jMQglZXSwY7WV6IZOcLGG PO/Q4rlRmXRTgNvpe2PlbXubqWoqvCRBQembq1SbhkPAZOhSxqimMaTYPUogo5kW uz05/ZTZSFyT4dF92ikQemPcbmfHPqnFdNLgrYbYYd8hecZcT8SNRFcJHUWAVlAt CiAzJsFz1xHgmhauwMeo8nAH3I+5/mgEIK/NsDM2jaIUPPAN7kYyjMquY/Pqren1 6P2BA== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 42ffbvrsyf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Oct 2024 05:17:12 -0700 (PDT) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 24 Oct 2024 05:17:11 -0700 Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Thu, 24 Oct 2024 05:17:11 -0700 Received: from cavium-VAMSI-BM.. (unknown [10.28.36.156]) by maili.marvell.com (Postfix) with ESMTP id BD4463F7094; Thu, 24 Oct 2024 05:17:09 -0700 (PDT) From: Vamsi Krishna To: CC: , , , "Vamsi Attunuru" Subject: [PATCH v3 1/1] dma/cnxk: support dma queue priority configuration Date: Thu, 24 Oct 2024 17:47:03 +0530 Message-ID: <20241024121703.1664265-1-vattunuru@marvell.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: AYbbZiWw4P9T49okrUjHqoPT96vm-eYg X-Proofpoint-ORIG-GUID: AYbbZiWw4P9T49okrUjHqoPT96vm-eYg X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Vamsi Attunuru Allow configuration of DPI DMA queue priority through mailbox request. Signed-off-by: Vamsi Attunuru --- V3 changes: * Updated release notes. V2 changes: * Rebased to tot. v1 changes: * Addressed v0 comments. doc/guides/rel_notes/release_24_11.rst | 4 ++++ drivers/common/cnxk/roc_dpi.c | 2 ++ drivers/common/cnxk/roc_dpi.h | 1 + drivers/common/cnxk/roc_dpi_priv.h | 2 ++ drivers/common/cnxk/roc_features.h | 6 ++++++ drivers/dma/cnxk/cnxk_dmadev.c | 6 ++++++ drivers/dma/cnxk/cnxk_dmadev.h | 1 + 7 files changed, 22 insertions(+) diff --git a/doc/guides/rel_notes/release_24_11.rst b/doc/guides/rel_notes/release_24_11.rst index fa4822d928..7f08ab372c 100644 --- a/doc/guides/rel_notes/release_24_11.rst +++ b/doc/guides/rel_notes/release_24_11.rst @@ -231,6 +231,10 @@ New Features * Added independent enqueue feature. +* **Updated Marvell CNXK DMA driver.** + + Added support for DMA queue priority configuration. + * **Added IPv4 network order lookup in the FIB library.** A new flag field is introduced in ``rte_fib_conf`` structure. 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/common/cnxk/roc_features.h b/drivers/common/cnxk/roc_features.h index 6abb35c296..0002a7b5c3 100644 --- a/drivers/common/cnxk/roc_features.h +++ b/drivers/common/cnxk/roc_features.h @@ -96,4 +96,10 @@ roc_feature_nix_has_second_pass_drop(void) return 0; } +static inline bool +roc_feature_dpi_has_priority(void) +{ + return roc_model_is_cn10k(); +} + #endif diff --git a/drivers/dma/cnxk/cnxk_dmadev.c b/drivers/dma/cnxk/cnxk_dmadev.c index 2d5307b22e..e7be3767b2 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_feature_dpi_has_priority()) { + dev_info->dev_capa |= RTE_DMA_CAPA_PRI_POLICY_SP; + dev_info->nb_priorities = CN10K_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_feature_dpi_has_priority()) + 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..39fd6afbe9 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 CN10K_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