net/sfc: clarify Rx buffer size calculation
The user has the right to supply pools with excessively large buffers, regardless of the maximum supported Rx packet length reported by the adapter. However, in this PMD, on EF10 boards, a Rx descriptor has only 14 bits to specify the buffer length. To avoid potential problems, use this information accordingly. Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
This commit is contained in:
parent
61b3e9e79a
commit
cd8e2d8292
@ -1081,7 +1081,11 @@ sfc_rx_mb_pool_buf_size(struct sfc_adapter *sa, struct rte_mempool *mb_pool)
|
||||
buf_size = EFX_P2ALIGN(uint32_t, buf_size, nic_align_end);
|
||||
}
|
||||
|
||||
return buf_size;
|
||||
/*
|
||||
* Buffer length field of a Rx descriptor may not be wide
|
||||
* enough to store a 16-bit data count taken from an mbuf.
|
||||
*/
|
||||
return MIN(buf_size, encp->enc_rx_dma_desc_size_max);
|
||||
}
|
||||
|
||||
int
|
||||
|
Loading…
Reference in New Issue
Block a user