Fix sending TSO packets larger than single DMA segment on VNIC

Due to the bug in the number of 'GATHER' subdescriptors for TSO
packets, VNIC was not able to transmit more than one DMA segment
with TSO enabled.

Obtained from: Semihalf
Sponsored by:  Cavium
This commit is contained in:
zbb 2016-04-08 16:14:18 +00:00
parent 707781311d
commit 4725d54489

View File

@ -1904,7 +1904,6 @@ static int
nicvf_tx_mbuf_locked(struct snd_queue *sq, struct mbuf **mbufp)
{
bus_dma_segment_t segs[256];
struct nicvf *nic;
struct snd_buff *snd_buff;
size_t seg;
int nsegs, qentry;
@ -1928,12 +1927,7 @@ nicvf_tx_mbuf_locked(struct snd_queue *sq, struct mbuf **mbufp)
}
/* Set how many subdescriptors is required */
nic = sq->nic;
if ((*mbufp)->m_pkthdr.tso_segsz != 0 && nic->hw_tso)
subdesc_cnt = MIN_SQ_DESC_PER_PKT_XMIT;
else
subdesc_cnt = MIN_SQ_DESC_PER_PKT_XMIT + nsegs - 1;
subdesc_cnt = MIN_SQ_DESC_PER_PKT_XMIT + nsegs - 1;
if (subdesc_cnt > sq->free_cnt) {
/* ARM64TODO: Add mbuf defragmentation if we lack descriptors */
bus_dmamap_unload(sq->snd_buff_dmat, snd_buff->dmap);