X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_sched%2Frte_red.c;h=fdf40576189d2d287db6248c22002daf097bb4e8;hb=6307b909b8e01af6737734cde4ff8b782b6efdf3;hp=f63e195fbf2c2a7a586f19b2e737b6957fe258fd;hpb=657eabecd878194c362b30c53bdeddfbe0dcd5ef;p=dpdk.git diff --git a/lib/librte_sched/rte_red.c b/lib/librte_sched/rte_red.c index f63e195fbf..fdf4057618 100644 --- a/lib/librte_sched/rte_red.c +++ b/lib/librte_sched/rte_red.c @@ -1,13 +1,13 @@ /*- * BSD LICENSE - * + * * Copyright(c) 2010-2014 Intel Corporation. All rights reserved. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -17,7 +17,7 @@ * * Neither the name of Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -71,10 +71,10 @@ __rte_red_init_tables(void) for (i = 0; i < RTE_DIM(rte_red_pow2_frac_inv); i++) { double m = (double)i; - + rte_red_pow2_frac_inv[i] = (uint16_t) round(scale / pow(2, m / table_size)); } - + scale = 1024.0; RTE_RED_ASSERT(RTE_RED_WQ_LOG2_NUM == RTE_DIM(rte_red_log2_1_minus_Wq)); @@ -83,7 +83,7 @@ __rte_red_init_tables(void) double n = (double)i; double Wq = pow(2, -n); uint32_t index = i - RTE_RED_WQ_LOG2_MIN; - + rte_red_log2_1_minus_Wq[index] = (uint16_t) round(-1.0 * scale * log2(1.0 - Wq)); /** * Table entry of zero, corresponds to a Wq of zero @@ -137,7 +137,7 @@ rte_red_config_init(struct rte_red_config *red_cfg, if (maxp_inv > RTE_RED_MAXP_INV_MAX) { return -7; } - + /** * Initialize the RED module if not already done */