/* * This header provides constants for binding nvidia,tegra186-gpio*. * * The first cell in Tegra's GPIO specifier is the GPIO ID. The macros below * provide names for this. * * The second cell contains standard flag values specified in gpio.h. */ #ifndef _DT_BINDINGS_GPIO_TEGRA_GPIO_H #define _DT_BINDINGS_GPIO_TEGRA_GPIO_H #include /* GPIOs implemented by main GPIO controller */ #define TEGRA_MAIN_GPIO_PORT_A 0 #define TEGRA_MAIN_GPIO_PORT_B 1 #define TEGRA_MAIN_GPIO_PORT_C 2 #define TEGRA_MAIN_GPIO_PORT_D 3 #define TEGRA_MAIN_GPIO_PORT_E 4 #define TEGRA_MAIN_GPIO_PORT_F 5 #define TEGRA_MAIN_GPIO_PORT_G 6 #define TEGRA_MAIN_GPIO_PORT_H 7 #define TEGRA_MAIN_GPIO_PORT_I 8 #define TEGRA_MAIN_GPIO_PORT_J 9 #define TEGRA_MAIN_GPIO_PORT_K 10 #define TEGRA_MAIN_GPIO_PORT_L 11 #define TEGRA_MAIN_GPIO_PORT_M 12 #define TEGRA_MAIN_GPIO_PORT_N 13 #define TEGRA_MAIN_GPIO_PORT_O 14 #define TEGRA_MAIN_GPIO_PORT_P 15 #define TEGRA_MAIN_GPIO_PORT_Q 16 #define TEGRA_MAIN_GPIO_PORT_R 17 #define TEGRA_MAIN_GPIO_PORT_T 18 #define TEGRA_MAIN_GPIO_PORT_X 19 #define TEGRA_MAIN_GPIO_PORT_Y 20 #define TEGRA_MAIN_GPIO_PORT_BB 21 #define TEGRA_MAIN_GPIO_PORT_CC 22 #define TEGRA_MAIN_GPIO(port, offset) \ ((TEGRA_MAIN_GPIO_PORT_##port * 8) + offset) /* GPIOs implemented by AON GPIO controller */ #define TEGRA_AON_GPIO_PORT_S 0 #define TEGRA_AON_GPIO_PORT_U 1 #define TEGRA_AON_GPIO_PORT_V 2 #define TEGRA_AON_GPIO_PORT_W 3 #define TEGRA_AON_GPIO_PORT_Z 4 #define TEGRA_AON_GPIO_PORT_AA 5 #define TEGRA_AON_GPIO_PORT_EE 6 #define TEGRA_AON_GPIO_PORT_FF 7 #define TEGRA_AON_GPIO(port, offset) \ ((TEGRA_AON_GPIO_PORT_##port * 8) + offset) #endif a>treecommitdiff
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2017-01-18 02:01:22 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2017-01-19 14:28:01 +0100
commite5072053b09642b8ff417d47da05b84720aea3ee (patch)
tree27c6a3089d66f995cd8542a913209492a5d01609
parent524b698db06b9b6da7192e749f637904e2f62d7b (diff)
netfilter: conntrack: refine gc worker heuristics, redux
This further refines the changes made to conntrack gc_worker in commit e0df8cae6c16 ("netfilter: conntrack: refine gc worker heuristics"). The main idea of that change was to reduce the scan interval when evictions take place. However, on the reporters' setup, there are 1-2 million conntrack entries in total and roughly 8k new (and closing) connections per second. In this case we'll always evict at least one entry per gc cycle and scan interval is always at 1 jiffy because of this test: } else if (expired_count) { gc_work->next_gc_run /= 2U; next_run = msecs_to_jiffies(1); being true almost all the time. Given we scan ~10k entries per run its clearly wrong to reduce interval based on nonzero eviction count, it will only waste cpu cycles since a vast majorities of conntracks are not timed out. Thus only look at the ratio (scanned entries vs. evicted entries) to make a decision on whether to reduce or not. Because evictor is supposed to only kick in when system turns idle after a busy period, pick a high ratio -- this makes it 50%. We thus keep the idea of increasing scan rate when its likely that table contains many expired entries. In order to not let timed-out entries hang around for too long (important when using event logging, in which case we want to timely destroy events), we now scan the full table within at most GC_MAX_SCAN_JIFFIES (16 seconds) even in worst-case scenario where all timed-out entries sit in same slot. I tested this with a vm under synflood (with sysctl net.netfilter.nf_conntrack_tcp_timeout_syn_recv=3). While flood is ongoing, interval now stays at its max rate (GC_MAX_SCAN_JIFFIES / GC_MAX_BUCKETS_DIV -> 125ms). With feedback from Nicolas Dichtel. Reported-by: Denys Fedoryshchenko <nuclearcat@nuclearcat.com> Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com> Fixes: b87a2f9199ea82eaadc ("netfilter: conntrack: add gc worker to remove timed-out entries") Signed-off-by: Florian Westphal <fw@strlen.de> Tested-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Tested-by: Denys Fedoryshchenko <nuclearcat@nuclearcat.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>