Page MenuHomeFreeBSD

netmap: Handle packet batches in generic mode
ClosedPublic

Authored by markj on Apr 5 2023, 2:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 6:02 AM
Unknown Object (File)
Dec 10 2023, 1:31 PM
Unknown Object (File)
Sep 11 2023, 10:33 PM
Unknown Object (File)
Aug 14 2023, 10:44 PM
Unknown Object (File)
Aug 14 2023, 12:08 PM
Unknown Object (File)
Jun 21 2023, 3:47 PM
Unknown Object (File)
Jun 3 2023, 5:11 PM
Unknown Object (File)
May 15 2023, 5:43 AM

Details

Summary

ifnets are allowed to pass batches of multiple packets to if_input,
linked by the m_nextpkt pointer. iflib will do this, for example.
Netmap's generic mode did not handle this and would only deliver the
first packet in the batch, leaking the rest.

PR: 270636

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Apr 5 2023, 2:19 PM

Could this be the same as https://reviews.freebsd.org/D38065#875109 eventually resulting in:

[zone: mbuf_cluser] kern.ipc.nmbclusters limit reached

Could this be the same as https://reviews.freebsd.org/D38065#875109 eventually resulting in:

[zone: mbuf_cluser] kern.ipc.nmbclusters limit reached

Yes, that seems plausible.

This revision is now accepted and ready to land.Apr 5 2023, 8:40 PM

Any example other than iflib? (iflib has native support...)

Any example other than iflib? (iflib has native support...)

Not that I know of, but I did not try to audit the network drivers. I think there are some out-of-tree Intel NIC drivers which might not have netmap support? Also see the reporter's comments in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270636

Interesting, thanks. I wonder why the behaviour is different with AMD Ryzen.
Which setup (machine, NIC) did you use to reproduce the issue?

Interesting, thanks. I wonder why the behaviour is different with AMD Ryzen.
Which setup (machine, NIC) did you use to reproduce the issue?

I used bhyve with e1000 emulation, since that's easiest to set up. In particular, the problem does not occur with virtio-net.

Looking at iflib_rxeof(), the problem might be related to whether LRO is enabled and in use.

Yeah, that makes sense, thanks.

This revision was automatically updated to reflect the committed changes.