1. 18 3月, 2017 8 次提交
  2. 19 1月, 2017 1 次提交
    • T
      net: Remove usage of net_device last_rx member · 4a7c9726
      Tobias Klauser 提交于
      The network stack no longer uses the last_rx member of struct net_device
      since the bonding driver switched to use its own private last_rx in
      commit 9f242738 ("bonding: use last_arp_rx in slave_last_rx()").
      
      However, some drivers still (ab)use the field for their own purposes and
      some driver just update it without actually using it.
      
      Previously, there was an accompanying comment for the last_rx member
      added in commit 4dc89133 ("net: add a comment on netdev->last_rx")
      which asked drivers not to update is, unless really needed. However,
      this commend was removed in commit f8ff080d ("bonding: remove
      useless updating of slave->dev->last_rx"), so some drivers added later
      on still did update last_rx.
      
      Remove all usage of last_rx and switch three drivers (sky2, atp and
      smc91c92_cs) which actually read and write it to use their own private
      copy in netdev_priv.
      
      Compile-tested with allyesconfig and allmodconfig on x86 and arm.
      
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Jay Vosburgh <j.vosburgh@gmail.com>
      Cc: Veaceslav Falico <vfalico@gmail.com>
      Cc: Andy Gospodarek <andy@greyhouse.net>
      Cc: Mirko Lindner <mlindner@marvell.com>
      Cc: Stephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: NTobias Klauser <tklauser@distanz.ch>
      Acked-by: NEric Dumazet <edumazet@google.com>
      Reviewed-by: NJay Vosburgh <jay.vosburgh@canonical.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4a7c9726
  3. 11 1月, 2017 1 次提交
  4. 09 1月, 2017 1 次提交
  5. 06 1月, 2017 3 次提交
    • T
      igb: close/suspend race in netif_device_detach · 9474933c
      Todd Fujinaka 提交于
      Similar to ixgbe, when an interface is part of a namespace it is
      possible that igb_close() may be called while __igb_shutdown() is
      running which ends up in a double free WARN and/or a BUG in
      free_msi_irqs().
      
      Extend the rtnl_lock() to protect the call to netif_device_detach() and
      igb_clear_interrupt_scheme() in __igb_shutdown() and check for
      netif_device_present() to avoid calling igb_clear_interrupt_scheme() a
      second time in igb_close().
      
      Also extend the rtnl lock in igb_resume() to netif_device_attach().
      Signed-off-by: NTodd Fujinaka <todd.fujinaka@intel.com>
      Acked-by: NAlexander Duyck <alexander.h.duyck@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      9474933c
    • G
      igb: re-assign hw address pointer on reset after PCI error · 69b97cf6
      Guilherme G Piccoli 提交于
      Whenever the igb driver detects the result of a read operation returns
      a value composed only by F's (like 0xFFFFFFFF), it will detach the
      net_device, clear the hw_addr pointer and warn to the user that adapter's
      link is lost - those steps happen on igb_rd32().
      
      In case a PCI error happens on Power architecture, there's a recovery
      mechanism called EEH, that will reset the PCI slot and call driver's
      handlers to reset the adapter and network functionality as well.
      
      We observed that once hw_addr is NULL after the error is detected on
      igb_rd32(), it's never assigned back, so in the process of resetting
      the network functionality we got a NULL pointer dereference in both
      igb_configure_tx_ring() and igb_configure_rx_ring(). In order to avoid
      such bug, this patch re-assigns the hw_addr value in the slot_reset
      handler.
      Reported-by: NAnthony H Thai <ahthai@us.ibm.com>
      Reported-by: NHarsha Thyagaraja <hathyaga@in.ibm.com>
      Signed-off-by: NGuilherme G Piccoli <gpiccoli@linux.vnet.ibm.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      69b97cf6
    • C
      igb: use igb_adapter->io_addr instead of e1000_hw->hw_addr · 629823b8
      Cao jin 提交于
      When running as guest, under certain condition, it will oops as following.
      writel() in igb_configure_tx_ring() results in oops, because hw->hw_addr
      is NULL. While other register access won't oops kernel because they use
      wr32/rd32 which have a defense against NULL pointer.
      
          [  141.225449] pcieport 0000:00:1c.0: AER: Multiple Uncorrected (Fatal)
          error received: id=0101
          [  141.225523] igb 0000:01:00.1: PCIe Bus Error:
          severity=Uncorrected (Fatal), type=Unaccessible,
          id=0101(Unregistered Agent ID)
          [  141.299442] igb 0000:01:00.1: broadcast error_detected message
          [  141.300539] igb 0000:01:00.0 enp1s0f0: PCIe link lost, device now
          detached
          [  141.351019] igb 0000:01:00.1 enp1s0f1: PCIe link lost, device now
          detached
          [  143.465904] pcieport 0000:00:1c.0: Root Port link has been reset
          [  143.465994] igb 0000:01:00.1: broadcast slot_reset message
          [  143.466039] igb 0000:01:00.0: enabling device (0000 -> 0002)
          [  144.389078] igb 0000:01:00.1: enabling device (0000 -> 0002)
          [  145.312078] igb 0000:01:00.1: broadcast resume message
          [  145.322211] BUG: unable to handle kernel paging request at
          0000000000003818
          [  145.361275] IP: [<ffffffffa02fd38d>]
          igb_configure_tx_ring+0x14d/0x280 [igb]
          [  145.400048] PGD 0
          [  145.438007] Oops: 0002 [#1] SMP
      
      A similar issue & solution could be found at:
          http://patchwork.ozlabs.org/patch/689592/Signed-off-by: NCao jin <caoj.fnst@cn.fujitsu.com>
      Acked-by: NAlexander Duyck <alexander.h.duyck@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      629823b8
  6. 15 12月, 2016 2 次提交
    • A
      igb: update code to better handle incrementing page count · bd4171a5
      Alexander Duyck 提交于
      Update the driver code so that we do bulk updates of the page reference
      count instead of just incrementing it by one reference at a time.  The
      advantage to doing this is that we cut down on atomic operations and
      this in turn should give us a slight improvement in cycles per packet.
      In addition if we eventually move this over to using build_skb the gains
      will be more noticeable.
      
      Link: http://lkml.kernel.org/r/20161110113616.76501.17072.stgit@ahduyck-blue-test.jf.intel.comSigned-off-by: NAlexander Duyck <alexander.h.duyck@intel.com>
      Acked-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Chris Metcalf <cmetcalf@mellanox.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no>
      Cc: Helge Deller <deller@gmx.de>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Keguang Zhang <keguang.zhang@gmail.com>
      Cc: Ley Foon Tan <lftan@altera.com>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Richard Kuo <rkuo@codeaurora.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Steven Miao <realmz6@gmail.com>
      Cc: Tobias Klauser <tklauser@distanz.ch>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bd4171a5
    • A
      igb: update driver to make use of DMA_ATTR_SKIP_CPU_SYNC · 5be59554
      Alexander Duyck 提交于
      The ARM architecture provides a mechanism for deferring cache line
      invalidation in the case of map/unmap.  This patch makes use of this
      mechanism to avoid unnecessary synchronization.
      
      A secondary effect of this change is that the portion of the page that
      has been synchronized for use by the CPU should be writable and could be
      passed up the stack (at least on ARM).
      
      The last bit that occurred to me is that on architectures where the
      sync_for_cpu call invalidates cache lines we were prefetching and then
      invalidating the first 128 bytes of the packet.  To avoid that I have
      moved the sync up to before we perform the prefetch and allocate the
      skbuff so that we can actually make use of it.
      
      Link: http://lkml.kernel.org/r/20161110113611.76501.98897.stgit@ahduyck-blue-test.jf.intel.comSigned-off-by: NAlexander Duyck <alexander.h.duyck@intel.com>
      Acked-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Chris Metcalf <cmetcalf@mellanox.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no>
      Cc: Helge Deller <deller@gmx.de>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Keguang Zhang <keguang.zhang@gmail.com>
      Cc: Ley Foon Tan <lftan@altera.com>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Richard Kuo <rkuo@codeaurora.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Steven Miao <realmz6@gmail.com>
      Cc: Tobias Klauser <tklauser@distanz.ch>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5be59554
  7. 02 12月, 2016 1 次提交
  8. 18 10月, 2016 1 次提交
    • J
      ethernet/intel: use core min/max MTU checking · 91c527a5
      Jarod Wilson 提交于
      e100: min_mtu 68, max_mtu 1500
      - remove e100_change_mtu entirely, is identical to old eth_change_mtu,
        and no longer serves a purpose. No need to set min_mtu or max_mtu
        explicitly, as ether_setup() will already set them to 68 and 1500.
      
      e1000: min_mtu 46, max_mtu 16110
      
      e1000e: min_mtu 68, max_mtu varies based on adapter
      
      fm10k: min_mtu 68, max_mtu 15342
      - remove fm10k_change_mtu entirely, does nothing now
      
      i40e: min_mtu 68, max_mtu 9706
      
      i40evf: min_mtu 68, max_mtu 9706
      
      igb: min_mtu 68, max_mtu 9216
      - There are two different "max" frame sizes claimed and both checked in
        the driver, the larger value wasn't relevant though, so I've set max_mtu
        to the smaller of the two values here to retain identical behavior.
      
      igbvf: min_mtu 68, max_mtu 9216
      - Same issue as igb duplicated
      
      ixgb: min_mtu 68, max_mtu 16114
      - Also remove pointless old == new check, as that's done in dev_set_mtu
      
      ixgbe: min_mtu 68, max_mtu 9710
      
      ixgbevf: min_mtu 68, max_mtu dependent on hardware/firmware
      - Some hw can only handle up to max_mtu 1504 on a vf, others 9710
      
      CC: netdev@vger.kernel.org
      CC: intel-wired-lan@lists.osuosl.org
      CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      91c527a5
  9. 28 9月, 2016 1 次提交
  10. 24 9月, 2016 1 次提交
    • M
      net: Update API for VF vlan protocol 802.1ad support · 79aab093
      Moshe Shemesh 提交于
      Introduce new rtnl UAPI that exposes a list of vlans per VF, giving
      the ability for user-space application to specify it for the VF, as an
      option to support 802.1ad.
      We adjusted IP Link tool to support this option.
      
      For future use cases, the new UAPI supports multiple vlans. For now we
      limit the list size to a single vlan in kernel.
      Add IFLA_VF_VLAN_LIST in addition to IFLA_VF_VLAN to keep backward
      compatibility with older versions of IP Link tool.
      
      Add a vlan protocol parameter to the ndo_set_vf_vlan callback.
      We kept 802.1Q as the drivers' default vlan protocol.
      Suitable ip link tool command examples:
        Set vf vlan protocol 802.1ad:
          ip link set eth0 vf 1 vlan 100 proto 802.1ad
        Set vf to VST (802.1Q) mode:
          ip link set eth0 vf 1 vlan 100 proto 802.1Q
        Or by omitting the new parameter
          ip link set eth0 vf 1 vlan 100
      Signed-off-by: NMoshe Shemesh <moshe@mellanox.com>
      Signed-off-by: NTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      79aab093
  11. 19 8月, 2016 1 次提交
  12. 30 6月, 2016 3 次提交
  13. 24 6月, 2016 1 次提交
  14. 21 5月, 2016 2 次提交
  15. 14 5月, 2016 3 次提交
  16. 05 5月, 2016 1 次提交
    • F
      drivers: replace dev->trans_start accesses with dev_trans_start · 4d0e9657
      Florian Westphal 提交于
      a trans_start struct member exists twice:
      - in struct net_device (legacy)
      - in struct netdev_queue
      
      Instead of open-coding dev->trans_start usage to obtain the current
      trans_start value, use dev_trans_start() instead.
      
      This is not exactly the same, as dev_trans_start also considers
      the trans_start values of the netdev queues owned by the device
      and provides the most recent one.
      
      For legacy devices this doesn't matter as dev_trans_start can cope
      with netdev trans_start values of 0 (they are ignored).
      
      This is a prerequisite to eventual removal of dev->trans_start.
      
      Cc: linux-rdma@vger.kernel.org
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4d0e9657
  17. 07 4月, 2016 4 次提交
  18. 18 3月, 2016 1 次提交
    • J
      mm: introduce page reference manipulation functions · fe896d18
      Joonsoo Kim 提交于
      The success of CMA allocation largely depends on the success of
      migration and key factor of it is page reference count.  Until now, page
      reference is manipulated by direct calling atomic functions so we cannot
      follow up who and where manipulate it.  Then, it is hard to find actual
      reason of CMA allocation failure.  CMA allocation should be guaranteed
      to succeed so finding offending place is really important.
      
      In this patch, call sites where page reference is manipulated are
      converted to introduced wrapper function.  This is preparation step to
      add tracepoint to each page reference manipulation function.  With this
      facility, we can easily find reason of CMA allocation failure.  There is
      no functional change in this patch.
      
      In addition, this patch also converts reference read sites.  It will
      help a second step that renames page._count to something else and
      prevents later attempt to direct access to it (Suggested by Andrew).
      Signed-off-by: NJoonsoo Kim <iamjoonsoo.kim@lge.com>
      Acked-by: NMichal Nazarewicz <mina86@mina86.com>
      Acked-by: NVlastimil Babka <vbabka@suse.cz>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Mel Gorman <mgorman@techsingularity.net>
      Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
      Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fe896d18
  19. 25 2月, 2016 4 次提交
    • S
      igb: call ndo_stop() instead of dev_close() when running offline selftest · 46eafa59
      Stefan Assmann 提交于
      Calling dev_close() causes IFF_UP to be cleared which will remove the
      interfaces routes and some addresses. That's probably not what the user
      intended when running the offline selftest. Besides this does not happen
      if the interface is brought down before the test, so the current
      behaviour is inconsistent.
      Instead call the net_device_ops ndo_stop function directly and avoid
      touching IFF_UP at all.
      Signed-off-by: NStefan Assmann <sassmann@kpanic.de>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      46eafa59
    • C
      igb: Fix VLAN tag stripping on Intel i350 · 030f9f52
      Corinna Vinschen 提交于
      Problem: When switching off VLAN offloading on an i350, the VLAN
      interface gets unusable.  For testing, set up a VLAN on an i350
      and some remote machine, e.g.:
      
        $ ip link add link eth0 name eth0.42 type vlan id 42
        $ ip addr add 192.168.42.1/24 dev eth0.42
        $ ip link set dev eth0.42 up
      
      Offloading is switched on by default:
      
        $ ethtool -k eth0 | grep vlan-offload
        rx-vlan-offload: on
        tx-vlan-offload: on
      
        $ ping -c 3 -I eth0.42 192.168.42.2
        [...works as usual...]
      
      Now switch off VLAN offloading and try again:
      
        $ ethtool -K eth0 rxvlan off
        Actual changes:
        rx-vlan-offload: off
        tx-vlan-offload: off [requested on]
        $ ping -c 3 -I eth0.42 192.168.42.2
        PING 192.168.42.2 (192.168.42.2) from 192.168.42.1 eth0.42: 56(84) bytes of da
      ta.
      
        --- 192.168.42.2 ping statistics ---
        3 packets transmitted, 0 received, 100% packet loss, time 1999ms
      
      I can only reproduce it on an i350, the above works fine on a 82580.
      
      While inspecting the igb source, I came across the code in igb_set_vmolr
      which sets the E1000_VMOLR_STRVLAN/E1000_DVMOLR_STRVLAN flags once and
      for all, and in all of the igb code there's no other place where the
      STRVLAN is set or cleared.  Thus, VLAN stripping is enabled in igb
      unconditionally, independently of the offloading setting.
      
      I compared that to the latest Intel igb-5.3.3.5 driver from
      http://sourceforge.net/projects/e1000/ which in fact sets and clears the
      STRVLAN flag independently from igb_set_vmolr in its own function
      igb_set_vf_vlan_strip, depending on the vlan settings.
      
      So I included the STRVLAN handling from the igb-5.3.3.5 driver into our
      current igb driver and tested the above scenario again.  This time ping
      still works after switching off VLAN offloading.
      
      Tested on i350, with and without addtional VFs, as well as on 82580
      successfully.
      Signed-off-by: NCorinna Vinschen <vinschen@redhat.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      030f9f52
    • A
      igb: Add support for generic Tx checksums · 6e033700
      Alexander Duyck 提交于
      This patch adds support for generic Tx checksums to the igb driver.  It
      turns out this is actually pretty easy after going over the datasheet as we
      were doing a number of steps we didn't need to.
      
      In order to perform a Tx checksum for an L4 header we need to fill in the
      following fields in the Tx descriptor:
        MACLEN (maximum of 127), retrieved from:
      		skb_network_offset()
        IPLEN  (maximum of 511), retrieved from:
      		skb_checksum_start_offset() - skb_network_offset()
        TUCMD.L4T indicates offset and if checksum or crc32c, based on:
      		skb->csum_offset
      
      The added advantage to doing this is that we can support inner checksum
      offloads for tunnels and MPLS while still being able to transparently
      insert VLAN tags.
      
      I also took the opportunity to clean-up many of the feature flag
      configuration bits to make them a bit more consistent between drivers.
      Signed-off-by: NAlexander Duyck <aduyck@mirantis.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      6e033700
    • T
      igb: rename igb define to be more generic · c883de9f
      Todd Fujinaka 提交于
      E1000_MRQC_ENABLE_RSS_4Q enables 4 and 8 queues depending on the part
      so rename to be generic.
      
      Similarly, E1000_MRQC_ENABLE_VMDQ_RSS_2Q has no numeric meaning so
      rename to be more generic.
      Signed-off-by: NTodd Fujinaka <todd.fujinaka@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      c883de9f