Thanks William, 
https://www.kernel.org/doc/Documentation/networking/packet_mmap.txt is very 
good document for TPACKET_V*, I completely agree TPCKET_V3 is the best way to 
improve tap and veth performance. Can you share us how to use your patch? 
Lib/netdev-linux.c is still there, which recv function will be called when I 
add veth/tap in OVS DPDK?

-----邮件原件-----
发件人: William Tu [mailto:u9012...@gmail.com] 
发送时间: 2019年12月21日 1:43
收件人: Yi Yang (杨燚)-云服务集团 <yangy...@inspur.com>
抄送: d...@openvswitch.org; i.maxim...@ovn.org; b...@ovn.org; echau...@redhat.com
主题: Re: 答复: [PATCH RFC] WIP: netdev-tpacket: Add AF_PACKET v3 support.

On Fri, Dec 20, 2019 at 06:09:08AM +0000, Yi Yang (杨燚)-云服务集团 wrote:
> Hi, William
> 
> What kernel version can support AF_PACKET v3? I can try it with your patch.

Hi Yiyang,

Kernel +4.0 should have v3 support.

I'm also reading this doc:
https://www.kernel.org/doc/Documentation/networking/packet_mmap.txt

-------------------------------------------------------------------------------
+ AF_PACKET TPACKET_V3 example
-------------------------------------------------------------------------------

AF_PACKET's TPACKET_V3 ring buffer can be configured to use non-static frame 
sizes by doing it's own memory management. It is based on blocks where polling 
works on a per block basis instead of per ring as in TPACKET_V2 and predecessor.

It is said that TPACKET_V3 brings the following benefits:
 *) ~15 - 20% reduction in CPU-usage
 *) ~20% increase in packet capture rate
 *) ~2x increase in packet density
 *) Port aggregation analysis
 *) Non static frame size to capture entire packet payload

So it seems to be a good candidate to be used with packet fanout.

DPDK library is using TPACKET_V2, and V3 is better due to:
TPACKET_V2 --> TPACKET_V3:
        - Flexible buffer implementation for RX_RING:
                1. Blocks can be configured with non-static frame-size
                2. Read/poll is at a block-level (as opposed to packet-level)
                3. Added poll timeout to avoid indefinite user-space wait
                   on idle links
                4. Added user-configurable knobs:
                        4.1 block::timeout
                        4.2 tpkt_hdr::sk_rxhash
        - RX Hash data available in user space
        - TX_RING semantics are conceptually similar to TPACKET_V2;

Thanks
William

> 
> -----邮件原件-----
> 发件人: William Tu [mailto:u9012...@gmail.com]
> 发送时间: 2019年12月20日 8:41
> 收件人: d...@openvswitch.org
> 抄送: i.maxim...@ovn.org; Yi Yang (杨燚)-云服务集团 <yangy...@inspur.com>; 
> b...@ovn.org; echau...@redhat.com
> 主题: [PATCH RFC] WIP: netdev-tpacket: Add AF_PACKET v3 support.
> 
> 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.
> 
> [1] https://patchwork.ozlabs.org/patch/1204939/
> [2] slide 18, https://www.netdevconf.info/2.2/slides/karlsson-afpacket-talk.
> pdf
> [3] dpdk/drivers/net/af_packet/rte_eth_af_packet.c
> ---
>  lib/automake.mk            |   2 +
>  lib/netdev-linux-private.h |  23 +++
>  lib/netdev-linux.c         |  24 ++-
>  lib/netdev-provider.h      |   1 +
>  lib/netdev-tpacket.c       | 487
> +++++++++++++++++++++++++++++++++++++++++++++
>  lib/netdev-tpacket.h       |  43 ++++
>  lib/netdev.c               |   1 +
>  7 files changed, 580 insertions(+), 1 deletion(-)  create mode 100644 
> lib/netdev-tpacket.c  create mode 100644 lib/netdev-tpacket.h
> 

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to