Skip to content

Commit

Permalink
Make default hardware queue configuration as optional.
Browse files Browse the repository at this point in the history
Closes-Bug: #1640056

Change-Id: Idb4652f2d9fa55568fe83e443226d7b8dae865a5
  • Loading branch information
krharsh committed Nov 11, 2016
1 parent 45b8adb commit f744289
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion fabfile/testbeds/testbed_multibox_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@
# For Qos hardware queues (nic queues) are mapped to logical queues in agent.
# hardware_q_id: Identifier for the hardwarwe queue.
# logical_queue: Defines the logical queues each hardware queue is mapped to.
# default: When set to True defines the default hardware queue for Qos, one of the queue must be defined default.
# default: When set to True defines the default hardware queue for Qos.

#env.qos = {host4: [ {'hardware_q_id': '3', 'logical_queue':['1', '6-10', '12-15']},
# {'hardware_q_id': '5', 'logical_queue':['2']},
Expand Down
2 changes: 1 addition & 1 deletion fabfile/testbeds/testbed_singlebox_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@
# For Qos hardware queues (nic queues) are mapped to logical queues in agent.
# hardware_q_id: Identifier for the hardwarwe queue.
# logical_queue: Defines the logical queues each hardware queue is mapped to.
# default: When set to True defines the default hardware queue for Qos, one of the queue must be defined default.
# default: When set to True defines the default hardware queue for Qos.

#env.qos = {host1: [ {'hardware_q_id': '3', 'logical_queue':['1', '6-10', '12-15']},
# {'hardware_q_id': '5', 'logical_queue':['2']},
Expand Down
11 changes: 7 additions & 4 deletions fabfile/utils/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ def get_vgw_details(compute_host_string):

def get_qos_details(compute_host_string):
set_qos = False
default_hw_queue = False
qos_logical_queue = []
queue_id = []
qos_details = (set_qos, qos_logical_queue, queue_id)
qos_details = (set_qos, qos_logical_queue, queue_id, default_hw_queue)
qos_info = getattr(env, 'qos', None)
if qos_info:
if( compute_host_string not in qos_info.keys()):
Expand All @@ -130,10 +131,12 @@ def get_qos_details(compute_host_string):
queue_id.append(nic_queue['hardware_q_id'])
else:
default_nic_queue = nic_queue
qos_logical_queue.append(str(default_nic_queue['logical_queue']).strip('[]').replace(" ",""))
queue_id.append(default_nic_queue['hardware_q_id'])
default_hw_queue = True
if default_hw_queue:
qos_logical_queue.append(str(default_nic_queue['logical_queue']).strip('[]').replace(" ",""))
queue_id.append(default_nic_queue['hardware_q_id'])

qos_details = (set_qos, qos_logical_queue, queue_id)
qos_details = (set_qos, qos_logical_queue, queue_id, default_hw_queue)
return qos_details

def get_priority_group_details(compute_host_string):
Expand Down
4 changes: 3 additions & 1 deletion fabfile/utils/commandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,12 @@ def frame_vnc_compute_cmd(host_string, cmd='setup-vnc-compute',
cmd += " --vgw_gateway_routes %s" % str([(';'.join(str(e) for e in gateway_routes)).replace(" ","")])

# Qos Arguments
(set_qos, qos_logical_queue, qos_queue_id) = get_qos_details(host_string)
(set_qos, qos_logical_queue, qos_queue_id, default_hw_queue) = get_qos_details(host_string)
if set_qos:
cmd += " --qos_logical_queue %s" % ' '.join(qos_logical_queue)
cmd += " --qos_queue_id %s" % ' '.join(qos_queue_id)
if default_hw_queue:
cmd += " --default_hw_queue"

# Qos priority group arguments
(set_priority, priority_id, priority_bandwidth, priority_scheduling) = get_priority_group_details(host_string)
Expand Down

0 comments on commit f744289

Please sign in to comment.