Displaying 5 results from an estimated 5 matches for "virtnet_uses_svring".
2023 Apr 30
1
[RFC PATCH net 2/3] virtio-net: allow usage of vrings smaller than MAX_SKB_FRAGS + 2
...ax_descs(struct virtnet_info *vi)
+{
+ if (vi->svring) {
+ if (virtnet_check_host_gso(vi))
+ return 4; /* 1 fragment + linear part + virtio header + GSO header */
+ else
+ return 3; /* 1 fragment + linear part + virtio header */
+ } else {
+ return MAX_SKB_FRAGS + 2;
+ }
+}
+
+static bool virtnet_uses_svring(struct virtnet_info *vi)
+{
+ u32 i;
+
+ /* If a transmit/receive virtqueue is small,
+ * we cannot handle fragmented packets.
+ */
+ for (i = 0; i < vi->max_queue_pairs; i++) {
+ if (IS_SMALL_VRING(virtqueue_get_vring_size(vi->sq[i].vq)) ||
+ IS_SMALL_VRING(virtqueue_get_vring_siz...
2023 Apr 30
1
[RFC PATCH net 2/3] virtio-net: allow usage of vrings smaller than MAX_SKB_FRAGS + 2
...svring) {
> + if (virtnet_check_host_gso(vi))
> + return 4; /* 1 fragment + linear part + virtio header + GSO header */
> + else
> + return 3; /* 1 fragment + linear part + virtio header */
> + } else {
> + return MAX_SKB_FRAGS + 2;
> + }
> +}
> +
> +static bool virtnet_uses_svring(struct virtnet_info *vi)
> +{
> + u32 i;
> +
> + /* If a transmit/receive virtqueue is small,
> + * we cannot handle fragmented packets.
> + */
> + for (i = 0; i < vi->max_queue_pairs; i++) {
> + if (IS_SMALL_VRING(virtqueue_get_vring_size(vi->sq[i].vq)) ||
>...
2023 Apr 30
1
[RFC PATCH net 2/3] virtio-net: allow usage of vrings smaller than MAX_SKB_FRAGS + 2
...lly need bool svring? can't we just check single_pkt_max_descs
> all the time?
>
We can work without the bool, we could always check if single_pkt_max_descs != MAX_SKB_FRAGS + 2.
It doesn't really matter to me, I was thinking it may be more readable this way.
> > +static bool virtnet_uses_svring(struct virtnet_info *vi)
> > +{
> > + u32 i;
> > +
> > + /* If a transmit/receive virtqueue is small,
> > + * we cannot handle fragmented packets.
> > + */
> > + for (i = 0; i < vi->max_queue_pairs; i++) {
> > +...
2023 Apr 30
5
[RFC PATCH net 0/3] virtio-net: allow usage of small vrings
At the moment, if a virtio network device uses vrings with less than
MAX_SKB_FRAGS + 2 entries, the device won't be functional.
The following condition vq->num_free >= 2 + MAX_SKB_FRAGS will always
evaluate to false, leading to TX timeouts.
This patchset attempts this fix this bug, and to allow small rings down
to 4 entries.
The first patch introduces a new mechanism in virtio core -
2023 May 01
1
[RFC PATCH net 2/3] virtio-net: allow usage of vrings smaller than MAX_SKB_FRAGS + 2
...just check single_pkt_max_descs
> > all the time?
> >
>
> We can work without the bool, we could always check if single_pkt_max_descs != MAX_SKB_FRAGS + 2.
> It doesn't really matter to me, I was thinking it may be more readable this way.
>
> > > +static bool virtnet_uses_svring(struct virtnet_info *vi)
> > > +{
> > > + u32 i;
> > > +
> > > + /* If a transmit/receive virtqueue is small,
> > > + * we cannot handle fragmented packets.
> > > + */
> > > + for (i = 0; i < vi->max_queue_pa...