[ovs-git] [openvswitch/ovs] 002cb6: dpif-netdev: Avoid infinite re-addition of misconf...

Ilya Maximets noreply at github.com
Wed Dec 18 11:13:45 UTC 2019


  Branch: refs/heads/branch-2.12
  Home:   https://github.com/openvswitch/ovs
  Commit: 002cb62160cba242d49f918fd49aa54f957413b1
      https://github.com/openvswitch/ovs/commit/002cb62160cba242d49f918fd49aa54f957413b1
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2019-12-18 (Wed, 18 Dec 2019)

  Changed paths:
    M lib/dpif-netdev.c

  Log Message:
  -----------
  dpif-netdev: Avoid infinite re-addition of misconfigured ports.

Infinite re-addition of failed ports happens if the device in userspace
datapath has a linux network interface and it's not able to be
configured.  For example, if the first reconfiguration fails because of
misconfiguration or bad initial device state.
In current code victims are afxdp ports and the Mellanox NIC ports
opened by the DPDK due to their bifurcated drivers (It's unlikely for
usual netdev-linux ports to fail).

The root cause: Every change in the state of the network interface
of a linux kernel device generates if-notifier event and if-notifier
event triggers the OVS code to re-apply the configuration of ports,
i.e. add broken ports back. The most obvious part is that dpif-netdev
changes the device flags before trying to configure it:

   1. add_port()
   2. set_flags() --> if-notifier event
   3. reconfigure() --> port removal from the datapath due to
                        misconfiguration or any other issue in
                        the underlying device.
   4. setting flags back --> another if-notifier event.
   5. There was new if-notifier event?
      yes --> re-apply all settings. --> goto step 1.

Easy way to reproduce is to add afxdp port with n_rxq=N, where N is
bigger than device supports.

This patch fixes the most obvious case for this issue by moving
enabling of a promisc mode later to the place where we already know
that device could be added to datapath without errors, i.e. after
its first successful reconfiguration.

Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2019-September/363038.html
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Acked-by: William Tu <u9012063 at gmail.com>


  Commit: c0ce219ead0086f1bf79ff6071df1822ee0804c9
      https://github.com/openvswitch/ovs/commit/c0ce219ead0086f1bf79ff6071df1822ee0804c9
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2019-12-18 (Wed, 18 Dec 2019)

  Changed paths:
    M lib/netdev-afxdp.c

  Log Message:
  -----------
  netdev-afxdp: Avoid removing of XDP program if not loaded.

'bpf_set_link_xdp_fd' generates netlink event regardless of actual
changes it does, so if-notifier will receive link update even if
there was no XDP program previously loaded on the interface.

OVS tries to remove XDP program if device configuration was not
successful triggering if-notifier that triggers bridge reconfiguration
and another attempt to add failed port.  And so on in the infinite
loop.

This patch avoids the issue by not removing XDP program if it wasn't
loaded.  Since loading of the XDP program is one of the last steps
of port configuration, this should help to avoid infinite re-addition
for most types of misconfiguration.

Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Acked-by: William Tu <u9012063 at gmail.com>


  Commit: 1b3faafb1ee74ff5bc877bf0ef3097ce4d77f8ef
      https://github.com/openvswitch/ovs/commit/1b3faafb1ee74ff5bc877bf0ef3097ce4d77f8ef
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2019-12-18 (Wed, 18 Dec 2019)

  Changed paths:
    M tests/automake.mk
    M tests/system-afxdp-testsuite.at
    A tests/system-afxdp.at

  Log Message:
  -----------
  system-afxdp.at: Add test for infinite re-addition of failed ports.

New file created for AF_XDP specific tests.

Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Acked-by: William Tu <u9012063 at gmail.com>


Compare: https://github.com/openvswitch/ovs/compare/b1cbbabb7154...1b3faafb1ee7


More information about the git mailing list