]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r344696:
authorvmaffione <vmaffione@FreeBSD.org>
Fri, 8 Mar 2019 08:27:33 +0000 (08:27 +0000)
committervmaffione <vmaffione@FreeBSD.org>
Fri, 8 Mar 2019 08:27:33 +0000 (08:27 +0000)
commitb77ae4ff9c0570a97cdfea6bf18780ca4a154d03
tree60194a711c7c09cc35a400d812bf0d4b6b95ef2a
parente0d29f4de92a779206bc484b47bc49ead56ac2f2
MFC r344696:

netmap: pkt-gen: fix bug in send_packets()

The send_packets() function was using ring->cur as index to scan
the transmit ring. This function may also set ring->cur ahead of
ring->head, in case no more slots are available. However, the function
also uses nm_ring_space() which looks at ring->head to check how many
slots are available. If ring->head and ring->cur are different, this
results in pkt-gen advancing ring->cur beyond ring->tail.

This patch fixes send_packets() (and similar source locations) to
use ring->head as a index, rather than using ring->cur.
tools/tools/netmap/pkt-gen.c