Skip to content
  1. Aug 21, 2015
  2. Aug 20, 2015
    • Nikolay Aleksandrov's avatar
      vrf: vrf_master_ifindex_rcu is not always called with rcu read lock · 18041e31
      Nikolay Aleksandrov authored
      
      
      While running net-next I hit this:
      [  634.073119] ===============================
      [  634.073150] [ INFO: suspicious RCU usage. ]
      [  634.073182] 4.2.0-rc6+ #45 Not tainted
      [  634.073213] -------------------------------
      [  634.073244] include/net/vrf.h:38 suspicious rcu_dereference_check()
      usage!
      [  634.073274]
                     other info that might help us debug this:
      
      [  634.073307]
                     rcu_scheduler_active = 1, debug_locks = 1
      [  634.073338] 2 locks held by swapper/0/0:
      [  634.073369]  #0:  (((&n->timer))){+.-...}, at: [<ffffffff8112bc35>]
      call_timer_fn+0x5/0x480
      [  634.073412]  #1:  (slock-AF_INET){+.-...}, at: [<ffffffff8174f0f5>]
      icmp_send+0x155/0x5f0
      [  634.073450]
                     stack backtrace:
      [  634.073483] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.2.0-rc6+ #45
      [  634.073514] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS
      VirtualBox 12/01/2006
      [  634.073545]  0000000000000000 0593ba8242d9ace4 ffff88002fc03b48
      ffffffff81803f1b
      [  634.073612]  0000000000000000 ffffffff81e12500 ffff88002fc03b78
      ffffffff811003c5
      [  634.073642]  0000000000000000 ffff88002ec4e600 ffffffff81f00f80
      ffff88002fc03cf0
      [  634.073669] Call Trace:
      [  634.073694]  <IRQ>  [<ffffffff81803f1b>] dump_stack+0x4c/0x65
      [  634.073728]  [<ffffffff811003c5>] lockdep_rcu_suspicious+0xc5/0x100
      [  634.073763]  [<ffffffff8174eb56>] icmp_route_lookup+0x176/0x5c0
      [  634.073793]  [<ffffffff8174f2fb>] ? icmp_send+0x35b/0x5f0
      [  634.073818]  [<ffffffff8174f274>] ? icmp_send+0x2d4/0x5f0
      [  634.073844]  [<ffffffff8174f3ce>] icmp_send+0x42e/0x5f0
      [  634.073873]  [<ffffffff8170b662>] ipv4_link_failure+0x22/0xa0
      [  634.073899]  [<ffffffff8174bdda>] arp_error_report+0x3a/0x80
      [  634.073926]  [<ffffffff816d6100>] ? neigh_lookup+0x2c0/0x2c0
      [  634.073952]  [<ffffffff816d396e>] neigh_invalidate+0x8e/0x110
      [  634.073984]  [<ffffffff816d62ae>] neigh_timer_handler+0x1ae/0x290
      [  634.074013]  [<ffffffff816d6100>] ? neigh_lookup+0x2c0/0x2c0
      [  634.074013]  [<ffffffff8112bce3>] call_timer_fn+0xb3/0x480
      [  634.074013]  [<ffffffff8112bc35>] ? call_timer_fn+0x5/0x480
      [  634.074013]  [<ffffffff816d6100>] ? neigh_lookup+0x2c0/0x2c0
      [  634.074013]  [<ffffffff8112c2bc>] run_timer_softirq+0x20c/0x430
      [  634.074013]  [<ffffffff810af50e>] __do_softirq+0xde/0x630
      [  634.074013]  [<ffffffff810afc97>] irq_exit+0x117/0x120
      [  634.074013]  [<ffffffff81810976>] smp_apic_timer_interrupt+0x46/0x60
      [  634.074013]  [<ffffffff8180e950>] apic_timer_interrupt+0x70/0x80
      [  634.074013]  <EOI>  [<ffffffff8106b9d6>] ? native_safe_halt+0x6/0x10
      [  634.074013]  [<ffffffff81101d8d>] ? trace_hardirqs_on+0xd/0x10
      [  634.074013]  [<ffffffff81027d43>] default_idle+0x23/0x200
      [  634.074013]  [<ffffffff8102852f>] arch_cpu_idle+0xf/0x20
      [  634.074013]  [<ffffffff810f89ba>] default_idle_call+0x2a/0x40
      [  634.074013]  [<ffffffff810f8dcc>] cpu_startup_entry+0x39c/0x4c0
      [  634.074013]  [<ffffffff817f9cad>] rest_init+0x13d/0x150
      [  634.074013]  [<ffffffff81f69038>] start_kernel+0x4a8/0x4c9
      [  634.074013]  [<ffffffff81f68120>] ?
      early_idt_handler_array+0x120/0x120
      [  634.074013]  [<ffffffff81f68339>] x86_64_start_reservations+0x2a/0x2c
      [  634.074013]  [<ffffffff81f68485>] x86_64_start_kernel+0x14a/0x16d
      
      It would seem vrf_master_ifindex_rcu() can be called without RCU held in
      other contexts as well so introduce a new helper which acquires rcu and
      returns the ifindex.
      Also add curly braces around both the "if" and "else" parts as per the
      style guide.
      
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      18041e31
    • Ying Xue's avatar
      lwtunnel: Fix the sparse warnings in fib_encap_match · 824e7383
      Ying Xue authored
      When CONFIG_LWTUNNEL config is not enabled, the lwtstate_free() is not
      declared in lwtunnel.h at all. However, even in this case, the function
      is still referenced in fib_semantics.c so that there appears the
      following sparse warnings:
      
      net/ipv4/fib_semantics.c:553:17: error: undefined identifier 'lwtstate_free'
        CC      net/ipv4/fib_semantics.o
        net/ipv4/fib_semantics.c: In function ‘fib_encap_match’:
        net/ipv4/fib_semantics.c:553:3: error: implicit declaration of function ‘lwtstate_free’ [-Werror=implicit-function-declaration]
        cc1: some warnings being treated as errors
        make[1]: *** [net/ipv4/fib_semantics.o] Error 1
        make: *** [net/ipv4/fib_semantics.o] Error 2
      
      To eliminate the error, we define an empty function for lwtstate_free()
      in lwtunnel.h when CONFIG_LWTUNNEL is disabled.
      
      Fixes: df383e62
      
       ("lwtunnel: fix memory leak")
      Cc: Jiri Benc <jbenc@redhat.com>
      Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
      Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
      Acked-by: default avatarJiri Benc <jbenc@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      824e7383
  3. Aug 19, 2015
    • David S. Miller's avatar
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · def63be8
      David S. Miller authored
      
      
      Jeff Kirsher says:
      
      ====================
      Intel Wired LAN Driver Updates 2015-08-18
      
      This series contains updates to igb, e100, e1000e and ixgbe.
      
      Shota Suzuki provides a fix for a possible overflow in
      igb_set_interrupt_capability() which leads to an oops.  When changing the
      number of queues by "ethtool -L", set IGB_FLAG_QUEUE_PAIRS in the same
      manner as when initializing the igb driver.
      
      Vasily Averin provides a fix for a missing rtnl_unlock() for when we
      error out due to not being able to allocate memory for our queues.
      
      Stefan Assman provides a couple of fixes for igb/igbvf.  First changes
      the igb driver in probe to simply call igb_enable_sriov() instead of
      igb_sriov_reinit() since we are starting from scratch.  Then in igbvf,
      fix the driver where it does not clear the buffer_info->dma in all
      cases after calling dma_unmap_single(), which was found by changing the
      MTU twice.
      
      Richard Cochran implements the periodic output function using the
      programmable clock outputs available in i210 when possible, falling
      back to the target time for longer periods.
      
      Todd adds support for the Marvell PHY 1512 which is required for i354
      devices.  Then updates igb to make sure SR-IOV init uses the correct
      number of queues, since recent changes could result in the PF holding
      onto all of the queues.
      
      Alex Williamson provides a fix in the case where a guest OS does not
      support hot-unplug, so disable SR-IOV prior to unregister_netdev() to
      avoid the problem.
      
      Jia-Ju Bai provides several patches, first knocks some collecting dust
      off an old e100 driver to add a check to avoid a null pointer
      dereference.  Then cleans up a possible resource leak by releasing the
      skb buffer allocated when the e100_xmit_prepare() runs into an issue
      in the DMA mapping.  In igb, add a missing rtnl_unlock() for when we
      error out due to igb_sriov_reinit() in the igb_init_interrupt_scheme().
      Provides a e1000e fix, based on suggestions from Alex Duyck to move
      head/tail register writing to e1000_configure_tx/rx() to avoid a
      possible null pointer dereference (similar to igb driver).  Lastly,
      fix a possible memory leak in igb_probe(), where the memory shadow_vfta
      allocated by kcalloc in igb_sw_init() is not freed.
      
      Mark simplifies port-specific macros for ixgbe by eliminating explicit
      comparisons with 0 and enclose formal parameters in parens to eliminate
      the risk of an operator precedence issue.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      def63be8
    • David S. Miller's avatar
      Merge branch 'vrf-next' · 1c8aa215
      David S. Miller authored
      
      
      Nikolay Aleksandrov says:
      
      ====================
      vrf: a few simplifications and cleanups
      
      These patches remove some unnecessary checks (patches 3, 4), unnecessary
      num_slaves member and refcnt manipulations which are already done by the
      upper functions.
      ====================
      
      Acked-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1c8aa215
    • Nikolay Aleksandrov's avatar
      vrf: simplify the netdev notifier function · 58aa9087
      Nikolay Aleksandrov authored
      
      
      We can drop the check because if vrf_ptr is present then we must have
      the vrf device as a master and since we're running with rtnl it can't go
      away.
      
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      58aa9087
    • Nikolay Aleksandrov's avatar
      vrf: don't check for dstats and rth in uninit path · 3a4a27d3
      Nikolay Aleksandrov authored
      
      
      dstats and rth are always present because we fail the device registration
      if they can't be allocated in vrf_init() (ndo_init) so drop the unnecessary
      checks.
      
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3a4a27d3
    • Nikolay Aleksandrov's avatar
      vrf: drop unused num_slaves member · db5dbec5
      Nikolay Aleksandrov authored
      
      
      slave_queue has a num_slaves member which is unused, drop it.
      
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      db5dbec5
    • Nikolay Aleksandrov's avatar
      vrf: drop unnecessary dev refcnt changes · 17d95f5e
      Nikolay Aleksandrov authored
      
      
      netdev_master_upper_dev_link/unlink already do a dev_hold/put on the
      devices being linked, so no need to take another reference.
      
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      17d95f5e
    • Andrew Schwartzmeyer's avatar
      hv_netvsc: Fix dereference of nvdev before check · 954591b9
      Andrew Schwartzmeyer authored
      
      
      Passes static analysis by Smatch.
      
      Signed-off-by: default avatarAndrew Schwartzmeyer <andschwa@microsoft.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      954591b9
    • Jiri Benc's avatar
      lwtunnel: ip tunnel: fix multiple routes with different encap · 2d798499
      Jiri Benc authored
      Currently, two routes going through the same tunnel interface are considered
      the same even when they are routed to a different host after encapsulation.
      This causes all routes added after the first one to have incorrect
      encapsulation parameters.
      
      This is nicely visible by doing:
      
        # ip r a 192.168.1.2/32 dev vxlan0 tunnel dst 10.0.0.2
        # ip r a 192.168.1.3/32 dev vxlan0 tunnel dst 10.0.0.3
        # ip r
        [...]
        192.168.1.2/32 tunnel id 0 src 0.0.0.0 dst 10.0.0.2 [...]
        192.168.1.3/32 tunnel id 0 src 0.0.0.0 dst 10.0.0.2 [...]
      
      Implement the missing comparison function.
      
      Fixes: 3093fbe7
      
       ("route: Per route IP tunnel metadata via lightweight tunnel")
      Signed-off-by: default avatarJiri Benc <jbenc@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2d798499
    • Jiri Benc's avatar
      lwtunnel: fix memory leak · df383e62
      Jiri Benc authored
      The built lwtunnel_state struct has to be freed after comparison.
      
      Fixes: 571e7226
      
       ("ipv4: support for fib route lwtunnel encap attributes")
      Signed-off-by: default avatarJiri Benc <jbenc@redhat.com>
      Acked-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      df383e62
    • Dan Carpenter's avatar
      cxgb4: memory corruption in debugfs · c938a003
      Dan Carpenter authored
      You can't use kstrtoul() with an int or it causes memory corruption.
      Also j should be unsigned or we have underflow bugs.
      
      I considered changing "j" to unsigned long but everything fits in a u32.
      
      Fixes: 8e3d04fd
      
       ('cxgb4: Add MPS tracing support')
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c938a003
    • David S. Miller's avatar
      enic: Fix namespace pollution causing build errors. · 3dc33e23
      David S. Miller authored
      
      
      drivers/net/built-in.o: In function `.vnic_wq_devcmd2_alloc':
      (.text+0x49fe40): multiple definition of `.vnic_wq_devcmd2_alloc'
      drivers/scsi/built-in.o:(.text+0xb4318): first defined here
      drivers/net/built-in.o:(.opd+0x2af00): multiple definition of `vnic_wq_devcmd2_alloc'
      drivers/scsi/built-in.o:(.opd+0xad70): first defined here
      drivers/net/built-in.o: In function `.vnic_wq_init_start':
      (.text+0x49f9c0): multiple definition of `.vnic_wq_init_start'
      drivers/scsi/built-in.o:(.text+0xb3b58): first defined here
      drivers/net/built-in.o:(.opd+0x2ae88): multiple definition of `vnic_wq_init_start'
      drivers/scsi/built-in.o:(.opd+0xace0): first defined here
      
      Rename these to 'enic_*' to avoid the conflict with the functiosn of
      the same name in the snic scsi driver.
      
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3dc33e23
    • Rajesh Borundia's avatar
      bnx2x: Add vxlan RSS support · f34fa14c
      Rajesh Borundia authored
      
      
      Latest FW submission added some vxlan offload capabilities to our device.
      This patch adds the ability to connect to the vxlan NDOs and configure
      the UDP port associated with it in the HW.
      
      The device would now be capable of performing RSS according to the
      inner headers of the vxlan packets.
      
      Signed-off-by: default avatarRajesh Borundia <Rajesh.Borundia@qlogic.com>
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@qlogic.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f34fa14c
    • David S. Miller's avatar
      Merge branch 'dsa-multi-swtich' · 3f0bf60f
      David S. Miller authored
      
      
      Andrew Lunn says:
      
      ====================
      D in DSA patches
      
      The D in DSA is distributed, meaning multiple switches can be
      connected together. Currently no mainline system does this, and so the
      code is broken. This patchset contains two fixes, and a small helper.
      
      With three of more switches, the current device tree binding is not
      sufficient to express the routing between the switches. The first
      patch extends the binding, in a backwards compatible way, to allow a
      link between a switch to describe all the switches accessible over the
      link, not just the direct neighbor.
      
      The third patch fixes the port configuration on newer devices for
      links connecting switches.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3f0bf60f