[ovs-dev] [PATCH v3] Use TPACKET_V3 to accelerate veth for userspace datapath

Ben Pfaff blp at ovn.org
Fri Feb 14 22:05:48 UTC 2020


On Fri, Feb 14, 2020 at 01:17:08PM -0800, William Tu wrote:
> On Fri, Feb 14, 2020 at 01:14:10PM -0800, William Tu wrote:
> > On Tue, Feb 11, 2020 at 06:21:37PM +0800, yang_y_yi at 126.com wrote:
> > > From: Yi Yang <yangyi01 at inspur.com>
> > > 
> > > We can avoid high system call overhead by using TPACKET_V3
> > > and using DPDK-like poll to receive and send packets (Note: send
> > > still needs to call sendto to trigger final packet transmission).
> > > 
> > > From Linux kernel 3.10 on, TPACKET_V3 has been supported,
> > > so all the Linux kernels current OVS supports can run
> > > TPACKET_V3 without any problem.
> > > 
> > > I can see about 30% performance improvement for veth compared to
> > > last recvmmsg optimization if I use TPACKET_V3, it is about 1.98
> > > Gbps, but it was 1.47 Gbps before.
> > > 
> > > Note: Linux kernel TPACKET_V3 can't support TSO, so the performance
> > > is very poor, please turn off tso for veth interfces in case
> > > userspace-tso-enable is set to true.
> > > 
> > > Signed-off-by: Yi Yang <yangyi01 at inspur.com>
> > > Co-authored-by: William Tu <u9012063 at gmail.com>
> > > Signed-off-by: William Tu <u9012063 at gmail.com>
> > > ---
> > >  acinclude.m4                     |  12 ++
> > >  configure.ac                     |   1 +
> > >  include/linux/automake.mk        |   1 +
> > >  include/linux/if_packet.h        | 126 +++++++++++++
> > >  include/sparse/linux/if_packet.h | 108 +++++++++++
> > >  lib/netdev-linux-private.h       |  22 +++
> > >  lib/netdev-linux.c               | 375 ++++++++++++++++++++++++++++++++++++++-
> > >  7 files changed, 640 insertions(+), 5 deletions(-)
> > >  create mode 100644 include/linux/if_packet.h
> > > 
> > > Changelog:
> > > - v2->v3
> > >  * Fix build issues in case HAVE_TPACKET_V3 is not defined
> > >  * Add tso-related support code
> > >  * make sure it can work normally in case userspace-tso-enable is true
> > > 
> > > - v1->v2
> > >  * Remove TPACKET_V1 and TPACKET_V2 which is obsolete
> > >  * Add include/linux/if_packet.h
> > >  * Change include/sparse/linux/if_packet.h
> > > 
> > > diff --git a/acinclude.m4 b/acinclude.m4
> > > index 1212a46..b39bbb9 100644
> > 
> > I applied this patch and tested on travis. Most of them fail.
> > https://travis-ci.org/williamtu/ovs-travis/builds/650613663
> > 
> > Are you able to run travis build?
> > 
> > Thanks
> > William
> > 
> More details about compile fail
> at
> https://api.travis-ci.org/v3/job/650613667/log.txt

These look like errors from "sparse".  Probably, include/sparse needs
some updates.


More information about the dev mailing list