antrea icon indicating copy to clipboard operation
antrea copied to clipboard

Rename VF name back to the original when Pod deleted

Open luolanzone opened this issue 7 months ago • 41 comments

For #7128

luolanzone avatar Apr 29 '25 08:04 luolanzone

/test-all

luolanzone avatar May 15 '25 08:05 luolanzone

/test-all-features-conformance

luolanzone avatar May 15 '25 12:05 luolanzone

/test-all

luolanzone avatar May 19 '25 02:05 luolanzone

Hi @antoninbas @jianjuns why I am adding a temporary interface suffix '~~' is for multiple SR-IOV nics in a Pod. Here is an issue I observed when I did the PoC:

E.g. two VF named 'eth1', 'eth2' in a K8s Node, when the users used two annotations to get two SR-IOV VFs for a Pod, the VF 'eth2' might be selected as the first annotation NAD, and being renamed to an interface with a default interface name 'eth1' in the Pod, then later, when the VF 'eth1' is moved to the Pod, it will conflict with existing 'eth1' in the Pod.

This issue is also tracked as the issue 3 in #7128.

A similar case may also happen when the VFs names are like 'ens64', 'ens65' but users also specify the interfaces name as 'ens64', 'ens65' in the NAD annotation. Let me know if we want to document this or have some improvement in codes.

luolanzone avatar May 20 '25 02:05 luolanzone

@luolanzone did you check the host-device plugin implementation? Looks like they solve a similar problem and that there were potentially issues with interface renaming: https://github.com/containernetworking/plugins/blob/d0d20a9e2203ba462e6d8251072ff54595b3b469/plugins/main/host-device/host-device.go#L245-L247

antoninbas avatar May 20 '25 04:05 antoninbas

Hi @antoninbas I didn't go through the whole logic in host-device. Let me double check, we may use the same way to handle the rename issue. Thanks to point out.

luolanzone avatar May 20 '25 08:05 luolanzone

Hi @antoninbas @jianjuns could you take a look again? Thanks.

luolanzone avatar May 22 '25 09:05 luolanzone

@antoninbas I am checking how to add the e2e tests, will update the codes later when it's ready.

luolanzone avatar May 22 '25 09:05 luolanzone

/test-sriov-secondary-network-e2e

luolanzone avatar May 22 '25 09:05 luolanzone

Hi @jianjuns @antoninbas @tnqn , I have verified the codes in a SRIOV testbed with two VF devices assigned in the Pod. The manual verification passed, but I still need sometime to update the unit tests, could you help to review the feature codes first? Thanks!

luolanzone avatar May 27 '25 10:05 luolanzone

cc @wenqiq

luolanzone avatar May 27 '25 10:05 luolanzone

/test-sriov-secondary-network-e2e

luolanzone avatar May 28 '25 10:05 luolanzone

/test-sriov-secondary-network-e2e

wenqiq avatar May 29 '25 01:05 wenqiq

/test-sriov-secondary-network-e2e

XinShuYang avatar May 29 '25 02:05 XinShuYang

Will do a rebase after https://github.com/antrea-io/antrea/pull/7199 is merged.

luolanzone avatar May 29 '25 02:05 luolanzone

unit test failed due to a multicast case, @wenyingd is checking the bug.

luolanzone avatar May 29 '25 08:05 luolanzone

/test-all

luolanzone avatar Jun 03 '25 06:06 luolanzone

Re-base is done on top of https://github.com/antrea-io/antrea/pull/7199

luolanzone avatar Jun 05 '25 07:06 luolanzone

/test-sriov-secondary-network-e2e

luolanzone avatar Jun 09 '25 06:06 luolanzone

/test-sriov-secondary-network-e2e

luolanzone avatar Jun 09 '25 07:06 luolanzone

/test-sriov-secondary-network-e2e

luolanzone avatar Jun 09 '25 08:06 luolanzone

/test-all

luolanzone avatar Jun 09 '25 08:06 luolanzone

Re-based and added e2e.

luolanzone avatar Jun 09 '25 09:06 luolanzone

/test-sriov-secondary-network-e2e

luolanzone avatar Jun 09 '25 09:06 luolanzone

/test-all

luolanzone avatar Jun 09 '25 09:06 luolanzone

/test-sriov-secondary-network-e2e

luolanzone avatar Jun 10 '25 06:06 luolanzone

/test-sriov-secondary-network-e2e

luolanzone avatar Jun 12 '25 03:06 luolanzone

@antoninbas @tnqn would you take a look as well? Thanks.

luolanzone avatar Jun 12 '25 03:06 luolanzone

Re-based and resolved conflicts.

/test-sriov-secondary-network-e2e /test-all

luolanzone avatar Jun 12 '25 08:06 luolanzone

/test-sriov-secondary-network-e2e /test-all

luolanzone avatar Jun 19 '25 13:06 luolanzone