From f8b63272ff00d09cde40ee86f3357308cab53e00 Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Wed, 30 Jan 2019 14:02:43 +0000 Subject: [PATCH] Add traffic control constants Change-Id: If1902521086341f1f3786241509a000eaffe72b2 Related-Bug: #1560963 --- neutron_lib/constants.py | 12 +++++++++++- .../traffic-control-constants-b8120d1bea0681bf.yaml | 9 +++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/traffic-control-constants-b8120d1bea0681bf.yaml diff --git a/neutron_lib/constants.py b/neutron_lib/constants.py index 50e3d9277..612cb6665 100644 --- a/neutron_lib/constants.py +++ b/neutron_lib/constants.py @@ -12,7 +12,6 @@ # implied. # See the License for the specific language governing permissions and # limitations under the License. - # TODO(salv-orlando): Verify if a single set of operational # status constants is achievable NET_STATUS_ACTIVE = 'ACTIVE' @@ -333,6 +332,17 @@ VALID_DIRECTIONS = (INGRESS_DIRECTION, EGRESS_DIRECTION) PROVISIONAL_IPV6_PD_PREFIX = '::/64' +# Traffic control +TC_QDISC_TYPE_HTB = 'htb' +TC_QDISC_TYPE_TBF = 'tbf' +TC_QDISC_TYPE_INGRESS = 'ingress' +TC_QDISC_TYPES = (TC_QDISC_TYPE_HTB, TC_QDISC_TYPE_TBF, TC_QDISC_TYPE_INGRESS) + +TC_QDISC_INGRESS_ID = 'ffff:' + +TC_QDISC_PARENTS = {'root': 0xffffffff, + 'ingress': 0xfffffff1} + class Sentinel(object): """A constant object that does not change even when copied.""" diff --git a/releasenotes/notes/traffic-control-constants-b8120d1bea0681bf.yaml b/releasenotes/notes/traffic-control-constants-b8120d1bea0681bf.yaml new file mode 100644 index 000000000..0736af328 --- /dev/null +++ b/releasenotes/notes/traffic-control-constants-b8120d1bea0681bf.yaml @@ -0,0 +1,9 @@ +--- +features: + - | + Adds traffic control related constants: + + * Qdisc types: ``htb``, ``tbf`` and ``ingress``, used in Neutron ``tc_lib`` + * Qdisc ID: for ``ingress`` type, because this one is specific only for + ingress traffic. + * Qdisc parents: for ``root`` and ``ingress`` types.