From 4d5b6d701f498b490d9e279cb33c1eda4f5ede9e Mon Sep 17 00:00:00 2001 From: Shibby Date: Fri, 18 Oct 2013 13:09:40 +0200 Subject: [PATCH] Compile bcm_nat as module Many users have >100Mbps WAN speed. BCM_NAT can give us ~30% speed-up WAN->LAN. BW Limiter will not works when this module is loaded. If we enable QoS then bcm_nat will be disabled. If someone need a higher WAN speed and doesn`t use BW Limiter/QoS, he can enable Broadcom FastNAT: modprobe bcm_nat BTW this module works only with K26RT and K26RT-N branches. RT-AC doesn`t support bcm_nat for now. This commit add also new router option called CTF (default n). Tomato is not compatible with CTF module but we still have CTF on/off checkbox in GUI. If CTF is not defined then remove CTF checkbox from GUI. --- release/src-rt/linux/linux-2.6/config_base | 2 +- release/src/Makefile | 6 +++++- release/src/router/Makefile | 2 +- release/src/router/config/config.in | 4 ++++ release/src/router/config_base | 1 + release/src/router/www/Makefile | 10 ++++++++-- 6 files changed, 20 insertions(+), 5 deletions(-) diff --git a/release/src-rt/linux/linux-2.6/config_base b/release/src-rt/linux/linux-2.6/config_base index 0afab70f4c..2d86ceab1b 100644 --- a/release/src-rt/linux/linux-2.6/config_base +++ b/release/src-rt/linux/linux-2.6/config_base @@ -444,7 +444,7 @@ CONFIG_NETFILTER_XT_MATCH_GEOIP=m CONFIG_NF_CONNTRACK_IPV4=y CONFIG_NF_CONNTRACK_PROC_COMPAT=y # CONFIG_IP_NF_QUEUE is not set -# CONFIG_BCM_NAT is not set +CONFIG_BCM_NAT=m CONFIG_IP_NF_IPTABLES=y CONFIG_IP_NF_MATCH_TOS=m CONFIG_IP_NF_MATCH_TIME=m diff --git a/release/src/Makefile b/release/src/Makefile index 570399858a..c184e4c338 100644 --- a/release/src/Makefile +++ b/release/src/Makefile @@ -242,7 +242,7 @@ what: # USB ("USB"|"") # JFFSv1 | NO_JFFS # NO_CIFS, NO_SSH, NO_ZEBRA, NO_SAMBA, NO_HTTPS, NO_XXTP, NO_LIBOPT -# SAMBA3, OPENVPN, IPV6SUPP, EBTABLES, NTFS, MEDIASRV, BBEXTRAS, USBEXTRAS, BCM57, SLIM, NOCAT +# SAMBA3, OPENVPN, IPV6SUPP, EBTABLES, NTFS, MEDIASRV, BBEXTRAS, USBEXTRAS, BCM57, SLIM, NOCAT CTF # NFS BTCLIENT BTGUI TR_EXTRAS SNMP SDHC HFS UPS DNSCRYPT PPTPD TOR IPSEC RAID define RouterOptions @@ -404,6 +404,10 @@ define RouterOptions sed -i "/TCONFIG_TOR/d" $(1); \ echo "TCONFIG_TOR=y" >>$(1); \ fi; \ + if [ "$(CTF)" = "y" ]; then \ + sed -i "/TCONFIG_CTF/d" $(1); \ + echo "TCONFIG_CTF=y" >>$(1); \ + fi; \ ) endef diff --git a/release/src/router/Makefile b/release/src/router/Makefile index 30f6268d17..7b44325c5a 100644 --- a/release/src/router/Makefile +++ b/release/src/router/Makefile @@ -444,7 +444,7 @@ endif @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/hid/* $(PLATFORMDIR)/extras/ || true @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/hid || true @cp -f $(TARGETDIR)/lib/modules/*/kernel/drivers/net/bcm57*.*o $(PLATFORMDIR)/extras/ || true - @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/ctf*.*o $(PLATFORMDIR)/extras/ || true + $(if $(TCONFIG_CTF),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/net/ctf*.*o $(PLATFORMDIR)/extras/ || true $(if $(TCONFIG_PPTP),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/net/pptp.*o $(PLATFORMDIR)/extras/ || true $(if $(TCONFIG_L2TP),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/drivers/net/pppol2tp.*o $(PLATFORMDIR)/extras/ || true @mv $(TARGETDIR)/lib/modules/*/kernel/drivers/net/ppp_deflate.*o $(PLATFORMDIR)/extras/ || true diff --git a/release/src/router/config/config.in b/release/src/router/config/config.in index 9695da983b..b8d5793c63 100644 --- a/release/src/router/config/config.in +++ b/release/src/router/config/config.in @@ -170,3 +170,7 @@ config TCONFIG_IPSEC config TCONFIG_RAID bool "RAID Support: mdadm plus md modules" default n + +config TCONFIG_CTF + bool "CTF (Cut-Through Forwarding)" + default n diff --git a/release/src/router/config_base b/release/src/router/config_base index e63b2637b0..4fe001556d 100644 --- a/release/src/router/config_base +++ b/release/src/router/config_base @@ -39,3 +39,4 @@ TCONFIG_SAMBASRV=y # TCONFIG_UPS is not set # TCONFIG_DNSCRYPT is not set # TCONFIG_TOR is not set +# TCONFIG_CTF is not set diff --git a/release/src/router/www/Makefile b/release/src/router/www/Makefile index f7b67cf01d..b9abe0f03e 100644 --- a/release/src/router/www/Makefile +++ b/release/src/router/www/Makefile @@ -152,6 +152,7 @@ ifneq ($(TCONFIG_TOR),y) endif + # Only include the USB and NAS pages if USB Support is configured in. ifneq ($(TCONFIG_USB),y) rm -f $(INSTALLDIR)/www/nas-*.* @@ -161,8 +162,13 @@ ifneq ($(TCONFIG_USB),y) sed -i $(INSTALLDIR)/www/about.asp -e "/USB-BEGIN/,/USB-END/d" endif -# Only include CTF option if CTF module exists - test -d $(SRCBASE)/ctf/linux || sed -i $(INSTALLDIR)/www/advanced-misc.asp -e "/CTF-BEGIN/,/CTF-END/d" +## Only include CTF option if CTF module exists +# test -d $(SRCBASE)/ctf/linux || sed -i $(INSTALLDIR)/www/advanced-misc.asp -e "/CTF-BEGIN/,/CTF-END/d" + +# Only include the CTF configuration if CTF is configured in. +ifneq ($(TCONFIG_CTF),y) + sed -i $(INSTALLDIR)/www/advanced-misc.asp -e "/CTF-BEGIN/,/CTF-END/d" +endif ifeq ($(TOMATO_EXPERIMENTAL),1) cd $(INSTALLDIR)/www && \ -- 2.11.4.GIT