Revision a2dc7392
Added by Renato Botelho about 12 years ago
etc/inc/interfaces.inc | ||
---|---|---|
487 | 487 |
if ($mtu <= 1500) |
488 | 488 |
continue; |
489 | 489 |
} |
490 |
if (!isset($opts['encaps']['txcsum']))
|
|
490 |
if (!isset($opts['caps']['txcsum'])) |
|
491 | 491 |
$commontx = false; |
492 |
if (!isset($opts['encaps']['rxcsum']))
|
|
492 |
if (!isset($opts['caps']['rxcsum'])) |
|
493 | 493 |
$commonrx = false; |
494 |
if (!isset($opts['encaps']['tso4']))
|
|
494 |
if (!isset($opts['caps']['tso4'])) |
|
495 | 495 |
$commontso4 = false; |
496 |
if (!isset($opts['encaps']['tso6']))
|
|
496 |
if (!isset($opts['caps']['tso6'])) |
|
497 | 497 |
$commontso6 = false; |
498 |
if (!isset($opts['encaps']['lro']))
|
|
498 |
if (!isset($opts['caps']['lro'])) |
|
499 | 499 |
$commonlro = false; |
500 | 500 |
if ($smallermtu == 0 && !empty($mtu)) |
501 | 501 |
$smallermtu = $mtu; |
... | ... | |
509 | 509 |
if ($smallermtu == 0) |
510 | 510 |
$smallermtu = 1500; |
511 | 511 |
|
512 |
$flags = 0; |
|
513 |
if ($commonrx === false) |
|
514 |
$flags |= IFCAP_RXCSUM; |
|
515 |
if ($commontx === false) |
|
516 |
$flags |= IFCAP_TXCSUM; |
|
517 |
if ($commontso4 === false) |
|
518 |
$flags |= IFCAP_TSO4; |
|
519 |
if ($commontso6 === false) |
|
520 |
$flags |= IFCAP_TSO6; |
|
521 |
if ($commonlro === false) |
|
522 |
$flags |= IFCAP_LRO; |
|
512 |
$flags_on = 0; |
|
513 |
$flags_off = 0; |
|
514 |
if (isset($config['system']['disablechecksumoffloading']) || ($commonrx === false)) |
|
515 |
$flags_off |= IFCAP_RXCSUM; |
|
516 |
else |
|
517 |
$flags_on |= IFCAP_RXCSUM; |
|
518 |
if (isset($config['system']['disablechecksumoffloading']) || ($commontx === false)) |
|
519 |
$flags_off |= IFCAP_TXCSUM; |
|
520 |
else |
|
521 |
$flags_on |= IFCAP_TXCSUM; |
|
522 |
if (isset($config['system']['disablesegmentationoffloading']) || ($commontso4 === false)) |
|
523 |
$flags_off |= IFCAP_TSO4; |
|
524 |
else |
|
525 |
$flags_on |= IFCAP_TSO4; |
|
526 |
if (isset($config['system']['disablesegmentationoffloading']) || ($commontso6 === false)) |
|
527 |
$flags_off |= IFCAP_TSO6; |
|
528 |
else |
|
529 |
$flags_on |= IFCAP_TSO6; |
|
530 |
if (isset($config['system']['disablelargereceiveoffloading']) || ($commonlro === false)) |
|
531 |
$flags_off |= IFCAP_LRO; |
|
532 |
else |
|
533 |
$flags_on |= IFCAP_LRO; |
|
523 | 534 |
|
524 | 535 |
if ($g['booting'] || !empty($bridge['bridgeif'])) { |
525 | 536 |
pfSense_interface_destroy($bridge['bridgeif']); |
... | ... | |
543 | 554 |
} |
544 | 555 |
/* make sure the parent interface is up */ |
545 | 556 |
pfSense_interface_mtu($realif, $smallermtu); |
546 |
pfSense_interface_capabilities($realif, -$flags); |
|
557 |
pfSense_interface_capabilities($realif, -$flags_off); |
|
558 |
pfSense_interface_capabilities($realif, $flags_on); |
|
547 | 559 |
interfaces_bring_up($realif); |
548 | 560 |
pfSense_bridge_add_member($bridge['bridgeif'], $realif); |
549 | 561 |
} |
... | ... | |
666 | 678 |
pfSense_interface_mtu($interface, $mtu); |
667 | 679 |
|
668 | 680 |
$options = pfSense_get_interface_addresses($bridgeif); |
669 |
$flags = 0; |
|
670 |
if (!isset($options['encaps']['txcsum'])) |
|
671 |
$flags |= IFCAP_TXCSUM; |
|
672 |
|
|
673 |
if (!isset($options['encaps']['rxcsum'])) |
|
674 |
$flags |= IFCAP_RXCSUM; |
|
681 |
$flags_on = 0; |
|
682 |
$flags_off = 0; |
|
683 |
if (isset($options['encaps']['txcsum'])) |
|
684 |
$flags_on |= IFCAP_TXCSUM; |
|
685 |
else |
|
686 |
$flags_off |= IFCAP_TXCSUM; |
|
687 |
if (isset($options['encaps']['rxcsum'])) |
|
688 |
$flags_on |= IFCAP_RXCSUM; |
|
689 |
else |
|
690 |
$flags_off |= IFCAP_RXCSUM; |
|
691 |
if (isset($options['encaps']['tso4'])) |
|
692 |
$flags_on |= IFCAP_TSO4; |
|
693 |
else |
|
694 |
$flags_off |= IFCAP_TSO4; |
|
695 |
if (isset($options['encaps']['tso6'])) |
|
696 |
$flags_on |= IFCAP_TSO6; |
|
697 |
else |
|
698 |
$flags_off |= IFCAP_TSO6; |
|
699 |
if (isset($options['encaps']['lro'])) |
|
700 |
$flags_on |= IFCAP_LRO; |
|
701 |
else |
|
702 |
$flags_off |= IFCAP_LRO; |
|
675 | 703 |
|
676 |
pfSense_interface_capabilities($interface, -$flags); |
|
704 |
pfSense_interface_capabilities($interface, -$flags_off); |
|
705 |
pfSense_interface_capabilities($interface, $flags_on); |
|
677 | 706 |
|
678 | 707 |
interfaces_bring_up($interface); |
679 | 708 |
pfSense_bridge_add_member($bridgeif, $interface); |
... | ... | |
719 | 748 |
foreach ($members as $member) { |
720 | 749 |
$opts = pfSense_get_interface_addresses($member); |
721 | 750 |
$mtu = $opts['mtu']; |
722 |
if (!isset($opts['encaps']['txcsum']))
|
|
751 |
if (!isset($opts['caps']['txcsum'])) |
|
723 | 752 |
$commontx = false; |
724 |
if (!isset($opts['encaps']['rxcsum']))
|
|
753 |
if (!isset($opts['caps']['rxcsum'])) |
|
725 | 754 |
$commonrx = false; |
726 |
if (!isset($opts['encaps']['tso4']))
|
|
755 |
if (!isset($opts['caps']['tso4'])) |
|
727 | 756 |
$commontso4 = false; |
728 |
if (!isset($opts['encaps']['tso6']))
|
|
757 |
if (!isset($opts['caps']['tso6'])) |
|
729 | 758 |
$commontso6 = false; |
730 |
if (!isset($opts['encaps']['lro']))
|
|
759 |
if (!isset($opts['caps']['lro'])) |
|
731 | 760 |
$commonlro = false; |
732 | 761 |
if ($smallermtu == 0 && !empty($mtu)) |
733 | 762 |
$smallermtu = $mtu; |
... | ... | |
739 | 768 |
if ($smallermtu == 0) |
740 | 769 |
$smallermtu = 1500; |
741 | 770 |
|
742 |
$flags = 0; |
|
743 |
if ($commonrx === false) |
|
744 |
$flags |= IFCAP_RXCSUM; |
|
745 |
if ($commontx === false) |
|
746 |
$flags |= IFCAP_TXCSUM; |
|
747 |
if ($commontso4 === false) |
|
748 |
$flags |= IFCAP_TSO4; |
|
749 |
if ($commontso6 === false) |
|
750 |
$flags |= IFCAP_TSO6; |
|
751 |
if ($commonlro === false) |
|
752 |
$flags |= IFCAP_LRO; |
|
771 |
$flags_on = 0; |
|
772 |
$flags_off = 0; |
|
773 |
if (isset($config['system']['disablechecksumoffloading']) || ($commonrx === false)) |
|
774 |
$flags_off |= IFCAP_RXCSUM; |
|
775 |
else |
|
776 |
$flags_on |= IFCAP_RXCSUM; |
|
777 |
if (isset($config['system']['disablechecksumoffloading']) || ($commontx === false)) |
|
778 |
$flags_off |= IFCAP_TXCSUM; |
|
779 |
else |
|
780 |
$flags_on |= IFCAP_TXCSUM; |
|
781 |
if (isset($config['system']['disablesegmentationoffloading']) || ($commontso4 === false)) |
|
782 |
$flags_off |= IFCAP_TSO4; |
|
783 |
else |
|
784 |
$flags_on |= IFCAP_TSO4; |
|
785 |
if (isset($config['system']['disablesegmentationoffloading']) || ($commontso6 === false)) |
|
786 |
$flags_off |= IFCAP_TSO6; |
|
787 |
else |
|
788 |
$flags_on |= IFCAP_TSO6; |
|
789 |
if (isset($config['system']['disablelargereceiveoffloading']) || ($commonlro === false)) |
|
790 |
$flags_off |= IFCAP_LRO; |
|
791 |
else |
|
792 |
$flags_on |= IFCAP_LRO; |
|
753 | 793 |
|
754 | 794 |
$checklist = get_interface_list(); |
755 | 795 |
|
... | ... | |
758 | 798 |
continue; |
759 | 799 |
/* make sure the parent interface is up */ |
760 | 800 |
pfSense_interface_mtu($member, $smallermtu); |
761 |
pfSense_interface_capabilities($member, -$flags); |
|
801 |
pfSense_interface_capabilities($member, -$flags_off); |
|
802 |
pfSense_interface_capabilities($member, $flags_on); |
|
762 | 803 |
interfaces_bring_up($member); |
763 | 804 |
mwexec("/sbin/ifconfig {$laggif} laggport {$member}"); |
764 | 805 |
} |
... | ... | |
2819 | 2860 |
|
2820 | 2861 |
/* skip vlans for checksumming and polling */ |
2821 | 2862 |
if (!stristr($realif, "_vlan") && is_array($options)) { |
2822 |
$flags = 0; |
|
2863 |
$flags_on = 0; |
|
2864 |
$flags_off = 0; |
|
2823 | 2865 |
if(isset($config['system']['disablechecksumoffloading'])) { |
2824 | 2866 |
if (isset($options['encaps']['txcsum'])) |
2825 |
$flags |= IFCAP_TXCSUM; |
|
2867 |
$flags_off |= IFCAP_TXCSUM;
|
|
2826 | 2868 |
if (isset($options['encaps']['rxcsum'])) |
2827 |
$flags |= IFCAP_RXCSUM; |
|
2869 |
$flags_off |= IFCAP_RXCSUM;
|
|
2828 | 2870 |
} else { |
2829 |
if (!isset($options['caps']['txcsum']))
|
|
2830 |
$flags |= IFCAP_TXCSUM; |
|
2831 |
if (!isset($options['caps']['rxcsum']))
|
|
2832 |
$flags |= IFCAP_RXCSUM; |
|
2871 |
if (isset($options['caps']['txcsum'])) |
|
2872 |
$flags_on |= IFCAP_TXCSUM;
|
|
2873 |
if (isset($options['caps']['rxcsum'])) |
|
2874 |
$flags_on |= IFCAP_RXCSUM;
|
|
2833 | 2875 |
} |
2834 | 2876 |
|
2835 |
if(isset($config['system']['disablesegmentationoffloading'])) { |
|
2836 |
if (isset($options['encaps']['tso4'])) |
|
2837 |
$flags |= IFCAP_TSO; |
|
2838 |
if (isset($options['encaps']['tso6'])) |
|
2839 |
$flags |= IFCAP_TSO; |
|
2840 |
} else { |
|
2841 |
if (!isset($options['caps']['tso4'])) |
|
2842 |
$flags |= IFCAP_TSO; |
|
2843 |
if (!isset($options['caps']['tso6'])) |
|
2844 |
$flags |= IFCAP_TSO; |
|
2845 |
} |
|
2877 |
if(isset($config['system']['disablesegmentationoffloading'])) |
|
2878 |
$flags_off |= IFCAP_TSO; |
|
2879 |
else if (isset($options['caps']['tso']) || isset($options['caps']['tso4']) || isset($options['caps']['tso6'])) |
|
2880 |
$flags_on |= IFCAP_TSO; |
|
2846 | 2881 |
|
2847 |
if(isset($config['system']['disablelargereceiveoffloading'])) { |
|
2848 |
if (isset($options['encaps']['lro'])) |
|
2849 |
$flags |= IFCAP_LRO; |
|
2850 |
} else { |
|
2851 |
if (!isset($options['caps']['lro'])) |
|
2852 |
$flags |= IFCAP_LRO; |
|
2853 |
} |
|
2882 |
if(isset($config['system']['disablelargereceiveoffloading'])) |
|
2883 |
$flags_off |= IFCAP_LRO; |
|
2884 |
else if (isset($options['caps']['lro'])) |
|
2885 |
$flags_on |= IFCAP_LRO; |
|
2854 | 2886 |
|
2855 | 2887 |
/* if the NIC supports polling *AND* it is enabled in the GUI */ |
2856 |
if (!isset($config['system']['polling']) || !isset($options['caps']['polling'])) { |
|
2857 |
$flags |= IFCAP_POLLING; |
|
2858 |
} |
|
2859 |
pfSense_interface_capabilities($realhwif, -$flags); |
|
2888 |
if (!isset($config['system']['polling'])) |
|
2889 |
$flags_off |= IFCAP_POLLING; |
|
2890 |
else if (isset($options['caps']['polling'])) |
|
2891 |
$flags_on |= IFCAP_POLLING; |
|
2892 |
|
|
2893 |
pfSense_interface_capabilities($realhwif, -$flags_off); |
|
2894 |
pfSense_interface_capabilities($realhwif, $flags_on); |
|
2860 | 2895 |
} |
2861 | 2896 |
|
2862 | 2897 |
/* invalidate interface/ip/sn cache */ |
Also available in: Unified diff
Fix #1047
again on interfaces
when it's necessary for all members
system->advanced when configuring lagg and bridge