1. 11 8月, 2015 6 次提交
    • D
      netlink: make sure -EBUSY won't escape from netlink_insert · 4e7c1330
      Daniel Borkmann 提交于
      Linus reports the following deadlock on rtnl_mutex; triggered only
      once so far (extract):
      
      [12236.694209] NetworkManager  D 0000000000013b80     0  1047      1 0x00000000
      [12236.694218]  ffff88003f902640 0000000000000000 ffffffff815d15a9 0000000000000018
      [12236.694224]  ffff880119538000 ffff88003f902640 ffffffff81a8ff84 00000000ffffffff
      [12236.694230]  ffffffff81a8ff88 ffff880119c47f00 ffffffff815d133a ffffffff81a8ff80
      [12236.694235] Call Trace:
      [12236.694250]  [<ffffffff815d15a9>] ? schedule_preempt_disabled+0x9/0x10
      [12236.694257]  [<ffffffff815d133a>] ? schedule+0x2a/0x70
      [12236.694263]  [<ffffffff815d15a9>] ? schedule_preempt_disabled+0x9/0x10
      [12236.694271]  [<ffffffff815d2c3f>] ? __mutex_lock_slowpath+0x7f/0xf0
      [12236.694280]  [<ffffffff815d2cc6>] ? mutex_lock+0x16/0x30
      [12236.694291]  [<ffffffff814f1f90>] ? rtnetlink_rcv+0x10/0x30
      [12236.694299]  [<ffffffff8150ce3b>] ? netlink_unicast+0xfb/0x180
      [12236.694309]  [<ffffffff814f5ad3>] ? rtnl_getlink+0x113/0x190
      [12236.694319]  [<ffffffff814f202a>] ? rtnetlink_rcv_msg+0x7a/0x210
      [12236.694331]  [<ffffffff8124565c>] ? sock_has_perm+0x5c/0x70
      [12236.694339]  [<ffffffff814f1fb0>] ? rtnetlink_rcv+0x30/0x30
      [12236.694346]  [<ffffffff8150d62c>] ? netlink_rcv_skb+0x9c/0xc0
      [12236.694354]  [<ffffffff814f1f9f>] ? rtnetlink_rcv+0x1f/0x30
      [12236.694360]  [<ffffffff8150ce3b>] ? netlink_unicast+0xfb/0x180
      [12236.694367]  [<ffffffff8150d344>] ? netlink_sendmsg+0x484/0x5d0
      [12236.694376]  [<ffffffff810a236f>] ? __wake_up+0x2f/0x50
      [12236.694387]  [<ffffffff814cad23>] ? sock_sendmsg+0x33/0x40
      [12236.694396]  [<ffffffff814cb05e>] ? ___sys_sendmsg+0x22e/0x240
      [12236.694405]  [<ffffffff814cab75>] ? ___sys_recvmsg+0x135/0x1a0
      [12236.694415]  [<ffffffff811a9d12>] ? eventfd_write+0x82/0x210
      [12236.694423]  [<ffffffff811a0f9e>] ? fsnotify+0x32e/0x4c0
      [12236.694429]  [<ffffffff8108cb70>] ? wake_up_q+0x60/0x60
      [12236.694434]  [<ffffffff814cba09>] ? __sys_sendmsg+0x39/0x70
      [12236.694440]  [<ffffffff815d4797>] ? entry_SYSCALL_64_fastpath+0x12/0x6a
      
      It seems so far plausible that the recursive call into rtnetlink_rcv()
      looks suspicious. One way, where this could trigger is that the senders
      NETLINK_CB(skb).portid was wrongly 0 (which is rtnetlink socket), so
      the rtnl_getlink() request's answer would be sent to the kernel instead
      to the actual user process, thus grabbing rtnl_mutex() twice.
      
      One theory would be that netlink_autobind() triggered via netlink_sendmsg()
      internally overwrites the -EBUSY error to 0, but where it is wrongly
      originating from __netlink_insert() instead. That would reset the
      socket's portid to 0, which is then filled into NETLINK_CB(skb).portid
      later on. As commit d470e3b4 ("[NETLINK]: Fix two socket hashing bugs.")
      also puts it, -EBUSY should not be propagated from netlink_insert().
      
      It looks like it's very unlikely to reproduce. We need to trigger the
      rhashtable_insert_rehash() handler under a situation where rehashing
      currently occurs (one /rare/ way would be to hit ht->elasticity limits
      while not filled enough to expand the hashtable, but that would rather
      require a specifically crafted bind() sequence with knowledge about
      destination slots, seems unlikely). It probably makes sense to guard
      __netlink_insert() in any case and remap that error. It was suggested
      that EOVERFLOW might be better than an already overloaded ENOMEM.
      
      Reference: http://thread.gmane.org/gmane.linux.network/372676Reported-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Acked-by: NThomas Graf <tgraf@suug.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4e7c1330
    • I
      bna: fix interrupts storm caused by erroneous packets · ade4dc3e
      Ivan Vecera 提交于
      The commit "e29aa339 bna: Enable Multi Buffer RX" moved packets counter
      increment from the beginning of the NAPI processing loop after the check
      for erroneous packets so they are never accounted. This counter is used
      to inform firmware about number of processed completions (packets).
      As these packets are never acked the firmware fires IRQs for them again
      and again.
      
      Fixes: e29aa339 ("bna: Enable Multi Buffer RX")
      Signed-off-by: NIvan Vecera <ivecera@redhat.com>
      Acked-by: NRasesh Mody <rasesh.mody@qlogic.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ade4dc3e
    • D
      Merge branch 'mvpp2-fixes' · ea708584
      David S. Miller 提交于
      Marcin Wojtas says:
      
      ====================
      Fixes for the network driver of Marvell Armada 375 SoC
      
      This is a set of three patches that fix long-lasting problems implemented in
      the initial support for the Armada 375 network controller.
      
      Due to an inappropriate concept of handling the per-CPU sent packets'
      processing on TX path the driver numerous problems occured, such as RCU
      stalls. Those have been fixed, of which details you can find in the commit
      logs. The patches were intensively tested on top of v4.2-rc5.
      
      I'm looking forward to any comments or remarks.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ea708584
    • M
      net: mvpp2: replace TX coalescing interrupts with hrtimer · edc660fa
      Marcin Wojtas 提交于
      The PP2 controller is capable of per-CPU TX processing, which means there are
      per-CPU banked register sets and queues. Current version of the driver supports
      TX packet coalescing - once on given CPU sent packets amount reaches a threshold
      value, an IRQ occurs. However, there is a single interrupt line responsible for
      CPU0/1 TX and RX events (the latter is not per-CPU, the hardware does not
      support RSS).
      
      When the top-half executes the interrupt cause is not known. This is why in
      NAPI poll function, along with RX processing, IRQ cause register on both
      CPU's is accessed in order to determine on which of them the TX coalescing
      threshold might have been reached. Thus the egress processing and releasing the
      buffers is able to take place on the corresponding CPU. Hitherto approach lead
      to an illegal usage of on_each_cpu function in softirq context.
      
      The problem is solved by resigning from TX coalescing interrupts and separating
      egress finalization from NAPI processing. For that purpose a method of using
      hrtimer is introduced. In main transmit function (mvpp2_tx) buffers are released
      once a software coalescing threshold is reached. In case not all the data is
      processed a timer is set on this CPU - in its interrupt context a tasklet is
      scheduled in which all queues are processed. At once only one timer per-CPU can
      be running, which is controlled by a dedicated flag.
      
      This commit removes TX processing from NAPI polling function, disables hardware
      coalescing and enables hrtimer with tasklet, using new per-CPU port structure
      (mvpp2_port_pcpu).
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      edc660fa
    • M
      net: mvpp2: enable proper per-CPU TX buffers unmapping · 71ce391d
      Marcin Wojtas 提交于
      mvpp2 driver allows usage of per-CPU TX processing. Once the packets are
      prepared independetly on each CPU, the hardware enqueues the descriptors in
      common TX queue. After they are sent, the buffers and associated sk_buffs
      should be released on the corresponding CPU.
      
      This is why a special index is maintained in order to point to the right data to
      be released after transmission takes place. Each per-CPU TX queue comprise an
      array of sent sk_buffs, freed in mvpp2_txq_bufs_free function. However, the
      index was used there also for obtaining a descriptor (and therefore a buffer to
      be DMA-unmapped) from common TX queue, which was wrong, because it was not
      referring to the current CPU.
      
      This commit enables proper unmapping of sent data buffers by indexing them in
      per-CPU queues using a dedicated array for keeping their physical addresses.
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      71ce391d
    • M
      net: mvpp2: remove excessive spinlocks from driver initialization · d53793c5
      Marcin Wojtas 提交于
      Using spinlocks protection during one-time driver initialization is not
      necessary. Moreover it resulted in invalid GFP_KERNEL allocation under the lock.
      
      This commit removes redundant spinlocks from buffer manager part of mvpp2
      initialization.
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Reported-by: NAlexandre Fournier <alexandre.fournier@wisp-e.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d53793c5
  2. 08 8月, 2015 6 次提交
  3. 07 8月, 2015 12 次提交
  4. 05 8月, 2015 4 次提交
  5. 04 8月, 2015 6 次提交
  6. 03 8月, 2015 3 次提交
    • L
      rtlwifi: rtl8723be: Add module parameter for MSI interrupts · 741e3b99
      Larry Finger 提交于
      The driver code allows for the disabling of MSI interrupts; however the
      module_parm line was missed and the option fails to show with modinfo.
      Signed-off-by: NLarry Finger <Larry.Finger@lwfinger.net>
      Cc: Stable <stable@vger.kernel.org> [3.15+]
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      741e3b99
    • E
      fq_codel: explicitly reset flows in ->reset() · 3d0e0af4
      Eric Dumazet 提交于
      Alex reported the following crash when using fq_codel
      with htb:
      
        crash> bt
        PID: 630839  TASK: ffff8823c990d280  CPU: 14  COMMAND: "tc"
         [... snip ...]
         #8 [ffff8820ceec17a0] page_fault at ffffffff8160a8c2
            [exception RIP: htb_qlen_notify+24]
            RIP: ffffffffa0841718  RSP: ffff8820ceec1858  RFLAGS: 00010282
            RAX: 0000000000000000  RBX: 0000000000000000  RCX: ffff88241747b400
            RDX: ffff88241747b408  RSI: 0000000000000000  RDI: ffff8811fb27d000
            RBP: ffff8820ceec1868   R8: ffff88120cdeff24   R9: ffff88120cdeff30
            R10: 0000000000000bd4  R11: ffffffffa0840919  R12: ffffffffa0843340
            R13: 0000000000000000  R14: 0000000000000001  R15: ffff8808dae5c2e8
            ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
         #9 [...] qdisc_tree_decrease_qlen at ffffffff81565375
        #10 [...] fq_codel_dequeue at ffffffffa084e0a0 [sch_fq_codel]
        #11 [...] fq_codel_reset at ffffffffa084e2f8 [sch_fq_codel]
        #12 [...] qdisc_destroy at ffffffff81560d2d
        #13 [...] htb_destroy_class at ffffffffa08408f8 [sch_htb]
        #14 [...] htb_put at ffffffffa084095c [sch_htb]
        #15 [...] tc_ctl_tclass at ffffffff815645a3
        #16 [...] rtnetlink_rcv_msg at ffffffff81552cb0
        [... snip ...]
      
      As Jamal pointed out, there is actually no need to call dequeue
      to purge the queued skb's in reset, data structures can be just
      reset explicitly. Therefore, we reset everything except config's
      and stats, so that we would have a fresh start after device flipping.
      
      Fixes: 4b549a2e ("fq_codel: Fair Queue Codel AQM")
      Reported-by: NAlex Gartrell <agartrell@fb.com>
      Cc: Alex Gartrell <agartrell@fb.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      [xiyou.wangcong@gmail.com: added codel_vars_init() and qdisc_qstats_backlog_dec()]
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3d0e0af4
    • I
      rocker: free netdevice during netdevice removal · 1ebd47ef
      Ido Schimmel 提交于
      When removing a port's netdevice in 'rocker_remove_ports', we should
      also free the allocated 'net_device' structure. Do that by calling
      'free_netdev' after unregistering it.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@resnulli.us>
      Fixes: 4b8ac966 ("rocker: introduce rocker switch driver")
      Acked-by: NScott Feldman <sfeldma@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1ebd47ef
  7. 01 8月, 2015 3 次提交
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 7c764cec
      Linus Torvalds 提交于
      Pull networking fixes from David Miller:
      
       1) Must teardown SR-IOV before unregistering netdev in igb driver, from
          Alex Williamson.
      
       2) Fix ipv6 route unreachable crash in IPVS, from Alex Gartrell.
      
       3) Default route selection in ipv4 should take the prefix length, table
          ID, and TOS into account, from Julian Anastasov.
      
       4) sch_plug must have a reset method in order to purge all buffered
          packets when the qdisc is reset, likewise for sch_choke, from WANG
          Cong.
      
       5) Fix deadlock and races in slave_changelink/br_setport in bridging.
          From Nikolay Aleksandrov.
      
       6) mlx4 bug fixes (wrong index in port even propagation to VFs,
          overzealous BUG_ON assertion, etc.) from Ido Shamay, Jack
          Morgenstein, and Or Gerlitz.
      
       7) Turn off klog message about SCTP userspace interface compat that
          makes no sense at all, from Daniel Borkmann.
      
       8) Fix unbounded restarts of inet frag eviction process, causing NMI
          watchdog soft lockup messages, from Florian Westphal.
      
       9) Suspend/resume fixes for r8152 from Hayes Wang.
      
      10) Fix busy loop when MSG_WAITALL|MSG_PEEK is used in TCP recv, from
          Sabrina Dubroca.
      
      11) Fix performance regression when removing a lot of routes from the
          ipv4 routing tables, from Alexander Duyck.
      
      12) Fix device leak in AF_PACKET, from Lars Westerhoff.
      
      13) AF_PACKET also has a header length comparison bug due to signedness,
          from Alexander Drozdov.
      
      14) Fix bug in EBPF tail call generation on x86, from Daniel Borkmann.
      
      15) Memory leaks, TSO stats, watchdog timeout and other fixes to
          thunderx driver from Sunil Goutham and Thanneeru Srinivasulu.
      
      16) act_bpf can leak memory when replacing programs, from Daniel
          Borkmann.
      
      17) WOL packet fixes in gianfar driver, from Claudiu Manoil.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (79 commits)
        stmmac: fix missing MODULE_LICENSE in stmmac_platform
        gianfar: Enable device wakeup when appropriate
        gianfar: Fix suspend/resume for wol magic packet
        gianfar: Fix warning when CONFIG_PM off
        act_pedit: check binding before calling tcf_hash_release()
        net: sk_clone_lock() should only do get_net() if the parent is not a kernel socket
        net: sched: fix refcount imbalance in actions
        r8152: reset device when tx timeout
        r8152: add pre_reset and post_reset
        qlcnic: Fix corruption while copying
        act_bpf: fix memory leaks when replacing bpf programs
        net: thunderx: Fix for crash while BGX teardown
        net: thunderx: Add PCI driver shutdown routine
        net: thunderx: Fix crash when changing rss with mutliple traffic flows
        net: thunderx: Set watchdog timeout value
        net: thunderx: Wakeup TXQ only if CQE_TX are processed
        net: thunderx: Suppress alloc_pages() failure warnings
        net: thunderx: Fix TSO packet statistic
        net: thunderx: Fix memory leak when changing queue count
        net: thunderx: Fix RQ_DROP miscalculation
        ...
      7c764cec
    • L
      Merge branch 'for-linus-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · acea568f
      Linus Torvalds 提交于
      Pull btrfs fixes from Chris Mason:
       "Filipe fixed up a hard to trigger ENOSPC regression from our merge
        window pull, and we have a few other smaller fixes"
      
      * 'for-linus-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
        Btrfs: fix quick exhaustion of the system array in the superblock
        btrfs: its btrfs_err() instead of btrfs_error()
        btrfs: Avoid NULL pointer dereference of free_extent_buffer when read_tree_block() fail
        btrfs: Fix lockdep warning of btrfs_run_delayed_iputs()
      acea568f
    • L
      Merge tag 'sound-4.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · c6fd4fc7
      Linus Torvalds 提交于
      Pull sound fixes from Takashi Iwai:
       "This became a relative big update as it includes the collected ASoC
        fixes.  There are a few fixes in ASoC core side, mostly for DAPM and
        the new topology API.  The rest are various ASoC driver-specific
        fixes, as well as the usual HD-audio and USB-audio quirks"
      
      * tag 'sound-4.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (29 commits)
        ALSA: hda - Fix MacBook Pro 5,2 quirk
        ALSA: hda - Fix race between PM ops and HDA init/probe
        ALSA: usb-audio: add dB range mapping for some devices
        ALSA: hda - Apply a fixup to Dell Vostro 5480
        ALSA: hda - Add pin quirk for the headset mic jack detection on Dell laptop
        ALSA: hda - Apply fixup for another Toshiba Satellite S50D
        ALSA: fireworks: add support for AudioFire2 quirk
        ALSA: hda - Fix the headset mic that will not work on Dell desktop machine
        ALSA: hda - fix cs4210_spdif_automute()
        ASoC: pcm1681: Fix setting de-emphasis sampling rate selection
        ASoC: ssm4567: Keep TDM_BCLKS in ssm4567_set_dai_fmt
        ASoC: sgtl5000: Fix up define for SGTL5000_SMALL_POP
        ASoC: dapm: Don't add prefix to widget stream name
        ASoC: rt5645: Check if codec is initialized in workqueue handler
        ASoC: Intel: Get correct usage_count value to load firmware
        ASoC: topology: Fix to add dapm mixer info
        ASoC: zx: spdif: Fix devm_ioremap_resource return value check
        ASoC: zx: i2s: Fix devm_ioremap_resource return value check
        ASoC: mediatek: Use platform_of_node for machine drivers
        ASoC: Free card DAPM context on snd_soc_instantiate_card() error path
        ...
      c6fd4fc7