The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/8164
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === Apparently the bnx2x devices don't allow this. Fixes #8162 Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
From f41c8ef7f40497e2ccdbcc8b8e1e8a8e7964dc56 Mon Sep 17 00:00:00 2001 From: Thomas Parrott <thomas.parr...@canonical.com> Date: Tue, 17 Nov 2020 16:50:34 +0000 Subject: [PATCH] lxd/device/nic/sriov: Don't fail when resetting VF MAC to 00:00:00:00:00:00 Apparently the bnx2x devices don't allow this. Fixes #8162 Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com> --- lxd/device/nic_sriov.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lxd/device/nic_sriov.go b/lxd/device/nic_sriov.go index fe358a3252..5e7a447401 100644 --- a/lxd/device/nic_sriov.go +++ b/lxd/device/nic_sriov.go @@ -461,11 +461,9 @@ func (d *nicSRIOV) setupSriovParent(vfDevice string, vfID int, volatile map[stri return vfPCIDev, err } } else { - // Reset VF to ensure no previous MAC restriction exists. - _, err := shared.TryRunCommand("ip", "link", "set", "dev", d.config["parent"], "vf", volatile["last_state.vf.id"], "mac", "00:00:00:00:00:00") - if err != nil { - return vfPCIDev, err - } + // Try to reset VF to ensure no previous MAC restriction exists, as some devices require this + // before being able to set a new VF MAC. However some devices don't allow it so ignore failures. + shared.TryRunCommand("ip", "link", "set", "dev", d.config["parent"], "vf", volatile["last_state.vf.id"], "mac", "00:00:00:00:00:00") // Ensure spoof checking is disabled if not enabled in instance. _, err = shared.TryRunCommand("ip", "link", "set", "dev", d.config["parent"], "vf", volatile["last_state.vf.id"], "spoofchk", "off")
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel