Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1611886 > unrolled thread
| Started by | "Michael S. Tsirkin" <mst@redhat.com> |
|---|---|
| First post | 2017-03-29 14:40 +0200 |
| Last post | 2017-03-30 06:10 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] virtio_net: enable big packets for large MTU values "Michael S. Tsirkin" <mst@redhat.com> - 2017-03-29 14:40 +0200
Re: [PATCH] virtio_net: enable big packets for large MTU values "Michael S. Tsirkin" <mst@redhat.com> - 2017-03-29 18:20 +0200
Re: [PATCH] virtio_net: enable big packets for large MTU values Jason Wang <jasowang@redhat.com> - 2017-03-30 06:10 +0200
| From | "Michael S. Tsirkin" <mst@redhat.com> |
|---|---|
| Date | 2017-03-29 14:40 +0200 |
| Subject | [PATCH] virtio_net: enable big packets for large MTU values |
| Message-ID | <tql3j-6Rq-5@gated-at.bofh.it> |
If one enables e.g. jumbo frames without mergeable buffers, packets won't fit in 1500 byte buffers we use. Switch to big packet mode instead. TODO: make sizing more exact, possibly extend small packet mode to use larger pages. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- drivers/net/virtio_net.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index e0fb3707..9dc31dc 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -2428,6 +2428,10 @@ static int virtnet_probe(struct virtio_device *vdev) dev->mtu = mtu; dev->max_mtu = mtu; } + + /* TODO: size buffers correctly in this case. */ + if (dev->mtu > ETH_DATA_LEN) + vi->big_packets = true; } if (vi->any_header_sg) -- MST
[toc] | [next] | [standalone]
| From | "Michael S. Tsirkin" <mst@redhat.com> |
|---|---|
| Date | 2017-03-29 18:20 +0200 |
| Message-ID | <tqouf-Wy-27@gated-at.bofh.it> |
| In reply to | #1611886 |
On Wed, Mar 29, 2017 at 03:38:09PM +0300, Michael S. Tsirkin wrote:
> If one enables e.g. jumbo frames without mergeable
> buffers, packets won't fit in 1500 byte buffers
> we use. Switch to big packet mode instead.
> TODO: make sizing more exact, possibly extend small
> packet mode to use larger pages.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Fixes: 14de9d114a82 ("virtio-net: Add initial MTU advice feature")
> ---
> drivers/net/virtio_net.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index e0fb3707..9dc31dc 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -2428,6 +2428,10 @@ static int virtnet_probe(struct virtio_device *vdev)
> dev->mtu = mtu;
> dev->max_mtu = mtu;
> }
> +
> + /* TODO: size buffers correctly in this case. */
> + if (dev->mtu > ETH_DATA_LEN)
> + vi->big_packets = true;
> }
>
> if (vi->any_header_sg)
> --
> MST
[toc] | [prev] | [next] | [standalone]
| From | Jason Wang <jasowang@redhat.com> |
|---|---|
| Date | 2017-03-30 06:10 +0200 |
| Message-ID | <tqzzk-Cl-7@gated-at.bofh.it> |
| In reply to | #1611886 |
On 2017年03月29日 20:38, Michael S. Tsirkin wrote: > If one enables e.g. jumbo frames without mergeable > buffers, packets won't fit in 1500 byte buffers > we use. Switch to big packet mode instead. > TODO: make sizing more exact, possibly extend small > packet mode to use larger pages. > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> > --- > drivers/net/virtio_net.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > index e0fb3707..9dc31dc 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -2428,6 +2428,10 @@ static int virtnet_probe(struct virtio_device *vdev) > dev->mtu = mtu; > dev->max_mtu = mtu; > } > + > + /* TODO: size buffers correctly in this case. */ > + if (dev->mtu > ETH_DATA_LEN) > + vi->big_packets = true; > } > > if (vi->any_header_sg) Ok, I think maybe we should fail the probe of small buffer in this case and decrease the max_mtu to ETH_DATA_LEN if small buffer is used (since user are allowed to increase the mtu). Thanks
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web