Re: [net-next PATCH 2/3] octeontx2-pf: Add devlink param to vary cqe size
From: sundeep subbaraya <hidden>
Date: 2021-10-06 07:00:07
Hi Jakub, On Wed, Oct 6, 2021 at 6:46 AM Jakub Kicinski [off-list ref] wrote:
On Tue, 5 Oct 2021 22:45:35 +0530 Subbaraya Sundeep wrote:quoted
Completion Queue Entry(CQE) is a descriptor written by hardware to notify software about the send and receive completion status. The CQE can be of size 128 or 512 bytes. A 512 bytes CQE can hold more receive fragments pointers compared to 128 bytes CQE. This patch adds devlink param to change CQE descriptor size.nak, this belongs in ethtool -g
We do use ethtool -G for setting the number of receive buffers to allocate from the kernel and give those pointers to hardware memory pool(NPA). This patch is to specify hardware the completion queue descriptor size it needs to use while writing to memory. The CQE consists of buffer pointer/packet addresses. Say a large packet is received then hardware splits that large packet into buffers and writes only one CQE consisting of all the buffer pointers which makes a packet. If hardware is configured to use 128 byte CQE then only 6 pointers can be accomodated and rest of packet data is truncated. If CQE is configured as 512 byte then 42 pointers can be accomodated hence large packets can be received. ethtool -G can be used to change number of packets a ring can hold but not number of fragments a single packet can use. Since this is hardware related am using devlink. CN9XX series hardware max packet length is 9212 and a 128 byte CQE (6 buffer pointers) with 2K receive buffer was sufficient to receive 9212 packet (2k * 6 = 12K). CN10XX series max receive length is 65535 so 128 byte CQE was not enough. Thanks, Sundeep