[ovs-dev] [PATCH] netdev-linux: do not send packets to down tap ifaces.

Flavio Leitner fbl at sysclose.org
Thu Jan 11 12:49:11 UTC 2018


On Wed, Jan 10, 2018 at 03:09:30PM -0800, Ben Pfaff wrote:
> On Wed, Jan 10, 2018 at 02:06:43PM -0200, Flavio Leitner wrote:
> > Today OVS pushes packets to the TAP interface ignoring its
> > current state. That works because the kernel will return -EIO
> > when it's not UP and OVS will just ignore that as it is not
> > an OVS issue.
> > 
> > However, it causes a huge impact when broadcasts happen when
> > using userspace datapath accelerated with DPDK (e.g.: action
> > NORMAL).  This patch improves the situation by checking the
> > TAP's interface state before issueing any syscall.
> > 
> > However, there might be use-cases moving interfaces to other
> > networking namespaces and in that case, OVS can't retrieve
> > the iface state (sets it to DOWN). That would stop the traffic
> > breaking the use-case. This patch relies on netlink notifications
> > to find out if the device is local or not. When it's local, the
> > device state is checked otherwise it will behave as before.
> > 
> > Signed-off-by: Flavio Leitner <fbl at sysclose.org>
> 
> Can you help me understand the "huge impact"?  What kind of impact?

The PMD thread needs to be all time processing packets in order to
provide maximum performance (no loss, less jitter and stable tput).
However, it calls the write() syscall when sending packets to tap
devices and then we lost control over the CPU.

One exampe is that we need to warm up the fdb before starting the
performance tests because the ARP resolution uses the syscall and
causes issues right at the beginning.

So, basically every time a broadcast happen for whatever reason,
there is a high chance of stalling the PMD thread enough to cause
packet loss, jitter or tput degradation.

A real world example is OpenStack running with OVS-DPDK and
serving multiple VMs through vhost-user ports.  If any of the
VMs triggers a broadcast, other VMs will notice the penalty.

-- 
Flavio



More information about the dev mailing list