[ovs-git] [openvswitch/ovs] 688786: dpif-netdev: Fix dp_netdev_pmd_remove_flow().

GitHub noreply at github.com
Thu May 5 02:20:57 UTC 2016


  Branch: refs/heads/branch-2.5
  Home:   https://github.com/openvswitch/ovs
  Commit: 68878667ae0d53a36908800d20fe5bbb6d6fab74
      https://github.com/openvswitch/ovs/commit/68878667ae0d53a36908800d20fe5bbb6d6fab74
  Author: Daniele Di Proietto <diproiettod at vmware.com>
  Date:   2016-05-04 (Wed, 04 May 2016)

  Changed paths:
    M lib/dpif-netdev.c

  Log Message:
  -----------
  dpif-netdev: Fix dp_netdev_pmd_remove_flow().

After removing a flow from the dpcls classifier there might still be
readers who have access to the flow, until the next grace period.

Setting flow->cr.mask to NULL can cause concurrent readers to crash,
so this commit avoids doing it.

The crash can be reproduced, for example, by invoking an operation
that cause datapath flows to be deleted (such as `ovs-appctl
upcall/enable-megaflows`) while traffic is running.

I think the assignment was intended just as a safety measure to catch
race conditions, and it should be safe to remove.

Here's a stack trace of a possible crash:

Program terminated with signal SIGSEGV, Segmentation fault.
rule=0x7f3ae8006190) at ../lib/dpif-netdev.c:4156
4156            if (OVS_UNLIKELY((value & *maskp++) != *keyp++)) {
(gdb) bt
rule=0x7f3ae8006190) at ../lib/dpif-netdev.c:4156
rules=0x7f3afa3f2e40, cnt=<optimized out>) at ../lib/dpif-netdev.c:4225
(pmd=pmd at entry=0x7f3afa3fc010, packets=packets at entry=0x7f3afa3fa420,
cnt=cnt at entry=32, keys=keys at entry=0x7f3afa3f6428,
batches=batches at entry=0x7f3afa3f4118,
n_batches=n_batches at entry=0x7f3afa3fa3b0)
    at ../lib/dpif-netdev.c:3483
(pmd=pmd at entry=0x7f3afa3fc010, packets=packets at entry=0x7f3afa3fa420,
cnt=<optimized out>, md_is_valid=md_is_valid at entry=false,
port_no=<optimized out>) at ../lib/dpif-netdev.c:3625
cnt=<optimized out>, packets=0x7f3afa3fa420, pmd=0x7f3afa3fc010) at
../lib/dpif-netdev.c:3642
rxq=<optimized out>, port=<optimized out>, port=<optimized out>) at
../lib/dpif-netdev.c:2574
../lib/dpif-netdev.c:2693
../lib/ovs-thread.c:340
pthread_create.c:312
../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Fixes: 361d808dd9e4("flow: Split miniflow's map.")
CC: Jarno Rajahalme <jarno at ovn.org>
Signed-off-by: Daniele Di Proietto <diproiettod at vmware.com>
Acked-by: Jarno Rajahalme <jrajahalme at nicira.com>


  Commit: 48629b125e3cb6d501e1b3ca8627fcc3a8e5c8b5
      https://github.com/openvswitch/ovs/commit/48629b125e3cb6d501e1b3ca8627fcc3a8e5c8b5
  Author: Ilya Maximets <i.maximets at samsung.com>
  Date:   2016-05-04 (Wed, 04 May 2016)

  Changed paths:
    M INSTALL.DPDK.md
    M NEWS
    M lib/dpif-netdev.c
    M lib/netdev.c
    M lib/netdev.h
    M vswitchd/ovs-vswitchd.8.in

  Log Message:
  -----------
  dpif-netdev: Add dpif-netdev/pmd-rxq-show appctl command.

This command can be used to check the port/rxq assignment to
pmd threads. For each pmd thread of the datapath shows list
of queue-ids with port names.

Additionally log message from pmd_thread_main() extended with
queue-id, and type of this message changed from INFO to DBG.

Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
Acked-by: Flavio Leitner <fbl at sysclose.org>
Acked-by: Daniele Di Proietto <diproiettod at vmware.com>


Compare: https://github.com/openvswitch/ovs/compare/4fc4d3119bdc...48629b125e3c


More information about the git mailing list