lkml.org 
[lkml]   [2023]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH net] virtio-net: reject small vring sizes
Date
> > +static int virtnet_validate_vqs(struct virtnet_info *vi)
> > +{
> > + u32 i, min_size = roundup_pow_of_two(MAX_SKB_FRAGS + 2);
>
> why power of two?

The ring size is always a power of 2, so checking against MAX_SKB_FRAGS + 2 or against roundup_pow_of_two will result in the same, and I think that printing the warning with the actual min value is more helpful.
I can check the condition against MAX_SKB_FRAGS + 2, and print the rounded value in case of an error.

\
 
 \ /
  Last update: 2023-04-17 08:44    [W:0.150 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site