Re: [PATCH net-next v8 5/9] eth: bnxt: store rx buffer size per queue

Pavel Begunkov
2026-01-13T10:46:49Z

On 1/13/26 10:19, Paolo Abeni wrote:
> On 1/9/26 12:28 PM, Pavel Begunkov wrote:
>> @@ -4478,7 +4485,7 @@ static void bnxt_init_one_rx_agg_ring_rxbd(struct bnxt *bp,
>> ring = &rxr->rx_agg_ring_struct;
>> ring->fw_ring_id = INVALID_HW_RING_ID;
>> if ((bp->flags & BNXT_FLAG_AGG_RINGS)) {
>> - type = ((u32)BNXT_RX_PAGE_SIZE << RX_BD_LEN_SHIFT) |
>> + type = ((u32)(u32)rxr->rx_page_size << RX_BD_LEN_SHIFT) |
>
> Minor nit: duplicate cast above.

oops, missed that, thanks

>
>> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
>> index f5f07a7e6b29..4c880a9fba92 100644
>> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
>> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
>> @@ -1107,6 +1107,7 @@ struct bnxt_rx_ring_info {
>>
>> unsigned long *rx_agg_bmap;
>> u16 rx_agg_bmap_size;
>> + u16 rx_page_size;
>
> Any special reason for using u16 above? AFAICS using u32 will not change
> the struct size on 64 bit arches, and using u32 will likely yield better
> code.

IIRC bnxt doesn't support more than 2^16-1, but it doesn't really
matter, I can convert it to u32.

--
Pavel Begunkov