From c13a414c348d8fb70ff5b8c99a4fa619e60a0b55 Mon Sep 17 00:00:00 2001 From: Aniruddha Paul Date: Thu, 3 Apr 2025 08:28:12 +0000 Subject: [PATCH] osi-dma: Fix pktid for both Orin and Thor Add pktid increment macro and and also fix thor macro GET_TX_TS_PKTID_T264 to get the pktid. Bug 4993045 Change-Id: Ibe58f4353d358e9449374f5bf72990e6021bfc5e Signed-off-by: Aniruddha Paul Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/3333051 GVS: buildbot_gerritrpt Reviewed-by: Krishna Thota Reviewed-by: svc-mobile-cert Reviewed-by: Bhadram Varka Reviewed-by: svcacv Reviewed-by: svc-mobile-coverity Reviewed-by: Rakesh Goyal --- osi/dma/dma_local.h | 2 +- osi/dma/osi_dma_txrx.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/osi/dma/dma_local.h b/osi/dma/dma_local.h index c37bb94..5780c7c 100644 --- a/osi/dma/dma_local.h +++ b/osi/dma/dma_local.h @@ -143,7 +143,7 @@ static inline void osi_dma_writel(nveu32_t val, void *addr) #define GET_TX_TS_PKTID(idx, c) (((idx) & (PKT_ID_CNT - 1U)) | \ (((c) + 1U) << CHAN_START_POSITION)) /* T264 has saperate logic to tell vdma number so we can use all 10 bits for pktid */ -#define GET_TX_TS_PKTID_T264(idx) ((((idx) & 0x7FFFFFFFU) + 1U) & (PKT_ID_CNT_T264 - 1U)) +#define GET_TX_TS_PKTID_T264(idx) ((idx) & (PKT_ID_CNT_T264 - 1U)) /** @} */ /** diff --git a/osi/dma/osi_dma_txrx.c b/osi/dma/osi_dma_txrx.c index 1133553..4d1a144 100644 --- a/osi/dma/osi_dma_txrx.c +++ b/osi/dma/osi_dma_txrx.c @@ -1279,6 +1279,7 @@ nve32_t hw_transmit(struct osi_dma_priv_data *osi_dma, /* packet ID for Onestep is 0x0 always */ pkt_id = OSI_NONE; } else { + INC_TX_TS_PKTID(l_dma->pkt_id); if (osi_dma->mac != OSI_MAC_HW_MGBE_T26X) { pkt_id = GET_TX_TS_PKTID(l_dma->pkt_id, chan); } else {