Commit fbdd137
committed
vm networking: add flag vnet_hdr
When segmentation offload is enabled, and unsegmented packets are sent
to a VM (i.e. when running a container in the root netns), the kernel
will detect that packets are larger than expected and proceed.
That's not the case for containers (i.e. when running a container with
its own netns, and a veth pair). In that case, packets reach the
virtio-net interface, are forwarded to the bridge, and then to the
appropriate veth.
Unsegmented packets with GSO fields unset are dropped by the kernel
either at the bridge or at the veth level. That may be due to the
correct network topology where the vnet interface is attached to a
bridge.
In that case, we need to tell libkrun that the network backend sends /
receives virtio_net_hdr structs with the packets, and the backend need
to preserve GSO fields for VM-to-VM connections, or populate them for
host-to-VM connections.
Signed-off-by: Albin Kerouanton <albin.kerouanton@docker.com>1 parent 78fd29a commit fbdd137
2 files changed
+19
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
| |||
43 | 48 | | |
44 | 49 | | |
45 | 50 | | |
| 51 | + | |
46 | 52 | | |
47 | 53 | | |
48 | 54 | | |
| |||
57 | 63 | | |
58 | 64 | | |
59 | 65 | | |
| 66 | + | |
60 | 67 | | |
61 | 68 | | |
62 | 69 | | |
| |||
149 | 156 | | |
150 | 157 | | |
151 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
152 | 165 | | |
153 | 166 | | |
154 | 167 | | |
| |||
180 | 193 | | |
181 | 194 | | |
182 | 195 | | |
183 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
184 | 200 | | |
185 | 201 | | |
186 | 202 | | |
| |||
0 commit comments