WSL2-Linux-Kernel/include/net
Davide Caratti a5b72a083d net/sched: add delete_empty() to filters and use it in cls_flower
Revert "net/sched: cls_u32: fix refcount leak in the error path of
u32_change()", and fix the u32 refcount leak in a more generic way that
preserves the semantic of rule dumping.
On tc filters that don't support lockless insertion/removal, there is no
need to guard against concurrent insertion when a removal is in progress.
Therefore, for most of them we can avoid a full walk() when deleting, and
just decrease the refcount, like it was done on older Linux kernels.
This fixes situations where walk() was wrongly detecting a non-empty
filter, like it happened with cls_u32 in the error path of change(), thus
leading to failures in the following tdc selftests:

 6aa7: (filter, u32) Add/Replace u32 with source match and invalid indev
 6658: (filter, u32) Add/Replace u32 with custom hash table and invalid handle
 74c2: (filter, u32) Add/Replace u32 filter with invalid hash table id

On cls_flower, and on (future) lockless filters, this check is necessary:
move all the check_empty() logic in a callback so that each filter
can have its own implementation. For cls_flower, it's sufficient to check
if no IDRs have been allocated.

This reverts commit 275c44aa19.

Changes since v1:
 - document the need for delete_empty() when TCF_PROTO_OPS_DOIT_UNLOCKED
   is used, thanks to Vlad Buslov
 - implement delete_empty() without doing fl_walk(), thanks to Vlad Buslov
 - squash revert and new fix in a single patch, to be nice with bisect
   tests that run tdc on u32 filter, thanks to Dave Miller

Fixes: 275c44aa19 ("net/sched: cls_u32: fix refcount leak in the error path of u32_change()")
Fixes: 6676d5e416 ("net: sched: set dedicated tcf_walker flag when tp is empty")
Suggested-by: Jamal Hadi Salim <jhs@mojatatu.com>
Suggested-by: Vlad Buslov <vladbu@mellanox.com>
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Reviewed-by: Vlad Buslov <vladbu@mellanox.com>
Tested-by: Jamal Hadi Salim <jhs@mojatatu.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-12-30 20:35:19 -08:00
..
9p
bluetooth Bluetooth: Add support for utilizing Fast Advertising Interval 2019-09-05 17:27:21 +02:00
caif
iucv
netfilter treewide: Use sizeof_field() macro 2019-12-09 10:36:44 -08:00
netns ipv6: keep track of routes using src 2019-11-21 14:45:55 -08:00
nfc
phonet
sctp Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-11-25 14:57:26 -08:00
tc_act net: sched: take reference to psample group in flow_action infra 2019-09-16 09:18:03 +02:00
6lowpan.h
Space.h
act_api.h net/sched: actions: remove unused 'order' 2019-11-12 12:11:22 -08:00
addrconf.h ipv6: Make ipv6_mc_may_pull() return bool. 2019-10-07 09:37:27 -04:00
af_ieee802154.h
af_rxrpc.h
af_unix.h
af_vsock.h vsock: prevent transport modules unloading 2019-11-14 18:12:18 -08:00
ah.h
arp.h net: avoid potential false sharing in neighbor related code 2019-11-06 16:14:48 -08:00
atmclip.h
ax25.h
ax88796.h
bond_3ad.h
bond_alb.h
bond_options.h
bonding.h bonding: fix state transition issue in link monitoring 2019-11-05 17:40:16 -08:00
bpf_sk_storage.h
busy_poll.h net: annotate lockless accesses to sk->sk_napi_id 2019-10-30 17:34:35 -07:00
calipso.h
cfg80211-wext.h
cfg80211.h mac80211: Implement Airtime-based Queue Limit (AQL) 2019-11-22 13:36:25 +01:00
cfg802154.h
checksum.h
cipso_ipv4.h
cls_cgroup.h
codel.h
codel_impl.h
codel_qdisc.h
compat.h
datalink.h
dcbevent.h
dcbnl.h
devlink.h Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux 2019-11-13 14:24:58 -08:00
dn.h
dn_dev.h
dn_fib.h
dn_neigh.h
dn_nsp.h
dn_route.h
drop_monitor.h
dsa.h net: dsa: ocelot: add tagger for Ocelot/Felix switches 2019-11-15 12:32:16 -08:00
dsfield.h
dst.h net/dst: do not confirm neighbor for vxlan and geneve pmtu update 2019-12-24 22:28:55 -08:00
dst_cache.h
dst_metadata.h
dst_ops.h net: add bool confirm_neigh parameter for dst_ops.update_pmtu 2019-12-24 22:28:54 -08:00
erspan.h
esp.h
ethoc.h
failover.h
fib_notifier.h net: fib_notifier: propagate extack down to the notifier block callback 2019-10-04 11:10:56 -07:00
fib_rules.h net: fib_notifier: propagate extack down to the notifier block callback 2019-10-04 11:10:56 -07:00
firewire.h
flow.h
flow_dissector.h cls_flower: Fix the behavior using port ranges with hw-offload 2019-12-03 11:55:46 -08:00
flow_offload.h net: core: rename indirect block ingress cb function 2019-12-06 20:45:09 -08:00
fou.h
fq.h net/flow_dissector: switch to siphash 2019-10-23 20:13:22 -07:00
fq_impl.h net/fq_impl: Switch to kvmalloc() for memory allocation 2019-11-08 09:11:49 +01:00
garp.h treewide: Use sizeof_field() macro 2019-12-09 10:36:44 -08:00
gen_stats.h net_sched: extend packet counter to 64bit 2019-11-05 18:20:55 -08:00
genetlink.h net: genetlink: remove unused genl_family_attrbuf() 2019-10-06 15:44:47 +02:00
geneve.h
gre.h
gro_cells.h
gtp.h
gue.h
hwbm.h net: hwbm: if CONFIG_NET_HWBM unset, make stub functions static 2019-10-25 16:24:32 -07:00
icmp.h
ieee80211_radiotap.h
ieee802154_netdev.h
if_inet6.h ipv6: shrink struct ipv6_mc_socklist 2019-08-28 14:43:03 -07:00
ife.h
ila.h
inet6_connection_sock.h
inet6_hashtables.h
inet_common.h
inet_connection_sock.h net/tls: use RCU protection on icsk->icsk_ulp_data 2019-08-31 23:44:28 -07:00
inet_ecn.h
inet_frag.h
inet_hashtables.h tcp/dccp: fix possible race __inet_lookup_established() 2019-12-13 21:40:49 -08:00
inet_sock.h ip: support SO_MARK cmsg 2019-09-13 21:44:19 +02:00
inet_timewait_sock.h tcp: honor SO_PRIORITY in TIME_WAIT state 2019-09-27 12:05:02 +02:00
inetpeer.h
ip.h inet: protect against too small mtu values. 2019-12-07 11:55:11 -08:00
ip6_checksum.h
ip6_fib.h ipv6: keep track of routes using src 2019-11-21 14:45:55 -08:00
ip6_route.h
ip6_tunnel.h
ip_fib.h ipv4: move fib4_has_custom_rules() helper to public header 2019-11-21 14:45:55 -08:00
ip_tunnels.h treewide: Use sizeof_field() macro 2019-12-09 10:36:44 -08:00
ip_vs.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-11-02 13:54:56 -07:00
ipcomp.h
ipconfig.h
ipv6.h net: ipv6: add net argument to ip6_dst_lookup_flow 2019-12-04 12:27:12 -08:00
ipv6_frag.h
ipv6_stubs.h net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup 2019-12-04 12:27:13 -08:00
ipx.h
iw_handler.h
kcm.h
l3mdev.h
lag.h
lapb.h
lib80211.h
llc.h
llc_c_ac.h
llc_c_ev.h
llc_c_st.h
llc_conn.h llc: fix sk_buff leak in llc_conn_service() 2019-10-08 13:23:05 -07:00
llc_if.h
llc_pdu.h
llc_s_ac.h
llc_s_ev.h
llc_s_st.h
llc_sap.h
lwtunnel.h
mac80211.h mac80211: Use Airtime-based Queue Limits (AQL) on packet dequeue 2019-11-22 13:36:25 +01:00
mac802154.h
mip6.h
mld.h
mpls.h
mpls_iptunnel.h
mrp.h treewide: Use sizeof_field() macro 2019-12-09 10:36:44 -08:00
ncsi.h
ndisc.h net: avoid potential false sharing in neighbor related code 2019-11-06 16:14:48 -08:00
neighbour.h neighbour: remove neigh_cleanup() method 2019-12-09 09:48:47 -08:00
net_failover.h
net_namespace.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-11-02 13:54:56 -07:00
net_ratelimit.h
netevent.h
netlabel.h
netlink.h
netprio_cgroup.h netprio: use css ID instead of cgroup ID 2019-11-12 08:18:03 -08:00
netrom.h
nexthop.h net: Properly update v4 routes with v6 nexthop 2019-09-05 12:35:58 +02:00
nl802154.h
nsh.h
p8022.h
page_pool.h net: page_pool: add the possibility to sync DMA memory for device 2019-11-20 12:34:28 -08:00
ping.h
pkt_cls.h net: sched: take reference to action dev before calling offloads 2019-08-26 14:17:43 -07:00
pkt_sched.h Merge ra.kernel.org:/pub/scm/linux/kernel/git/netdev/net 2019-09-17 23:51:10 +02:00
pptp.h
protocol.h
psample.h net: sched: take reference to psample group in flow_action infra 2019-09-16 09:18:03 +02:00
psnap.h
raw.h
rawv6.h
red.h
regulatory.h
request_sock.h net: add {READ|WRITE}_ONCE() annotations on ->rskq_accept_head 2019-10-09 21:34:31 -07:00
rose.h
route.h ipv4: use dst hint for ipv4 list receive 2019-11-21 14:45:55 -08:00
rsi_91x.h
rtnetlink.h
rtnh.h
sch_generic.h net/sched: add delete_empty() to filters and use it in cls_flower 2019-12-30 20:35:19 -08:00
scm.h
secure_seq.h
seg6.h
seg6_hmac.h
seg6_local.h
slhc_vj.h
smc.h net/smc: introduce bookkeeping of SMCD link groups 2019-11-15 12:28:28 -08:00
snmp.h net/tls: add skeleton of MIB statistics 2019-10-05 16:29:00 -07:00
sock.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-22 09:54:33 -08:00
sock_reuseport.h udp: correct reuseport selection with connected sockets 2019-09-16 09:02:18 +02:00
stp.h
strparser.h
switchdev.h
tcp.h tcp: refine tcp_write_queue_empty() implementation 2019-12-13 21:58:40 -08:00
tcp_states.h
timewait_sock.h
tipc.h
tls.h net/tls: use sg_next() to walk sg entries 2019-11-28 22:40:29 -08:00
tls_toe.h net/tls: rename tls_hw_* functions tls_toe_* 2019-10-04 14:07:07 -07:00
transp_v6.h
tso.h
tun_proto.h
udp.h udp: Remove unlikely() from IS_ERR*() condition 2019-08-30 19:49:37 -07:00
udp_tunnel.h
udplite.h
vsock_addr.h vsock: remove include/linux/vm_sockets.h file 2019-11-14 18:12:17 -08:00
vxlan.h vxlan: add adjacent link to limit depth level 2019-10-24 14:53:49 -07:00
wext.h
wimax.h
x25.h net/x25: add new state X25_STATE_5 2019-12-09 10:28:43 -08:00
x25device.h
xdp.h
xdp_priv.h page_pool: do not release pool until inflight == 0. 2019-11-16 12:39:10 -08:00
xdp_sock.h xsk: Restructure/inline XSKMAP lookup/redirect/flush 2019-11-02 00:38:49 +01:00
xfrm.h xfrm: ifdef setsockopt(UDP_ENCAP_ESPINUDP/UDP_ENCAP_ESPINUDP_NON_IKE) 2019-10-09 06:55:32 +02:00