mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
netfilter: x_tables: remove XT_TABLE_INFO_SZ and a dereference.
After Florian patches, there is no need for XT_TABLE_INFO_SZ anymore : Only one copy of table is kept, instead of one copy per cpu. We also can avoid a dereference if we put table data right after xt_table_info. It reduces register pressure and helps compiler. Then, we attempt a kmalloc() if total size is under order-3 allocation, to reduce TLB pressure, as in many cases, rules fit in 32 KB. Signed-off-by: Eric Dumazet <[email protected]> Cc: Florian Westphal <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
This commit is contained in:
parent
53b8762727
commit
711bdde6a8
5 changed files with 19 additions and 30 deletions
|
|
@ -951,7 +951,7 @@ copy_entries_to_user(unsigned int total_size,
|
|||
struct xt_counters *counters;
|
||||
const struct xt_table_info *private = table->private;
|
||||
int ret = 0;
|
||||
void *loc_cpu_entry;
|
||||
const void *loc_cpu_entry;
|
||||
|
||||
counters = alloc_counters(table);
|
||||
if (IS_ERR(counters))
|
||||
|
|
@ -1065,7 +1065,7 @@ static int compat_table_info(const struct xt_table_info *info,
|
|||
struct xt_table_info *newinfo)
|
||||
{
|
||||
struct ip6t_entry *iter;
|
||||
void *loc_cpu_entry;
|
||||
const void *loc_cpu_entry;
|
||||
int ret;
|
||||
|
||||
if (!newinfo || !info)
|
||||
|
|
|
|||
Loading…
Reference in a new issue