From: David S. Miller Date: Sat, 15 Jun 2019 01:52:14 +0000 (-0700) Subject: Merge branch 'packet-DDOS' X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=4373a5e2606b4eda14fa096caf93dc2efc22689f;p=openwrt%2Fstaging%2Fblogic.git Merge branch 'packet-DDOS' Eric Dumazet says: ==================== net/packet: better behavior under DDOS Using tcpdump (or other af_packet user) on a busy host can lead to catastrophic consequences, because suddenly, potentially all cpus are spinning on a contended spinlock. Both packet_rcv() and tpacket_rcv() grab the spinlock to eventually find there is no room for an additional packet. This patch series align packet_rcv() and tpacket_rcv() to both check if the queue is full before grabbing the spinlock. If the queue is full, they both increment a new atomic counter placed on a separate cache line to let readers drain the queue faster. There is still false sharing on this new atomic counter, we might in the future make it per cpu if there is interest. ==================== Acked-by: Willem de Bruijn Signed-off-by: David S. Miller --- 4373a5e2606b4eda14fa096caf93dc2efc22689f