linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, virtualization@lists.linux-foundation.org
Subject: Re: [PATCH net-next V2 11/11] vhost_net: batch submitting XDP buffers to underlayer sockets
Date: Fri, 14 Sep 2018 11:11:19 +0800	[thread overview]
Message-ID: <dfc04379-125b-dd4e-b903-4b9323a25506@redhat.com> (raw)
In-Reply-To: <20180913140332-mutt-send-email-mst@kernel.org>



On 2018年09月14日 02:04, Michael S. Tsirkin wrote:
> On Wed, Sep 12, 2018 at 11:17:09AM +0800, Jason Wang wrote:
>> +static void vhost_tx_batch(struct vhost_net *net,
>> +			   struct vhost_net_virtqueue *nvq,
>> +			   struct socket *sock,
>> +			   struct msghdr *msghdr)
>> +{
>> +	struct tun_msg_ctl ctl = {
>> +		.type = TUN_MSG_PTR,
>> +		.num = nvq->batched_xdp,
>> +		.ptr = nvq->xdp,
>> +	};
>> +	int err;
>> +
>> +	if (nvq->batched_xdp == 0)
>> +		goto signal_used;
>> +
>> +	msghdr->msg_control = &ctl;
>> +	err = sock->ops->sendmsg(sock, msghdr, 0);
>> +	if (unlikely(err < 0)) {
>> +		vq_err(&nvq->vq, "Fail to batch sending packets\n");
>> +		return;
>> +	}
>> +
>> +signal_used:
>> +	vhost_net_signal_used(nvq);
>> +	nvq->batched_xdp = 0;
>> +}
>> +
> Given it's all tun-specific now, how about just exporting tap_sendmsg
> and calling that? Will get rid of some indirection too.
>

Yes we can do it on top in the future.

Thanks

  reply	other threads:[~2018-09-14  3:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-12  3:16 [PATCH net-next V2 00/11] vhost_net TX batching Jason Wang
2018-09-12  3:16 ` [PATCH net-next V2 01/11] net: sock: introduce SOCK_XDP Jason Wang
2018-09-12  3:17 ` [PATCH net-next V2 02/11] tuntap: switch to use XDP_PACKET_HEADROOM Jason Wang
2018-09-12  3:17 ` [PATCH net-next V2 03/11] tuntap: enable bh early during processing XDP Jason Wang
2018-09-12  3:17 ` [PATCH net-next V2 04/11] tuntap: simplify error handling in tun_build_skb() Jason Wang
2018-09-12  3:17 ` [PATCH net-next V2 05/11] tuntap: tweak on the path of skb XDP case " Jason Wang
2018-09-12  3:17 ` [PATCH net-next V2 06/11] tuntap: split out XDP logic Jason Wang
2018-09-12  3:17 ` [PATCH net-next V2 07/11] tuntap: move XDP flushing out of tun_do_xdp() Jason Wang
2018-09-12  3:17 ` [PATCH net-next V2 08/11] tun: switch to new type of msg_control Jason Wang
2018-09-12  3:17 ` [PATCH net-next V2 09/11] tuntap: accept an array of XDP buffs through sendmsg() Jason Wang
2018-09-12  3:17 ` [PATCH net-next V2 10/11] tap: " Jason Wang
2018-09-12  3:17 ` [PATCH net-next V2 11/11] vhost_net: batch submitting XDP buffers to underlayer sockets Jason Wang
2018-09-13 18:04   ` Michael S. Tsirkin
2018-09-14  3:11     ` Jason Wang [this message]
2018-09-13 16:28 ` [PATCH net-next V2 00/11] vhost_net TX batching David Miller
2018-09-13 18:02   ` Michael S. Tsirkin
2018-09-13 18:05     ` David Miller

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=dfc04379-125b-dd4e-b903-4b9323a25506@redhat.com \
    --to=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /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).