summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-03-22 15:42:18 -0700
committerJohn Lo <loj@cisco.com>2019-03-23 03:45:16 +0000
commit537e85deab6fd916952ff4badeda4ec5d6f1a121 (patch)
tree00260c027b0963b1ab965623fbe425e837fb2fd8 /src/vnet
parent6c1f56f08c30eb2ad5d734f9891f8b7f4ef9760d (diff)
tcp: make default mtu configurable
Change-Id: I56d8d8d67d5590e24c1ddb54b0c63a2cb03798e1 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/tcp/tcp.c6
-rw-r--r--src/vnet/tcp/tcp.h3
-rw-r--r--src/vnet/tcp/tcp_output.c8
3 files changed, 10 insertions, 7 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index 39d683c78e7..32abe2df210 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -841,9 +841,10 @@ format_tcp_vars (u8 * s, va_list * args)
tcp_flight_size (tc), tcp_available_output_snd_space (tc),
tcp_rcv_wnd_available (tc));
s = format (s, " tsval_recent %u\n", tc->tsval_recent);
- s = format (s, " tsecr %u tsecr_last_ack %u tsval_recent_age %u\n",
+ s = format (s, " tsecr %u tsecr_last_ack %u tsval_recent_age %u",
tc->rcv_opts.tsecr, tc->tsecr_last_ack,
tcp_time_now () - tc->tsval_recent_age);
+ s = format (s, " snd_mss %u\n", tc->snd_mss);
s = format (s, " rto %u rto_boff %u srtt %u us %.3f rttvar %u rtt_ts %.4f",
tc->rto, tc->rto_boff, tc->srtt, tc->mrtt_us * 1000, tc->rttvar,
tc->rtt_ts);
@@ -1534,6 +1535,7 @@ tcp_init (vlib_main_t * vm)
tcp_api_reference ();
tm->tx_pacing = 1;
tm->cc_algo = TCP_CC_NEWRENO;
+ tm->default_mtu = 1460;
return 0;
}
@@ -1596,6 +1598,8 @@ tcp_config_fn (vlib_main_t * vm, unformat_input_t * input)
else if (unformat (input, "max-rx-fifo %U", unformat_memory_size,
&tm->max_rx_fifo))
;
+ else if (unformat (input, "mtu %d", &tm->default_mtu))
+ ;
else if (unformat (input, "no-tx-pacing"))
tm->tx_pacing = 0;
else if (unformat (input, "cc-algo %U", unformat_tcp_cc_algo,
diff --git a/src/vnet/tcp/tcp.h b/src/vnet/tcp/tcp.h
index 9e2c6d8c4f5..66f1aed1510 100644
--- a/src/vnet/tcp/tcp.h
+++ b/src/vnet/tcp/tcp.h
@@ -486,6 +486,9 @@ typedef struct _tcp_main
* rfc 7323 window scaling factor */
u32 max_rx_fifo;
+ /** Default MTU to be used when establishing connections */
+ u16 default_mtu;
+
/** Number of preallocated connections */
u32 preallocated_connections;
u32 preallocated_half_open_connections;
diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c
index 4b38649c171..2abc40a8cc7 100644
--- a/src/vnet/tcp/tcp_output.c
+++ b/src/vnet/tcp/tcp_output.c
@@ -49,10 +49,6 @@ typedef struct
tcp_connection_t tcp_connection;
} tcp_tx_trace_t;
-#ifndef CLIB_MARCH_VARIANT
-u16 dummy_mtu = 1460;
-#endif /* CLIB_MARCH_VARIANT */
-
static u8 *
format_tcp_tx_trace (u8 * s, va_list * args)
{
@@ -89,7 +85,7 @@ void
tcp_update_rcv_mss (tcp_connection_t * tc)
{
/* TODO find our iface MTU */
- tc->mss = dummy_mtu - sizeof (tcp_header_t);
+ tc->mss = tcp_main.default_mtu - sizeof (tcp_header_t);
}
/**
@@ -293,7 +289,7 @@ tcp_make_syn_options (tcp_options_t * opts, u8 wnd_scale)
u8 len = 0;
opts->flags |= TCP_OPTS_FLAG_MSS;
- opts->mss = dummy_mtu; /*XXX discover that */
+ opts->mss = tcp_main.default_mtu; /*XXX discover that */
len += TCP_OPTION_LEN_MSS;
opts->flags |= TCP_OPTS_FLAG_WSCALE;
href='#n320'>320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697