Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

octeontx2-pf: cn10k/cn20k: Update count_eot in NPA_LF_AURA_BATCH_FREE0

This patch updates the count_eot calculation for CN20K devices.
Where the count_eot feild extended to 2 bits, while maintaining
CN10K compatibility where only bit 0 is used.

Signed-off-by: Geetha sowjanya <gakula@marvell.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260128022448.4402-1-gakula@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Geetha sowjanya and committed by
Jakub Kicinski
988719c5 303c1a66

+10 -3
+10 -3
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
··· 789 789 tar_addr = (__force u64)otx2_get_regaddr(pfvf, NPA_LF_AURA_BATCH_FREE0); 790 790 /* LMTID is same as AURA Id */ 791 791 val = (lmt_info->lmt_id & 0x7FF) | BIT_ULL(63); 792 - /* Set if [127:64] of last 128bit word has a valid pointer */ 793 - count_eot = (num_ptrs % 2) ? 0ULL : 1ULL; 792 + /* Meaning of count_eot 793 + * CN10K: count_eot = 0 if the number of pointers to free is even, 794 + * count_eot = 1 if the number of pointers to free is odd. 795 + * 796 + * CN20K: count_eot represents the least significant 2 bits of the 797 + * total number of valid pointers to free. 798 + * Example: if 7 pointers are freed (0b111), count_eot = 0b11. 799 + */ 800 + count_eot = (num_ptrs - 1) & 0x3ULL; 794 801 /* Set AURA ID to free pointer */ 795 802 ptrs[0] = (count_eot << 32) | (aura & 0xFFFFF); 796 803 /* Target address for LMTST flush tells HW how many 128bit ··· 807 800 */ 808 801 if (num_ptrs > 2) { 809 802 size = (sizeof(u64) * num_ptrs) / 16; 810 - if (!count_eot) 803 + if (!(count_eot & 1)) 811 804 size++; 812 805 tar_addr |= ((size - 1) & 0x7) << 4; 813 806 }