VF rate limiting can be configured with invalid values

Bug #1971575 reported by Antonio Augusto Vilas Boas Teixeira
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
Antonio Augusto Vilas Boas Teixeira

Bug Description

Brief Description
-----------------
When configuring 'max-tx-rate' for a SR-IOV interface values exceeding the NIC's supported speed can be set if the port is not cabled.

Severity
--------
Minor: System/Feature is usable with minor issue

Steps to Reproduce
------------------
Set an interface to pci-sriov class (interface shouldn't be cabled, thus having no defined speed):

$ system host-if-modify controller-0 ens801f1 -c pci-sriov -N 8

Create an interface using some of the VFs of the previously modified interface:

$ system host-if-add -c pci-sriov controller-0 virtif vf ens801f1 --num-vfs 2 --vf-driver=netdevice

Try to set 'max-tx-rate' to some unsupported value, e.g. for a 25Gbps NIC:

$ system host-if-modify controller-0 virtif --max-tx-rate=25001

The system allows this value to be set:

+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| ifname | virtif |
| iftype | vf |
| ports | [] |
| imac | 3c:fd:fe:d1:64:48 |
| imtu | 1500 |
| ifclass | pci-sriov |
| ptp_role | none |
| aemode | None |
| schedpolicy | None |
| txhashpolicy | None |
| primary_reselect | None |
| uuid | 070a7d26-e77b-4033-ab0d-d4ec73eb7f6a |
| ihost_uuid | 93ee7544-8649-4d6b-a726-5c5e0b7051aa |
| vlan_id | None |
| uses | [u'ens801f1'] |
| used_by | [] |
| created_at | |
| updated_at | |
| sriov_numvfs | 2 |
| sriov_vf_driver | netdevice |
| max_tx_rate | 25001 |
| accelerated | [True] |
+------------------+--------------------------------------+

Expected Behavior
------------------
The system should refuse to set a tx rate greater than what the port supports.

Actual Behavior
----------------
System allows any value to be configured.

Reproducibility
---------------
Always reproducible

System Configuration
--------------------
AIO-SX, but should apply to any configuration

Branch/Pull Time/Commit
-----------------------
Master Centos cengn build as of 20-Apr-2022 04:45

Last Pass
---------
N/A

Timestamp/Logs
--------------
N/A

Test Activity
-------------
Developer testing

Workaround
----------
N/A

Changed in starlingx:
assignee: nobody → Antonio Augusto Vilas Boas Teixeira (aaugusto-wndrvr)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to config (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/config/+/840452

Changed in starlingx:
status: New → In Progress
Ghada Khalil (gkhalil)
tags: added: stx.networking
Changed in starlingx:
importance: Undecided → Low
tags: added: stx.7.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to config (master)

Reviewed: https://review.opendev.org/c/starlingx/config/+/840452
Committed: https://opendev.org/starlingx/config/commit/1864bea8e0777541ac27fbc5ac41685459dbb8d2
Submitter: "Zuul (22348)"
Branch: master

commit 1864bea8e0777541ac27fbc5ac41685459dbb8d2
Author: Antonio Augusto Vilas Boas Teixeira <email address hidden>
Date: Wed May 4 08:58:38 2022 -0400

    Prevent invalid configuration of max VF tx rate

    If a port has its detected speed as None (e.g. port is not cabled), when
    configuring the 'max-tx-rate' of an interface which uses this port any
    value can be set, even one exceeding the NIC's supported speed.

    This change adds an error message in this scenario, preventing the
    configuration of the tx rate parameter when the port speed is unknown.

    Closes-Bug: 1971575

    Signed-off-by: Antonio Augusto Vilas Boas Teixeira
    <email address hidden>
    Change-Id: I271656df1bac03f9a8f714f876baf1c742748b31

Changed in starlingx:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.