1. 27 9月, 2014 4 次提交
  2. 23 9月, 2014 7 次提交
    • F
      net: bcmgenet: call bcmgenet_dma_teardown in bcmgenet_fini_dma · 4a0c081e
      Florian Fainelli 提交于
      We should not be manipulaging the DMA_CTRL registers directly by writing
      0 to them to disable DMA. This is an operation that needs to be timed to
      make sure the DMA engines have been properly stopped since their state
      machine stops on a packet boundary, not immediately.
      
      Make sure that tha bcmgenet_fini_dma() calls bcmgenet_dma_teardown() to
      ensure a proper DMA engine state. As a result, we need to reorder the
      function bodies to resolve the use dependency.
      
      Fixes: 1c1008c7 ("net: bcmgenet: add main driver file")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4a0c081e
    • F
      net: bcmgenet: fix TX reclaim accounting for fragments · 478a010c
      Florian Fainelli 提交于
      The GENET driver supports SKB fragments, and succeeds in transmitting
      them properly, but when reclaiming these transmitted fragments, we will
      only update the count of free buffer descriptors by 1, even for SKBs
      with fragments. This leads to the networking stack thinking it has more
      room than the hardware has when pushing new SKBs, and backing off
      consequently because we return NETDEV_TX_BUSY.
      
      Fix this by accounting for the SKB nr_frags plus one (itself) and update
      ring->free_bds accordingly with that value for each iteration loop in
      __bcmgenet_tx_reclaim().
      
      Fixes: 1c1008c7 ("net: bcmgenet: add main driver file")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      478a010c
    • T
      dm9000: Return an ERR_PTR() in all error conditions of dm9000_parse_dt() · 09f3756b
      Tobias Klauser 提交于
      In one error condition dm9000_parse_dt() returns NULL, however the
      return value is checked using IS_ERR() in dm9000_probe(), leading to the
      error not being properly propagated if CONFIG_OF is not enabled or the
      device tree data is not available. Fix this by also returning an
      ERR_PTR() in this case.
      
      Fixes: 0b8bf1ba (net: dm9000: Allow instantiation using device tree)
      Signed-off-by: NTobias Klauser <tklauser@distanz.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      09f3756b
    • D
      r8169: fix an if condition · 85911d71
      Dan Carpenter 提交于
      There is an extra semi-colon so __rtl8169_set_features() is called every
      time.
      
      Fixes: 929a031d ('r8169: adjust __rtl8169_set_features')
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: Hayes Wang <hayeswang@realtek.com>--
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      85911d71
    • V
      tg3: Work around HW/FW limitations with vlan encapsulated frames · 476c1885
      Vlad Yasevich 提交于
      TG3 appears to have an issue performing TSO and checksum offloading
      correclty when the frame has been vlan encapsulated (non-accelrated).
      In these cases, tcp checksum is not correctly updated.
      
      This patch attempts to work around this issue.  After the patch,
      802.1ad vlans start working correctly over tg3 devices.
      
      CC: Prashant Sreedharan <prashant@broadcom.com>
      CC: Michael Chan <mchan@broadcom.com>
      Signed-off-by: NVladislav Yasevich <vyasevic@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      476c1885
    • D
      pch_gbe: 'select' NET_PTP_CLASSIFY. · 4e5f9ef3
      David S. Miller 提交于
      Fixes the following randconfig build failure:
      
      > drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c: In function
      > ‘pch_ptp_match’:
      > drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:130:2: error:
      > implicit declaration of function ‘ptp_classify_raw’
      > [-Werror=implicit-function-declaration]
      >   if (ptp_classify_raw(skb) == PTP_CLASS_NONE)
      >   ^
      > cc1: some warnings being treated as errors
      > make[5]: *** [drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.o] Error 1
      Reported-by: NJim Davis <jim.epost@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4e5f9ef3
    • J
      mlx4: Fix mlx4 reg/unreg mac to work properly with 0-mac addresses · f4fd40b2
      Jack Morgenstein 提交于
      There is a chance that the VF mlx4 RoCE driver (mlx4_ib) may see a 0-mac
      as the current default MAC address when a RoCE interface first comes up.
      
      In this case, the RoCE driver registers the 0-mac to get its MAC index --
      used in the INIT2RTR transition when it creates its proxy Q1 qp's.
      
      If we do not allow QP1 to be created, the RoCE driver will not come up.
      If we do not register the 0-mac, but simply use a random mac-index,
      QP1 will attempt to send packets with an someone's else source MAC which
      will get the system into more troubled.
      
      Since a 0-mac was previously used to indicate a free slot, this leads to
      errors, both when the 0-mac is registered and when it is unregistered.
      
      The required fix is to check in addition that the slot containing the
      0-mac has a reference count of zero.
      
      Additionally, when comparing MAC addresses, need to mask out the 2 MSBs
      of the u64 mac on both sides of the comparison.
      
      Note that when the EN driver (mlx4_en) comes up, it set itself a proper
      mac --> the RoCE driver gets to be notified on that and further handing
      is done with the update qp command, as was added by commit 9433c188
      ("IB/mlx4: Invoke UPDATE_QP for proxy QP1 on MAC changes").
      Signed-off-by: NJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      f4fd40b2
  3. 22 9月, 2014 1 次提交
  4. 20 9月, 2014 2 次提交
    • N
      3c59x: Fix bad offset spec in skb_frag_dma_map · 8400dd02
      Neil Horman 提交于
      Recently aded the use of skb_frag_dma_map to 3c59x, but didn't realize it
      automatically included the frag_offset internally, as well as provided an option
      to specify an extra offset in the parameter list.  We need to specify an offset
      of 0 in the parameter list to avoid skb corruption that results in lost
      connections.
      Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      CC: Linux Kernel list <linux-kernel@vger.kernel.org>
      CC: "David S. Miller" <davem@davemloft.net>
      CC: Meelis Roos <mroos@linux.ee>
      Tested-by: NMeelis Roos <mroos@linux.ee>
      8400dd02
    • N
      3c59x: Add dma error checking and recovery · 6f2b6a30
      Neil Horman 提交于
      Noted that 3c59x has no checks on transmit for failed DMA mappings, and no
      ability to unmap fragments when a single map fails in the middle of a transmit.
      This patch provides error checking to ensure that dma mappings work properly,
      and unrolls an skb mapping if a fragmented skb transmission has a mapping
      failure to prevent leaks.
      Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      CC: Linux Kernel list <linux-kernel@vger.kernel.org>
      CC: "David S. Miller" <davem@davemloft.net>
      CC: Meelis Roos <mroos@linux.ee>
      Tested-by: NMeelis Roos <mroos@linux.ee>
      6f2b6a30
  5. 17 9月, 2014 2 次提交
  6. 16 9月, 2014 1 次提交
  7. 14 9月, 2014 3 次提交
  8. 13 9月, 2014 3 次提交
  9. 11 9月, 2014 5 次提交
  10. 09 9月, 2014 5 次提交
    • F
      net: bcmgenet: check harder for out of memory conditions · b629be5c
      Florian Fainelli 提交于
      There is a potential case where we might be failing to refill a
      control block, leaving it with both a NULL skb pointer *and* a NULL
      dma_unmap_addr.
      
      The way we process incoming packets, by first calling
      dma_unmap_single(), and then only checking for a potential NULL skb can
      lead to situations where do pass a NULL dma_unmap_addr() to
      dma_unmap_single(), resulting in an oops.
      
      Fix this my moving the NULL skb check earlier, since no backing skb
      also means no corresponding DMA mapping for this packet.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b629be5c
    • F
      net: systemport: check harder for out of memory conditions · fe24ba08
      Florian Fainelli 提交于
      There is a potential case where we might be failing to refill a
      control block, leaving it with both a NULL skb pointer *and* a NULL
      dma_unmap_addr.
      
      The way we process incoming packets, by first calling
      dma_unmap_single(), and then only checking for a potential NULL skb can
      lead to situations where do pass a NULL dma_unmap_addr() to
      dma_unmap_single(), resulting in an oops.
      
      Fix this my moving the NULL skb check earlier, since no backing skb
      also means no corresponding DMA mapping for this packet.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fe24ba08
    • I
      net/mlx4_en: do not ignore autoneg in mlx4_en_set_pauseparam() · 278d436a
      Ivan Vecera 提交于
      The driver does not support pause autonegotiation so it should return
      -EINVAL when the function is called with non-zero autoneg.
      
      Cc: Amir Vadai <amirv@mellanox.com>
      Signed-off-by: NIvan Vecera <ivecera@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      278d436a
    • A
      drivers: net: ethernet: octeon_mgmt: fix a compiler warning · 208f7ca4
      Aaro Koskinen 提交于
      Fix the following compiler warning:
      
      drivers/net/ethernet/octeon/octeon_mgmt.c: In function 'octeon_mgmt_clean_tx_buffers':
      drivers/net/ethernet/octeon/octeon_mgmt.c:295:4: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
          u64 ns = cvmx_read_csr(CVMX_MIXX_TSTAMP(p->port));
          ^
      Signed-off-by: NAaro Koskinen <aaro.koskinen@nsn.com>
      Acked-by: NDavid Daney <david.daney@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      208f7ca4
    • D
      sunvnet - add missing rmb() for sunvnet driver · 78dcff7b
      David L Stevens 提交于
      The sunvnet driver does not have an rmb() in the ring consumer corresponding
      to the wmb() in the producer. According to Documentation/memory-barriers.txt:
      
      "When dealing with CPU-CPU interactions, certain types of memory barrier should
      always be paired.  A lack of appropriate pairing is almost certainly an error."
      
      In cases where an rmb() is not a no-op and a consumer is removing data from
      the ring while a producer is adding new entries, a load reorder would allow
      
      CPU1						CPU2
      ----						----
      						LOAD desc.size [e.g]
      STORE desc.size
      <wmb>
      set desc.hdr.state = VIO_DESC_READY
      						LOAD desc.hdr.state
      						[because VIO_DESC_READY, use
      						 old desc.size, already loaded
      						 out of order]
      
      [CPU2 has reordered apparently unrelated LOADs]
      
      To ensure other desc fields are not loaded before checking VIO_DESC_READY, we
      need an rmb() between the check and desc data accesses.
      
      I've also moved the viodbg() call to after the rmb() so that it, too, has
      current descriptor data even with reordering, which has the side effect that
      it won't print anything for descriptors that are not VIO_DESC_READY as before.
      That's a) probably a good thing, since the fields are not necessarily set and,
      b) better than adding another rmb() just for viodbg().
      
      This would not be possible if strict-ordering is enforced, but then the
      memory barriers should be no-ops in that case.
      Signed-off-by: NDavid L Stevens <david.stevens@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      78dcff7b
  11. 06 9月, 2014 6 次提交
    • L
      amd-xgbe: Enable interrupts for all management counters · a3ba7c98
      Lendacky, Thomas 提交于
      As the management counters reach a threshold they will generate an
      interrupt so the value can be saved and the counter reset. The
      current code does not enable this interrupt on all counters. This
      can result in inaccurate statistics.
      
      Update the code to enable all the counters to generate an interrupt
      when its threshold is exceeded.
      Signed-off-by: NTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a3ba7c98
    • L
      amd-xgbe: Treat certain counter registers as 64 bit · 60265108
      Lendacky, Thomas 提交于
      Even if the management counters are configured to be 32 bit register
      values, the [rt]xoctetcount_gb and [rt]xoctetcount_g counters are
      always 64 bit counter registers.  Since they are not being treated as
      64 bit values, these statistics are being reported incorrectly (ifconfig,
      ethtool, etc.).
      
      Update the routines used to read the registers to access the "hi"
      register (an offset of 4 from the "lo" register) to create a 64 bit
      value for these 64 bit counters.
      Signed-off-by: NTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      60265108
    • D
      greth: moved TX ring cleaning to NAPI rx poll func · e1743a16
      Daniel Hellstrom 提交于
      This patch does not affect the 10/100 GRETH MAC.
      
      Before all GBit GRETH TX descriptor ring cleaning was done in
      start_xmit(), when descriptor list became full it activated
      TX interrupt to start the NAPI rx poll function to do TX ring
      cleaning.
      
      With this patch the TX descriptor ring is always cleaned from
      the NAPI rx poll function, triggered via TX or RX interrupt.
      Otherwise we could end up in TX frames being sent but not
      reported to the stack being sent. On the 10/100 GRETH this
      is not an issue since the SKB is copied&aligned into private
      buffers so that the SKB can be freed directly on start_xmit()
      Signed-off-by: NDaniel Hellstrom <daniel@gaisler.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e1743a16
    • A
      cnic : Cleanup CONFIG_IPV6 & VLAN check · c99d667e
      Anish Bhatt 提交于
      The cnic module needs to ensure that if ipv6 support is compiled as a module,
      then the cnic module cannot be compiled as built-in as it depends on ipv6.
      Made this check cleaner via Kconfig
      
      Use simpler IS_ENABLED for CONFIG_VLAN_8021Q check
      Signed-off-by: NAnish Bhatt <anish@chelsio.com>
      Acked-by: NMichael Chan <mchan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c99d667e
    • Y
      bnx2x: Fix link problems for 1G SFP RJ45 module · 6e9e5644
      Yaniv Rosner 提交于
      When 1G SFP RJ45 module is detected, driver must reset the Tx laser
      in order to prevent link issues. As part of change, the link_attr_sync
      was relocated from vars to params.
      Signed-off-by: NYaniv Rosner <Yaniv.Rosner@qlogic.com>
      Signed-off-by: NYuval Mintz <Yuval.Mintz@qlogic.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6e9e5644
    • N
      3c59x: avoid panic in boomerang_start_xmit when finding page address: · 98ea232c
      Neil Horman 提交于
      This bug was reported on a very old kernel (RHEL6, 2.6.32-491.el6):
      
      BUG: unable to handle kernel paging request at 00800000
      IP: [<c04107b5>] nommu_map_page+0x15/0x110
      *pdpt = 000000003454f001 *pde = 000000003f03d067
      Oops: 0000 [#1] SMP
      last sysfs file: /sys/devices/system/cpu/online
      Modules linked in: nfsd lockd nfs_acl auth_rpcgss sunrpc exportfs p4_clockmod
      ipv6 ppdev parport_pc parport microcode iTCO_wdt iTCO_vendor_support 3c59x mii
      dcdbas serio_raw snd_intel8x0 snd_ac97_codec ac97_bus snd_seq snd_seq_device
      snd_pcm snd_timer snd soundcore snd_page_alloc i2c_i801 sg lpc_ich mfd_core ext4
      jbd2 mbcache sr_mod cdrom sd_mod crc_t10dif pata_acpi ata_generic ata_piix
      radeon ttm drm_kms_helper drm i2c_algo_bit i2c_core dm_mirror dm_region_hash
      dm_log dm_mod [last unloaded: mperf]
      
      Pid: 4219, comm: nfsd Not tainted 2.6.32-491.el6.i686 #1 Dell Computer
      Corporation OptiPlex GX240               /OptiPlex GX240
      EIP: 0060:[<c04107b5>] EFLAGS: 00010246 CPU: 0
      EIP is at nommu_map_page+0x15/0x110
      EAX: 00000000 EBX: c0a83480 ECX: 00000000 EDX: 00800000
      ESI: 00000000 EDI: f70e7860 EBP: e2d09b54 ESP: e2d09b24
       DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
      Process nfsd (pid: 4219, ti=e2d08000 task=e2ceaaa0 task.ti=e2d08000)
      Stack:
       00000056 00000000 0000000e c65efd38 00000020 00000296 00000206 00000206
      <0> c050c850 c0a83480 e2cef154 00000001 e2d09ba8 f8fcd585 00000510 00000001
      <0> 00000000 00000000 f5172200 f8fdac00 0039ef8c f5277020 f70e7860 00000510
      Call Trace:
       [<c050c850>] ? page_address+0xd0/0xe0
       [<f8fcd585>] ? boomerang_start_xmit+0x3b5/0x520 [3c59x]
       [<c07b2975>] ? dev_hard_start_xmit+0xe5/0x400
       [<f9182b00>] ? ip6_output_finish+0x0/0xf0 [ipv6]
       [<c07ca053>] ? sch_direct_xmit+0x113/0x180
       [<c07d5588>] ? nf_hook_slow+0x68/0x120
       [<c07b2ea5>] ? dev_queue_xmit+0x1b5/0x290
       [<f9182b6d>] ? ip6_output_finish+0x6d/0xf0 [ipv6]
       [<f9184cb8>] ? ip6_xmit+0x3e8/0x490 [ipv6]
       [<f91ab9f9>] ? inet6_csk_xmit+0x289/0x2f0 [ipv6]
       [<c07f6451>] ? tcp_transmit_skb+0x431/0x7f0
       [<c07a403f>] ? __alloc_skb+0x4f/0x140
       [<c07f85a2>] ? tcp_write_xmit+0x1c2/0xa50
       [<c07f90b1>] ? __tcp_push_pending_frames+0x31/0xe0
       [<c07ea47a>] ? tcp_sendpage+0x44a/0x4b0
       [<c07ea030>] ? tcp_sendpage+0x0/0x4b0
       [<c079be1e>] ? kernel_sendpage+0x4e/0x90
       [<f8457bb9>] ? svc_send_common+0xc9/0x120 [sunrpc]
       [<f8457c85>] ? svc_sendto+0x75/0x1f0 [sunrpc]
       [<c060d0d9>] ? _atomic_dec_and_lock+0x59/0x90
       [<f87d55d0>] ? nfs3svc_encode_readres+0x0/0xc0 [nfsd]
       [<f845876d>] ? svc_authorise+0x2d/0x40 [sunrpc]
       [<f87d4410>] ? nfs3svc_release_fhandle+0x0/0x10 [nfsd]
       [<f8455721>] ? svc_process_common+0xf1/0x5a0 [sunrpc]
       [<f8457e86>] ? svc_tcp_sendto+0x36/0xa0 [sunrpc]
       [<f8461778>] ? svc_send+0x98/0xd0 [sunrpc]
       [<f87c698c>] ? nfsd+0xac/0x140 [nfsd]
       [<c04470e0>] ? complete+0x40/0x60
       [<f87c68e0>] ? nfsd+0x0/0x140 [nfsd]
       [<c04802ac>] ? kthread+0x7c/0xa0
       [<c0480230>] ? kthread+0x0/0xa0
       [<c0409f9f>] ? kernel_thread_helper+0x7/0x10
      Code: 8d b6 00 00 00 00 eb f8 8d b4 26 00 00 00 00 8d bc 27 00 00 00 00 55 89 e5
      83 ec 30 89 75 f8 31 f6 89 7d fc 89 c7 89 c8 89 5d f4 <8b> 1a 8b 4d 08 c1 eb 19
      c1 e3 04 8b 9b c0 29 c7 c0 83 e3 fc 29
      
      But the problem seems to still exist upstream.  It seems on 32 bit kernels
      page_address() can reutrn a NULL value in some circumstances, and the
      pci_map_single api isn't prepared to handle that (on this system it results in a
      bogus pointer deference in nommu_map_page.
      
      The fix is pretty easy, if we convert the 3c59x driver to use the more
      convieient skb_frag_dma_map api we don't need to find the virtual address of the
      page at all, and page gets mapped to the hardware properly.  Verified to fix the
      problem as described by the reporter.
      
      Applies to the net tree
      
      Change Notes:
      
      v2) Converted PCI_DMA_TODEVICE to DMA_TO_DEVICE.  Thanks Dave!
      
      v3) Actually Run git commit after making changes to v2 :)
      Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      CC: klassert@mathematik.tu-chemnitz.de
      CC: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      98ea232c
  12. 03 9月, 2014 1 次提交