commit 98fe52e15eb7c05ff3337e6235435ffc9e1be4d7
Author: Rodolfo Alonso Hernandez <email address hidden>
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})
Reviewed: https:/ /review. opendev. org/c/openstack /neutron/ +/832765 /opendev. org/openstack/ neutron/ commit/ 98fe52e15eb7c05 ff3337e6235435f fc9e1be4d7
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/ussuri
commit 98fe52e15eb7c05 ff3337e6235435f fc9e1be4d7
Author: Rodolfo Alonso Hernandez <email address hidden>
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 plugins. ml2.drivers. mech_sriov. agent import pci_lib PciDeviceIPWrap per("enp196s0f0 ")
pci.set_ vf_rate( 15, {'max_tx_rate': 10})
the 15th VF of "enp196s0f0":
$ from neutron.
pci = pci_lib.
The "msg" [3] (structure passed to "iproute" library) is this: /paste. opendev. org/show/ b2FZBOebGOCHMrY hPr6X/. The
https:/
"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/a9564dff8e 53659f761d71bbe e0dd68dd0db6ce8 /pyroute2. core/pr2modules /netlink/ rtnl/ifinfmsg/ __init_ _.py#L712- L717 /github. com/shemminger/ iproute2/ blob/c8d9d92544 668922dc5aa06d2 491f42b837b9361 /ip/ipaddress. c#L454- L470 /github. com/svinota/ pyroute2/ blob/a9564dff8e 53659f761d71bbe e0dd68dd0db6ce8 /pyroute2. core/pr2modules /iproute/ linux.py# L1499
[2]https:/
[3]https:/
Conflicts:
neutron/ tests/unit/ plugins/ ml2/drivers/ mech_sriov/ agent/test_ eswitch_ manager. py
Closes-Bug: #1962844 c42850812e36822 4b76b1fce19 a3d0e077dbe885e c955208a7a) 8153385bb52dea7 be713c4184)
Change-Id: Ibbb6d938355440
(cherry picked from commit cdff281f642511e
(cherry picked from commit 1cadfc84a565075