Skip to content

Commit a364da8

Browse files
ihciahroypat
authored andcommitted
fix(tap): use corrent virtio feature for CSUM offload
Enable TUN_F_CSUM based on whether VIRTIO_NET_F_GUEST_CSUM is negotiated. Signed-off-by: ihciah <[email protected]>
1 parent a46d1b9 commit a364da8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/vmm/src/devices/virtio/net/device.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ impl Net {
683683
&mut tap_features,
684684
guest_supported_features,
685685
gen::TUN_F_CSUM,
686-
VIRTIO_NET_F_CSUM,
686+
VIRTIO_NET_F_GUEST_CSUM,
687687
);
688688
add_if_supported(
689689
&mut tap_features,
@@ -1058,7 +1058,7 @@ pub mod tests {
10581058
// Test that `Net::build_tap_offload_features` creates the TAP offload features that we expect
10591059
// it to do, based on the available guest features
10601060
fn test_build_tap_offload_features_all() {
1061-
let supported_features = 1 << VIRTIO_NET_F_CSUM
1061+
let supported_features = 1 << VIRTIO_NET_F_GUEST_CSUM
10621062
| 1 << VIRTIO_NET_F_GUEST_UFO
10631063
| 1 << VIRTIO_NET_F_GUEST_TSO4
10641064
| 1 << VIRTIO_NET_F_GUEST_TSO6;
@@ -1073,7 +1073,7 @@ pub mod tests {
10731073
// Same as before, however, using each supported feature one by one.
10741074
fn test_build_tap_offload_features_one_by_one() {
10751075
let features = [
1076-
(1 << VIRTIO_NET_F_CSUM, gen::TUN_F_CSUM),
1076+
(1 << VIRTIO_NET_F_GUEST_CSUM, gen::TUN_F_CSUM),
10771077
(1 << VIRTIO_NET_F_GUEST_UFO, gen::TUN_F_UFO),
10781078
(1 << VIRTIO_NET_F_GUEST_TSO4, gen::TUN_F_TSO4),
10791079
];

0 commit comments

Comments
 (0)