File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -3682,6 +3682,14 @@ static int virtnet_validate(struct virtio_device *vdev)
3682
3682
return 0 ;
3683
3683
}
3684
3684
3685
+ static bool virtnet_check_guest_gso (const struct virtnet_info * vi )
3686
+ {
3687
+ return virtio_has_feature (vi -> vdev , VIRTIO_NET_F_GUEST_TSO4 ) ||
3688
+ virtio_has_feature (vi -> vdev , VIRTIO_NET_F_GUEST_TSO6 ) ||
3689
+ virtio_has_feature (vi -> vdev , VIRTIO_NET_F_GUEST_ECN ) ||
3690
+ virtio_has_feature (vi -> vdev , VIRTIO_NET_F_GUEST_UFO );
3691
+ }
3692
+
3685
3693
static int virtnet_probe (struct virtio_device * vdev )
3686
3694
{
3687
3695
int i , err = - ENOMEM ;
@@ -3777,10 +3785,7 @@ static int virtnet_probe(struct virtio_device *vdev)
3777
3785
spin_lock_init (& vi -> refill_lock );
3778
3786
3779
3787
/* If we can receive ANY GSO packets, we must allocate large ones. */
3780
- if (virtio_has_feature (vdev , VIRTIO_NET_F_GUEST_TSO4 ) ||
3781
- virtio_has_feature (vdev , VIRTIO_NET_F_GUEST_TSO6 ) ||
3782
- virtio_has_feature (vdev , VIRTIO_NET_F_GUEST_ECN ) ||
3783
- virtio_has_feature (vdev , VIRTIO_NET_F_GUEST_UFO ))
3788
+ if (virtnet_check_guest_gso (vi ))
3784
3789
vi -> big_packets = true;
3785
3790
3786
3791
if (virtio_has_feature (vdev , VIRTIO_NET_F_MRG_RXBUF ))
You can’t perform that action at this time.
0 commit comments