aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-02-07 15:10:57 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-02-07 15:10:57 -0500
commit926af6273fc683cd98cd0ce7bf0d04a02eed6742 (patch)
tree99c40d2bc42563a92c2877e58e32a6b4c922ba30 /net/core/dev.c
parentb6789123bccba8b5feb9901ed2e8c3c39181979d (diff)
parent912964eacb111551db73429719eb5fadcab0ff8a (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Load correct firmware in rtl8192ce wireless driver, from Jurij Smakov. 2) Fix leak of tx_ring and tx_cq due to overwriting in mlx4 driver, from Martin KaFai Lau. 3) Need to reference count PHY driver module when it is attached, from Mao Wenan. 4) Don't do zero length vzalloc() in ethtool register dump, from Stanislaw Gruszka. 5) Defer net_disable_timestamp() to a workqueue to get out of locking issues, from Eric Dumazet. 6) We cannot drop the SKB dst when IP options refer to them, fix also from Eric Dumazet. 7) Incorrect packet header offset calculations in ip6_gre, again from Eric Dumazet. 8) Missing tcp_v6_restore_cb() causes use-after-free, from Eric too. 9) tcp_splice_read() can get into an infinite loop with URG, and hey it's from Eric once more. 10) vnet_hdr_sz can change asynchronously, so read it once during decision making in macvtap and tun, from Willem de Bruijn. 11) Can't use kernel stack for DMA transfers in USB networking drivers, from Ben Hutchings. 12) Handle csum errors properly in UDP by calling the proper destructor, from Eric Dumazet. 13) For non-deterministic softirq run when scheduling NAPI from a workqueue in mlx4, from Benjamin Poirier. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (28 commits) sctp: check af before verify address in sctp_addr_id2transport sctp: avoid BUG_ON on sctp_wait_for_sndbuf mlx4: Invoke softirqs after napi_reschedule udp: properly cope with csum errors catc: Use heap buffer for memory size test catc: Combine failure cleanup code in catc_probe() rtl8150: Use heap buffers for all register access pegasus: Use heap buffers for all register access macvtap: read vnet_hdr_size once tun: read vnet_hdr_sz once tcp: avoid infinite loop in tcp_splice_read() hns: avoid stack overflow with CONFIG_KASAN ipv6: Fix IPv6 packet loss in scenarios involving roaming + snooping switches ipv6: tcp: add a missing tcp_v6_restore_cb() nl80211: Fix mesh HT operation check mac80211: Fix adding of mesh vendor IEs mac80211: Allocate a sync skcipher explicitly for FILS AEAD mac80211: Fix FILS AEAD protection in Association Request frame ip6_gre: fix ip6gre_err() invalid reads netlabel: out of bound access in cipso_v4_validate() ...
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 7f218e095361..29101c98399f 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1695,24 +1695,19 @@ EXPORT_SYMBOL_GPL(net_dec_egress_queue);
1695 1695
1696static struct static_key netstamp_needed __read_mostly; 1696static struct static_key netstamp_needed __read_mostly;
1697#ifdef HAVE_JUMP_LABEL 1697#ifdef HAVE_JUMP_LABEL
1698/* We are not allowed to call static_key_slow_dec() from irq context
1699 * If net_disable_timestamp() is called from irq context, defer the
1700 * static_key_slow_dec() calls.
1701 */
1702static atomic_t netstamp_needed_deferred; 1698static atomic_t netstamp_needed_deferred;
1703#endif 1699static void netstamp_clear(struct work_struct *work)
1704
1705void net_enable_timestamp(void)
1706{ 1700{
1707#ifdef HAVE_JUMP_LABEL
1708 int deferred = atomic_xchg(&netstamp_needed_deferred, 0); 1701 int deferred = atomic_xchg(&netstamp_needed_deferred, 0);
1709 1702
1710 if (deferred) { 1703 while (deferred--)
1711 while (--deferred) 1704 static_key_slow_dec(&netstamp_needed);
1712 static_key_slow_dec(&netstamp_needed); 1705}
1713 return; 1706static DECLARE_WORK(netstamp_work, netstamp_clear);
1714 }
1715#endif 1707#endif
1708
1709void net_enable_timestamp(void)
1710{
1716 static_key_slow_inc(&netstamp_needed); 1711 static_key_slow_inc(&netstamp_needed);
1717} 1712}
1718EXPORT_SYMBOL(net_enable_timestamp); 1713EXPORT_SYMBOL(net_enable_timestamp);
@@ -1720,12 +1715,12 @@ EXPORT_SYMBOL(net_enable_timestamp);
1720void net_disable_timestamp(void) 1715void net_disable_timestamp(void)
1721{ 1716{
1722#ifdef HAVE_JUMP_LABEL 1717#ifdef HAVE_JUMP_LABEL
1723 if (in_interrupt()) { 1718 /* net_disable_timestamp() can be called from non process context */
1724 atomic_inc(&netstamp_needed_deferred); 1719 atomic_inc(&netstamp_needed_deferred);
1725 return; 1720 schedule_work(&netstamp_work);
1726 } 1721#else
1727#endif
1728 static_key_slow_dec(&netstamp_needed); 1722 static_key_slow_dec(&netstamp_needed);
1723#endif
1729} 1724}
1730EXPORT_SYMBOL(net_disable_timestamp); 1725EXPORT_SYMBOL(net_disable_timestamp);
1731 1726