Commit Graph

53 Commits

Author SHA1 Message Date
Rodolfo Alonso Hernandez 3ebdfe612a Support for minimum bandwidth rules in tunnelled networks
This patch adds support for QoS minimum bandwidth rules in tunnelled
networks. Now the ML2/OVS and ML2/OVN mechanism drivers can represent
in the Placement API the available bandwidth of the tunnelled networks
in each compute host.

Both mechanism drivers represent the compute VTEP (VXLAN) or TEP
(Geneve) interface as an IP address. This new resource provider
(by default called "rp_tunnelled") represents the available bandwidth
of this interface. Any new port created in a compute node that belongs
to a tunnelled network, will request to the Placement API the
corresponding bandwidth from the resource provider inventory.

This patch does not provide backend enforcement support for minimum
bandwidth rules.

RFE spec: https://review.opendev.org/c/openstack/neutron-specs/+/860859

What is missing and will be added in next patches:
* Tempest tests, that will be pushed to the corresponding repository.

Depends-On: https://review.opendev.org/c/openstack/neutron-tempest-plugin/+/863880

Partial-Bug: #1991965
Related-Bug: #1578989
Change-Id: I3bfc2c0f9566bcc6861ca91339e32257ea92c7e9
2023-01-02 11:14:50 +00:00
LIU Yulong 5765186516 Support pps limitation for openvswitch agent
Add packet rate limit rule to the openvswitch QoS
driver SUPPORTED_RULES list. This patch adds the
ability to limit neutron port packet I/O rate. We
will leverage the ovs meter to achieve the limitation.

The meter action is only supoorted when datapath is
in user mode (with ovs >= 2.7) or ovs kernel datapath with
kernel version >= 4.15 (and ovs >= 2.10).

[1] https://docs.openvswitch.org/en/latest/faq/releases/

Partially-Implements: bp/packet-rate-limit
Related-Bug: #1938966
Related-Bug: #1912460
Change-Id: Ib6341ad539afc9f94f1783a721cf5f793ccdc7d8
2022-05-07 13:11:46 +08:00
Rodolfo Alonso Hernandez 2f944d3105 Support filtering for QoS rule type list
Added support for filtering the QoS rule type list command.
Two new filter flags are added:
- all_supported: if True, the listing call will print all QoS rule
  types supported by at least one loaded mechanism driver.
- all_rules: if True, the listing call will print all QoS rule types
  supported by the Neutron server.

Both filter flags are exclusive and not required.

Depends-On: https://review.opendev.org/c/openstack/neutron-lib/+/827533

Closes-Bug: #1959749
Change-Id: I41eaab177e121316c3daec34b309c266e2f81979
2022-02-24 08:28:53 +00:00
Zuul 32e9aae234 Merge "Do not block qos for direct-physical ports" 2022-01-11 17:34:01 +00:00
Balazs Gibizer abfbe5d54d Do not block qos for direct-physical ports
Today the sriov qos service plugin blindly blocks creating ports
with minimum bandwidth qos and with direct_physical vnic_type. This was
originally added when only dataplane enforcement was the scope of the
qos service plugin. However in the last many releases we created
placement enforcement for this qos rule regardless of the vnic_type.
So now blindly blocking the port creation is now preventing using the
placement enforcement for this rule for direct_physical ports.

This patch removes this limitation by marking minimum bandwidth as
supported rule for the sriov qos service plugin. The limitation that
data plane enforcement is not supported for this rule remains. The agent
will not even try to apply any kind of rules to these ports as port
binding is not forwarded for the sriov agent at all.

The documentation is extended to explain that placement enforcement now
works while data plane enforcement still not supported.

This is somewhat similar to the case when the support for egress
direction is added to the minimum bandwidth rule, while the sriov data
plane enforcement was not (could not) been implemented for this
direction in the sriov agent. Today the sriov agent simply ignores the
egress direction rules in the minimum bandwidth qos rule during applying
the data plane enforcement.

Closes-Bug: #1949877

Change-Id: I20ad32eac414ff90b551bff940d92cbcfa848101
2021-12-10 12:28:59 +01:00
Zuul 89a63261ce Merge "[OVN][Placement] Add support for minimum bandwidth QoS rules" 2021-11-22 16:31:44 +00:00
Rodolfo Alonso Hernandez 4909c8c18d Bump neutron-lib to 2.17.0
Remove the QoS constants from Neutron code. QoS constants are now
located in ``neutron_lib.services.qos.constants``.

This patch also reverts [1]. This patch was merged in order to
allow a newer neutron-lib release in "requirements". This test
was failing because the element order of the "VALID_RULE_TYPES"
list was different between Neutron and neutron-lib. That was
modifying the "QosRuleType" OVO hash.

[1]https://review.opendev.org/c/openstack/neutron/+/817940

Closes-Bug: #1950977
Related-Bug: #1922237
Change-Id: I31edea3cc0f4a284a773a35302997ca6069efc95
2021-11-17 10:09:14 +00:00
Rodolfo Alonso Hernandez 1248b36ddc [OVN][Placement] Add support for minimum bandwidth QoS rules
In order to be able to schedule a port bound to OVN backend and a
minimum bandwidth rule, this type of QoS rule should be supported
in the mechanism QoS driver ``OVNQosDriver``.

This new QoS rule has no driver enforcement; it is used only for
Placement scheduling.

Partial-Bug: #1578989

Change-Id: Ia10aae1820f13bb28956d9ef45eced2dba71be98
2021-11-08 18:17:11 +00:00
Przemyslaw Szczerbik aada855f6d Enable QoS minimum packet rate rule for OVS backend
This patch does *not* implement dataplane enforcement.

QoS minimum packet rate rule is enabled in OVS backend driver and
create/delete/update empty methods are added to enable placement
enforcement.

Partial-Bug: #1922237
See-Also: https://review.opendev.org/785236
Change-Id: Ie283ad3a4ec433c88ac23f798908cd143159394b
2021-10-21 15:17:24 +02:00
LIU Yulong 8e30639452 [QoS] Add rule type packet per second (pps)
This patch adds new API extension to QoS service plugin
to allow CURD actions for packet rate limit (packet per
second) rule in Neutron server side.

NOTE: This patch will NOT implement the real functionality
in L2/L3 backend to limit the pps.

Co-Authored-By:  NANALI <lin203@chinaunicom.cn>

Closes-bug: #1912460
Change-Id: Icc88accb88d9cec40c960c56f032c3c27317b42e
2021-07-22 09:53:38 +08:00
Nurmatov Mamatisa 26f3de0f78 Add minimum bw qos rule validation for network
Minimum bandwidth QoS rule is only applicable for the network which is
backed by physical networks.
It will raise exception when you want to set Minimum bandwidth QoS rule
or update rule on network without ports.

Closes-Bug: #1913180
Change-Id: I6ab945086b13730ad60957760bbc2eb5c321aca2
2021-02-19 11:26:40 +03:00
Bernard Cafarelli cebdd77af8
Bump pylint version to support python 3.8
As spotted in Focal testing patch [0], pep8 test fails with many
C0321 false-positives, reported in pylint as current version does not
support python 3.8 [1]

Use a newer version of pylint and astroid, fixing or disabling some of
the new checks: no-else-*, unnecessary-comprehension, import-outside-toplevel

[0] https://review.opendev.org/#/c/738163/
[1] https://github.com/PyCQA/pylint/issues/2737

Change-Id: Ie646b7093aa8634fd950c136a0eba9adcf56591c
2020-08-06 16:00:30 +02:00
Rodolfo Alonso Hernandez b098239d72 Refactor OVN client QoS extension
The QoS OVN client extension is moved to the ML2 driver. This
extension is called from the OVN driver in the events of:
- create port
- update port
- delete port
- update network

The QoS OVN client extension now can accept several rules per policy
as documented in the SUPPORTED_RULES. The QoS OVN client extension
can write one OVN QoS rule per flow direction and each OVN QoS rule
register can hold both a bandwidth limit rule and a DSCP marking rule.

The "update_policy" method is called from the OVN QoS driver, when
a QoS policy or its rules are updated.

The QoS OVN client extension updates the QoS OVN registers
exclusively, based on the related events.

Closes-Bug: #1863852

Change-Id: I4833ed0c9a2741bdd007d4ebb3e8c1cb4c30d4c7
2020-04-10 13:11:00 +00:00
Bence Romsics 321afc8f89 Move rejection of min-bw rule on non-physnet port to the ovs qos driver
The ovs qos driver only supports the min-bw rule on physnet ports.
However other (future) qos drivers may support the min-bw rule on
non-physnet ports too, therefore implementing the rejection of the
unsupported combination in the qos plugin was a bug.

This change moves the rejection from the qos plugin to the ovs qos
driver.

Change-Id: I02d77a03c411dc8ab303a7d7b53d7ea93cc9f4c6
Closes-Bug: #1861442
Depends-On: https://review.opendev.org/705694
Related-Bug: #1819029
2020-02-21 15:00:23 +01:00
Rodolfo Alonso Hernandez d8349033e9 Enforce "qos_max_rate" and "qos_burst" in OVN QoS options
If QoS rule is QosBandwidthLimitRule, then the generated options in
the QoS OVN driver of the QoS service should contain those two
parameters: "qos_max_rate" and "qos_burst".

According to [1], the units used are:
- qos_max_rate: kbps, the one used in Neutron
- qos_burst: kilobits, the one used in Neutron

A "rule.max_kbps" value should be always present in the rule, but not
"rule.max_burst_kbps". This value can be None in
OvnNbApiIdlImpl.QoSAddCommand.

[1]http://www.openvswitch.org/support/dist-docs/ovn-nbctl.8.html

Change-Id: Ie1598be7d21f33df6b1a66fa71ba6783d2433dca
Closes-Bug: #1861680
2020-02-11 11:45:51 +00:00
Yunxiang Tao dcec852b7f [OVN] Update QoS related code from networking-ovn
In terms of [1], patch [0] has import the lasted code of ovn_client.py, but not
"/networking_ovn/ml2/qos_driver.py", so this patch will update it.

[0] https://review.opendev.org/#/c/697316/
[1] https://review.opendev.org/#/c/692084/

Change-Id: Iefff6cdf070d234c4ea9c8e1d5fdfe4542eb7fa3
Closes-Bug: #1813551
2020-02-06 10:54:26 +08:00
waleed mousa 12089a526e Add support for direct ports with QoS in OVS
Today OVS mechanism driver can bind Direct port see [1] for OVS hardware
offloads.
OVS was extended with tc-offload to support rate limit see [2].
The OVS QoS driver [3] is limited to work only with Normal Ports, so we
can't put QoS rules on direct port.
This patch proposes to add support in OVS QoS driver for direct ports.
The mechanism to enforce such policies is the same with normal and
hardware offloaded direct ports.

[1] - e7f6ba220e
[2] - 3b074128ca/neutron/plugins/ml2/drivers/openvswitch/mech_driver/mech_openvswitch.py (L83)
[3] - 3b074128ca/neutron/services/qos/drivers/openvswitch/driver.py (L56)

Change-Id: I24b5cd6c022e479080fc84e4c445c9cddfc88e38
Closes-Bug: #1843165
2020-01-16 11:50:02 +00:00
Maciej Józefczyk be1bdd4342 [OVN] Import OVN Client, L3 and QoS related code
This patch moves the OVN Client, L3 and QoS related code:
Previous paths in networking-ovn tree:
./networking_ovn/ml2/qos_driver.py -> neutron/services/qos/drivers/ovn/qos_driver.py
./networking_ovn/common/ovn_client.py -> neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py
./networking_ovn/l3/l3_ovn_scheduler.py -> neutron/scheduler/l3_ovn_scheduler.py
./networking_ovn/l3/l3_ovn.py -> neutron/services/ovn_l3/plugin.py

Co-Authored-By: Amitabha Biswas <abiswas@us.ibm.com>
Co-Authored-By: Andrew Austin <aaustin@redhat.com>
Co-Authored-By: Anh Tran <anhtt@vn.fujitsu.com>
Co-Authored-By: Armando Migliaccio <armamig@gmail.com>
Co-Authored-By: Arslan Qadeer <arslanq@xgrid.co>
Co-Authored-By: Boden R <bodenvmw@gmail.com>
Co-Authored-By: Brian Haley <bhaley@redhat.com>
Co-Authored-By: Cao Xuan Hoang <hoangcx@vn.fujitsu.com>
Co-Authored-By: Chandra S Vejendla <csvejend@us.ibm.com>
Co-Authored-By: Changxun Zhou <zhoucx@dtdream.com>
Co-Authored-By: Daniel Alvarez <dalvarez@redhat.com>
Co-Authored-By: Dong Jun <dongj@dtdream.com>
Co-Authored-By: Doug Hellmann <doug@doughellmann.com>
Co-Authored-By: Gary Kotton <gkotton@vmware.com>
Co-Authored-By: Guoshuai Li <ligs@dtdream.com>
Co-Authored-By: Han Zhou <zhouhan@gmail.com>
Co-Authored-By: Ihar Hrachyshka <ihrachys@redhat.com>
Co-Authored-By: Jakub Libosvar <libosvar@redhat.com>
Co-Authored-By: John Kasperski <jckasper@us.ibm.com>
Co-Authored-By: Kamil Sambor <ksambor@redhat.com>
Co-Authored-By: Kevin Benton <kevin@benton.pub>
Co-Authored-By: Kyle Mestery <mestery@mestery.com>
Co-Authored-By: LIU Yulong <liuyulong@le.com>
Co-Authored-By: Lucas Alvares Gomes <lucasagomes@gmail.com>
Co-Authored-By: Maciej Józefczyk <mjozefcz@redhat.com>
Co-Authored-By: Miguel Angel Ajo <majopela@redhat.com>
Co-Authored-By: Na <nazhu@cn.ibm.com>
Co-Authored-By: Numan Siddique <nusiddiq@redhat.com>
Co-Authored-By: Richard Theis <rtheis@us.ibm.com>
Co-Authored-By: Russell Bryant <rbryant@redhat.com>
Co-Authored-By: Sławek Kapłoński <slawek@kaplonski.pl>
Co-Authored-By: Terry Wilson <twilson@redhat.com>
Co-Authored-By: Yunxiang Tao <taoyunxiang@cmss.chinamobile.com>
Co-Authored-By: lzklibj <lzklibj@cn.ibm.com>
Co-Authored-By: melissaml <ma.lei@99cloud.net>
Co-Authored-By: reedip <rbanerje@redhat.com>
Co-Authored-By: venkata anil <anilvenkata@redhat.com>
Co-Authored-By: xurong00037997 <xu.rong@zte.com.cn>
Co-Authored-By: zhufl <zhu.fanglei@zte.com.cn>

Change-Id: I52bc2785d815b3f04efbda3b78a28861ca9e8fe1
Related-Blueprint: neutron-ovn-merge
2019-12-14 19:17:40 +00:00
Boden R 9bbe9911c4 remove neutron.common.constants
All of the externally consumed variables from neutron.common.constants
now live in neutron-lib. This patch removes neutron.common.constants
and switches all uses over to lib.

NeutronLibImpact

Depends-On: https://review.openstack.org/#/c/647836/
Change-Id: I3c2f28ecd18996a1cee1ae3af399166defe9da87
2019-04-04 14:10:26 -06:00
Boden R 68fd13af40 remove neutron.common.exceptions
Today the neutron common exceptions already live in neutron-lib and are
shimmed from neutron. This patch removes the neutron.common.exceptions
module and changes neutron's imports over to use their respective
neutron-lib exception module instead.

NeutronLibImpact

Change-Id: I9704f20eb21da85d2cf024d83338b3d94593671e
2019-02-01 14:35:00 -07:00
Lajos Katona 4df02ee93c Enable ingress direction for min_bw rule
Enable QoS minimum-bandwidth rule for ovs and sriov backends for both
ingress and egress directions.
Add qos-bw-limit-direction as supported extension to qos-plugin, and
add create/delete/update_minimum_bandwidth and
delete_minimum_bandwidth_ingress empty methods to sriov/ovs/linuxbridge
extension drivers.

Change-Id: I6eb21ccf0400ea9adae90ff0bf97e08cdb09b8eb
Depends-On: https://review.openstack.org/609368
Partial-Bug: #1578989
See-Also: https://review.openstack.org/502306 (nova spec)
See-Also: https://review.openstack.org/508149 (neutron spec)
2018-10-17 09:27:18 +02:00
Boden R d7942945c9 use get_port_binding_by_status_and_host from lib
The get_port_binding_by_status_and_host function was rehomed into
neutron-lib with https://review.openstack.org/#/c/580786/ and released
in neutron-lib 1.18.0. This patch consumes the function by removing it
in neutron and replacing all uses with lib's version.

NeutronLibImpact

Change-Id: Iac3246d0eb59709749e0b7e857091447d11a0133
2018-07-30 07:10:23 -06:00
Miguel Lavalle 03db94ebaa Pluralize binding relationship in Port
As a consequence of implementing multiple bindings for ports, [1] made
the following attributes lists:

- 'port_binding' in the in the SQLAlchemy Port model
- 'binding' in the Port OVO

This patch pluralizes their names to 'port_bindings' and 'bindings'
respectively

[1] Ie31d4e27e3f55edfe334c4029ca9ed685e684c39

Change-Id: I4ebe47cf9d51a700310aad8dcccc82fea3f00a16
2018-07-13 19:37:36 -05:00
Jakub Libosvar f7b62a7f29 Multiple port binding for ML2
Functionality is added to the ML2 plugin to handle multiple port
bindings

Co-Authored-By: Anindita Das <anindita.das@intel.com>
Co-Authored-By: Miguel Lavalle <miguel.lavalle@huawei.com>

Partial-Bug: #1580880

Change-Id: Ie31d4e27e3f55edfe334c4029ca9ed685e684c39
2018-07-13 18:14:50 -05:00
Boden R 1b8664f8e1 use qos constants from neutron-lib
neutron-lib contains the QoS constants. This patch removes them from
neutron and replaces all such uses to lib's QoS constants.

NeutronLibImpact

Change-Id: I6ed379b178a2b79fd14385a1d1e87d87eb04bfb9
2017-10-26 19:57:19 +00:00
Boden R 0822b0aef4 consume common constants from lib
The neutron-lib commit I360545b6ee4291547e0c5c8e668ad03d3efa4725 moved
the externally consumed globals from neutron.common.constants into lib.
With the exception of PROVISIONAL_IPV6_PD_PREFIX all other constants
in neutron.common.constants should only be used in neutron, and will
hopefully remain that way. External consumers needing access to other
common constants should move them into lib first.

NeutronLibImpact

Change-Id: Ie4bcffccf626a6e1de84af01f3487feb825f8b65
2017-10-13 11:45:18 -06:00
Boden R 40866acd02 use new payload objects for *_INIT callbacks
Part of the work we did while rehoming the callback modules introduced
the notion of payload objects [1] to replace the unstructured kwargs
used today. When using payloads event sources need to use publish()
rather than notify() to trigger the callback(s) and pass along a payload
object (if needed).

This patch begins to move us onto the payload objects by updating
BEFORE_INIT and AFTER_INIT event types to use the payloads.

NB: This change needs to be in sync with consumers using the events
herein. Once publish() is used with payloads, callback functions must
also define the payload kwarg to follow suit. Therefore such consumers
need to depend on this patch.

NeutronLibImpact

[1] https://docs.openstack.org/neutron-lib/latest/contributor/callbacks.html#event-payloads

Change-Id: I9194c7857f10392149159071cda8e080e93adc10
2017-10-09 08:38:40 -06:00
Boden R d37e974e46 use qos DriverBase from neutron-lib
neutron-lib contains the QoS DriverBase class. This patch removes
DriverBase and its associated UTs from neutron and uses them from
neutron-lib.

This patch also switches test_ovs_bridge to use mock.patch.object rather
than mock.patch as py27 was incurring sporadic failures running this
test module.

NeutronLibImpact

Change-Id: Ic8027b73f82d691bd3c465061a4c8d8301288b07
2017-09-05 11:05:00 -06:00
Inessa Vasilevskaya 7322bd6efb Make code follow log translation guideline
Since Pike log messages should not be translated.
This patch removes calls to i18n _LC, _LI, _LE, _LW from
logging logic throughout the code. Translators definition
from neutron._i18n is removed as well.
This patch also removes log translation verification from
ignore directive in tox.ini.

Change-Id: If9aa76fcf121c0e61a7c08088006c5873faee56e
2017-08-14 02:01:48 +00:00
Sławek Kapłoński 2cc547241c New API call to get details of supported QoS rule type
This commit adds new API call that allows to discover
details about supported QoS rule type and its parameters
by each of loaded backend drivers.

DocImpact: New call to get details about supported
           rule_type for each loaded backend driver
ApiImpact

Change-Id: I2008e9d3e400dd717434fbdd2e693c9c5e34c3a4
Closes-Bug: #1686035
2017-07-11 14:24:17 +00:00
Jenkins 2ce4f19afd Merge "Ingress bandwidth limit rule in Linuxbridge agent" 2017-06-22 13:59:07 +00:00
Sławek Kapłoński da646496e3 Ingress bandwidth limit rule in Linuxbridge agent
Add support for QoS ingress bandwidth limiting in
linuxbridge agent.
It uses traffic shaping done by tc with tbf qdisc.

DocImpact: Ingress bandwidth limit in QoS supported by
           Linuxbridge agent

Change-Id: Id495b302d31f5527db3e45b51517bc53153e7fc2
Partial-Bug: #1560961
2017-06-22 08:20:48 +00:00
Jenkins dd52e9fbb8 Merge "Revert "Change list of available qos rules"" 2017-06-22 00:21:04 +00:00
Jenkins 817ca843fa Merge "Add support for ingress bandwidth limit rules in ovs agent" 2017-06-15 03:19:53 +00:00
Sławek Kapłoński 2d0d1a2d76 Add support for ingress bandwidth limit rules in ovs agent
Add support for QoS ingress bandwidth limiting in
openvswitch agent.
It uses default ovs QoS policies on bandwidth limiting
mechanism.

DocImpact: Ingress bandwidth limit in QoS supported by
           Openvswitch agent

Change-Id: I9d94e27db5d574b61061689dc99f12f095625ca0
Partial-Bug: #1560961
2017-06-14 11:11:43 +00:00
Jenkins 3984c3fd1e Merge "Remove redundant code in QosServiceDriverManager" 2017-06-12 10:28:49 +00:00
Nguyen Phuong An 3ea08fe54b Remove redundant code in QosServiceDriverManager
I don't see notification_api [1] is used anywhere and it
duplicate with push_api[2]. So this patch-set removed it.

[1]https://github.com/openstack/neutron/blob/master/neutron/services/qos/drivers/manager.py#L41
[2]https://github.com/openstack/neutron/blob/master/neutron/services/qos/drivers/manager.py#L50

TrivialFix
Change-Id: Ib31c320f7486738190d27cf41e16a5f93e524039
2017-06-12 01:18:50 +00:00
Rodolfo Alonso Hernandez 48398e5347 Change allowed directions for QoS min-bw rule in SR-IOV
Changed allowed directions for QoS minimum bandwidth rule in
SR-IOV driver to only "egress". Currently this is the only
supported direction for this rule in this backend.

Closes-Bug: #1696679
Change-Id: Ia56146143e902663e9a47231773956ab2f035c8e
2017-06-08 14:36:36 +01:00
Rodolfo Alonso Hernandez 9fbd9eb3b7 Change supported vif type in Linux Bridge.
With [1], the vif_type for a Linux Bridge port is set
to 'tap', replacing 'bridge'. This definition needs to be
changed in the list of supported vif types in the pluging
driver.

[1] https://review.openstack.org/#/c/447150/

Change-Id: I715565627b2446533298b5905edbaa256bd84c92
Closes-Bug: #1694190
2017-05-31 15:06:59 +00:00
YAMAMOTO Takashi 55d810c7e6 Revert "Change list of available qos rules"
This reverts commit 3299cdffae.

At least, there's a user which relies on the previous
semantics. (Our tempest plugin)
We should not change API semantics lightly
in an incompatible way.

Closes-Bug: #1694396
Related-Bug: #1694190
Change-Id: I88a216951d8996ac8bc90078b4239f0d25392e58
2017-05-30 08:12:28 +00:00
Miguel Angel Ajo 45fd7eef6e Add precommit calls to the QoSDriver class
Added create, update and delete precommit calls for QoS
driver, to be used by some out-of-tree backends.

Co-Authored-By: Miguel Angel Ajo <mangelajo@redhat.com>
Co-Authored-By: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>

Closes-Bug: #1657381
Change-Id: I44dd7e049eab054363063021f07ade81ef2d1a90
2017-05-23 10:59:56 +01:00
Jenkins 65ce6d6f49 Merge "Change list of available qos rules" 2017-05-04 09:34:39 +00:00
Sławek Kapłoński 3299cdffae Change list of available qos rules
This patch changes way how neutron calculates which QoS rules
are available to use. It now returns all rule types which are
supported by at least one loaded QoS driver.
If user will want to apply policy with rule unsupported by driver
used by port then it will be catched on port/network update event.
This validation mechanism was introduced in
I75bd18b3a1875daa5639dd141fb7bbd6e1c54118

DocImpact: list of returned available QoS rule types is changed

Change-Id: Ia00d349625db358ab486802fc0ff2e69eaa3895e
Closes-Bug: #1686898
2017-05-03 17:14:29 +00:00
Jenkins 90b01bb6ca Merge "Add QoS bandwidth limit for instance ingress traffic" 2017-05-01 11:20:39 +00:00
Sławek Kapłoński c29f3aaa7c Add QoS bandwidth limit for instance ingress traffic
This patch introduces the new parameter "direction" to
the QoS bandwidth limit rule. It will allow the creation
of bandwidth limit rules for either ingress or egress
traffic. For backwards compatibility the default direction
will be egress.

DocImpact: Ingress bandwidth limit available for QoS
APIImpact: New type of parameter for QoS rule in neutron API

Change-Id: Ia13568879c2b6f80fb190ccafe7e19ca05b0c6a8
Partial-Bug: #1560961
2017-04-27 12:51:50 +00:00
Boden R 0e2b667bf1 use neutron-lib callbacks
The callback modules have been available in neutron-lib since commit [1]
and are ready for consumption.

As the callback registry is implemented with a singleton manager
instance, sync complications can arise ensuring all consumers switch to
lib's implementation at the same time. Therefore this consumption has
been broken down:
1) Shim neutron's callbacks using lib's callback system and remove
existing neutron internals related to callbacks (devref, UTs, etc.).
2) Switch all neutron's callback imports over to neutron-lib's.
3) Have all sub-projects using callbacks move their imports over to use
neutron-lib's callbacks implementation.
4) Remove the callback shims in neutron-lib once sub-projects are moved
over to lib's callbacks.
5) Follow-on patches moving our existing uses of callbacks to the new
event payload model provided by neutron-lib.callback.events

This patch implements #2 from above, moving all neutron's callback
imports to use neutron-lib's callbacks.

There are also a few places in the UT code that still patch callbacks,
we can address those in step #4 which may need [2].

NeutronLibImpact

[1] fea8bb64ba7ff52632c2bd3e3298eaedf623ee4f
[2] I9966c90e3f90552b41ed84a68b19f3e540426432

Change-Id: I8dae56f0f5c009bdf3e8ebfa1b360756216ab886
2017-04-26 12:12:53 -06:00
Dong Jun ca2bf84168 Correct param type description of supported_rules of QoS driver
supported_rules of DriverBase() is dict type instead of list type

Change-Id: Ic7d800c9ef19dd20793dd0931d718bbbc5c66ff8
2017-04-19 09:58:20 +08:00
Miguel Angel Ajo 6037e53f07 Remove deprecated support for QoS notification_drivers
In Ocata, notification_drivers were deprecated in favor of
the new QoSDriver architecture.

This patch removes backwards compatible support for notification
drivers along with its testing.

Change-Id: I5f747635be3fd66b70326d9f94c85a6736286bd2
2017-04-17 06:32:01 -07:00
Sławek Kapłoński e2226fe373 Improve validation of supported QoS rules
New way of validation of QoS policy can be applied on port/network based on
port_types. It can validate if port can support rule by rule_type and also by
rule parameters or some values of parameters.

For example bandwidth_limit_rule can have parameter "direction" with
possible values "ingress" and "egress". Some of mechanism drivers can support
only one of those directions.

If user will try to apply policy with rule unsupported by port_type then it
will get error message and policy will not be applied.
Such validation is made during:
* port create
* port update
* network update
* QoS rule create
* QoS rule update

Co-Authored-By: Miguel Angel Ajo <majopela@redhat.com>

Implements blueprint qos-rules-validation
Closes-Bug: #1586056

Change-Id: I75bd18b3a1875daa5639dd141fb7bbd6e1c54118
2017-04-02 16:33:11 +00:00
Boden R 7bd521e7ce use neutron_lib's portbindings api-def
Neutron-lib 1.1.0 is now out and contains the portbindings
API definition (as per commit [1]). This patch moves neutron
references over to the neutron-lib version.

NeutronLibImpact
- Consumers using the public constants within neutron's
portbindings API extension must now use the values
from neutron-lib.

[1] 87e42f993c07ae320159d5123662ee9f3bd4d903

Change-Id: I669af9b4c712877772d91a03857ab108714001d4
2017-03-31 09:16:22 -06:00