X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Ftcp%2Ftcp.c;h=695f614a91c11912cbe3f1691fda8fd7ba7715a8;hb=2e31cc35ca5db7f16c8052578d79f1ec84c0acb5;hp=d759cf0d0cdd7393d26169f761cd8fe376fa2592;hpb=97670eb3c643eefbecfbe2d61a8f06cde9516778;p=vpp.git diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c index d759cf0d0cd..695f614a91c 100644 --- a/src/vnet/tcp/tcp.c +++ b/src/vnet/tcp/tcp.c @@ -510,7 +510,7 @@ tcp_connection_fib_attach (tcp_connection_t * tc) static void tcp_cc_init (tcp_connection_t * tc) { - tc->cc_algo = tcp_cc_algo_get (TCP_CC_NEWRENO); + tc->cc_algo = tcp_cc_algo_get (tcp_main.cc_algo); tc->cc_algo->init (tc); } @@ -1425,11 +1425,27 @@ tcp_init (vlib_main_t * vm) tcp_api_reference (); tm->tx_pacing = 1; + tm->cc_algo = TCP_CC_NEWRENO; return 0; } VLIB_INIT_FUNCTION (tcp_init); +uword +unformat_tcp_cc_algo (unformat_input_t * input, va_list * va) +{ + uword *result = va_arg (*va, uword *); + + if (unformat (input, "newreno")) + *result = TCP_CC_NEWRENO; + else if (unformat (input, "cubic")) + *result = TCP_CC_CUBIC; + else + return 0; + + return 1; +} + static clib_error_t * tcp_config_fn (vlib_main_t * vm, unformat_input_t * input) { @@ -1451,6 +1467,9 @@ tcp_config_fn (vlib_main_t * vm, unformat_input_t * input) ; else if (unformat (input, "no-tx-pacing")) tm->tx_pacing = 0; + else if (unformat (input, "cc-algo %U", unformat_tcp_cc_algo, + &tm->cc_algo)) + ; else return clib_error_return (0, "unknown input `%U'", format_unformat_error, input);