net/nfp: fix Rx descriptor DMA address for VNIC

When using flower firmware application, and the ctrl vNIC receiving a
packet that is larger than the mbuf size, the Rx function will break the
receive loop and sent a free list descriptor with random DMA address.

Fix this by moving the increment of the free list descriptor counter
to after the packet size have been checked and acted on.

Fixes: a36634e87e ("net/nfp: add flower ctrl VNIC Rx/Tx")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
This commit is contained in:
Chaoyong He 2022-11-18 09:44:08 +08:00 committed by Ferruh Yigit
parent 3fd6400393
commit 7aa745d788

View File

@ -74,8 +74,6 @@ nfp_flower_ctrl_vnic_recv(void *rx_queue,
break;
}
nb_hold++;
/*
* Grab the mbuf and refill the descriptor with the
* previously allocated mbuf
@ -127,6 +125,7 @@ nfp_flower_ctrl_vnic_recv(void *rx_queue,
rxds->fld.dd = 0;
rxds->fld.dma_addr_hi = (dma_addr >> 32) & 0xff;
rxds->fld.dma_addr_lo = dma_addr & 0xffffffff;
nb_hold++;
rxq->rd_p++;
if (unlikely(rxq->rd_p == rxq->rx_count)) /* wrapping?*/