1. 06 Sep, 2014 11 commits
    • David S. Miller's avatar
      Merge branch 'amd-xgbe-net' · bc55dc63
      David S. Miller authored
      Tom Lendacky says:
      
      ====================
      amd-xgbe: AMD XGBE driver fixes 2014-09-05
      
      The following series of patches includes fixes to the driver.
      
      - Proper access to 64 bit management counter registers
      - Enable all management counter registers to generate an interrupt when
        the counter threshold is reached
      
      This patch series is based on net.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bc55dc63
    • Lendacky, Thomas's avatar
      amd-xgbe: Enable interrupts for all management counters · a3ba7c98
      Lendacky, Thomas authored
      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: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a3ba7c98
    • Lendacky, Thomas's avatar
      amd-xgbe: Treat certain counter registers as 64 bit · 60265108
      Lendacky, Thomas authored
      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: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      60265108
    • Daniel Hellstrom's avatar
      greth: moved TX ring cleaning to NAPI rx poll func · e1743a16
      Daniel Hellstrom authored
      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: default avatarDaniel Hellstrom <daniel@gaisler.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e1743a16
    • Anish Bhatt's avatar
      cnic : Cleanup CONFIG_IPV6 & VLAN check · c99d667e
      Anish Bhatt authored
      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: default avatarAnish Bhatt <anish@chelsio.com>
      Acked-by: default avatarMichael Chan <mchan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c99d667e
    • Masanari Iida's avatar
      net: treewide: Fix typo found in DocBook/networking.xml · e793c0f7
      Masanari Iida authored
      This patch fix spelling typo found in DocBook/networking.xml.
      It is because the neworking.xml is generated from comments
      in the source, I have to fix typo in comments within the source.
      Signed-off-by: default avatarMasanari Iida <standby24x7@gmail.com>
      Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e793c0f7
    • Yaniv Rosner's avatar
      bnx2x: Fix link problems for 1G SFP RJ45 module · 6e9e5644
      Yaniv Rosner authored
      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: default avatarYaniv Rosner <Yaniv.Rosner@qlogic.com>
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@qlogic.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6e9e5644
    • Neil Horman's avatar
      3c59x: avoid panic in boomerang_start_xmit when finding page address: · 98ea232c
      Neil Horman authored
      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: default avatarNeil Horman <nhorman@tuxdriver.com>
      CC: klassert@mathematik.tu-chemnitz.de
      CC: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      98ea232c
    • Pablo Neira Ayuso's avatar
      netfilter: add explicit Kconfig for NETFILTER_XT_NAT · 84a59ca5
      Pablo Neira Ayuso authored
      Paul Bolle reports that 'select NETFILTER_XT_NAT' from the IPV4 and IPV6
      NAT tables becomes noop since there is no Kconfig switch for it. Add the
      Kconfig switch to resolve this problem.
      
      Fixes: 8993cf8e netfilter: move NAT Kconfig switches out of the iptables scope
      Reported-by: default avatarPaul Bolle <pebolle@tiscali.nl>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      84a59ca5
    • Nicolas Dichtel's avatar
      ipv6: use addrconf_get_prefix_route() to remove peer addr · e7478dfc
      Nicolas Dichtel authored
      addrconf_get_prefix_route() ensures to get the right route in the right table.
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Acked-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e7478dfc
    • Nicolas Dichtel's avatar
      ipv6: fix a refcnt leak with peer addr · f24062b0
      Nicolas Dichtel authored
      There is no reason to take a refcnt before deleting the peer address route.
      It's done some lines below for the local prefix route because
      inet6_ifa_finish_destroy() will release it at the end.
      For the peer address route, we want to free it right now.
      
      This bug has been introduced by commit
      caeaba79 ("ipv6: add support of peer address").
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Acked-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f24062b0
  2. 05 Sep, 2014 5 commits
    • Willem de Bruijn's avatar
      net-timestamp: only report sw timestamp if reporting bit is set · c199105d
      Willem de Bruijn authored
      The timestamping API has separate bits for generating and reporting
      timestamps. A software timestamp should only be reported for a packet
      when the packet has the relevant generation flag (SKBTX_..) set
      and the socket has reporting bit SOF_TIMESTAMPING_SOFTWARE set.
      
      The second check was accidentally removed. Reinstitute the original
      behavior.
      
      Tested:
        Without this patch, Documentation/networking/txtimestamp reports
        timestamps regardless of whether SOF_TIMESTAMPING_SOFTWARE is set.
        After the patch, it only reports them when the flag is set.
      
      Fixes: f24b9be5 ("net-timestamp: extend SCM_TIMESTAMPING ancillary data struct")
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c199105d
    • Chen Gang's avatar
      drivers/net/fddi/skfp/h/skfbi.h: Remove useless PCI_BASE_2ND macros · 4357450a
      Chen Gang authored
      They are use less, and may generate compiling warnings, so remove them
      (microblaze, arc, arm64, and unicore32 have already defined PCI_IOBASE).
      
      The related warnings (with allmodconfig under microblaze):
      
        CC [M]  drivers/net/fddi/skfp/skfddi.o
        In file included from drivers/net/fddi/skfp/skfddi.c:95:0:
        drivers/net/fddi/skfp/h/skfbi.h:151:0: warning: "PCI_IOBASE" redefined
         #define PCI_IOBASE 0xffffff00L  /* Bit 31..8:  I/O Base address */
         ^
        In file included from include/linux/io.h:22:0,
                         from include/linux/pci.h:31,
                         from drivers/net/fddi/skfp/skfddi.c:82:
        ./arch/microblaze/include/asm/io.h:33:0: note: this is the location of the previous definition
         #define PCI_IOBASE ((void __iomem *)_IO_BASE)
         ^
      Signed-off-by: default avatarChen Gang <gang.chen.5i5j@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4357450a
    • Guillaume Nault's avatar
      l2tp: fix race while getting PMTU on PPP pseudo-wire · eed4d839
      Guillaume Nault authored
      Use dst_entry held by sk_dst_get() to retrieve tunnel's PMTU.
      
      The dst_mtu(__sk_dst_get(tunnel->sock)) call was racy. __sk_dst_get()
      could return NULL if tunnel->sock->sk_dst_cache was reset just before the
      call, thus making dst_mtu() dereference a NULL pointer:
      
      [ 1937.661598] BUG: unable to handle kernel NULL pointer dereference at 0000000000000020
      [ 1937.664005] IP: [<ffffffffa049db88>] pppol2tp_connect+0x33d/0x41e [l2tp_ppp]
      [ 1937.664005] PGD daf0c067 PUD d9f93067 PMD 0
      [ 1937.664005] Oops: 0000 [#1] SMP
      [ 1937.664005] Modules linked in: l2tp_ppp l2tp_netlink l2tp_core ip6table_filter ip6_tables iptable_filter ip_tables ebtable_nat ebtables x_tables udp_tunnel pppoe pppox ppp_generic slhc deflate ctr twofish_generic twofish_x86_64_3way xts lrw gf128mul glue_helper twofish_x86_64 twofish_common blowfish_generic blowfish_x86_64 blowfish_common des_generic cbc xcbc rmd160 sha512_generic hmac crypto_null af_key xfrm_algo 8021q garp bridge stp llc tun atmtcp clip atm ext3 mbcache jbd iTCO_wdt coretemp kvm_intel iTCO_vendor_support kvm pcspkr evdev ehci_pci lpc_ich mfd_core i5400_edac edac_core i5k_amb shpchp button processor thermal_sys xfs crc32c_generic libcrc32c dm_mod usbhid sg hid sr_mod sd_mod cdrom crc_t10dif crct10dif_common ata_generic ahci ata_piix tg3 libahci libata uhci_hcd ptp ehci_hcd pps_core usbcore scsi_mod libphy usb_common [last unloaded: l2tp_core]
      [ 1937.664005] CPU: 0 PID: 10022 Comm: l2tpstress Tainted: G           O   3.17.0-rc1 #1
      [ 1937.664005] Hardware name: HP ProLiant DL160 G5, BIOS O12 08/22/2008
      [ 1937.664005] task: ffff8800d8fda790 ti: ffff8800c43c4000 task.ti: ffff8800c43c4000
      [ 1937.664005] RIP: 0010:[<ffffffffa049db88>]  [<ffffffffa049db88>] pppol2tp_connect+0x33d/0x41e [l2tp_ppp]
      [ 1937.664005] RSP: 0018:ffff8800c43c7de8  EFLAGS: 00010282
      [ 1937.664005] RAX: ffff8800da8a7240 RBX: ffff8800d8c64600 RCX: 000001c325a137b5
      [ 1937.664005] RDX: 8c6318c6318c6320 RSI: 000000000000010c RDI: 0000000000000000
      [ 1937.664005] RBP: ffff8800c43c7ea8 R08: 0000000000000000 R09: 0000000000000000
      [ 1937.664005] R10: ffffffffa048e2c0 R11: ffff8800d8c64600 R12: ffff8800ca7a5000
      [ 1937.664005] R13: ffff8800c439bf40 R14: 000000000000000c R15: 0000000000000009
      [ 1937.664005] FS:  00007fd7f610f700(0000) GS:ffff88011a600000(0000) knlGS:0000000000000000
      [ 1937.664005] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      [ 1937.664005] CR2: 0000000000000020 CR3: 00000000d9d75000 CR4: 00000000000027e0
      [ 1937.664005] Stack:
      [ 1937.664005]  ffffffffa049da80 ffff8800d8fda790 000000000000005b ffff880000000009
      [ 1937.664005]  ffff8800daf3f200 0000000000000003 ffff8800c43c7e48 ffffffff81109b57
      [ 1937.664005]  ffffffff81109b0e ffffffff8114c566 0000000000000000 0000000000000000
      [ 1937.664005] Call Trace:
      [ 1937.664005]  [<ffffffffa049da80>] ? pppol2tp_connect+0x235/0x41e [l2tp_ppp]
      [ 1937.664005]  [<ffffffff81109b57>] ? might_fault+0x9e/0xa5
      [ 1937.664005]  [<ffffffff81109b0e>] ? might_fault+0x55/0xa5
      [ 1937.664005]  [<ffffffff8114c566>] ? rcu_read_unlock+0x1c/0x26
      [ 1937.664005]  [<ffffffff81309196>] SYSC_connect+0x87/0xb1
      [ 1937.664005]  [<ffffffff813e56f7>] ? sysret_check+0x1b/0x56
      [ 1937.664005]  [<ffffffff8107590d>] ? trace_hardirqs_on_caller+0x145/0x1a1
      [ 1937.664005]  [<ffffffff81213dee>] ? trace_hardirqs_on_thunk+0x3a/0x3f
      [ 1937.664005]  [<ffffffff8114c262>] ? spin_lock+0x9/0xb
      [ 1937.664005]  [<ffffffff813092b4>] SyS_connect+0x9/0xb
      [ 1937.664005]  [<ffffffff813e56d2>] system_call_fastpath+0x16/0x1b
      [ 1937.664005] Code: 10 2a 84 81 e8 65 76 bd e0 65 ff 0c 25 10 bb 00 00 4d 85 ed 74 37 48 8b 85 60 ff ff ff 48 8b 80 88 01 00 00 48 8b b8 10 02 00 00 <48> 8b 47 20 ff 50 20 85 c0 74 0f 83 e8 28 89 83 10 01 00 00 89
      [ 1937.664005] RIP  [<ffffffffa049db88>] pppol2tp_connect+0x33d/0x41e [l2tp_ppp]
      [ 1937.664005]  RSP <ffff8800c43c7de8>
      [ 1937.664005] CR2: 0000000000000020
      [ 1939.559375] ---[ end trace 82d44500f28f8708 ]---
      
      Fixes: f34c4a35 ("l2tp: take PMTU from tunnel UDP socket")
      Signed-off-by: default avatarGuillaume Nault <g.nault@alphalink.fr>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      eed4d839
    • Sabrina Dubroca's avatar
      ipv6: fix rtnl locking in setsockopt for anycast and multicast · a9ed4a29
      Sabrina Dubroca authored
      Calling setsockopt with IPV6_JOIN_ANYCAST or IPV6_LEAVE_ANYCAST
      triggers the assertion in addrconf_join_solict()/addrconf_leave_solict()
      
      ipv6_sock_ac_join(), ipv6_sock_ac_drop(), ipv6_sock_ac_close() need to
      take RTNL before calling ipv6_dev_ac_inc/dec. Same thing with
      ipv6_sock_mc_join(), ipv6_sock_mc_drop(), ipv6_sock_mc_close() before
      calling ipv6_dev_mc_inc/dec.
      
      This patch moves ASSERT_RTNL() up a level in the call stack.
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarSabrina Dubroca <sd@queasysnail.net>
      Reported-by: default avatarTommi Rantala <tt.rantala@gmail.com>
      Acked-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a9ed4a29
    • Andy King's avatar
      VMXNET3: Check for map error in vmxnet3_set_mc · 4ad9a64f
      Andy King authored
      We should check if the map of the table actually succeeds, and also free
      resources accordingly.
      
      Version bumped to 1.2.1.0
      Acked-by: default avatarShelley Gong <shelleygong@vmware.com>
      Acked-by: default avatarBhavesh Davda <bhavesh@vmware.com>
      Signed-off-by: default avatarAndy King <acking@vmware.com>
      Reported-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4ad9a64f
  3. 04 Sep, 2014 1 commit
  4. 02 Sep, 2014 23 commits