1. 18 5月, 2016 14 次提交
    • A
      r8169: default to 64-bit DMA on recent PCIe chips · 27896c83
      Ard Biesheuvel 提交于
      The current logic around the 'use_dac' module parameter prevents the
      r81969 driver from being loadable on 64-bit systems without any RAM
      below 4 GB when the parameter is left at its default value.
      
      So introduce a new default value -1 which indicates that 64-bit DMA
      should be enabled on sufficiently recent PCIe chips, i.e., versions
      RTL_GIGA_MAC_VER_18 or later. Explicit param values of 0 or 1 retain
      the existing behavior of unconditionally enabling/disabling 64-bit DMA
      on 64-bit architectures (i.e., regardless of the type and version of the
      chip)
      
      Since PCIe chips do not need to CPlusCmd Dual Address Cycle to be set,
      make that conditional on the device type as well.
      
      Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      27896c83
    • A
      phy dp83867: Make rgmii parameters optional · 81003bc9
      Alexander Graf 提交于
      If you compile without OF_MDIO support in an RGMII configuration, we fail
      to configure the dp83867 phy today by writing garbage into its configuration
      registers.
      
      On the other hand if you do compile with OF_MDIO and the phy gets loaded via
      device tree, you have to have the properties set in the device tree, otherwise
      we fail to load the driver and don't even attach the generic phy driver to
      the interface anymore.
      
      To make things slightly more consistent, make the rgmii configuration properties
      optional and allow a user to omit them in their device tree.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      81003bc9
    • A
      phy dp83867: Fix compilation with CONFIG_OF_MDIO=m · 7f32541c
      Alexander Graf 提交于
      When CONFIG_OF_MDIO is configured as module, the #define for it really
      is CONFIG_OF_MDIO_MODULE, not CONFIG_OF_MDIO. So if we are compiling it
      as module, the dp83867 doesn't see that OF_MDIO was selected and doesn't
      read the dt rgmii parameters.
      
      The fix is simple: Use IS_ENABLED(). It checks for both - module as well
      as compiled in code.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7f32541c
    • D
      Merge tag 'net-next-qcom-soc-4.7-2-merge' of git://github.com/andersson/kernel · 08a6ee58
      David S. Miller 提交于
      Merge tag 'qcom-soc-for-4.7-2' into net-next
      
      This merges the Qualcomm SOC tree with the net-next, solving the
      merge conflict in the SMD API between the two.
      08a6ee58
    • Y
      bpf: arm64: remove callee-save registers use for tmp registers · 4c1cd4fd
      Yang Shi 提交于
      In the current implementation of ARM64 eBPF JIT, R23 and R24 are used for
      tmp registers, which are callee-saved registers. This leads to variable size
      of JIT prologue and epilogue. The latest blinding constant change prefers to
      constant size of prologue and epilogue. AAPCS reserves R9 ~ R15 for temp
      registers which not need to be saved/restored during function call. So, replace
      R23 and R24 to R10 and R11, and remove tmp_used flag to save 2 instructions for
      some jited BPF program.
      
      CC: Daniel Borkmann <daniel@iogearbox.net>
      Acked-by: NZi Shen Lim <zlim.lnx@gmail.com>
      Signed-off-by: NYang Shi <yang.shi@linaro.org>
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4c1cd4fd
    • J
      asix: Fix offset calculation in asix_rx_fixup() causing slow transmissions · cd9e2e5d
      John Stultz 提交于
      In testing with HiKey, we found that since
      commit 3f30b158 ("asix: On RX avoid creating bad Ethernet
      frames"),
      we're seeing lots of noise during network transfers:
      
      [  239.027993] asix 1-1.1:1.0 eth0: asix_rx_fixup() Data Header synchronisation was lost, remaining 988
      [  239.037310] asix 1-1.1:1.0 eth0: asix_rx_fixup() Bad Header Length 0x54ebb5ec, offset 4
      [  239.045519] asix 1-1.1:1.0 eth0: asix_rx_fixup() Bad Header Length 0xcdffe7a2, offset 4
      [  239.275044] asix 1-1.1:1.0 eth0: asix_rx_fixup() Data Header synchronisation was lost, remaining 988
      [  239.284355] asix 1-1.1:1.0 eth0: asix_rx_fixup() Bad Header Length 0x1d36f59d, offset 4
      [  239.292541] asix 1-1.1:1.0 eth0: asix_rx_fixup() Bad Header Length 0xaef3c1e9, offset 4
      [  239.518996] asix 1-1.1:1.0 eth0: asix_rx_fixup() Data Header synchronisation was lost, remaining 988
      [  239.528300] asix 1-1.1:1.0 eth0: asix_rx_fixup() Bad Header Length 0x2881912, offset 4
      [  239.536413] asix 1-1.1:1.0 eth0: asix_rx_fixup() Bad Header Length 0x5638f7e2, offset 4
      
      And network throughput ends up being pretty bursty and slow with
      a overall throughput of at best ~30kB/s (where as previously we
      got 1.1MB/s with the slower USB1.1 "full speed" host).
      
      We found the issue also was reproducible on a x86_64 system,
      using a "high-speed" USB2.0 port but the throughput did not
      measurably drop (possibly due to the scp transfer being cpu
      bound on my slow test hardware).
      
      After lots of debugging, I found the check added in the
      problematic commit seems to be calculating the offset
      incorrectly.
      
      In the normal case, in the main loop of the function, we do:
      (where offset is zero, or set to "offset += (copy_length + 1) &
      0xfffe" in the previous loop)
          rx->header = get_unaligned_le32(skb->data +
                                          offset);
          offset += sizeof(u32);
      
      But the problematic patch calculates:
          offset = ((rx->remaining + 1) & 0xfffe) + sizeof(u32);
          rx->header = get_unaligned_le32(skb->data + offset);
      
      Adding some debug logic to check those offset calculation used
      to find rx->header, the one in problematic code is always too
      large by sizeof(u32).
      
      Thus, this patch removes the incorrect " + sizeof(u32)" addition
      in the problematic calculation, and resolves the issue.
      
      Cc: Dean Jenkins <Dean_Jenkins@mentor.com>
      Cc: "David B. Robins" <linux@davidrobins.net>
      Cc: Mark Craske <Mark_Craske@mentor.com>
      Cc: Emil Goode <emilgoode@gmail.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: YongQin Liu <yongqin.liu@linaro.org>
      Cc: Guodong Xu <guodong.xu@linaro.org>
      Cc: Ivan Vecera <ivecera@redhat.com>
      Cc: linux-usb@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Cc: stable <stable@vger.kernel.org> #4.4+
      Reported-by: NYongqin Liu <yongqin.liu@linaro.org>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cd9e2e5d
    • J
      switchdev: pass pointer to fib_info instead of copy · da4ed551
      Jiri Pirko 提交于
      The problem is that fib_info->nh is [0] so the struct fib_info
      allocation size depends on number of nexthops. If we just copy fib_info,
      we do not copy the nexthops info and driver accesses memory which is not
      ours.
      
      Given the fact that fib4 does not defer operations and therefore it does
      not need copy, just pass the pointer down to drivers as it was done
      before.
      
      Fixes: 850d0cbc ("switchdev: remove pointers from switchdev objects")
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      da4ed551
    • W
      net_sched: close another race condition in tcf_mirred_release() · dc327f89
      WANG Cong 提交于
      We saw the following extra refcount release on veth device:
      
        kernel: [7957821.463992] unregister_netdevice: waiting for mesos50284 to become free. Usage count = -1
      
      Since we heavily use mirred action to redirect packets to veth, I think
      this is caused by the following race condition:
      
      CPU0:
      tcf_mirred_release(): (in RCU callback)
      	struct net_device *dev = rcu_dereference_protected(m->tcfm_dev, 1);
      
      CPU1:
      mirred_device_event():
              spin_lock_bh(&mirred_list_lock);
              list_for_each_entry(m, &mirred_list, tcfm_list) {
                      if (rcu_access_pointer(m->tcfm_dev) == dev) {
                              dev_put(dev);
                              /* Note : no rcu grace period necessary, as
                               * net_device are already rcu protected.
                               */
                              RCU_INIT_POINTER(m->tcfm_dev, NULL);
                      }
              }
              spin_unlock_bh(&mirred_list_lock);
      
      CPU0:
      tcf_mirred_release():
              spin_lock_bh(&mirred_list_lock);
              list_del(&m->tcfm_list);
              spin_unlock_bh(&mirred_list_lock);
              if (dev)               // <======== Stil refers to the old m->tcfm_dev
                      dev_put(dev);  // <======== dev_put() is called on it again
      
      The action init code path is good because it is impossible to modify
      an action that is being removed.
      
      So, fix this by moving everything under the spinlock.
      
      Fixes: 2ee22a90 ("net_sched: act_mirred: remove spinlock in fast path")
      Fixes: 6bd00b85 ("act_mirred: fix a race condition on mirred_list")
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Acked-by: NJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dc327f89
    • R
      tipc: fix nametable publication field in nl compat · 03aaaa9b
      Richard Alpe 提交于
      The publication field of the old netlink API should contain the
      publication key and not the publication reference.
      
      Fixes: 44a8ae94 (tipc: convert legacy nl name table dump to nl compat)
      Signed-off-by: NRichard Alpe <richard.alpe@ericsson.com>
      Acked-by: NJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      03aaaa9b
    • H
      drivers: net: Don't print unpopulated net_device name · 3274940b
      Harvey Hunt 提交于
      For ethernet devices, net_device.name will be eth%d before
      register_netdev() is called. Don't print the net_device name until
      the format string is replaced.
      Signed-off-by: NHarvey Hunt <harvey.hunt@imgtec.com>
      Cc: Marcel Ziswiler <marcel@ziswiler.com>
      Cc: Robert Jarzmik <robert.jarzmik@free.fr>
      Cc: Barry Song <Baohua.Song@csr.com>
      Cc: netdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3274940b
    • S
      qed: add support for dcbx. · 39651abd
      Sudarsana Reddy Kalluru 提交于
      This patch adds the necessary driver support for Management Firmware to
      configure the device/firmware with the dcbx results. Management Firmware
      is responsible for communicating the DCBX and driving the negotiation,
      but the driver has responsibility of receiving async notification and
      configuring the results in hw/fw. This patch also adds the dcbx support for
      future protocols (e.g., FCoE) as preparation to their imminent submission.
      Signed-off-by: NSudarsana Reddy Kalluru <sudarsana.kalluru@qlogic.com>
      Signed-off-by: NYuval Mintz <Yuval.Mintz@qlogic.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      39651abd
    • G
      ravb: Add missing free_irq() calls to ravb_close() · ccf92824
      Geert Uytterhoeven 提交于
      When reopening the network device on ra7795/salvator-x, e.g. after a
      DHCP timeout:
      
          IP-Config: Reopening network devices...
          genirq: Flags mismatch irq 139. 00000000 (eth0:ch0:rx_be) vs. 00000000 (ravb e6800000.ethernet eth0: cannot request IRQ eth0:ch0:rx_be
          IP-Config: Failed to open eth0
          IP-Config: No network devices available
      
      The "mismatch" is due to requesting an IRQ that is already in use,
      while IRQF_PROBE_SHARED wasn't set.
      
      However, the real cause is that ravb_close() doesn't release any of the
      R-Car Gen3-specific secondary IRQs.
      
      Add the missing free_irq() calls to fix this.
      
      Fixes: f51bdc23 ("ravb: Add dma queue interrupt support")
      Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Acked-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ccf92824
    • D
      qed: Remove a stray tab · f82731b4
      Dan Carpenter 提交于
      This line was indented more than it should be.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: NYuval Mintz <Yuval.Mintz@qlogic.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f82731b4
    • D
      Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · 2cc632db
      David S. Miller 提交于
      Jeff Kirsher says:
      
      ====================
      10GbE Intel Wired LAN Driver Updates 2016-05-16
      
      This series contains 2 fixes to ixgbe only.
      
      Emil fixes transmit hangs when enabling SRIOV by swapping the parameters
      in GENMASK in order to generate the correct mask.
      
      Alex fixes his previous patch b83e3010 ("ixgbe/ixgbevf: Add support
      for GSO partial") where he somehow transposed the location of setting
      the VLAN features in netdev->features and the configuration of the
      vlan_features.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2cc632db
  2. 17 5月, 2016 26 次提交