RE: [EXTERNAL] Re: [net-next PATCH v5 5/6] octeontx2-pf: Prepare for AF_XDP

From: Suman Ghosh
Date: Wed Feb 12 2025 - 03:52:42 EST


>> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
>> b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
>> index 44137160bdf6..b012d8794f18 100644
>> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
>> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
>> @@ -22,6 +22,12 @@
>> #include "cn10k.h"
>>
>> #define CQE_ADDR(CQ, idx) ((CQ)->cqe_base + ((CQ)->cqe_size * (idx)))
>> +#define READ_FREE_SQE(SQ, free_sqe) \
>> + do { \
>> + typeof(SQ) _SQ = (SQ); \
>> + free_sqe = (((_SQ)->cons_head - (_SQ)->head - 1 + (_SQ)-
>>sqe_cnt) \
>> + & ((_SQ)->sqe_cnt - 1));
>\
>> + } while (0)
>
>It looks like READ_FREE_SQE() could be a function rather than a macro.
>And, as an aside, CQE_ADDR could be too.
[Suman] I will address the READ_FREE_SQE, but CQE_ADDR will push a separate patch in net tree.
>
>> #define PTP_PORT 0x13F
>> /* PTPv2 header Original Timestamp starts at byte offset 34 and
>> * contains 6 byte seconds field and 4 byte nano seconds field.
>
>...