Commit Graph

18 Commits

Author SHA1 Message Date
Brian Haley 555238da69 Start using oslo_utils.netutils.is_ipv6_enabled()
Seems that is_enabled_and_bind_by_default() from
neutron.common.ipv6_utils was copied directly into
oslo_utils.netutils, so start using it instead.

Trivialfix

Change-Id: I00fa441e7a20fcd1115485bb8ab75750e6a8cf07
2019-10-16 21:44:56 -04:00
ZhongShengping 161e6b80f0 Replace git.openstack.org URLs with opendev.org URLs
Thorough replacement of git.openstack.org URLs with their opendev.org
counterparts.

Change-Id: Ifc446e00d7f69cb23411b3a50c8d880c719f1e73
2019-04-23 10:00:45 +08:00
Rodolfo Alonso Hernandez d7cefa56e4 Implement add_tc_qdisc and list_tc_qdiscs using pyroute2
TcCommand.set_tbf_bw_limit() is used now to set and replace a TC TBF
filter.

Related-Bug: #1560963

Change-Id: I162dea499d16db76692dd3d6d99b6be45f44ae59
2019-02-07 11:12:35 +00:00
Brian Haley 8afe3beb7f Fix iptables rule removal warnings from QoS extension
Since iptables chain removal "cascades", it will remove rules
in other chains that jump to it.  Because of this, there is no
need to explicitly remove these jump rules, as it will just
generate a warning of the type: "Tried to remove rule that was
not there".

Trivialfix

Change-Id: I0638562400f3bcac689d94eb2a44eae9d2890782
2018-02-06 19:52:04 -05:00
Zuul 569b51483b Merge "Use same instance of iptables_manager in L2 agent and extensions" 2018-01-05 19:19:57 +00:00
Sławek Kapłoński cbee0f9f88 Use same instance of iptables_manager in L2 agent and extensions
This commit adds common_agent_extension class which is agent API
for L2 extension drivers used e.g. by Linuxbridge agent.
This is necessary to be able to use instance of iptables_manager
used in firewall driver also in L2 extension drivers (like qos).

This patch refactors little bit iptables_manager code to make possible
to initialize e.g. mangle or nat table on demand, even if iptables
is created as "state_less"

Change-Id: I3b66e49b7f176124e8aea3eb96d0d465f1ab1ea0
Closes-Bug: #1736674
2018-01-05 11:07:32 +01:00
Brian Haley 1feab00862 Use hexadecimal when adding DSCP rules
The iptables_manager can use iptables-save/restore for
manipulating rules, therefore we need to always use that
format when constructing them.

Found through inspection that the DSCP marking rules were
being added as integers, but iptables-save shows them in
hexadecimal:

  --> iptables -t mangle -A INPUT -j DSCP --set-dscp 12
  --> iptables-save | grep DSCP
  -A INPUT -j DSCP --set-dscp 0x0c

Adjust the rule string accordingly so that they are matched
correctly when the iptables_manager updates the rules.

Trivialfix

Change-Id: I2b3c37810d3dda0bc3ddeab0a84fee5d8cbe306c
2017-12-12 16:13:48 -05: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
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 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
Hirofumi Ichihara e3063496cf Revert "Linux Bridge: driver support for QoS egress minimum bandwidth"
This reverts commit 84b3ae3ae9.

The logic was incorrect[1]. We cannot achieve QoS egress minimum bandwidth of Linuxbridge by the patch. I also think that the issue is not solved by small patch and we must consider deeply.

[1]: https://bugs.launchpad.net/neutron/+bug/1662582

Change-Id: Id4703b5c63876f16e31b6805cd147b5840a4a591
2017-02-09 19:11:00 +00:00
Miguel Angel Ajo 38c1812015 Transition qos notification driver into qos driver
This will deprecate the notification_driver config setting,
and no config setting will be needed.

Also it lays down the foundation for a more decoupled interaction
with mechanism drivers.

Closes-Bug: #1657379
Related-Bug: #1627749
DocImpact

Change-Id: I2f166a43f0b980ad22617f8a3f7b4cc7f4786c48
2017-01-25 14:13:36 +01:00
Rodolfo Alonso Hernandez 84b3ae3ae9 Linux Bridge: driver support for QoS egress minimum bandwidth
This patch provides the Linux Bridge agent driver the ability to control
Linux Traffic Control (TC) to set the minimum required transmission rate
for an interface.

The TC library is refactored to use HTB qdiscs. This allows TC to
define, for several flows in the same interface, the maximum and the
minimum network bandwidth and the burst size.

To be able to do traffic shaping (instead of policing) for ingress
traffic, a new element, the Intermediate Functional Block device (IFB)
is introduced.

DocImpact
Partial-Bug: #1560963

Change-Id: I4d4db54519f1435068d1af38819404d1e5d9cd52
2017-01-13 15:44:16 +00:00
Denis Buliga 7fc79f43dc Refactors QosAgentDriver
QosAgentDriver has a method which uses linux specific module, which
is trying to import pyroute2.

Module pyroute2 tries to import a module from socket which does not
exists on windows (socket.inet_pton[1]). This can cause neutron
services to fail to start on windows[2].

[1]: https://docs.python.org/2/library/socket.html#socket.inet_pton
[2]: http://paste.openstack.org/show/593272/

Change-Id: I706368bfcaece380e1357e0c504fd3b9553ba49c
Related-Bug: #1492714
2017-01-03 04:34:44 -08:00
Sławek Kapłoński fd3bf3327c DSCP packet marking support in Linuxbridge agent
Linuxbridge agent uses iptable rules in POSTROUTING chain
in the mangle table to mark outgoing packets with the
DSCP mark value configured by the user in QoS policy.

DocImpact: DSCP Marking rule support is extended to the
           Linuxbridge L2 agent

Closes-Bug: #1644369

Change-Id: I47e44cb2e67ab73bd5ee0aa4cca47cb3d07e43f3
2016-12-13 11:14:27 +00:00
Sławek Kapłoński f766fc71be Add setting default max_burst value if not given by user
If user will not provide burst value for bandwidth limit rule there is
need to set such value on appropriate to ensure that bandwith limit
will work fine.
To ensure at least proper limitation of TCP traffic we decided to set
burst as 80% of bw_limit value.
LinuxBridge agent already sets is like that. This patch add same
behaviour for QoS extension driver in openvswitch L2 agent.

DocImpact: Add setting default max_burst value in LB and OvS drivers

Change-Id: Ib12a7cbf88cdffd10c8f6f8442582bf7377ca27d
Closes-Bug: #1572670
2016-05-12 10:06:54 +00:00
Sławek Kapłoński 6dcdb15dce LinuxBridge agent's QoS driver bw limit for egress traffic
QoS service plugin provides for now bandwidth limit rules for egress traffic
only (from VM point of view). QoS extension driver for Linuxbridge agent now
configures limits in proper way on tap interface so limited is traffic which is
outgoing from VM.
Linuxbridge agent's QoS extension configures egress bandwidth limit and burst
value in exactly same way how openvswitch is doing it with tc.
Old methods in TcCommand class will stay untouched because they can be used
later to implement also ingress bandwidth limits in QoS.

Change-Id: Id2b0463f49df52744e5bc3979a4cfd0ff06f9248
Closes-bug: #1563720
2016-04-18 14:07:07 +00:00
Sławek Kapłoński 45410d76be Add support for QoS for LinuxBridge agent
There is a new QoS extension driver for the linuxbridge agent
being added. This driver provides support for QoS configuring
on the linuxbridge agent.
This patch introduces two new config options for Linuxbridge agent:
kernel_hz - HZ value of host kernel,
tbf_latency - value of latency in tbf qdisc to calculate size of queue.

Co-Authored-By: vikram.choudhary <vikram.choudhary@huawei.com>

Change-Id: I457ca2569b5d4a916ba09e71040505cd0ad3257b
Closes-Bug: #1500012
Closes-Bug: #1550514
DocImpact Update agent configuration to show settings related to
          QoS and bandwidth limiting
2016-03-01 10:45:02 +00:00