yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #88443
[Bug 1962844] Re: [SR-IOV] QoS extension doesn't set max-tx-rate and min-tx-rate in the same port
Reviewed: https://review.opendev.org/c/openstack/neutron/+/831830
Committed: https://opendev.org/openstack/neutron/commit/cdff281f642511ea3d0e077dbe885ec955208a7a
Submitter: "Zuul (22348)"
Branch: master
commit cdff281f642511ea3d0e077dbe885ec955208a7a
Author: Rodolfo Alonso Hernandez <ralonsoh@xxxxxxxxxx>
Date: Thu Mar 3 02:57:07 2022 +0000
[SR-IOV] Fix QoS extension to set min/max values
"ip link" commands allow to define VF rates independently.
That means, first "rate" (max BW) can be set and in a second
command "min" (min BW) (check LP bug description).
However Pyroute2 command to set the VF rates requires to set both.
If one value is missing ("min_tx_rate", "max_tx_rate"), the library
sets this value to 0; in other words, the value is deleted.
The Pyroute2 structures are built depending on the parameter names.
In this case, {'vf': {'rate': ...}} will create a "vf_rate" [1]
nla structure, that requires "min_tx_rate" and "max_tx_rate".
This is part of the full structure passed to the "iproute" library
[2].
This is an example of code that only sets the "max_tx_rate" for
the 15th VF of "enp196s0f0":
$ from neutron.plugins.ml2.drivers.mech_sriov.agent import pci_lib
pci = pci_lib.PciDeviceIPWrapper("enp196s0f0")
pci.set_vf_rate(15, {'max_tx_rate': 10})
The "msg" [3] (structure passed to "iproute" library) is this:
https://paste.opendev.org/show/b2FZBOebGOCHMrYhPr6X/. The
"min_tx_rate" is set to the default value 0.
This patch reads first the existing rates ("min_tx_rate",
"max_tx_rate") and populates the command parameters accordingly.
[1]https://github.com/svinota/pyroute2/blob/a9564dff8e53659f761d71bbee0dd68dd0db6ce8/pyroute2.core/pr2modules/netlink/rtnl/ifinfmsg/__init__.py#L712-L717
[2]https://github.com/shemminger/iproute2/blob/c8d9d92544668922dc5aa06d2491f42b837b9361/ip/ipaddress.c#L454-L470
[3]https://github.com/svinota/pyroute2/blob/a9564dff8e53659f761d71bbee0dd68dd0db6ce8/pyroute2.core/pr2modules/iproute/linux.py#L1499
Closes-Bug: #1962844
Change-Id: Ibbb6d938355440c42850812e368224b76b1fce19
** Changed in: neutron
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1962844
Title:
[SR-IOV] QoS extension doesn't set max-tx-rate and min-tx-rate in the
same port
Status in neutron:
Fix Released
Bug description:
The SR-IOV agent extension can handle max-BW and min-BW QoS rules, but
currently doesn't apply both to the same port at the same time.
The problem is how the Pyroute2 command is used. The "ip link" command allows to set "rate" and "min" rules in two independent commands. E.g.:
$ ip link set dev enp196s0f0 vf 5 rate 30
$ ip l show dev enp196s0f0
vf 5 link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff, tx rate 30 (Mbps), max_tx_rate 30Mbps
$ ip link set dev enp196s0f0 vf 5 min 20
$ ip l show dev enp196s0f0
vf 5 link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff, tx rate 30 (Mbps), max_tx_rate 30Mbps, min_tx_rate 20Mbps
The second command setting the min-BW rate doesn't remove the max-BW
rate.
However, the Pyroute2 command to set the VF rates requires to set both.
> ip.link('set', 'enp196s0f0', index=idx, {'max_tx_rate': 100, 'min_tx_rate': 20})
If one key is missing, the value will be set to zero (the QoS rule will be removed). E.g.:
> ip.link('set', 'enp196s0f0', index=idx, {'max_tx_rate': 100}) --> this command will set a max-BW of 100Mbps and will remove any min-BW rule already defined.
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1962844/+subscriptions
References