Skip to content
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

Fix checks for vlan parameters #281

Conversation

mlguerrero12
Copy link
Contributor

@mlguerrero12 mlguerrero12 commented Oct 5, 2023

  • Add check to not allow non default values of qos and proto when vlan is zero.
  • Remove check when vlan is zero and qos and proto are not in config since default values are now set.

@mlguerrero12 mlguerrero12 force-pushed the removevlanqosprotocheck branch 2 times, most recently from bcb1e33 to f8813b8 Compare October 5, 2023 12:57
@mlguerrero12 mlguerrero12 marked this pull request as draft October 5, 2023 13:00
@mlguerrero12 mlguerrero12 changed the title Remove check of vlan QoS and Proto for VID 0 Fix checks for vlan parameters Oct 5, 2023
@mlguerrero12 mlguerrero12 marked this pull request as ready for review October 5, 2023 13:21
@mlguerrero12
Copy link
Contributor Author

@adrianchiris, @SchSeba, @zeeke, could you please review this? The sriov network operator sets vlan and vlanQoS equal to zero by default which is a valid config. I'm removing the check that prevents that and adding back a check that I omitted in my last PR.

Copy link
Member

@zeeke zeeke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adrianchiris
Copy link
Contributor

adrianchiris commented Oct 5, 2023

while at it, what about vlan proto == 802.1ad and vlan==0 ?

@mlguerrero12
Copy link
Contributor Author

mlguerrero12 commented Oct 5, 2023

nothing happens, it is ignored when vlan is set to 0 (checked with ice and mlx5 drivers). Problem with qos was that in mlx5, the qos was set even if vlan is zero (didn't happen with ice, there it is simply ignored).

Is this really a problem?
vf 0 link/ether 76:c9:0e:3f:be:95 brd ff:ff:ff:ff:ff:ff, qos 6, spoof checking off, link-state auto, trust on, query_rss off

It's a valid config. It doesn't return an error.

@adrianchiris
Copy link
Contributor

nothing happens, it is ignored when vlan is set to 0 (checked with ice and mlx5 drivers).

so its invalid ? maybe we want to block it in cni ? currently 802.1ad and vlan=0 is allowed and as you say will work and be ignored.

@mlguerrero12
Copy link
Contributor Author

It's a valid config. The driver doesn't return an error. If it was invalid, then the driver should be the one returning the error I think.

Same with the qos for mlx5 (as mentioned in the previous comment), if it was invalid as we are claiming, why would the driver allow it?

My point is, why do we want to introduce an extra layer here in the cni and what is the criteria to classify something as invalid?

@mlguerrero12
Copy link
Contributor Author

Just to clarify, the drivers for all cases effectively set the vlan to 0. With ignore I mean the other parameters, i.e. if the qos is set to 5 and vlan to 0, the ice driver sets vlan 0 and qos 0, whereas the mlx5 sets vlan 0 and qos 5.

@mlguerrero12
Copy link
Contributor Author

I also wonder, the fact that mlx5 allows to set vlan 0 and qos 5, doesn't it mean that it supports the vlan 0 priority tag support? When a device needs to send priority-tagged packets but it doesn't know in which vlan resides.

Copy link
Collaborator

@SchSeba SchSeba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mlguerrero12
Copy link
Contributor Author

To speed up the merge since ci is broken due to this, I will restrict the default values of qos and proto to their defaults when vlan is zero. We can discuss what I mentioned above in a following PR.

- Add check to not allow non default values of qos and proto
  when vlan is zero.
- Remove check when vlan is zero and qos and proto are not in
  config since default values are now set.

Signed-off-by: Marcelo Guerrero <[email protected]>
@adrianchiris
Copy link
Contributor

+1 for restricting this for now until there is a use-case for it.

its not the first time we see different behavior between drivers around VF configuration such as this.

@adrianchiris adrianchiris merged commit a953d5b into k8snetworkplumbingwg:master Oct 8, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants