Skip to content

Commit

Permalink
fix(tap): use corrent virtio feature for CSUM offload
Browse files Browse the repository at this point in the history
Signed-off-by: ihciah <ihciah@gmail.com>
  • Loading branch information
ihciah committed Aug 11, 2024
1 parent 68e1973 commit 01900e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/vmm/src/devices/virtio/net/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ impl Net {
&mut tap_features,
guest_supported_features,
gen::TUN_F_CSUM,
VIRTIO_NET_F_CSUM,
VIRTIO_NET_F_GUEST_CSUM,
);
add_if_supported(
&mut tap_features,
Expand Down Expand Up @@ -1058,7 +1058,7 @@ pub mod tests {
// Test that `Net::build_tap_offload_features` creates the TAP offload features that we expect
// it to do, based on the available guest features
fn test_build_tap_offload_features_all() {
let supported_features = 1 << VIRTIO_NET_F_CSUM
let supported_features = 1 << VIRTIO_NET_F_GUEST_CSUM
| 1 << VIRTIO_NET_F_GUEST_UFO
| 1 << VIRTIO_NET_F_GUEST_TSO4
| 1 << VIRTIO_NET_F_GUEST_TSO6;
Expand All @@ -1073,7 +1073,7 @@ pub mod tests {
// Same as before, however, using each supported feature one by one.
fn test_build_tap_offload_features_one_by_one() {
let features = [
(1 << VIRTIO_NET_F_CSUM, gen::TUN_F_CSUM),
(1 << VIRTIO_NET_F_GUEST_CSUM, gen::TUN_F_CSUM),
(1 << VIRTIO_NET_F_GUEST_UFO, gen::TUN_F_UFO),
(1 << VIRTIO_NET_F_GUEST_TSO4, gen::TUN_F_TSO4),
];
Expand Down

0 comments on commit 01900e0

Please sign in to comment.