From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: kvm@vger.kernel.org, netdev@vger.kernel.org,
virtualization@lists.linux-foundation.org, wexu@redhat.com,
stefanha@redhat.com
Subject: Re: [PATCH V4 net-next 3/3] tun: rx batching
Date: Tue, 10 Jan 2017 01:12:36 +0200 [thread overview]
Message-ID: <20170110011058-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <bff99f2f-8293-0dda-1db1-881e555f3623@redhat.com>
On Mon, Jan 09, 2017 at 10:39:55AM +0800, Jason Wang wrote:
>
>
> On 2017年01月07日 03:47, Michael S. Tsirkin wrote:
> > > +static int tun_get_coalesce(struct net_device *dev,
> > > + struct ethtool_coalesce *ec)
> > > +{
> > > + struct tun_struct *tun = netdev_priv(dev);
> > > +
> > > + ec->rx_max_coalesced_frames = tun->rx_batched;
> > > +
> > > + return 0;
> > > +}
> > > +
> > > +static int tun_set_coalesce(struct net_device *dev,
> > > + struct ethtool_coalesce *ec)
> > > +{
> > > + struct tun_struct *tun = netdev_priv(dev);
> > > +
> > > + if (ec->rx_max_coalesced_frames > NAPI_POLL_WEIGHT)
> > > + return -EINVAL;
> > So what should userspace do? Keep trying until it succeeds?
> > I think it's better to just use NAPI_POLL_WEIGHT instead and DTRT here.
> >
>
> Well, looking at how set_coalesce is implemented in other drivers, -EINVAL
> is usually used when user give a value that exceeds the limitation. For
> tuntap, what missed here is probably just a documentation for coalescing in
> tuntap.txt. (Or extend ethtool to return the max value). This seems much
> better than silently reduce the value to the limitation.
>
> Thanks
I don't think it's better, it's mostly that
1. there's a hardware limit so it does not change much
2. default is enabled and no one bothers changing
I don't see how will tuntap.txt help if we want to change it
in the future.
--
MST
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2017-01-09 23:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-06 2:13 [PATCH V4 net-next 0/3] vhost_net tx batching Jason Wang
2017-01-06 2:13 ` [PATCH V4 net-next 1/3] vhost: better detection of available buffers Jason Wang
2017-01-06 19:55 ` Michael S. Tsirkin
2017-01-09 2:59 ` Jason Wang
2017-01-09 23:10 ` Michael S. Tsirkin
2017-01-10 2:22 ` Jason Wang
2017-01-10 2:57 ` Michael S. Tsirkin
2017-01-06 2:13 ` [PATCH V4 net-next 2/3] vhost_net: tx batching Jason Wang
2017-01-06 2:13 ` [PATCH V4 net-next 3/3] tun: rx batching Jason Wang
2017-01-06 19:47 ` Michael S. Tsirkin
2017-01-09 2:39 ` Jason Wang
2017-01-09 23:12 ` Michael S. Tsirkin [this message]
2017-01-10 2:24 ` Jason Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170110011058-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=jasowang@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stefanha@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=wexu@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).