Merge Mainline

This commit is contained in:
CN_SZTL 2020-09-30 21:13:46 +08:00
commit 48e50b9c4d
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
88 changed files with 444 additions and 580 deletions

View File

@ -324,7 +324,18 @@ menu "Global build settings"
select KERNEL_F2FS_FS_SECURITY
select KERNEL_UBIFS_FS_SECURITY
select KERNEL_JFFS2_FS_SECURITY
select PACKAGE_refpolicy
help
This option enables the usage of SELinux labels
choice
prompt "default SELinux type"
depends on TARGET_ROOTFS_SECURITY_LABELS
default SELINUXTYPE_targeted
help
Choose SELinux policy to be used for build.
config SELINUXTYPE_targeted
bool "targeted"
select PACKAGE_refpolicy
endchoice
endmenu

View File

@ -243,10 +243,11 @@ endef
ifeq ($(CONFIG_TARGET_ROOTFS_SECURITY_LABELS),y)
define Image/mkfs/squashfs
echo "$(STAGING_DIR_HOSTPKG)/bin/setfiles -r" \
echo ". $(call mkfs_target_dir,$(1))/etc/selinux/config" > $@.fakeroot-script
echo "$(STAGING_DIR_HOST)/bin/setfiles -r" \
"$(call mkfs_target_dir,$(1))" \
"$(call mkfs_target_dir,$(1))/etc/selinux/targeted/contexts/files/file_contexts " \
"$(call mkfs_target_dir,$(1))" > $@.fakeroot-script
"$(call mkfs_target_dir,$(1))/etc/selinux/\$${SELINUXTYPE}/contexts/files/file_contexts " \
"$(call mkfs_target_dir,$(1))" >> $@.fakeroot-script
echo "$(Image/mkfs/squashfs-common)" >> $@.fakeroot-script
chmod +x $@.fakeroot-script
$(FAKEROOT) "$@.fakeroot-script"

View File

@ -6,12 +6,12 @@ ifdef CONFIG_TESTING_KERNEL
KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
endif
LINUX_VERSION-4.14 = .198
LINUX_VERSION-4.19 = .145
LINUX_VERSION-4.14 = .199
LINUX_VERSION-4.19 = .148
LINUX_VERSION-5.4 = .68
LINUX_KERNEL_HASH-4.14.198 = 1efaba581860a36666c3ae5001a9f291d3d6929d9d5e78800ebd6242858cb503
LINUX_KERNEL_HASH-4.19.145 = 17bc834ff8f15aee45b7ca7c8b9d43b6b03111a43eb7de75c808a04f4b3ff6b7
LINUX_KERNEL_HASH-4.14.199 = 02f3432a262b3804745501f8c3c51d735133af48a39909df8b031d0b9653d4f9
LINUX_KERNEL_HASH-4.19.148 = 3308c74a93ce6d4e495fde35d1351061240a895f76a288248c343713bd63555b
LINUX_KERNEL_HASH-5.4.68 = 0e93876c5ae8dc0c55cbe631971a46ab02b90cf7461fed3085703a5e4e3cd6dd
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))

View File

@ -37,8 +37,8 @@ else
local version=uci:get("AdGuardHome","AdGuardHome","version")
local testtime=fs.stat(binpath,"mtime")
if testtime~=tonumber(binmtime) or version==nil then
local tmp=luci.sys.exec(binpath.." -c /dev/null --check-config 2>&1| grep -m 1 -E '(version |v)[0-9.]+' -o")
version=string.sub(tmp, -7)
local tmp=luci.sys.exec(binpath.." --version | grep -m 1 -E ' [0-9.]+' -o ")
version=string.sub(tmp, 1)
if version=="" then version="core error" end
uci:set("AdGuardHome","AdGuardHome","version",version)
uci:set("AdGuardHome","AdGuardHome","binmtime",testtime)

View File

@ -8,14 +8,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=v2ray-plugin
PKG_VERSION:=1.4.3
PKG_VERSION:=1.5.0
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/teddysun/v2ray-plugin/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=2979dd5f27eda819033c330f1cf8f56fc675acece067a83c158e47789a85aa19
PKG_HASH:=edea83faafeecd5fc00f8a5ed9be27df4a034a550415bc5dcc278c2c67ce4dd7
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE

View File

@ -173,9 +173,9 @@ define Package/ath10k-firmware-qca9984/install
$(1)/lib/firmware/ath10k/QCA9984/hw1.0/firmware-5.bin
endef
$(eval $(call BuildPackage,ath10k-firmware-qca9887))
#$(eval $(call BuildPackage,ath10k-firmware-qca9887))
#$(eval $(call BuildPackage,ath10k-firmware-qca9888))
$(eval $(call BuildPackage,ath10k-firmware-qca988x))
#$(eval $(call BuildPackage,ath10k-firmware-qca988x))
#$(eval $(call BuildPackage,ath10k-firmware-qca99x0))
#$(eval $(call BuildPackage,ath10k-firmware-qca6174))
#$(eval $(call BuildPackage,ath10k-firmware-qca9984))

View File

@ -31,7 +31,7 @@ define Package/ath10k-firmware-qca9887/install
$(PKG_BUILD_DIR)/ath10k/QCA9887/hw1.0/board.bin \
$(1)/lib/firmware/ath10k/QCA9887/hw1.0/board.bin
endef
# $(eval $(call BuildPackage,ath10k-firmware-qca9887))
$(eval $(call BuildPackage,ath10k-firmware-qca9887))
Package/ath10k-firmware-qca9888 = $(call Package/firmware-default,ath10k qca9888 firmware)
define Package/ath10k-firmware-qca9888/install
@ -55,7 +55,7 @@ define Package/ath10k-firmware-qca988x/install
$(PKG_BUILD_DIR)/ath10k/QCA988X/hw2.0/firmware-5.bin \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin
endef
# $(eval $(call BuildPackage,ath10k-firmware-qca988x))
$(eval $(call BuildPackage,ath10k-firmware-qca988x))
Package/ath10k-firmware-qca6174 = $(call Package/firmware-default,ath10k qca6174 firmware)
define Package/ath10k-firmware-qca6174/install

View File

@ -9,8 +9,8 @@ include $(TOPDIR)/rules.mk
LUCI_TITLE:=n2n_v2 VPN Configuration module
LUCI_DEPENDS:=+n2n-edge +n2n-supernode
LUCI_PKGARCH:=all
PKG_VERSION:=1.0
PKG_RELEASE:=4
PKG_VERSION:=2.8.0
PKG_RELEASE:=1
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -1,18 +1,53 @@
--[[
--N2N VPN(V2) configuration page. Made by 981213
--
]]--
]] --
local fs = require "nixio.fs"
m = Map("n2n_v2", translate("N2N v2 VPN"),
translatef("n2n is a layer-two peer-to-peer virtual private network (VPN) which allows users to exploit features typical of P2P applications at network instead of application level."))
function get_mask(v)
v:value("1 ", "128.0.0.0(1)")
v:value("2 ", "192.0.0.0(2)")
v:value("3 ", "224.0.0.0(3)")
v:value("4 ", "240.0.0.0(4)")
v:value("5 ", "248.0.0.0(5)")
v:value("6 ", "252.0.0.0(6)")
v:value("7 ", "254.0.0.0(7)")
v:value("8 ", "255.0.0.0(8)")
v:value("9 ", "255.128.0.0(9)")
v:value("10", "255.192.0.0(10)")
v:value("11", "255.224.0.0(11)")
v:value("12", "255.240.0.0(12)")
v:value("13", "255.248.0.0(13)")
v:value("14", "255.252.0.0(14)")
v:value("15", "255.254.0.0(15)")
v:value("16", "255.255.0.0(16)")
v:value("17", "255.255.128.0(17)")
v:value("18", "255.255.192.0(18)")
v:value("19", "255.255.224.0(19)")
v:value("20", "255.255.240.0(20)")
v:value("21", "255.255.248.0(21)")
v:value("22", "255.255.252.0(22)")
v:value("23", "255.255.254.0(23)")
v:value("24", "255.255.255.0(24)")
v:value("25", "255.255.255.128(25)")
v:value("26", "255.255.255.192(26)")
v:value("27", "255.255.255.224(27)")
v:value("28", "255.255.255.240(28)")
v:value("29", "255.255.255.248(29)")
v:value("30", "255.255.255.252(30)")
v:value("31", "255.255.255.254(31)")
v:value("32", "255.255.255.255(32)")
end
m:section(SimpleSection).template = "n2n_v2/status"
m = Map("n2n_v2", translate("N2N v2 VPN"), translatef(
"n2n is a layer-two peer-to-peer virtual private network (VPN) which allows users to exploit features typical of P2P applications at network instead of application level."))
-- Basic config
m:section(SimpleSection).template = "n2n_v2/status"
s = m:section(TypedSection, "edge", translate("N2N Edge Settings"))
s.anonymous = true
s.addremove = true
s.addremove = true
switch = s:option(Flag, "enabled", translate("Enable"))
switch.rmempty = false
@ -26,19 +61,24 @@ mode:value("static")
ipaddr = s:option(Value, "ipaddr", translate("Interface IP address"))
ipaddr.optional = false
ipaddr.datatype = "ip4addr"
ipaddr:depends("mode", "static")
netmask = s:option(Value, "netmask", translate("Interface netmask"))
netmask.optional = false
prefix = s:option(ListValue, "prefix", translate("Interface netmask"))
get_mask(prefix)
prefix.optional = false
prefix:depends("mode", "static")
mtu = s:option(Value, "mtu", translate("MTU"))
mtu.datatype = "range(1,1500)"
mtu.optional = false
supernode = s:option(Value, "supernode", translate("Supernode IP address"))
supernode = s:option(Value, "supernode", translate("Supernode Host"))
supernode.datatype = "host"
supernode.optional = false
port = s:option(Value, "port", translate("Supernode Port"))
port.datatype = "range(0,65535)"
port.datatype = "port"
port.optional = false
community = s:option(Value, "community", translate("N2N Community name"))
@ -51,15 +91,38 @@ route.rmempty = false
s2 = m:section(TypedSection, "supernode", translate("N2N Supernode Settings"))
s2.anonymous = true
s2.addremove = true
s2.addremove = true
switch = s2:option(Flag, "enabled", translate("Enable"))
switch.rmempty = false
port = s2:option(Value, "port", translate("Port"))
port.datatype = "range(0,65535)"
port.datatype = "port"
port.optional = false
-- Static route
s = m:section(TypedSection, "route", translate("N2N routes"),
translate("Static route for n2n interface"))
s.anonymous = true
s.addremove = true
s.template = "cbi/tblsection"
---- IP address
o = s:option(Value, "ip", translate("IP"))
o.optional = false
o.datatype = "ip4addr"
o.rmempty = false
---- IP mask
o = s:option(ListValue, "mask", translate("Mask"))
o.optional = false
get_mask(o)
o.default = "24"
---- Gateway
o = s:option(Value, "gw", translate("Gateway"))
o.optional = false
o.datatype = "ip4addr"
o.rmempty = false
return m

View File

@ -32,8 +32,8 @@ msgstr "接口IP地址"
msgid "Interface netmask"
msgstr "接口子网掩码"
msgid "Supernode IP address"
msgstr "Supernode节点IP地址"
msgid "Supernode Host"
msgstr "Supernode节点地址"
msgid "N2N Community name"
msgstr "N2N网络组名称"
@ -58,3 +58,18 @@ msgstr "<b style='color:green;'>N2N v2 VPN 运行中</b>"
msgid "<b style='color:red;'>N2N v2 VPN is not running.</b>"
msgstr "<b style='color:red;'>N2N v2 VPN 未运行</b>"
msgid "N2N routes"
msgstr "路由表"
msgid "Static route for n2n interface"
msgstr "配置静态路由"
msgid "IP"
msgstr "IP"
msgid "Mask"
msgstr "掩码"
msgid "Gateway"
msgstr "网关"

View File

@ -8,7 +8,7 @@ PKG_NAME:=n2n
PKG_SOURCE_URL:=https://github.com/ntop/n2n.git
PKG_SOURCE_VERSION:=99e56e9f3c34c49eeb297971d41150b433489120
PKG_VERSION:=2.8.0_git-$(PKG_SOURCE_VERSION)
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)

View File

@ -3,7 +3,8 @@ config edge
option tunname 'n2n0'
option mode 'static'
option ipaddr '10.0.0.100'
option netmask '255.255.255.0'
option prefix '24'
option mtu '1290'
option supernode '1.2.3.4'
option port '1234'
option community 'example'

View File

@ -15,17 +15,18 @@ start_instance() {
config_get tunname "$cfg" 'tunname'
config_get mode "$cfg" 'mode'
config_get ipaddr "$cfg" 'ipaddr'
config_get netmask "$cfg" 'netmask'
config_get prefix "$cfg" 'prefix'
config_get mtu "$cfg" 'mtu'
config_get supernode "$cfg" 'supernode'
config_get port "$cfg" 'port'
config_get community "$cfg" 'community'
config_get key "$cfg" 'key'
config_get_bool route "$cfg" 'route' '0'
address="$ipaddr/$prefix"
[ "$route" = "1" ] && args='-r'
[ "$mode" = 'dhcp' ] && ipaddr='0.0.0.0'
[ "$mode" = 'dhcp' ] && address='0.0.0.0'
[ "-$mtu" != "-" ] && mtu="-M $mtu"
/usr/bin/edge -d $tunname -a ${mode}:${ipaddr} -c $community $([ -n "$key" ] && echo -k $key) -s ${netmask} -l ${supernode}:${port} $args $mtu
/usr/bin/edge -u 0 -g 0 -d $tunname -a ${mode}:${address} -c $community $([ -n "$key" ] && echo -k $key) -l ${supernode}:${port} $args $mtu
;;
supernode)
config_get_bool enabled "$cfg" 'enabled' '0'
@ -33,6 +34,12 @@ start_instance() {
config_get port "$cfg" port
/usr/bin/supernode -l $port &
;;
route)
config_get ip "$cfg" 'ip'
config_get mask "$cfg" 'mask'
config_get gw "$cfg" 'gw'
route add -net $ip/$mask gw $gw
;;
esac
}
@ -55,6 +62,7 @@ start() {
config_load 'n2n_v2'
config_foreach start_instance 'edge'
config_foreach start_instance 'supernode'
config_foreach start_instance 'route'
}
stop() {

View File

@ -9,13 +9,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=v2ray
PKG_VERSION:=4.28.2
PKG_VERSION:=4.29.0
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/v2ray-core-$(PKG_VERSION)
PKG_SOURCE:=v2ray-core-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/v2fly/v2ray-core/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=e78446333fd28ef8a3ec2c25612458bfc024a226008888ed5277201136f4ca97
PKG_HASH:=cc8cb22b616c218a6de9de0bee80651f502344a907b696008ae7bd467ba05a17
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
@ -69,7 +69,7 @@ include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/$(PKG_NAME)
TITLE:=A platform for building proxies
URL:=https://www.v2ray.com
URL:=https://www.v2fly.org
SECTION:=net
CATEGORY:=Network
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-certificates
@ -230,7 +230,7 @@ GEOIP_VER:=latest
GEOIP_FILE:=geoip-$(GEOIP_VER).dat
define Download/geoip.dat
URL:=https://github.com/v2ray/geoip/releases/$(GEOIP_VER)/download
URL:=https://github.com/v2fly/geoip/releases/$(GEOIP_VER)/download
URL_FILE:=geoip.dat
FILE:=$(GEOIP_FILE)
HASH:=skip
@ -240,7 +240,7 @@ GEOSITE_VER:=latest
GEOSITE_FILE:=geosite-$(GEOSITE_VER).dat
define Download/geosite.dat
URL:=https://github.com/v2ray/domain-list-community/releases/$(GEOSITE_VER)/download
URL:=https://github.com/v2fly/domain-list-community/releases/$(GEOSITE_VER)/download
URL_FILE:=dlc.dat
FILE:=$(GEOSITE_FILE)
HASH:=skip

View File

@ -7,8 +7,8 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-passwall
PKG_VERSION:=3.9
PKG_RELEASE:=61
PKG_DATE:=20200919
PKG_RELEASE:=64
PKG_DATE:=20200925
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
@ -93,7 +93,7 @@ define Package/$(PKG_NAME)
+curl +ca-certificates +resolveip +unzip +dnsmasq-full +tcping +libuci-lua \
+ipt2socks \
+ssocks \
+ssocksd \
+microsocks \
+pdnsd-alt \
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks:shadowsocks-libev-ss-redir \
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks:shadowsocks-libev-ss-local \

View File

@ -3,6 +3,7 @@ module("luci.controller.passwall", package.seeall)
local appname = "passwall"
local ucic = luci.model.uci.cursor()
local http = require "luci.http"
local util = require "luci.util"
local kcptun = require "luci.model.cbi.passwall.api.kcptun"
local brook = require "luci.model.cbi.passwall.api.brook"
local v2ray = require "luci.model.cbi.passwall.api.v2ray"
@ -47,6 +48,7 @@ function index()
entry({"admin", "services", appname, "link_load_temp"}, call("link_load_temp")).leaf = true
entry({"admin", "services", appname, "link_clear_temp"}, call("link_clear_temp")).leaf = true
entry({"admin", "services", appname, "link_add_node"}, call("link_add_node")).leaf = true
entry({"admin", "services", appname, "get_now_use_node"}, call("get_now_use_node")).leaf = true
entry({"admin", "services", appname, "get_log"}, call("get_log")).leaf = true
entry({"admin", "services", appname, "clear_log"}, call("clear_log")).leaf = true
entry({"admin", "services", appname, "status"}, call("status")).leaf = true
@ -124,6 +126,28 @@ function link_add_node()
luci.sys.call("lua /usr/share/passwall/subscribe.lua add log")
end
function get_now_use_node()
local e = {}
local tcp_node_num = ucic:get(appname, "@global_other[0]", "tcp_node_num") or 1
e.tcp = tonumber(tcp_node_num)
for i = 1, tcp_node_num, 1 do
local data, code, msg = nixio.fs.readfile("/var/etc/passwall/id/TCP_" .. i)
if data then
e["TCP" .. i] = util.trim(data)
end
end
local udp_node_num = ucic:get(appname, "@global_other[0]", "udp_node_num") or 1
e.udp = tonumber(udp_node_num)
for i = 1, udp_node_num, 1 do
local data, code, msg = nixio.fs.readfile("/var/etc/passwall/id/UDP_" .. i)
if data then
e["UDP" .. i] = util.trim(data)
end
end
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end
function get_log()
-- luci.sys.exec("[ -f /var/log/passwall.log ] && sed '1!G;h;$!d' /var/log/passwall.log > /var/log/passwall_show.log")
luci.http.write(luci.sys.exec("[ -f '/var/log/passwall.log' ] && cat /var/log/passwall.log"))

View File

@ -45,6 +45,28 @@ uci:foreach(appname, "socks", function(s)
end
end)
local doh_validate = function(self, value, t)
if value ~= "" then
local flag = 0
local util = require "luci.util"
local val = util.split(value, ",")
local url = val[1]
val[1] = nil
for i = 1, #val do
local v = val[i]
if v then
if not datatypes.ipmask4(v) then
flag = 1
end
end
end
if flag == 0 then
return value
end
end
return nil, translate("DoH request address") .. " " .. translate("Format must be:") .. " URL,IP"
end
m = Map(appname)
local status = m:get("@global_other[0]", "status") or ""
if status:find("big_icon") then
@ -143,10 +165,10 @@ o:value("180.76.76.76", "180.76.76.76 (" .. translate("Baidu") .. "DNS)")
---- DoH
o = s:taboption("DNS", Value, "up_china_dns_doh", translate("DoH request address"))
o.description = translate("When custom, Please follow the format strictly:") .. "<br />" .. "https://dns.alidns.com/dns-query,223.5.5.5,223.6.6.6<br />" .. "https://doh.pub/dns-query,119.29.29.29"
o:value("https://dns.alidns.com/dns-query,223.5.5.5,223.6.6.6", "AliDNS")
o:value("https://doh.pub/dns-query,119.29.29.29,119.28.28.28", "DNSPod")
o.default = "https://dns.alidns.com/dns-query,223.5.5.5,223.6.6.6"
o.validate = doh_validate
o:depends("up_china_dns", "https-dns-proxy")
---- DNS Forward Mode
@ -169,6 +191,13 @@ o:value("custom", translate("Custom DNS"))
---- Custom DNS
o = s:taboption("DNS", Value, "custom_dns", translate("Custom DNS"))
o.default = "127.0.0.1#5353"
o.validate = function(self, value, t)
local v = string.gsub(value, "#", ":")
if not datatypes.ipaddrport(v) then
return nil, translate("Custom DNS") .. " " .. translate("Not valid IP format, please re-enter!")
end
return value
end
o:depends({dns_mode = "custom"})
o = s:taboption("DNS", ListValue, "up_trust_pdnsd_dns", translate("Resolver For The List Proxied"))
@ -185,12 +214,17 @@ o:depends("dns_mode", "https-dns-proxy")
o = s:taboption("DNS", Value, "socks_server", translate("Socks Server"), translate("Make sure socks service is available on this address."))
for k, v in pairs(socks_table) do o:value(v.id, v.remarks) end
o.validate = function(self, value, t)
if not datatypes.ipaddrport(value) then
return nil, translate("Socks Server") .. " " .. translate("Not valid IP format, please re-enter!")
end
return value
end
o:depends({dns_mode = "dns2socks"})
o:depends({dns_mode = "https-dns-proxy", up_trust_doh_dns = "socks"})
---- DoH
o = s:taboption("DNS", Value, "up_trust_doh", translate("DoH request address"))
o.description = translate("When custom, Please follow the format strictly:") .. "<br />" .. "https://dns.google/dns-query,8.8.8.8,8.8.4.4<br />" .. "https://doh.opendns.com/dns-query,208.67.222.222"
o:value("https://dns.adguard.com/dns-query,176.103.130.130,176.103.130.131", "AdGuard")
o:value("https://cloudflare-dns.com/dns-query,1.1.1.1,1.0.0.1", "Cloudflare")
o:value("https://security.cloudflare-dns.com/dns-query,1.1.1.2,1.0.0.2", "Cloudflare-Security")
@ -200,6 +234,7 @@ o:value("https://doh.libredns.gr/dns-query,116.202.176.26", "LibreDNS")
o:value("https://doh.libredns.gr/ads,116.202.176.26", "LibreDNS (No Ads)")
o:value("https://dns.quad9.net/dns-query,9.9.9.9,149.112.112.112", "Quad9-Recommended")
o.default = "https://dns.google/dns-query,8.8.8.8,8.8.4.4"
o.validate = doh_validate
o:depends({dns_mode = "https-dns-proxy"})
---- DNS Forward

View File

@ -69,16 +69,15 @@ local function start()
local udp_forward = 1
local type = user.type or ""
if type == "Socks" then
local port = user.port
local auth = ""
local username = user.username
local password = user.password
if username and password then
local auth_file = CONFIG_PATH .. "/" .. id .. ".auth"
cmd(string.format('echo %s:%s > %s', username, password, auth_file))
bin = ln_start("/usr/bin/ssocksd", "ssocksd_" .. id, "-p " .. port .. " -a " .. auth_file)
else
bin = ln_start("/usr/bin/ssocksd", "ssocksd_" .. id, "-p " .. port)
if username and username ~= "" and password and password ~= "" then
username = "-u " .. username
password = "-P " .. password
auth = username .. " " .. password
end
bin = ln_start("/usr/bin/microsocks", "microsocks_" .. id, string.format("-i :: -p %s %s", port, auth))
elseif type == "SS" or type == "SSR" then
config = require("luci.model.cbi.passwall.server.api.shadowsocks").gen_config(user)
local udp_param = ""

View File

@ -69,7 +69,7 @@ remarks.default = translate("Remarks")
remarks.rmempty = false
type = s:option(ListValue, "type", translate("Type"))
if api.is_finded("ssocksd") then
if api.is_finded("microsocks") then
type:value("Socks", translate("Socks"))
end
if api.is_finded("ss-server") then
@ -125,12 +125,28 @@ port.datatype = "port"
port.rmempty = false
username = s:option(Value, "username", translate("Username"))
username.validate = function(self, value, t)
if value then
if not password:formvalue(t) or password:formvalue(t) == "" then
return nil, translate("Username and Password must be used together!")
end
end
return value
end
username:depends("protocol", "http")
username:depends("protocol", "socks")
username:depends("type", "Socks")
password = s:option(Value, "password", translate("Password"))
password.password = true
password.validate = function(self, value, t)
if value then
if (protocol:formvalue(t) == "http" or protocol:formvalue(t) == "socks" or type:formvalue(t) == "Socks") and (not username:formvalue(t) or username:formvalue(t) == "") then
return nil, translate("Username and Password must be used together!")
end
end
return value
end
password:depends("type", "Socks")
password:depends("type", "SS")
password:depends("type", "SSR")

View File

@ -34,6 +34,11 @@ table td, .table .td {
._select {
background: #dad8d8;
}
._now_use {
background: #94e1ff;
}
.ping a:hover{
text-decoration : underline;
}
@ -214,6 +219,36 @@ table td, .table .td {
}
}
//获取当前使用的节点
function get_now_use_node() {
XHR.get('<%=dsp.build_url("admin/services/passwall/get_now_use_node")%>', null,
function(x, result) {
for (var i = 1; i <= result.udp; i++) {
var id = result["UDP" + i];
if (id) {
var dom = document.getElementById("cbi-passwall-" + id);
if (dom) {
dom.classList.add("_now_use");
dom.title = "当前UDP" + i + "节点";
}
}
}
for (var i = 1; i <= result.tcp; i++) {
var id = result["TCP" + i];
if (id) {
var dom = document.getElementById("cbi-passwall-" + id);
if (dom) {
dom.classList.add("_now_use");
dom.title = "当前TCP" + i + "节点";
//var v = "当前使用:" + document.getElementById("cbid.passwall." + id + ".remarks").value;
//document.getElementById("cbi-passwall-" + id + "-remarks").innerHTML = v;
}
}
}
}
);
}
function ping_node(cbi_id, dom) {
var full = get_address_full(cbi_id);
if (full != null) {
@ -266,6 +301,8 @@ table td, .table .td {
}
}
get_now_use_node();
const _xhr = (index) => {
return new Promise((res) => {
const dom = nodes[index];
@ -365,7 +402,7 @@ table td, .table .td {
*/
var edit_btn = document.getElementById("cbi-passwall-nodes").getElementsByClassName("cbi-button cbi-button-edit");
for(var i = 0; i < edit_btn.length; i++) {
for (var i = 0; i < edit_btn.length; i++) {
try {
var onclick_str = edit_btn[i].getAttribute("onclick");
var id = onclick_str.substring(onclick_str.lastIndexOf('/') + 1, onclick_str.length - 1);

View File

@ -211,6 +211,9 @@ msgstr "ChinaDNS-NG 公平模式"
msgid "Filtered DNS(For Proxied Domains)"
msgstr "域名过滤服务(用于被代理的域名)"
msgid "Format must be:"
msgstr "格式必须为:"
msgid "DoH request address"
msgstr "DoH 请求地址"
@ -970,6 +973,9 @@ msgstr "匿名"
msgid "User Password"
msgstr "账号密码"
msgid "Username and Password must be used together!"
msgstr "账号和密码必须同时使用!"
msgid "Node Number"
msgstr "节点数量"

View File

@ -438,16 +438,32 @@ run_redir() {
esac
;;
TCP)
local kcptun_use=$(config_n_get $node use_kcp 0)
if [ "$kcptun_use" == "1" ]; then
local kcptun_server_host=$(config_n_get $node kcp_server)
local network_type="ipv4"
local kcptun_port=$(config_n_get $node kcp_port)
local kcptun_config="$(config_n_get $node kcp_opts)"
if [ -z "$kcptun_port" -o -z "$kcptun_config" ]; then
echolog "Kcptun未配置参数错误"
return 1
fi
if [ -n "$kcptun_port" -a -n "$kcptun_config" ]; then
local run_kcptun_ip=$server_host
[ -n "$kcptun_server_host" ] && run_kcptun_ip=$(get_host_ip $network_type $kcptun_server_host)
KCPTUN_REDIR_PORT=$(get_new_port $KCPTUN_REDIR_PORT tcp)
kcptun_params="-l 0.0.0.0:$KCPTUN_REDIR_PORT -r $run_kcptun_ip:$kcptun_port $kcptun_config"
ln_start_bin "$(first_type $(config_t_get global_app kcptun_client_file notset) kcptun-client)" "kcptun_tcp_$6" $kcptun_params
fi
fi
local _socks_flag _socks_address _socks_port _socks_username _socks_password
case "$type" in
socks)
local node_address=$(config_n_get $node address)
local node_port=$(config_n_get $node port)
local server_username=$(config_n_get $node username)
local server_password=$(config_n_get $node password)
eval port=\$TCP_REDIR_PORT$6
local extra_param="-T"
[ "$6" == 1 ] && [ "$UDP_NODE1" == "tcp" ] && extra_param=""
ln_start_bin "$(first_type ipt2socks)" "ipt2socks_tcp_$6" -l "$port" -b 0.0.0.0 -s "$node_address" -p "$node_port" -R $extra_param
_socks_flag=1
_socks_address=$(config_n_get $node address)
_socks_port=$(config_n_get $node port)
_socks_username=$(config_n_get $node username)
_socks_password=$(config_n_get $node password)
;;
v2ray)
local extra_param="tcp"
@ -470,65 +486,46 @@ run_redir() {
ln_start_bin "$(first_type naive)" naive "$config_file"
;;
brook)
local server_ip=$server_host
local protocol=$(config_n_get $node protocol client)
local brook_tls=$(config_n_get $node brook_tls 0)
if [ "$protocol" == "wsclient" ]; then
echolog "Brook的WebSocket不支持UDP转发"
[ "$brook_tls" == "1" ] && server_ip="wss://${server_ip}" || server_ip="ws://${server_ip}"
socks_port=$(get_new_port 2081 tcp)
ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_tcp_$6" wsclient --socks5 "127.0.0.1:$socks_port" -s "$server_ip:$port" -p "$(config_n_get $node password)"
_socks_flag=1
_socks_address="127.0.0.1"
_socks_port=$socks_port
echolog "Brook的WebSocket不支持透明代理将使用ipt2socks转换透明代理"
[ "$6" == 1 ] && [ "$UDP_NODE1" == "tcp" ] && echolog "Brook的WebSocket不支持UDP转发"
else
ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_udp_$6" tproxy -l ":$local_port" -s "$server_host:$port" -p "$(config_n_get $node password)"
[ "$kcptun_use" == "1" ] && {
server_ip=127.0.0.1
port=$KCPTUN_REDIR_PORT
}
ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_tcp_$6" tproxy -l ":$local_port" -s "$server_ip:$port" -p "$(config_n_get $node password)"
fi
;;
*)
local kcptun_use=$(config_n_get $node use_kcp 0)
ss|ssr)
if [ "$kcptun_use" == "1" ]; then
local kcptun_server_host=$(config_n_get $node kcp_server)
local network_type="ipv4"
local kcptun_port=$(config_n_get $node kcp_port)
local kcptun_config="$(config_n_get $node kcp_opts)"
if [ -z "$kcptun_port" -o -z "$kcptun_config" ]; then
echolog "Kcptun未配置参数错误"
force_stop
fi
if [ -n "$kcptun_port" -a -n "$kcptun_config" ]; then
local run_kcptun_ip=$server_host
[ -n "$kcptun_server_host" ] && run_kcptun_ip=$(get_host_ip $network_type $kcptun_server_host)
KCPTUN_REDIR_PORT=$(get_new_port $KCPTUN_REDIR_PORT tcp)
kcptun_params="-l 0.0.0.0:$KCPTUN_REDIR_PORT -r $run_kcptun_ip:$kcptun_port $kcptun_config"
ln_start_bin "$(first_type $(config_t_get global_app kcptun_client_file notset) kcptun-client)" "kcptun_tcp_$6" $kcptun_params
fi
fi
if [ "$type" == "ssr" ] || [ "$type" == "ss" ]; then
if [ "$kcptun_use" == "1" ]; then
lua $API_GEN_SS $node $local_port 127.0.0.1 $KCPTUN_REDIR_PORT > $config_file
[ "$6" == 1 ] && [ "$UDP_NODE1" == "tcp" ] && echolog "Kcptun不支持UDP转发"
else
lua $API_GEN_SS $node $local_port > $config_file
[ "$6" == 1 ] && [ "$UDP_NODE1" == "tcp" ] && extra_param="-u"
fi
for k in $(seq 1 $process); do
ln_start_bin "$(first_type ${type}-redir)" "${type}-redir" -c "$config_file" $extra_param
done
elif [ "$type" == "brook" ]; then
local server_ip=$server_host
local protocol=$(config_n_get $node protocol client)
local brook_tls=$(config_n_get $node brook_tls 0)
if [ "$protocol" == "wsclient" ]; then
[ "$brook_tls" == "1" ] && server_ip="wss://${server_ip}" || server_ip="ws://${server_ip}"
socks_port=$(get_new_port 2081 tcp)
ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_tcp_$6" wsclient --socks5 "127.0.0.1:$socks_port" -s "$server_ip:$port" -p "$(config_n_get $node password)"
eval port=\$TCP_REDIR_PORT$6
ln_start_bin "$(first_type ipt2socks)" "ipt2socks_tcp_$6" -T -l "$port" -b 0.0.0.0 -s 127.0.0.1 -p "$socks_port" -R
echolog "Brook的WebSocket不支持透明代理将使用ipt2socks转换透明代理"
[ "$6" == 1 ] && [ "$UDP_NODE1" == "tcp" ] && echolog "Brook的WebSocket不支持UDP转发"
else
[ "$kcptun_use" == "1" ] && {
server_ip=127.0.0.1
port=$KCPTUN_REDIR_PORT
}
ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_tcp_$6" tproxy -l ":$local_port" -s "$server_ip:$port" -p "$(config_n_get $node password)"
fi
lua $API_GEN_SS $node $local_port 127.0.0.1 $KCPTUN_REDIR_PORT > $config_file
process=1
[ "$6" == 1 ] && [ "$UDP_NODE1" == "tcp" ] && echolog "Kcptun不支持UDP转发"
else
lua $API_GEN_SS $node $local_port > $config_file
[ "$6" == 1 ] && [ "$UDP_NODE1" == "tcp" ] && extra_param="-u"
fi
for k in $(seq 1 $process); do
ln_start_bin "$(first_type ${type}-redir)" "${type}-redir" -c "$config_file" $extra_param
done
;;
esac
if [ -n "$_socks_flag" ]; then
local extra_param="-T"
[ "$6" == 1 ] && [ "$UDP_NODE1" == "tcp" ] && extra_param=""
ln_start_bin "$(first_type ipt2socks)" "ipt2socks_tcp_$6" -l "$local_port" -b 0.0.0.0 -s "$_socks_address" -p "$_socks_port" -R $extra_param
fi
unset _socks_flag _socks_address _socks_port _socks_username _socks_password
;;
esac
return 0

View File

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fstools
PKG_RELEASE:=5
PKG_RELEASE:=6
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git

View File

@ -0,0 +1,56 @@
From d05276dc1d6de119da518d62930b9a8ef55ef7e9 Mon Sep 17 00:00:00 2001
From: Yousong Zhou <yszhou4tech@gmail.com>
Date: Fri, 25 Oct 2019 10:48:47 +0000
Subject: [PATCH] libblkid-tiny: ntfs: fix use-after-free
The memory pointed to by ns can be reallocated when checking mft records
Fixes FS#2129
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
---
libblkid-tiny/ntfs.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
--- a/libblkid-tiny/ntfs.c
+++ b/libblkid-tiny/ntfs.c
@@ -88,6 +88,7 @@ static int probe_ntfs(blkid_probe pr, co
uint32_t sectors_per_cluster, mft_record_size;
uint16_t sector_size;
+ uint64_t volume_serial;
uint64_t nr_clusters, off; //, attr_off;
unsigned char *buf_mft;
@@ -148,15 +149,16 @@ static int probe_ntfs(blkid_probe pr, co
return 1;
+ volume_serial = ns->volume_serial;
off = le64_to_cpu(ns->mft_cluster_location) * sector_size *
sectors_per_cluster;
DBG(LOWPROBE, ul_debug("NTFS: sector_size=%"PRIu16", mft_record_size=%"PRIu32", "
"sectors_per_cluster=%"PRIu32", nr_clusters=%"PRIu64" "
- "cluster_offset=%"PRIu64"",
+ "cluster_offset=%"PRIu64", volume_serial=%"PRIu64"",
sector_size, mft_record_size,
sectors_per_cluster, nr_clusters,
- off));
+ off, volume_serial));
buf_mft = blkid_probe_get_buffer(pr, off, mft_record_size);
if (!buf_mft)
@@ -207,9 +209,9 @@ static int probe_ntfs(blkid_probe pr, co
#endif
blkid_probe_sprintf_uuid(pr,
- (unsigned char *) &ns->volume_serial,
- sizeof(ns->volume_serial),
- "%016" PRIX64, le64_to_cpu(ns->volume_serial));
+ (unsigned char *) &volume_serial,
+ sizeof(volume_serial),
+ "%016" PRIX64, le64_to_cpu(volume_serial));
return 0;
}

View File

@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=refpolicy
PKG_VERSION:=2.20200229
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_2_20200229
@ -29,6 +29,7 @@ define Package/refpolicy
CATEGORY:=Base system
TITLE:=SELinux reference policy
URL:=http://selinuxproject.org/page/Main_Page
PKGARCH:=all
endef
define Package/refpolicy/description
@ -55,9 +56,8 @@ endef
# builds is a small host tool that gets run as part of the build
# process.
MAKE_FLAGS += \
TEST_TOOLCHAIN="$(STAGING_DIR_HOSTPKG)" \
BINDIR=/bin \
SBINDIR=/sbin \
SETFILES="$(STAGING_DIR_HOST)/bin/setfiles" \
CHECKPOLICY="$(STAGING_DIR_HOSTPKG)/bin/checkpolicy" \
CC="$(HOSTCC)" \
CFLAGS="$(HOST_CFLAGS)"

View File

@ -67,7 +67,7 @@ MAKE_FLAGS += \
HOST_MAKE_FLAGS += \
PAMH=$(CONFIG_BUSYBOX_CONFIG_PAM) \
DESTDIR=$(STAGING_DIR_HOSTPKG) \
DESTDIR=$(STAGING_DIR_HOST) \
PREFIX= \
SBINDIR=/bin

View File

@ -85,6 +85,7 @@ endif
$(CP) $(STAGING_DIR_HOST)/bin/* $(PKG_BUILD_DIR)/staging_dir/host/bin/
(cd $(PKG_BUILD_DIR); find staging_dir/host/bin/ $(IB_LDIR)/scripts/dtc/ -type f | \
$(XARGS) $(SCRIPT_DIR)/bundle-libraries.sh $(PKG_BUILD_DIR)/staging_dir/host)
$(CP) $(TOPDIR)/staging_dir/host/lib/libfakeroot* $(PKG_BUILD_DIR)/staging_dir/host/lib
STRIP=sstrip $(SCRIPT_DIR)/rstrip.sh $(PKG_BUILD_DIR)/staging_dir/host/bin/
$(TAR) -cf - -C $(BUILD_DIR) $(IB_NAME) | xz -T$(if $(filter 1,$(NPROC)),2,0) -zc -7e > $@

View File

@ -42,7 +42,7 @@ Signed-off-by: Vinod Koul <vkoul@kernel.org>
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14075,9 +14075,11 @@ SYNOPSYS DESIGNWARE DMAC DRIVER
@@ -14084,9 +14084,11 @@ SYNOPSYS DESIGNWARE DMAC DRIVER
M: Viresh Kumar <vireshk@kernel.org>
R: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
S: Maintained

View File

@ -928,7 +928,7 @@ Fixes https://github.com/raspberrypi/linux/issues/2408
USB_PORT_FEAT_C_OVER_CURRENT);
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -2000,6 +2000,85 @@ free_interfaces:
@@ -1993,6 +1993,85 @@ free_interfaces:
if (cp->string == NULL &&
!(dev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS))
cp->string = usb_cache_string(dev, cp->desc.iConfiguration);

View File

@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
#define USB_VENDOR_ID_BELKIN 0x050d
#define USB_DEVICE_ID_FLIP_KVM 0x3201
@@ -1209,6 +1212,9 @@
@@ -1211,6 +1214,9 @@
#define USB_VENDOR_ID_XAT 0x2505
#define USB_DEVICE_ID_XAT_CSR 0x0220
@ -53,7 +53,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_MULTI_TOUCH), HID_QUIRK_MULTI_INPUT },
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL },
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE2), HID_QUIRK_ALWAYS_POLL },
@@ -178,6 +179,7 @@ static const struct hid_device_id hid_qu
@@ -180,6 +181,7 @@ static const struct hid_device_id hid_qu
{ HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SIRIUS_BATTERY_FREE_TABLET), HID_QUIRK_MULTI_INPUT },
{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD2, USB_DEVICE_ID_SMARTJOY_DUAL_PLUS), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },

View File

@ -30,7 +30,7 @@ Signed-off-by: Johan Hovold <johan@kernel.org>
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -1990,7 +1990,8 @@ static const struct usb_device_id option
@@ -1996,7 +1996,8 @@ static const struct usb_device_id option
{ USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d01, 0xff) }, /* D-Link DWM-156 (variant) */
{ USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d02, 0xff) },
{ USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d03, 0xff) },

View File

@ -10,14 +10,14 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/Makefile
+++ b/Makefile
@@ -432,8 +432,8 @@ KBUILD_LDFLAGS :=
@@ -450,8 +450,8 @@ KBUILD_LDFLAGS :=
GCC_PLUGINS_CFLAGS :=
CLANG_FLAGS :=
-export ARCH SRCARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC
-export CPP AR NM STRIP OBJCOPY OBJDUMP KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS
+export ARCH SRCARCH SUBARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD
+export CC CPP AR NM STRIP OBJCOPY OBJDUMP KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS
-export ARCH SRCARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC
-export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE READELF KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS
+export ARCH SRCARCH SUBARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC
+export CC CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE READELF KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS
export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE
export HOSTCXX KBUILD_HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS

View File

@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1783,6 +1783,19 @@ int phy_set_max_speed(struct phy_device
@@ -1784,6 +1784,19 @@ int phy_set_max_speed(struct phy_device
}
EXPORT_SYMBOL(phy_set_max_speed);

View File

@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1796,6 +1796,36 @@ void phy_support_asym_pause(struct phy_d
@@ -1797,6 +1797,36 @@ void phy_support_asym_pause(struct phy_d
}
EXPORT_SYMBOL(phy_support_asym_pause);

View File

@ -130,7 +130,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
/* Some Ethernet drivers try to connect to a PHY device before
* calling register_netdevice() -> netdev_register_kobject() and
* does the dev->dev.kobj initialization. Here we only check for
@@ -1956,6 +2019,9 @@ static int phy_remove(struct device *dev
@@ -1957,6 +2020,9 @@ static int phy_remove(struct device *dev
phydev->state = PHY_DOWN;
mutex_unlock(&phydev->lock);

View File

@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1159,6 +1159,10 @@ config SYNC_R4K
@@ -1160,6 +1160,10 @@ config SYNC_R4K
config MIPS_MACHINE
def_bool n

View File

@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/Makefile
+++ b/Makefile
@@ -1240,7 +1240,6 @@ endif
@@ -1260,7 +1260,6 @@ endif
PHONY += modules
modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
@$(kecho) ' Building modules, stage 2.';
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
@@ -1269,7 +1268,6 @@ _modinst_:
@@ -1289,7 +1288,6 @@ _modinst_:
rm -f $(MODLIB)/build ; \
ln -s $(CURDIR) $(MODLIB)/build ; \
fi

View File

@ -33,7 +33,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
# Read KERNELRELEASE from include/config/kernel.release (if it exists)
KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
@@ -772,11 +777,6 @@ ifdef CONFIG_DEBUG_SECTION_MISMATCH
@@ -792,11 +797,6 @@ ifdef CONFIG_DEBUG_SECTION_MISMATCH
KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once)
endif

View File

@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1144,6 +1144,10 @@ config SYNC_R4K
@@ -1145,6 +1145,10 @@ config SYNC_R4K
config MIPS_MACHINE
def_bool n

View File

@ -15,7 +15,7 @@
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1583,6 +1583,9 @@ int genphy_update_link(struct phy_device
@@ -1584,6 +1584,9 @@ int genphy_update_link(struct phy_device
{
int status;

View File

@ -17,7 +17,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -651,7 +651,7 @@ static int ehci_run (struct usb_hcd *hcd
@@ -652,7 +652,7 @@ static int ehci_run (struct usb_hcd *hcd
"USB %x.%x started, EHCI %x.%02x%s\n",
((ehci->sbrn & 0xf0)>>4), (ehci->sbrn & 0x0f),
temp >> 8, temp & 0xff,
@ -28,7 +28,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
&ehci->regs->intr_enable); /* Turn On Interrupts */
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -646,7 +646,7 @@ ehci_hub_status_data (struct usb_hcd *hc
@@ -645,7 +645,7 @@ ehci_hub_status_data (struct usb_hcd *hc
* always set, seem to clear PORT_OCC and PORT_CSC when writing to
* PORT_POWER; that's surprising, but maybe within-spec.
*/
@ -37,7 +37,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
mask = PORT_CSC | PORT_PEC | PORT_OCC;
else
mask = PORT_CSC | PORT_PEC;
@@ -1016,7 +1016,7 @@ int ehci_hub_control(
@@ -1015,7 +1015,7 @@ int ehci_hub_control(
if (temp & PORT_PEC)
status |= USB_PORT_STAT_C_ENABLE << 16;

View File

@ -9,7 +9,7 @@ Acked-by: Rob Landley <rob@landley.net>
---
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1068,9 +1068,6 @@ config FW_ARC
@@ -1069,9 +1069,6 @@ config FW_ARC
config ARCH_MAY_HAVE_PC_FDC
bool
@ -19,7 +19,7 @@ Acked-by: Rob Landley <rob@landley.net>
config CEVT_BCM1480
bool
@@ -2968,6 +2965,18 @@ choice
@@ -2969,6 +2966,18 @@ choice
bool "Extend builtin kernel arguments with bootloader arguments"
endchoice

View File

@ -24,7 +24,7 @@ v2: incorporated changes suggested by Jonas Gorski
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -2892,6 +2892,20 @@ config MIPS_O32_FP64_SUPPORT
@@ -2893,6 +2893,20 @@ config MIPS_O32_FP64_SUPPORT
If unsure, say N.

View File

@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
select HAVE_PCSPKR_PLATFORM
select IRQ_MIPS_CPU
select I8253
@@ -1129,6 +1131,9 @@ config DMA_NONCOHERENT
@@ -1130,6 +1132,9 @@ config DMA_NONCOHERENT
bool
select NEED_DMA_MAP_STATE
@ -40,7 +40,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
config NEED_DMA_MAP_STATE
bool
@@ -1653,6 +1658,7 @@ config CPU_R10000
@@ -1654,6 +1659,7 @@ config CPU_R10000
select CPU_SUPPORTS_64BIT_KERNEL
select CPU_SUPPORTS_HIGHMEM
select CPU_SUPPORTS_HUGEPAGES
@ -48,7 +48,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
help
MIPS Technologies R10000-series processors.
@@ -1901,9 +1907,11 @@ config SYS_HAS_CPU_MIPS32_R3_5
@@ -1902,9 +1908,11 @@ config SYS_HAS_CPU_MIPS32_R3_5
bool
config SYS_HAS_CPU_MIPS32_R5
@ -60,7 +60,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
bool
config SYS_HAS_CPU_MIPS64_R1
@@ -1913,6 +1921,7 @@ config SYS_HAS_CPU_MIPS64_R2
@@ -1914,6 +1922,7 @@ config SYS_HAS_CPU_MIPS64_R2
bool
config SYS_HAS_CPU_MIPS64_R6

View File

@ -17,7 +17,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -638,7 +638,7 @@ static int ehci_run (struct usb_hcd *hcd
@@ -639,7 +639,7 @@ static int ehci_run (struct usb_hcd *hcd
"USB %x.%x started, EHCI %x.%02x%s\n",
((ehci->sbrn & 0xf0)>>4), (ehci->sbrn & 0x0f),
temp >> 8, temp & 0xff,
@ -28,7 +28,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
&ehci->regs->intr_enable); /* Turn On Interrupts */
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -641,7 +641,7 @@ ehci_hub_status_data (struct usb_hcd *hc
@@ -640,7 +640,7 @@ ehci_hub_status_data (struct usb_hcd *hc
* always set, seem to clear PORT_OCC and PORT_CSC when writing to
* PORT_POWER; that's surprising, but maybe within-spec.
*/
@ -37,7 +37,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
mask = PORT_CSC | PORT_PEC | PORT_OCC;
else
mask = PORT_CSC | PORT_PEC;
@@ -1011,7 +1011,7 @@ int ehci_hub_control(
@@ -1010,7 +1010,7 @@ int ehci_hub_control(
if (temp & PORT_PEC)
status |= USB_PORT_STAT_C_ENABLE << 16;

View File

@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/Makefile
+++ b/Makefile
@@ -653,9 +653,9 @@ KBUILD_CFLAGS += $(call cc-disable-warni
@@ -673,9 +673,9 @@ KBUILD_CFLAGS += $(call cc-disable-warni
KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE

View File

@ -9,7 +9,7 @@ Acked-by: Rob Landley <rob@landley.net>
---
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1063,9 +1063,6 @@ config FW_ARC
@@ -1064,9 +1064,6 @@ config FW_ARC
config ARCH_MAY_HAVE_PC_FDC
bool
@ -19,7 +19,7 @@ Acked-by: Rob Landley <rob@landley.net>
config CEVT_BCM1480
bool
@@ -2969,6 +2966,18 @@ choice
@@ -2970,6 +2967,18 @@ choice
bool "Extend builtin kernel arguments with bootloader arguments"
endchoice

View File

@ -24,7 +24,7 @@ v2: incorporated changes suggested by Jonas Gorski
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -2893,6 +2893,20 @@ config MIPS_O32_FP64_SUPPORT
@@ -2894,6 +2894,20 @@ config MIPS_O32_FP64_SUPPORT
If unsure, say N.

View File

@ -19,7 +19,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1117,7 +1117,6 @@ config DMA_PERDEV_COHERENT
@@ -1118,7 +1118,6 @@ config DMA_PERDEV_COHERENT
config DMA_NONCOHERENT
bool
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
@ -27,7 +27,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
select NEED_DMA_MAP_STATE
select DMA_NONCOHERENT_MMAP
select DMA_NONCOHERENT_CACHE_SYNC
@@ -1898,9 +1897,11 @@ config SYS_HAS_CPU_MIPS32_R3_5
@@ -1899,9 +1898,11 @@ config SYS_HAS_CPU_MIPS32_R3_5
config SYS_HAS_CPU_MIPS32_R5
bool
@ -39,7 +39,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
config SYS_HAS_CPU_MIPS64_R1
bool
@@ -1910,6 +1911,7 @@ config SYS_HAS_CPU_MIPS64_R2
@@ -1911,6 +1912,7 @@ config SYS_HAS_CPU_MIPS64_R2
config SYS_HAS_CPU_MIPS64_R6
bool
@ -47,7 +47,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
config SYS_HAS_CPU_R3000
bool
@@ -1946,6 +1948,7 @@ config SYS_HAS_CPU_R8000
@@ -1947,6 +1949,7 @@ config SYS_HAS_CPU_R8000
config SYS_HAS_CPU_R10000
bool
@ -55,7 +55,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
config SYS_HAS_CPU_RM7000
bool
@@ -1974,6 +1977,7 @@ config SYS_HAS_CPU_BMIPS4380
@@ -1975,6 +1978,7 @@ config SYS_HAS_CPU_BMIPS4380
config SYS_HAS_CPU_BMIPS5000
bool
select SYS_HAS_CPU_BMIPS

View File

@ -1264,7 +1264,7 @@
extern struct kmem_cache *skbuff_head_cache;
void kfree_skb_partial(struct sk_buff *skb, bool head_stolen);
@@ -3922,8 +3941,12 @@ static inline void __nf_copy(struct sk_b
@@ -3923,8 +3942,12 @@ static inline void __nf_copy(struct sk_b
dst->_nfct = src->_nfct;
nf_conntrack_get(skb_nfct(src));
#endif

View File

@ -1,405 +0,0 @@
From 232aa8ec3ed979d4716891540c03a806ecab0c37 Mon Sep 17 00:00:00 2001
From: Priyaranjan Jha <priyarjha@google.com>
Date: Wed, 23 Jan 2019 12:04:53 -0800
Subject: tcp_bbr: refactor bbr_target_cwnd() for general inflight provisioning
Because bbr_target_cwnd() is really a general-purpose BBR helper for
computing some volume of inflight data as a function of the estimated
BDP, refactor it into following helper functions:
- bbr_bdp()
- bbr_quantization_budget()
- bbr_inflight()
Signed-off-by: Priyaranjan Jha <priyarjha@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -139,8 +139,8 @@ struct inet_connection_sock {
} icsk_mtup;
u32 icsk_user_timeout;
- u64 icsk_ca_priv[88 / sizeof(u64)];
-#define ICSK_CA_PRIV_SIZE (11 * sizeof(u64))
+ u64 icsk_ca_priv[104 / sizeof(u64)];
+#define ICSK_CA_PRIV_SIZE (13 * sizeof(u64))
};
#define ICSK_TIME_RETRANS 1 /* Retransmit timer */
--- a/net/ipv4/tcp_bbr.c
+++ b/net/ipv4/tcp_bbr.c
@@ -115,6 +115,14 @@ struct bbr {
unused_b:5;
u32 prior_cwnd; /* prior cwnd upon entering loss recovery */
u32 full_bw; /* recent bw, to estimate if pipe is full */
+
+ /* For tracking ACK aggregation: */
+ u64 ack_epoch_mstamp; /* start of ACK sampling epoch */
+ u16 extra_acked[2]; /* max excess data ACKed in epoch */
+ u32 ack_epoch_acked:20, /* packets (S)ACKed in sampling epoch */
+ extra_acked_win_rtts:5, /* age of extra_acked, in round trips */
+ extra_acked_win_idx:1, /* current index in extra_acked array */
+ unused_c:6;
};
#define CYCLE_LEN 8 /* number of phases in a pacing gain cycle */
@@ -174,6 +182,15 @@ static const u32 bbr_lt_bw_diff = 4000 /
/* If we estimate we're policed, use lt_bw for this many round trips: */
static const u32 bbr_lt_bw_max_rtts = 48;
+/* Gain factor for adding extra_acked to target cwnd: */
+static const int bbr_extra_acked_gain = BBR_UNIT;
+/* Window length of extra_acked window. */
+static const u32 bbr_extra_acked_win_rtts = 5;
+/* Max allowed val for ack_epoch_acked, after which sampling epoch is reset */
+static const u32 bbr_ack_epoch_acked_reset_thresh = 1U << 20;
+/* Time period for clamping cwnd increment due to ack aggregation */
+static const u32 bbr_extra_acked_max_us = 100 * 1000;
+
static void bbr_check_probe_rtt_done(struct sock *sk);
/* Do we estimate that STARTUP filled the pipe? */
@@ -200,6 +217,16 @@ static u32 bbr_bw(const struct sock *sk)
return bbr->lt_use_bw ? bbr->lt_bw : bbr_max_bw(sk);
}
+/* Return maximum extra acked in past k-2k round trips,
+ * where k = bbr_extra_acked_win_rtts.
+ */
+static u16 bbr_extra_acked(const struct sock *sk)
+{
+ struct bbr *bbr = inet_csk_ca(sk);
+
+ return max(bbr->extra_acked[0], bbr->extra_acked[1]);
+}
+
/* Return rate in bytes per second, optionally with a gain.
* The order here is chosen carefully to avoid overflow of u64. This should
* work for input rates of up to 2.9Tbit/sec and gain of 2.89x.
@@ -305,6 +332,8 @@ static void bbr_cwnd_event(struct sock *
if (event == CA_EVENT_TX_START && tp->app_limited) {
bbr->idle_restart = 1;
+ bbr->ack_epoch_mstamp = tp->tcp_mstamp;
+ bbr->ack_epoch_acked = 0;
/* Avoid pointless buffer overflows: pace at est. bw if we don't
* need more speed (we're restarting from idle and app-limited).
*/
@@ -315,30 +344,19 @@ static void bbr_cwnd_event(struct sock *
}
}
-/* Find target cwnd. Right-size the cwnd based on min RTT and the
- * estimated bottleneck bandwidth:
+/* Calculate bdp based on min RTT and the estimated bottleneck bandwidth:
*
- * cwnd = bw * min_rtt * gain = BDP * gain
+ * bdp = bw * min_rtt * gain
*
* The key factor, gain, controls the amount of queue. While a small gain
* builds a smaller queue, it becomes more vulnerable to noise in RTT
* measurements (e.g., delayed ACKs or other ACK compression effects). This
* noise may cause BBR to under-estimate the rate.
- *
- * To achieve full performance in high-speed paths, we budget enough cwnd to
- * fit full-sized skbs in-flight on both end hosts to fully utilize the path:
- * - one skb in sending host Qdisc,
- * - one skb in sending host TSO/GSO engine
- * - one skb being received by receiver host LRO/GRO/delayed-ACK engine
- * Don't worry, at low rates (bbr_min_tso_rate) this won't bloat cwnd because
- * in such cases tso_segs_goal is 1. The minimum cwnd is 4 packets,
- * which allows 2 outstanding 2-packet sequences, to try to keep pipe
- * full even with ACK-every-other-packet delayed ACKs.
*/
-static u32 bbr_target_cwnd(struct sock *sk, u32 bw, int gain)
+static u32 bbr_bdp(struct sock *sk, u32 bw, int gain)
{
struct bbr *bbr = inet_csk_ca(sk);
- u32 cwnd;
+ u32 bdp;
u64 w;
/* If we've never had a valid RTT sample, cap cwnd at the initial
@@ -353,7 +371,24 @@ static u32 bbr_target_cwnd(struct sock *
w = (u64)bw * bbr->min_rtt_us;
/* Apply a gain to the given value, then remove the BW_SCALE shift. */
- cwnd = (((w * gain) >> BBR_SCALE) + BW_UNIT - 1) / BW_UNIT;
+ bdp = (((w * gain) >> BBR_SCALE) + BW_UNIT - 1) / BW_UNIT;
+
+ return bdp;
+}
+
+/* To achieve full performance in high-speed paths, we budget enough cwnd to
+ * fit full-sized skbs in-flight on both end hosts to fully utilize the path:
+ * - one skb in sending host Qdisc,
+ * - one skb in sending host TSO/GSO engine
+ * - one skb being received by receiver host LRO/GRO/delayed-ACK engine
+ * Don't worry, at low rates (bbr_min_tso_rate) this won't bloat cwnd because
+ * in such cases tso_segs_goal is 1. The minimum cwnd is 4 packets,
+ * which allows 2 outstanding 2-packet sequences, to try to keep pipe
+ * full even with ACK-every-other-packet delayed ACKs.
+ */
+static u32 bbr_quantization_budget(struct sock *sk, u32 cwnd)
+{
+ struct bbr *bbr = inet_csk_ca(sk);
/* Allow enough full-sized skbs in flight to utilize end systems. */
cwnd += 3 * bbr_tso_segs_goal(sk);
@@ -362,12 +397,39 @@ static u32 bbr_target_cwnd(struct sock *
cwnd = (cwnd + 1) & ~1U;
/* Ensure gain cycling gets inflight above BDP even for small BDPs. */
- if (bbr->mode == BBR_PROBE_BW && gain > BBR_UNIT)
+ if (bbr->mode == BBR_PROBE_BW && bbr->cycle_idx == 0)
cwnd += 2;
return cwnd;
}
+/* Find inflight based on min RTT and the estimated bottleneck bandwidth. */
+static u32 bbr_inflight(struct sock *sk, u32 bw, int gain)
+{
+ u32 inflight;
+
+ inflight = bbr_bdp(sk, bw, gain);
+ inflight = bbr_quantization_budget(sk, inflight);
+
+ return inflight;
+}
+
+/* Find the cwnd increment based on estimate of ack aggregation */
+static u32 bbr_ack_aggregation_cwnd(struct sock *sk)
+{
+ u32 max_aggr_cwnd, aggr_cwnd = 0;
+
+ if (bbr_extra_acked_gain && bbr_full_bw_reached(sk)) {
+ max_aggr_cwnd = ((u64)bbr_bw(sk) * bbr_extra_acked_max_us)
+ / BW_UNIT;
+ aggr_cwnd = (bbr_extra_acked_gain * bbr_extra_acked(sk))
+ >> BBR_SCALE;
+ aggr_cwnd = min(aggr_cwnd, max_aggr_cwnd);
+ }
+
+ return aggr_cwnd;
+}
+
/* An optimization in BBR to reduce losses: On the first round of recovery, we
* follow the packet conservation principle: send P packets per P packets acked.
* After that, we slow-start and send at most 2*P packets per P packets acked.
@@ -428,8 +490,15 @@ static void bbr_set_cwnd(struct sock *sk
if (bbr_set_cwnd_to_recover_or_restore(sk, rs, acked, &cwnd))
goto done;
+ target_cwnd = bbr_bdp(sk, bw, gain);
+
+ /* Increment the cwnd to account for excess ACKed data that seems
+ * due to aggregation (of data and/or ACKs) visible in the ACK stream.
+ */
+ target_cwnd += bbr_ack_aggregation_cwnd(sk);
+ target_cwnd = bbr_quantization_budget(sk, target_cwnd);
+
/* If we're below target cwnd, slow start cwnd toward target cwnd. */
- target_cwnd = bbr_target_cwnd(sk, bw, gain);
if (bbr_full_bw_reached(sk)) /* only cut cwnd if we filled the pipe */
cwnd = min(cwnd + acked, target_cwnd);
else if (cwnd < target_cwnd || tp->delivered < TCP_INIT_CWND)
@@ -470,14 +539,14 @@ static bool bbr_is_next_cycle_phase(stru
if (bbr->pacing_gain > BBR_UNIT)
return is_full_length &&
(rs->losses || /* perhaps pacing_gain*BDP won't fit */
- inflight >= bbr_target_cwnd(sk, bw, bbr->pacing_gain));
+ inflight >= bbr_inflight(sk, bw, bbr->pacing_gain));
/* A pacing_gain < 1.0 tries to drain extra queue we added if bw
* probing didn't find more bw. If inflight falls to match BDP then we
* estimate queue is drained; persisting would underutilize the pipe.
*/
return is_full_length ||
- inflight <= bbr_target_cwnd(sk, bw, BBR_UNIT);
+ inflight <= bbr_inflight(sk, bw, BBR_UNIT);
}
static void bbr_advance_cycle_phase(struct sock *sk)
@@ -487,8 +556,6 @@ static void bbr_advance_cycle_phase(stru
bbr->cycle_idx = (bbr->cycle_idx + 1) & (CYCLE_LEN - 1);
bbr->cycle_mstamp = tp->delivered_mstamp;
- bbr->pacing_gain = bbr->lt_use_bw ? BBR_UNIT :
- bbr_pacing_gain[bbr->cycle_idx];
}
/* Gain cycling: cycle pacing gain to converge to fair share of available bw. */
@@ -506,8 +573,6 @@ static void bbr_reset_startup_mode(struc
struct bbr *bbr = inet_csk_ca(sk);
bbr->mode = BBR_STARTUP;
- bbr->pacing_gain = bbr_high_gain;
- bbr->cwnd_gain = bbr_high_gain;
}
static void bbr_reset_probe_bw_mode(struct sock *sk)
@@ -515,8 +580,6 @@ static void bbr_reset_probe_bw_mode(stru
struct bbr *bbr = inet_csk_ca(sk);
bbr->mode = BBR_PROBE_BW;
- bbr->pacing_gain = BBR_UNIT;
- bbr->cwnd_gain = bbr_cwnd_gain;
bbr->cycle_idx = CYCLE_LEN - 1 - prandom_u32_max(bbr_cycle_rand);
bbr_advance_cycle_phase(sk); /* flip to next phase of gain cycle */
}
@@ -699,6 +762,67 @@ static void bbr_update_bw(struct sock *s
}
}
+/* Estimates the windowed max degree of ack aggregation.
+ * This is used to provision extra in-flight data to keep sending during
+ * inter-ACK silences.
+ *
+ * Degree of ack aggregation is estimated as extra data acked beyond expected.
+ *
+ * max_extra_acked = "maximum recent excess data ACKed beyond max_bw * interval"
+ * cwnd += max_extra_acked
+ *
+ * Max extra_acked is clamped by cwnd and bw * bbr_extra_acked_max_us (100 ms).
+ * Max filter is an approximate sliding window of 5-10 (packet timed) round
+ * trips.
+ */
+static void bbr_update_ack_aggregation(struct sock *sk,
+ const struct rate_sample *rs)
+{
+ u32 epoch_us, expected_acked, extra_acked;
+ struct bbr *bbr = inet_csk_ca(sk);
+ struct tcp_sock *tp = tcp_sk(sk);
+
+ if (!bbr_extra_acked_gain || rs->acked_sacked <= 0 ||
+ rs->delivered < 0 || rs->interval_us <= 0)
+ return;
+
+ if (bbr->round_start) {
+ bbr->extra_acked_win_rtts = min(0x1F,
+ bbr->extra_acked_win_rtts + 1);
+ if (bbr->extra_acked_win_rtts >= bbr_extra_acked_win_rtts) {
+ bbr->extra_acked_win_rtts = 0;
+ bbr->extra_acked_win_idx = bbr->extra_acked_win_idx ?
+ 0 : 1;
+ bbr->extra_acked[bbr->extra_acked_win_idx] = 0;
+ }
+ }
+
+ /* Compute how many packets we expected to be delivered over epoch. */
+ epoch_us = tcp_stamp_us_delta(tp->delivered_mstamp,
+ bbr->ack_epoch_mstamp);
+ expected_acked = ((u64)bbr_bw(sk) * epoch_us) / BW_UNIT;
+
+ /* Reset the aggregation epoch if ACK rate is below expected rate or
+ * significantly large no. of ack received since epoch (potentially
+ * quite old epoch).
+ */
+ if (bbr->ack_epoch_acked <= expected_acked ||
+ (bbr->ack_epoch_acked + rs->acked_sacked >=
+ bbr_ack_epoch_acked_reset_thresh)) {
+ bbr->ack_epoch_acked = 0;
+ bbr->ack_epoch_mstamp = tp->delivered_mstamp;
+ expected_acked = 0;
+ }
+
+ /* Compute excess data delivered, beyond what was expected. */
+ bbr->ack_epoch_acked = min_t(u32, 0xFFFFF,
+ bbr->ack_epoch_acked + rs->acked_sacked);
+ extra_acked = bbr->ack_epoch_acked - expected_acked;
+ extra_acked = min(extra_acked, tp->snd_cwnd);
+ if (extra_acked > bbr->extra_acked[bbr->extra_acked_win_idx])
+ bbr->extra_acked[bbr->extra_acked_win_idx] = extra_acked;
+}
+
/* Estimate when the pipe is full, using the change in delivery rate: BBR
* estimates that STARTUP filled the pipe if the estimated bw hasn't changed by
* at least bbr_full_bw_thresh (25%) after bbr_full_bw_cnt (3) non-app-limited
@@ -733,14 +857,12 @@ static void bbr_check_drain(struct sock
if (bbr->mode == BBR_STARTUP && bbr_full_bw_reached(sk)) {
bbr->mode = BBR_DRAIN; /* drain queue we created */
- bbr->pacing_gain = bbr_drain_gain; /* pace slow to drain */
- bbr->cwnd_gain = bbr_high_gain; /* maintain cwnd */
tcp_sk(sk)->snd_ssthresh =
- bbr_target_cwnd(sk, bbr_max_bw(sk), BBR_UNIT);
+ bbr_inflight(sk, bbr_max_bw(sk), BBR_UNIT);
} /* fall through to check if in-flight is already small: */
if (bbr->mode == BBR_DRAIN &&
tcp_packets_in_flight(tcp_sk(sk)) <=
- bbr_target_cwnd(sk, bbr_max_bw(sk), BBR_UNIT))
+ bbr_inflight(sk, bbr_max_bw(sk), BBR_UNIT))
bbr_reset_probe_bw_mode(sk); /* we estimate queue is drained */
}
@@ -796,8 +918,6 @@ static void bbr_update_min_rtt(struct so
if (bbr_probe_rtt_mode_ms > 0 && filter_expired &&
!bbr->idle_restart && bbr->mode != BBR_PROBE_RTT) {
bbr->mode = BBR_PROBE_RTT; /* dip, drain queue */
- bbr->pacing_gain = BBR_UNIT;
- bbr->cwnd_gain = BBR_UNIT;
bbr_save_cwnd(sk); /* note cwnd so we can restore it */
bbr->probe_rtt_done_stamp = 0;
}
@@ -825,13 +945,44 @@ static void bbr_update_min_rtt(struct so
bbr->idle_restart = 0;
}
+static void bbr_update_gains(struct sock *sk)
+{
+ struct bbr *bbr = inet_csk_ca(sk);
+
+ switch (bbr->mode) {
+ case BBR_STARTUP:
+ bbr->pacing_gain = bbr_high_gain;
+ bbr->cwnd_gain = bbr_high_gain;
+ break;
+ case BBR_DRAIN:
+ bbr->pacing_gain = bbr_drain_gain; /* slow, to drain */
+ bbr->cwnd_gain = bbr_high_gain; /* keep cwnd */
+ break;
+ case BBR_PROBE_BW:
+ bbr->pacing_gain = (bbr->lt_use_bw ?
+ BBR_UNIT :
+ bbr_pacing_gain[bbr->cycle_idx]);
+ bbr->cwnd_gain = bbr_cwnd_gain;
+ break;
+ case BBR_PROBE_RTT:
+ bbr->pacing_gain = BBR_UNIT;
+ bbr->cwnd_gain = BBR_UNIT;
+ break;
+ default:
+ WARN_ONCE(1, "BBR bad mode: %u\n", bbr->mode);
+ break;
+ }
+}
+
static void bbr_update_model(struct sock *sk, const struct rate_sample *rs)
{
bbr_update_bw(sk, rs);
+ bbr_update_ack_aggregation(sk, rs);
bbr_update_cycle_phase(sk, rs);
bbr_check_full_bw_reached(sk, rs);
bbr_check_drain(sk, rs);
bbr_update_min_rtt(sk, rs);
+ bbr_update_gains(sk);
}
static void bbr_main(struct sock *sk, const struct rate_sample *rs)
@@ -878,6 +1029,13 @@ static void bbr_init(struct sock *sk)
bbr_reset_lt_bw_sampling(sk);
bbr_reset_startup_mode(sk);
+ bbr->ack_epoch_mstamp = tp->tcp_mstamp;
+ bbr->ack_epoch_acked = 0;
+ bbr->extra_acked_win_rtts = 0;
+ bbr->extra_acked_win_idx = 0;
+ bbr->extra_acked[0] = 0;
+ bbr->extra_acked[1] = 0;
+
cmpxchg(&sk->sk_pacing_status, SK_PACING_NONE, SK_PACING_NEEDED);
}

View File

@ -1,6 +1,6 @@
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -1155,7 +1155,7 @@ MODULE_DEVICE_TABLE(of, sdhci_msm_dt_mat
@@ -1171,7 +1171,7 @@ MODULE_DEVICE_TABLE(of, sdhci_msm_dt_mat
static const struct sdhci_ops sdhci_msm_ops = {
.reset = sdhci_reset,

View File

@ -2142,7 +2142,6 @@ Subject: [PATCH 30/38] NET: add qualcomm mdio and PHY
+module_platform_driver(ar40xx_drv);
+
+MODULE_DESCRIPTION("IPQ40XX ESS driver");
+MODULE_LICENSE("Dual BSD/GPL");
--- /dev/null
+++ b/drivers/net/phy/ar40xx.h
@@ -0,0 +1,337 @@

View File

@ -10,7 +10,7 @@ drivers/mmc/host/sdhci-msm.c | 29 ++++++++++++++++++++++++++++-
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -1123,6 +1123,33 @@ out:
@@ -1139,6 +1139,33 @@ out:
__sdhci_msm_set_clock(host, clock);
}
@ -44,7 +44,7 @@ drivers/mmc/host/sdhci-msm.c | 29 ++++++++++++++++++++++++++++-
static void sdhci_msm_write_w(struct sdhci_host *host, u16 val, int reg)
{
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -1154,7 +1181,7 @@ static const struct of_device_id sdhci_m
@@ -1170,7 +1197,7 @@ static const struct of_device_id sdhci_m
MODULE_DEVICE_TABLE(of, sdhci_msm_dt_match);
static const struct sdhci_ops sdhci_msm_ops = {

View File

@ -14,7 +14,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -1694,7 +1694,7 @@ MODULE_DEVICE_TABLE(of, sdhci_msm_dt_mat
@@ -1710,7 +1710,7 @@ MODULE_DEVICE_TABLE(of, sdhci_msm_dt_mat
static const struct sdhci_ops sdhci_msm_ops = {
.reset = sdhci_reset,

View File

@ -15,7 +15,7 @@ so the info might change.
--- a/arch/arm/boot/dts/qcom-ipq4019.dtsi
+++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi
@@ -571,6 +571,34 @@
@@ -593,6 +593,34 @@
status = "disabled";
};

View File

@ -14,7 +14,7 @@ Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
--- a/arch/arm/boot/dts/qcom-ipq4019.dtsi
+++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi
@@ -599,6 +599,29 @@
@@ -621,6 +621,29 @@
};
};

View File

@ -25,7 +25,7 @@ Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
};
cpus {
@@ -622,6 +624,64 @@
@@ -644,6 +646,64 @@
status = "disabled";
};

View File

@ -1,6 +1,6 @@
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -2318,6 +2318,12 @@ config MIPS_VPE_LOADER
@@ -2319,6 +2319,12 @@ config MIPS_VPE_LOADER
Includes a loader for loading an elf relocatable object
onto another VPE and running it.

View File

@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=nasm
PKG_VERSION:=2.14
PKG_VERSION:=2.15.05
PKG_SOURCE_URL:=https://www.nasm.us/pub/nasm/releasebuilds/$(PKG_VERSION)/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_HASH:=97c615dbf02ef80e4e2b6c385f7e28368d51efc214daa98e600ca4572500eec0
PKG_HASH:=3caf6729c1073bf96629b57cee31eeb54f4f8129b01902c73428836550b30a3f
HOST_BUILD_PARALLEL:=1