KVM Archive on lore.kernel.org
 help / color / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: prashantbhole.linux@gmail.com,
	"David S . Miller" <davem@davemloft.net>,
	David Ahern <dsahern@gmail.com>,
	kvm@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-next 0/3] vhost_net: access ptr ring using tap recvmsg
Date: Sat, 12 Oct 2019 16:38:30 -0400
Message-ID: <20191012163722-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <8f319697-34e1-fde5-65f3-7db8dc723982@redhat.com>

On Sat, Oct 12, 2019 at 03:57:21PM +0800, Jason Wang wrote:
> 
> On 2019/10/12 上午9:53, prashantbhole.linux@gmail.com wrote:
> > From: Prashant Bhole <prashantbhole.linux@gmail.com>
> > 
> > vhost_net needs to peek tun packet sizes to allocate virtio buffers.
> > Currently it directly accesses tap ptr ring to do it. Jason Wang
> > suggested to achieve this using msghdr->msg_control and modifying the
> > behavior of tap recvmsg.
> 
> 
> Note this may use more indirect calls, this could be optimized in the future
> by doing XDP/skb receiving by vhost_net its own.

So it looks like this is going in the reverse direction,
moving more data path code from vhost to tun.
What's the point of the patchset then?


> 
> > 
> > This change will be useful in future in case of virtio-net XDP
> > offload. Where packets will be XDP processed in tap recvmsg and vhost
> > will see only non XDP_DROP'ed packets.
> > 
> > Patch 1: reorganizes the tun_msg_ctl so that it can be extended by
> >   the means of different commands. tap sendmsg recvmsg will behave
> >   according to commands.
> > 
> > Patch 2: modifies recvmsg implementation to produce packet pointers.
> >   vhost_net uses recvmsg API instead of ptr_ring_consume().
> > 
> > Patch 3: removes ptr ring usage in vhost and functions those export
> >   ptr ring from tun/tap.
> > 
> > Prashant Bhole (3):
> >    tuntap: reorganize tun_msg_ctl usage
> >    vhost_net: user tap recvmsg api to access ptr ring
> >    tuntap: remove usage of ptr ring in vhost_net
> > 
> >   drivers/net/tap.c      | 44 ++++++++++++++---------
> >   drivers/net/tun.c      | 45 +++++++++++++++---------
> >   drivers/vhost/net.c    | 79 ++++++++++++++++++++++--------------------
> >   include/linux/if_tun.h |  9 +++--
> >   4 files changed, 103 insertions(+), 74 deletions(-)
> 
> 
> It would be helpful that if you can share some performance numbers here.
> 
> Thanks

      reply index

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-12  1:53 prashantbhole.linux
2019-10-12  1:53 ` [PATCH net-next 1/3] tuntap: reorganize tun_msg_ctl usage prashantbhole.linux
2019-10-12  7:44   ` Jason Wang
2019-10-15  0:33     ` Prashant Bhole
2019-10-12  1:53 ` [PATCH net-next 2/3] vhost_net: user tap recvmsg api to access ptr ring prashantbhole.linux
2019-10-12  7:54   ` Jason Wang
2019-10-12 20:41   ` Michael S. Tsirkin
2019-10-15  0:57     ` Prashant Bhole
2019-10-12  1:53 ` [PATCH net-next 3/3] tuntap: remove usage of ptr ring in vhost_net prashantbhole.linux
2019-10-12  7:57 ` [PATCH net-next 0/3] vhost_net: access ptr ring using tap recvmsg Jason Wang
2019-10-12 20:38   ` Michael S. Tsirkin [this message]

Reply instructions:

You may reply publically 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=20191012163722-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=prashantbhole.linux@gmail.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

KVM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kvm/0 kvm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kvm kvm/ https://lore.kernel.org/kvm \
		kvm@vger.kernel.org kvm@archiver.kernel.org
	public-inbox-index kvm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.kvm


AGPL code for this site: git clone https://public-inbox.org/ public-inbox