[ovs-git] [openvswitch/ovs] 1061dc: dpif-netdev: Retrieve dpif_class from struct dp_ne...

Ophir Munk noreply at github.com
Sun Dec 8 16:04:38 UTC 2019


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 1061dc7c85e780269697f7f8980f3b25cd3b1278
      https://github.com/openvswitch/ovs/commit/1061dc7c85e780269697f7f8980f3b25cd3b1278
  Author: Ophir Munk <ophirmu at mellanox.com>
  Date:   2019-12-08 (Sun, 08 Dec 2019)

  Changed paths:
    M lib/dpif-netdev.c

  Log Message:
  -----------
  dpif-netdev: Retrieve dpif_class from struct dp_netdev.

In case a pmd pointer (struct dp_netdev_pmd_thread *) needs to retrieve
the dpif_class it points at - it can access it as:  pmd->dp->class.  A
second option is to access it as: pmd->dp->dpif->dpif_class. The first
option is safe since there is one dp netdev with a constant pointer to
the dpif class. The second option is not safe since the pointer
pmd->dp->dpif may be changed under the hood, for example, in case there
is a call to dpif_open(). One such scenario is when a netdev bridge is
running while dumping flows statistics with dpctl in parallel:
ovs-appctl dpctl/dump-flows. This commit makes usage of the first
safe option instead of the second option.

Fixes: 30115809da2e ("dpif-netdev: Use netdev-offload API for port lookup while offloading")
Signed-off-by: Ophir Munk <ophirmu at mellanox.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>




More information about the git mailing list