Skip to content

Delete xde device when create_port fails #1680

Closed

Description

@bnaecker

When we create OPTE ports, one step is to create an xde device. However, we only call delete_xde in the Drop implementation on the port objects. If the create_port function fails after having created the xde device, the xde data link will never be cleaned up.

We need to be sure to call delete_xde if create_port fails, before returning from the function.

Activity

  1. added
    networking
    Sled Agent
    on Sep 7, 2022
  2. self-assigned this
    on Sep 7, 2022
  3. bnaecker commented on Sep 8, 2022

    @bnaecker
    CollaboratorAuthor

    This is actually not an issue. The first fallible operation after creating the xde device is creating the guest VNIC over it. We call delete_xde if that fails here. After that, the next operation is updating the secondary MACs of the underlay NIC, done here. At that point, we've created an actual Port object here. If any of the following fallible operations actually do fail, the Drop implementation for that port object will ensure that we call delete_xde. So we do correctly call delete_xde if the PortManager::create_port function fails after it calls create_xde.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Sled Agentnetworking

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions