Commit 634907e
committed
feat(net): add support for VIRTIO_NET_F_MRG_RXBUF
Now virtio-net device can split incoming packets across
multiple descriptor chains if VIRTIO_NET_F_MRG_RXBUF is enabled
by the guest. The amount of descriptor chains (also known as heads)
is written into the `virtio_net_hdr_v1` structure which is located
at the very begging of the packet. Virtio spec states that the
number of heads used should always be correct:
- 1 - if VIRTIO_NET_F_MRG_RXBUF is not negotiated
- N - if VIRTIO_NET_F_MRG_RXBUF is negotiated
Prior to this commit Firecracker never set the number of
used heads to 1, but Linux was fine with it. Now Firecracker always
sets correct number of heads. Because of this, some changes
were introduced into the unit test code that was generating
testing frames.
Additionally, because processing of descriptors was taking a big chunk
of total time spend in the RX packet processing, move reading of
descriptors to the preprocessing step performed when guest notifies
Firecracker about new descriptors available for RX queue.
Signed-off-by: Egor Lazarchuk <[email protected]>1 parent 604d728 commit 634907e
File tree
4 files changed
+687
-124
lines changed- src/vmm/src
- devices/virtio/net
4 files changed
+687
-124
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1225 | 1225 | | |
1226 | 1226 | | |
1227 | 1227 | | |
1228 | | - | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
1229 | 1238 | | |
1230 | 1239 | | |
1231 | 1240 | | |
| |||
0 commit comments