From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Wang Subject: Re: [PATCH net-next] tuntap: XDP_TX can use native XDP Date: Fri, 16 Mar 2018 14:46:22 +0800 Message-ID: <9b895dba-71bf-8053-610b-83ecb6d36879@redhat.com> References: <1520997820-8289-1-git-send-email-jasowang@redhat.com> <20180314053424-mutt-send-email-mst@kernel.org> <21e53c2b-6677-fc9a-0771-e895da1c257f@redhat.com> <20180315153150-mutt-send-email-mst@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org To: "Michael S. Tsirkin" Return-path: In-Reply-To: <20180315153150-mutt-send-email-mst@kernel.org> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On 2018年03月15日 21:32, Michael S. Tsirkin wrote: > On Thu, Mar 15, 2018 at 04:39:25PM +0800, Jason Wang wrote: >> >> On 2018年03月14日 11:37, Michael S. Tsirkin wrote: >>>> return NULL; >>>> case XDP_TX: >>>> - xdp_xmit = true; >>>> - /* fall through */ >>>> + get_page(alloc_frag->page); >>>> + alloc_frag->offset += buflen; >>>> + if (tun_xdp_xmit(tun->dev, &xdp)) >>>> + goto err_redirect; >>>> + tun_xdp_flush(tun->dev); >>> Why do we have to flush here though? >>> It might be a good idea to document the reason in a code comment. >>> >> ndo_xdp_xmit() does not touch doorbell, so we need a ndo_xdp_flush() here. >> It's the assumption of XDP API I think, so not sure it's worth to mention it >> here. >> >> Thanks > Can't one flush we called after multiple xmit calls? We can and could be another patch on top. But I want to unify it with the batching of XDP_REDIRECT by e.g let vhost submit more than one packets through msg.control in sendmsg(). Thanks