-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SriovNetworkNodeConfigPolicy priority inconsistent #194
Comments
@mskrocki Regarding the priority number, low number has high priority. For example, priority 30 > priority 40. There are two major steps for a policy to be applied on device:
Priority number takes effect only in the first step. |
@zshi-redhat thx for the quick reply. As it stands, if I have:
and
I end up with 2 VFs that have |
What is the generated sriovnetworknodestate.spec in the above example? If it's vfio-pci, then it is a bug. |
So for the above example resulting node state is:
|
I see, this is a bug, it shall generate something like:
@mskrocki would you mind proposing a fix for the issue? |
so the vfGroups is the main indicator, and that list should be ordered from highest to lowest priority (30, 40, 100) ? |
In the above case, the vfio-pci vfGroup with range 0-3 should not be listed in the sriovnetworknodestate, since the 0-1 devices are in the high priority group which shall not appear in the low priority group. 2-3 devices shouldn't exist given the numvfs is 2 in the high priority policy. |
Looking into it. To confirm https://github.com/k8snetworkplumbingwg/sriov-network-operator/blob/master/api/v1/helper.go#L272, we merge only when: |
I have looked at the code and how it handles policies for the same root PF. I understand that the policy priorities are suppose to resolve competing configurations, and merge them if priorities are same.
Thing is I am unable to determine what is the "higher" priority in this project?
With:
policy1
with p=30 andpolicy2
with p=40 which policy should overwrite which?As a context will note that the polices are sorted by the priority in decreasing order: 100, 40, 30 and this is how they are handled thru the rest of the life-cycle.
Having defined that, the issue is either in: https://github.com/k8snetworkplumbingwg/sriov-network-operator/blob/master/api/v1/helper.go#L264 where we select the last policy i.e. lower priority value (30 over 40) overwrites the final VFs number
or the issue is in https://github.com/k8snetworkplumbingwg/sriov-network-operator/blob/master/pkg/utils/utils.go#L263 where we first apply the config of the first VfGroup to the VFs (here its 40 over 30).
The text was updated successfully, but these errors were encountered: