← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2008238] Re: SRIOV port binding_profile attributes for OVS hardware offload are stripped on instance deletion or port detachment

 

Reviewed:  https://review.opendev.org/c/openstack/nova/+/884439
Committed: https://opendev.org/openstack/nova/commit/cef3b5ef2cc1fe983578e4966208cf95fdea5880
Submitter: "Zuul (22348)"
Branch:    master

commit cef3b5ef2cc1fe983578e4966208cf95fdea5880
Author: Alexey Stupnikov <aleksey.stupnikov@xxxxxxxxx>
Date:   Thu May 25 21:23:32 2023 +0200

    Translate VF network capabilities to port binding
    
    Libvirt's node device driver accumulates and reports information
    about host devices. Network capabilities reported by node device
    driver for NIC contain information about HW offloads supported
    by this NIC.
    
    One of possible features reported by node device driver is
    switchdev: a NIC capability to implement VFs similar to actual
    HW switch ports (also referred to as SR-IOV OVS hardware offload).
    From Neutron perspective, vnic-type should be set to "direct" and
    "switchdev" capability should be added to port binding profile to
    enable HW offload (there are also configuration steps on compute
    hosts to tune NIC config).
    
    This patch was written to automatically translate "switchdev" from
    VF network capabilities reported by node device driver to Neutron
    port binding profile and allow user to skip manual step that
    requires admin privileges.
    
    Other capabilities are also translated: they are not used right
    now, but provide visibility and can be utilized later.
    
    Closes-bug: #2020813
    Closes-bug: #2008238
    Change-Id: I3b17f386325b8f42c0c374f766fb21c520161a59


** Changed in: nova
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/2008238

Title:
  SRIOV port binding_profile attributes for OVS hardware offload are
  stripped on instance deletion or port detachment

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  Description
  ===========

  This issue applies for systems using SRIOV with Mellanox ASAP2 SDN
  offloads.

  An SRIOV port capable for ASAP2 SDN acceleration (OVS hardware
  offloads) has 'capabilities=[switchdev]' added to the port
  binding_profile.

  After a VM has been created with SRIOV port attached, the port can no
  longer be used for subsequent VM builds.  Attempt to reuse the port
  results in an error of the form "Cannot set interface MAC/vlanid to
  <mac>/<vlan> for ifname ens1f0 vf 7: Operation not supported"

  The underlying issue appears to be that when an SRIOV port is detached
  from a VM, or the VM is destroyed, the capabilities=[switchdev]
  property is removed from the port binding_profile.  This converts the
  port from ASAP2 to “Legacy SRIOV” (in Mellanox-speak) and makes it
  unusable.

  If the port binding_profile property is restored then the port can be
  successfully reused.

  The property is preserved during live migration, instance resizes and
  rebuilds.  It only appears to be instance depletion or port detachment
  where the binding_profile property is removed.

  Steps to reproduce
  ==================

  1. Create SRIOV port with ASAP2 capability:

  openstack port create --project <project> --network <network> --vnic-
  type=direct --binding-profile '{"capabilities": ["switchdev"]}' sriov-
  port-1

  2. Check the port binding_profile property:

  openstack port show -c binding_profile sriov-port-1

  3. Create an instance using the port:

  openstack server create --flavor <flavor> --image <image> --key-name
  <key> --nic port-id=sriov-port-1 sriov-vm-1

  4. Delete the instance:

  openstack server delete sriov-vm-1

  5. Check the port binding_profile property:

  openstack port show -c binding_profile sriov-port-1

  Expected Result
  ===============

  Nova sets properties in the binding_profile while the instance is in
  use.  Alongside those properties the capabilities='['switchdev']'
  property should be preserved.

  Actual Result
  =============

  After the instance is deleted (or port detached), the binding_profile
  is empty.

  Environment
  ===========

  This has been observed with the following configuration:

  - OpenStack Yoga
  - OVN Neutron driver

  Logs
  ====

  From Nova Compute:

  2023-01-24 19:55:32.270 7 ERROR nova.virt.libvirt.guest Traceback (most recent call last):
  2023-01-24 19:55:32.270 7 ERROR nova.virt.libvirt.guest   File "/var/lib/kolla/venv/lib/python3.6/site-packages/nova/virt/libvirt/guest.py", line 165, in launch
  2023-01-24 19:55:32.270 7 ERROR nova.virt.libvirt.guest     return self._domain.createWithFlags(flags)
  2023-01-24 19:55:32.270 7 ERROR nova.virt.libvirt.guest   File "/var/lib/kolla/venv/lib/python3.6/site-packages/eventlet/tpool.py", line 190, in doit
  2023-01-24 19:55:32.270 7 ERROR nova.virt.libvirt.guest     result = proxy_call(self._autowrap, f, *args, **kwargs)
  2023-01-24 19:55:32.270 7 ERROR nova.virt.libvirt.guest   File "/var/lib/kolla/venv/lib/python3.6/site-packages/eventlet/tpool.py", line 148, in proxy_call
  2023-01-24 19:55:32.270 7 ERROR nova.virt.libvirt.guest     rv = execute(f, *args, **kwargs)
  2023-01-24 19:55:32.270 7 ERROR nova.virt.libvirt.guest   File "/var/lib/kolla/venv/lib/python3.6/site-packages/eventlet/tpool.py", line 129, in execute
  2023-01-24 19:55:32.270 7 ERROR nova.virt.libvirt.guest     six.reraise(c, e, tb)
  2023-01-24 19:55:32.270 7 ERROR nova.virt.libvirt.guest   File "/usr/lib/python3.6/site-packages/six.py", line 703, in reraise
  2023-01-24 19:55:32.270 7 ERROR nova.virt.libvirt.guest     raise value
  2023-01-24 19:55:32.270 7 ERROR nova.virt.libvirt.guest   File "/var/lib/kolla/venv/lib/python3.6/site-packages/eventlet/tpool.py", line 83, in tworker
  2023-01-24 19:55:32.270 7 ERROR nova.virt.libvirt.guest     rv = meth(*args, **kwargs)
  2023-01-24 19:55:32.270 7 ERROR nova.virt.libvirt.guest   File "/usr/lib64/python3.6/site-packages/libvirt.py", line 1385, in createWithFlags
  2023-01-24 19:55:32.270 7 ERROR nova.virt.libvirt.guest     raise libvirtError('virDomainCreateWithFlags() failed')
  2023-01-24 19:55:32.270 7 ERROR nova.virt.libvirt.guest libvirt.libvirtError: Cannot set interface MAC/vlanid to fa:16:3e:43:1e:ce/2107 for ifname ens1f0 vf 7: Operation not supported
  2023-01-24 19:55:32.270 7 ERROR nova.virt.libvirt.guest
  2023-01-24 19:55:32.273 7 ERROR nova.virt.libvirt.driver [req-581cd9e8-11c8-44be-9ed2-a03a5f70d0f4 802a31d98b364da79be43fe6e9566d63 76f401abee7b4e80b7efd86f2f26e3ca - default default] [instance: d2091824-1f7a-4de1-8776-8f781956130a] Failed to start libvirt guest: libvirt.libvirtError: Cannot set interface MAC/vlanid to fa:16:3e:43:1e:ce/2107 for ifname ens1f0 vf 7: Operation not supported

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/2008238/+subscriptions



References