if_ntb: Reuse receive buffers correctly
authorcem <cem@FreeBSD.org>
Wed, 18 Nov 2015 22:20:49 +0000 (22:20 +0000)
committercem <cem@FreeBSD.org>
Wed, 18 Nov 2015 22:20:49 +0000 (22:20 +0000)
commit37b150b7e118d61f49eef786979de58d27f31277
tree8936f1923b4b4fee3d6618bb7f91d0a085777e69
parent48ceeb626ed38b1e39b7c252eae341fad6ee881b
if_ntb: Reuse receive buffers correctly

Discard the unused rx_free_q.  Instead, reuse inputed packets by putting
them back on the *pend* queue after reinitialization.

If tx or rx handlers are unavailable, free mbufs rather than leaking
them.

With this change, if_ntb can receive more than 100
(NTB_QP_DEF_NUM_ENTRIES) packets.

Sponsored by: EMC / Isilon Storage Division
sys/dev/ntb/if_ntb/if_ntb.c