From: David S. Miller Date: Sun, 3 Jun 2018 13:31:58 +0000 (-0400) Subject: Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=9c54aeb03a6d65a5834bd92376e921cbac6dfb8f;p=openwrt%2Fstaging%2Fblogic.git Merge git://git./linux/kernel/git/davem/net Filling in the padding slot in the bpf structure as a bug fix in 'ne' overlapped with actually using that padding area for something in 'net-next'. Signed-off-by: David S. Miller --- 9c54aeb03a6d65a5834bd92376e921cbac6dfb8f diff --cc drivers/net/tun.c index 2265d2ccea47,23e9eb66197f..c94fffee5ea9 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@@ -1941,15 -1929,13 +1943,16 @@@ static ssize_t tun_get_user(struct tun_ } } rcu_read_unlock(); + local_bh_enable(); } - rcu_read_lock(); - if (!rcu_dereference(tun->steering_prog)) + /* Compute the costly rx hash only if needed for flow updates. + * We may get a very small possibility of OOO during switching, not + * worth to optimize. + */ + if (!rcu_access_pointer(tun->steering_prog) && tun->numqueues > 1 && + !tfile->detached) rxhash = __skb_get_hash_symmetric(skb); - rcu_read_unlock(); if (frags) { /* Exercise flow dissector code path. */ diff --cc include/uapi/linux/bpf.h index 9b8c6e310e9a,8c317737ba3f..671486133988 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@@ -2332,17 -1031,9 +2332,18 @@@ struct bpf_map_info __u32 map_flags; char name[BPF_OBJ_NAME_LEN]; __u32 ifindex; + __u32 :32; __u64 netns_dev; __u64 netns_ino; + __u32 btf_id; + __u32 btf_key_type_id; + __u32 btf_value_type_id; +} __attribute__((aligned(8))); + +struct bpf_btf_info { + __aligned_u64 btf; + __u32 btf_size; + __u32 id; } __attribute__((aligned(8))); /* User bpf_sock_addr struct to access socket fields and sockaddr struct passed diff --cc net/netfilter/nf_tables_api.c index 2e8fd961746d,501e48a7965b..ca4c4d994ddb --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@@ -1336,24 -1298,12 +1336,26 @@@ static void nft_chain_stats_replace(str rcu_assign_pointer(chain->stats, newstats); synchronize_rcu(); free_percpu(oldstats); - } else + } else { rcu_assign_pointer(chain->stats, newstats); + static_branch_inc(&nft_counters_enabled); + } } +static void nf_tables_chain_free_chain_rules(struct nft_chain *chain) +{ + struct nft_rule **g0 = rcu_dereference_raw(chain->rules_gen_0); + struct nft_rule **g1 = rcu_dereference_raw(chain->rules_gen_1); + + if (g0 != g1) + kvfree(g1); + kvfree(g0); + + /* should be NULL either via abort or via successful commit */ + WARN_ON_ONCE(chain->rules_next); + kvfree(chain->rules_next); +} + static void nf_tables_chain_destroy(struct nft_ctx *ctx) { struct nft_chain *chain = ctx->chain; diff --cc net/sched/cls_flower.c index 4e74508515f4,c79f6e71512e..3786feab0b83 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c @@@ -1024,11 -976,8 +1024,11 @@@ static int fl_change(struct net *net, s kfree(tb); return 0; +errout_mask: + fl_mask_put(head, fnew->mask, false); + errout_idr: - if (fnew->handle) + if (!fold) idr_remove(&head->handle_idr, fnew->handle); errout: tcf_exts_destroy(&fnew->exts); diff --cc tools/include/uapi/linux/bpf.h index 9b8c6e310e9a,8c317737ba3f..671486133988 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h @@@ -2332,17 -1031,9 +2332,18 @@@ struct bpf_map_info __u32 map_flags; char name[BPF_OBJ_NAME_LEN]; __u32 ifindex; + __u32 :32; __u64 netns_dev; __u64 netns_ino; + __u32 btf_id; + __u32 btf_key_type_id; + __u32 btf_value_type_id; +} __attribute__((aligned(8))); + +struct bpf_btf_info { + __aligned_u64 btf; + __u32 btf_size; + __u32 id; } __attribute__((aligned(8))); /* User bpf_sock_addr struct to access socket fields and sockaddr struct passed