mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 10:29:37 +00:00
virtio-net: initialize vlan_features
There's nothing that prevent passing the device features of virtio_net to its vlan device. So this patch simply passes those to vlan device to benefit from advanced features. Netperf shows better sending performance for vlan device since TSO can work on vlan now. before: netperf -H 192.168.5.2 MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.5.2 () port 0 AF_INET : demo Recv Send Send Socket Socket Message Elapsed Size Size Size Time Throughput bytes bytes bytes secs. 10^6bits/sec 87380 16384 16384 10.00 4162.35 after: netperf -H 192.168.5.2 MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.5.2 () port 0 AF_INET : demo Recv Send Send Socket Socket Message Elapsed Size Size Size Time Throughput bytes bytes bytes secs. 10^6bits/sec 87380 16384 16384 10.00 9365.42 Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: "Michael S. Tsirkin" <mst@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
727f957a3c
commit
4fda830263
1 changed files with 2 additions and 0 deletions
|
@ -1511,6 +1511,8 @@ static int virtnet_probe(struct virtio_device *vdev)
|
||||||
/* (!csum && gso) case will be fixed by register_netdev() */
|
/* (!csum && gso) case will be fixed by register_netdev() */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dev->vlan_features = dev->features;
|
||||||
|
|
||||||
/* Configuration may specify what MAC to use. Otherwise random. */
|
/* Configuration may specify what MAC to use. Otherwise random. */
|
||||||
if (virtio_config_val_len(vdev, VIRTIO_NET_F_MAC,
|
if (virtio_config_val_len(vdev, VIRTIO_NET_F_MAC,
|
||||||
offsetof(struct virtio_net_config, mac),
|
offsetof(struct virtio_net_config, mac),
|
||||||
|
|
Loading…
Reference in a new issue