netmap: check if we already ran mmap before we attempt it

Submitted by:	neel@neelc.org
Reviewed by:	vmaffione
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D22390
This commit is contained in:
Vincenzo Maffione 2019-11-19 21:29:49 +00:00
parent f8d4f9bce9
commit a56e6334d1

View File

@ -981,7 +981,8 @@ nm_close(struct nm_desc *d)
static int
nm_mmap(struct nm_desc *d, const struct nm_desc *parent)
{
//XXX TODO: check if mmap is already done
if (d->done_mmap)
return 0;
if (IS_NETMAP_DESC(parent) && parent->mem &&
parent->req.nr_arg2 == d->req.nr_arg2) {