[ovs-dev] 答复: [PATCH RFC] WIP: netdev-tpacket: Add AF_PACKET v3 support.

Yi Yang (杨燚)-云服务集团 yangyi01 at inspur.com
Tue Dec 24 01:22:11 UTC 2019


William, maybe you don't know that kind of tap interface you're saying only can be used for VM, that is why openvswitch has to introduce internal type for the case I'm saying.

In OVS DPDK case, if you create the below interface, it is a tap interface.

ovs-vsctl add-port tapX -- set interface type=internal

It won't work if you create tap interface in the below way

Ip tuntap add tapX node tap
ovs-vsctl add-port br-int tapX

I have tried af_packet for it, it can't work, I don't think af_xdp can work for such tap, maybe you can double confirm this.



-----邮件原件-----
发件人: William Tu [mailto:u9012063 at gmail.com] 
发送时间: 2019年12月24日 8:17
收件人: Yi Yang (杨燚)-云服务集团 <yangyi01 at inspur.com>
抄送: blp at ovn.org; dev at openvswitch.org; i.maximets at ovn.org; echaudro at redhat.com
主题: Re: [PATCH RFC] WIP: netdev-tpacket: Add AF_PACKET v3 support.

On Sun, Dec 22, 2019 at 4:35 PM Yi Yang (杨燚)-云服务集团 <yangyi01 at inspur.com> wrote:
>
> Thanks William, af_packet only can open tap interface, it can't create 
> tap interface. Tap interface onlu can be created by the below way
>
> ovs-vsctl add-port tapX -- set interface tapX type=internal
>
> this tap is very special, it is like a mystery to me so far. "ip 
> tuntap add tapX mode tap" can't work for such tap interface.

Why not? What's the error message?
you can create a tapX device using ip tuntap first, and add tapX using OVS

using ovs-vsctl add-port tapX -- set interface tapX type=afxdp

Regards,
William
>
> Anybody can tell me how I can create such a tap interface without using "
> ovs-vsctl add-port tapX"
>
> By the way, I tried af_packet for veth, the performance is very good, 
> it is about 4Gbps on my machine, but it used TPACKET_V2.
>
> -----邮件原件-----
> 发件人: William Tu [mailto:u9012063 at gmail.com]
> 发送时间: 2019年12月21日 1:50
> 收件人: Ben Pfaff <blp at ovn.org>
> 抄送: dev at openvswitch.org; i.maximets at ovn.org; Yi Yang (杨燚)-云服务集团
> <yangyi01 at inspur.com>; echaudro at redhat.com
> 主题: Re: [PATCH RFC] WIP: netdev-tpacket: Add AF_PACKET v3 support.
>
> On Thu, Dec 19, 2019 at 08:44:30PM -0800, Ben Pfaff wrote:
> > On Thu, Dec 19, 2019 at 04:41:25PM -0800, William Tu wrote:
> > > Currently the performance of sending packets from userspace ovs to 
> > > kernel veth device is pretty bad as reported from YiYang[1].
> > > The patch adds AF_PACKET v3, tpacket v3, as another way to tx/rx 
> > > packet to linux device, hopefully showing better performance.
> > >
> > > AF_PACKET v3 should get closed to 1Mpps, as shown[2]. However, my 
> > > current patch using iperf tcp shows only 1.4Gbps, maybe I'm doing 
> > > something wrong.  Also DPDK has similar implementation using 
> > > AF_PACKET v2[3].  This is still work-in-progress but any feedbacks 
> > > are welcome.
> >
> > Is there a good reason that this is implemented as a new kind of 
> > netdev rather than just a new way for the existing netdev 
> > implementation to do packet i/o?
>
> The AF_PACKET v3 is more like PMD mode driver (the netdev-afxdp and 
> other dpdk netdev), which has its own memory mgmt, ring structure, and 
> polling the descriptors. So I implemented it as a new kind. I feel its 
> pretty different than tap or existing af_packet netdev.
>
> But integrate it to the existing netdev (lib/netdev-linux.c) is also OK.
>
> William
>


More information about the dev mailing list