Skip to content

Commit

Permalink
controller: use unsigned long long int for qos_max_rate/qos_min_rate/…
Browse files Browse the repository at this point in the history
…qos_burst

This patch allow to configure max/min rate greater than 4Gbps

Acked-by: Numan Siddique <numans@ovn.org>
Acked-By: Ihar Hrachyshka <ihrachys@redhat.com>
Tested-by: Rodolfo Alonso <ralonsoh@redhat.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Mark Michelson <mmichels@redhat.com>
  • Loading branch information
LorenzoBianconi authored and putnopvut committed May 18, 2023
1 parent 71c03a2 commit 3a2170d
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions controller/binding.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ struct qos_queue {
char *port;

uint32_t queue_id;
uint32_t min_rate;
uint32_t max_rate;
uint32_t burst;
unsigned long long min_rate;
unsigned long long max_rate;
unsigned long long burst;
};

static struct qos_queue *
Expand Down Expand Up @@ -224,9 +224,10 @@ get_qos_egress_port_interface(struct shash *bridge_mappings,
static void
add_ovs_qos_table_entry(struct ovsdb_idl_txn *ovs_idl_txn,
const struct ovsrec_port *port,
uint32_t min_rate, uint32_t max_rate,
uint32_t burst, uint32_t queue_id,
const char *ovn_port)
unsigned long long min_rate,
unsigned long long max_rate,
unsigned long long burst,
uint32_t queue_id, const char *ovn_port)
{
struct smap external_ids = SMAP_INITIALIZER(&external_ids);
struct smap other_config = SMAP_INITIALIZER(&other_config);
Expand Down Expand Up @@ -266,9 +267,9 @@ add_ovs_qos_table_entry(struct ovsdb_idl_txn *ovs_idl_txn,
ovsrec_qos_update_queues_setkey(qos, queue_id, queue);
}

smap_add_format(&other_config, "max-rate", "%d", max_rate);
smap_add_format(&other_config, "min-rate", "%d", min_rate);
smap_add_format(&other_config, "burst", "%d", burst);
smap_add_format(&other_config, "max-rate", "%llu", max_rate);
smap_add_format(&other_config, "min-rate", "%llu", min_rate);
smap_add_format(&other_config, "burst", "%llu", burst);
ovsrec_queue_verify_other_config(queue);
ovsrec_queue_set_other_config(queue, &other_config);
smap_destroy(&other_config);
Expand Down Expand Up @@ -336,10 +337,12 @@ configure_qos(const struct sbrec_port_binding *pb,
struct binding_ctx_in *b_ctx_in,
struct binding_ctx_out *b_ctx_out)
{

uint32_t min_rate = smap_get_int(&pb->options, "qos_min_rate", 0);
uint32_t max_rate = smap_get_int(&pb->options, "qos_max_rate", 0);
uint32_t burst = smap_get_int(&pb->options, "qos_burst", 0);
unsigned long long min_rate = smap_get_ullong(
&pb->options, "qos_min_rate", 0);
unsigned long long max_rate = smap_get_ullong(
&pb->options, "qos_max_rate", 0);
unsigned long long burst = smap_get_ullong(
&pb->options, "qos_burst", 0);
uint32_t queue_id = smap_get_int(&pb->options, "qdisc_queue_id", 0);

if ((!min_rate && !max_rate && !burst) || !queue_id) {
Expand Down

0 comments on commit 3a2170d

Please sign in to comment.