1. 15 Sep, 2016 11 commits
    • Jarod Wilson's avatar
      igb: don't unmap NULL hw_addr · d5463792
      Jarod Wilson authored
      [ Upstream commit 73bf8048 ]
      
      I've got a startech thunderbolt dock someone loaned me, which among other
      things, has the following device in it:
      
      08:00.0 Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev 03)
      
      This hotplugs just fine (kernel 4.2.0 plus a patch or two here):
      
      [  863.020315] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.2.18-k
      [  863.020316] igb: Copyright (c) 2007-2014 Intel Corporation.
      [  863.028657] igb 0000:08:00.0: enabling device (0000 -> 0002)
      [  863.062089] igb 0000:08:00.0: added PHC on eth0
      [  863.062090] igb 0000:08:00.0: Intel(R) Gigabit Ethernet Network Connection
      [  863.062091] igb 0000:08:00.0: eth0: (PCIe:2.5Gb/s:Width x1) e8:ea:6a:00:1b:2a
      [  863.062194] igb 0000:08:00.0: eth0: PBA No: 000200-000
      [  863.062196] igb 0000:08:00.0: Using MSI-X interrupts. 4 rx queue(s), 4 tx queue(s)
      [  863.064889] igb 0000:08:00.0 enp8s0: renamed from eth0
      
      But disconnecting it is another story:
      
      [ 1002.807932] igb 0000:08:00.0: removed PHC on enp8s0
      [ 1002.807944] igb 0000:08:00.0 enp8s0: PCIe link lost, device now detached
      [ 1003.341141] ------------[ cut here ]------------
      [ 1003.341148] WARNING: CPU: 0 PID: 199 at lib/iomap.c:43 bad_io_access+0x38/0x40()
      [ 1003.341149] Bad IO access at port 0x0 ()
      [ 1003.342767] Modules linked in: snd_usb_audio snd_usbmidi_lib snd_rawmidi igb dca firewire_ohci firewire_core crc_itu_t rfcomm ctr ccm arc4 iwlmvm mac80211 fuse xt_CHECKSUM ipt_MASQUERADE
      nf_nat_masquerade_ipv4 tun ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 ipt_REJECT nf_reject_ipv4 xt_conntrack ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat
      nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw ip6table_filter ip6_tables iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat
      nf_conntrack iptable_mangle iptable_security iptable_raw iptable_filter bnep dm_mirror dm_region_hash dm_log dm_mod coretemp x86_pkg_temp_thermal intel_powerclamp kvm_intel snd_hda_codec_hdmi kvm
      crct10dif_pclmul crc32_pclmul ghash_clmulni_intel drbg
      [ 1003.342793]  ansi_cprng aesni_intel hp_wmi aes_x86_64 iTCO_wdt lrw iTCO_vendor_support ppdev gf128mul sparse_keymap glue_helper ablk_helper cryptd snd_hda_codec_realtek snd_hda_codec_generic
      microcode snd_hda_intel uvcvideo iwlwifi snd_hda_codec videobuf2_vmalloc videobuf2_memops snd_hda_core videobuf2_core snd_hwdep btusb v4l2_common btrtl snd_seq btbcm btintel videodev cfg80211
      snd_seq_device rtsx_pci_ms bluetooth pcspkr input_leds i2c_i801 media parport_pc memstick rfkill sg lpc_ich snd_pcm 8250_fintek parport joydev snd_timer snd soundcore hp_accel ie31200_edac
      mei_me lis3lv02d edac_core input_polldev mei hp_wireless shpchp tpm_infineon sch_fq_codel nfsd auth_rpcgss nfs_acl lockd grace sunrpc ip_tables autofs4 xfs libcrc32c sd_mod sr_mod cdrom
      rtsx_pci_sdmmc mmc_core crc32c_intel serio_raw rtsx_pci
      [ 1003.342822]  nouveau ahci libahci mxm_wmi e1000e xhci_pci hwmon ptp drm_kms_helper pps_core xhci_hcd ttm wmi video ipv6
      [ 1003.342839] CPU: 0 PID: 199 Comm: kworker/0:2 Not tainted 4.2.0-2.el7_UNSUPPORTED.x86_64 #1
      [ 1003.342840] Hardware name: Hewlett-Packard HP ZBook 15 G2/2253, BIOS M70 Ver. 01.07 02/26/2015
      [ 1003.342843] Workqueue: pciehp-3 pciehp_power_thread
      [ 1003.342844]  ffffffff81a90655 ffff8804866d3b48 ffffffff8164763a 0000000000000000
      [ 1003.342846]  ffff8804866d3b98 ffff8804866d3b88 ffffffff8107134a ffff8804866d3b88
      [ 1003.342847]  ffff880486f46000 ffff88046c8a8000 ffff880486f46840 ffff88046c8a8098
      [ 1003.342848] Call Trace:
      [ 1003.342852]  [<ffffffff8164763a>] dump_stack+0x45/0x57
      [ 1003.342855]  [<ffffffff8107134a>] warn_slowpath_common+0x8a/0xc0
      [ 1003.342857]  [<ffffffff810713c6>] warn_slowpath_fmt+0x46/0x50
      [ 1003.342859]  [<ffffffff8133719e>] ? pci_disable_msix+0x3e/0x50
      [ 1003.342860]  [<ffffffff812f6328>] bad_io_access+0x38/0x40
      [ 1003.342861]  [<ffffffff812f6567>] pci_iounmap+0x27/0x40
      [ 1003.342865]  [<ffffffffa0b728d7>] igb_remove+0xc7/0x160 [igb]
      [ 1003.342867]  [<ffffffff8132189f>] pci_device_remove+0x3f/0xc0
      [ 1003.342869]  [<ffffffff81433426>] __device_release_driver+0x96/0x130
      [ 1003.342870]  [<ffffffff814334e3>] device_release_driver+0x23/0x30
      [ 1003.342871]  [<ffffffff8131b404>] pci_stop_bus_device+0x94/0xa0
      [ 1003.342872]  [<ffffffff8131b3ad>] pci_stop_bus_device+0x3d/0xa0
      [ 1003.342873]  [<ffffffff8131b3ad>] pci_stop_bus_device+0x3d/0xa0
      [ 1003.342874]  [<ffffffff8131b516>] pci_stop_and_remove_bus_device+0x16/0x30
      [ 1003.342876]  [<ffffffff81333f5b>] pciehp_unconfigure_device+0x9b/0x180
      [ 1003.342877]  [<ffffffff81333a73>] pciehp_disable_slot+0x43/0xb0
      [ 1003.342878]  [<ffffffff81333b6d>] pciehp_power_thread+0x8d/0xb0
      [ 1003.342885]  [<ffffffff810881b2>] process_one_work+0x152/0x3d0
      [ 1003.342886]  [<ffffffff8108854a>] worker_thread+0x11a/0x460
      [ 1003.342887]  [<ffffffff81088430>] ? process_one_work+0x3d0/0x3d0
      [ 1003.342890]  [<ffffffff8108ddd9>] kthread+0xc9/0xe0
      [ 1003.342891]  [<ffffffff8108dd10>] ? kthread_create_on_node+0x180/0x180
      [ 1003.342893]  [<ffffffff8164e29f>] ret_from_fork+0x3f/0x70
      [ 1003.342894]  [<ffffffff8108dd10>] ? kthread_create_on_node+0x180/0x180
      [ 1003.342895] ---[ end trace 65a77e06d5aa9358 ]---
      
      Upon looking at the igb driver, I see that igb_rd32() attempted to read from
      hw_addr and failed, so it set hw->hw_addr to NULL and spit out the message
      in the log output above, "PCIe link lost, device now detached".
      
      Well, now that hw_addr is NULL, the attempt to call pci_iounmap is obviously
      not going to go well. As suggested by Mark Rustad, do something similar to
      what ixgbe does, and save a copy of hw_addr as adapter->io_addr, so we can
      still call pci_iounmap on it on teardown. Additionally, for consistency,
      make the pci_iomap call assignment directly to io_addr, so map and unmap
      match.
      Signed-off-by: default avatarJarod Wilson <jarod@redhat.com>
      Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d5463792
    • Anjali Singhai Jain's avatar
      i40e: Fix Rx hash reported to the stack by our driver · b909cfc8
      Anjali Singhai Jain authored
      [ Upstream commit 857942fd ]
      
      If the driver calls skb_set_hash even with a zero hash, that
      indicates to the stack that the hash calculation is offloaded
      in hardware. So the Stack doesn't do a SW hash which is required
      for load balancing if the user decides to turn of rx-hashing
      on our device.
      
      This patch fixes the path so that we do not call skb_set_hash
      if the feature is disabled.
      
      Change-ID: Ic4debfa4ff91b5a72e447348a75768ed7a2d3e1b
      Signed-off-by: default avatarAnjali Singhai Jain <anjali.singhai@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b909cfc8
    • Shannon Nelson's avatar
      i40e: clean whole mac filter list · 42622b1b
      Shannon Nelson authored
      [ Upstream commit f1199998 ]
      
      Clean the whole mac filter list when resetting after an intermediate
      add or delete push to the firmware.  The code had evolved from using
      a list from the stack to a heap allocation, but the memset() didn't
      follow the change correctly.  This now cleans the whole list rather
      that just part of the first element.
      
      Change-ID: I4cd03d5a103b7407dd8556a3a231e800f2d6f2d5
      Reported-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
      Signed-off-by: default avatarShannon Nelson <shannon.nelson@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      42622b1b
    • Mitch Williams's avatar
      i40evf: check rings before freeing resources · 0af31973
      Mitch Williams authored
      [ Upstream commit fdb47ae8 ]
      
      If the driver gets unloaded during reset recovery, it's possible
      that it will attempt to free resources when they're already free.
      
      Add a check to make sure that the Tx and Rx rings actually exist
      before dereferencing them to free resources.
      
      Change-ID: I4d2b7e9ede49f634d421a4c5deaa5446bc755eee
      Signed-off-by: default avatarMitch Williams <mitch.a.williams@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0af31973
    • Mitch Williams's avatar
      i40e: don't add zero MAC filter · 796adc85
      Mitch Williams authored
      [ Upstream commit b7b713a8 ]
      
      When VFs are created, the MAC address defaults to all zeros, indicating
      to the VF driver that it should use a random MAC address. However, the
      PF driver was incorrectly adding this zero MAC to the filter table,
      along with the VF's randomly generated MAC address.
      
      Check for a good address before adding the default filter. While we're
      at it, make the error message a bit more useful.
      
      Change-ID: Ia100947d68140e0f73a19ba755cbffc3e79a8fcf
      Signed-off-by: default avatarMitch Williams <mitch.a.williams@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      796adc85
    • Mitch Williams's avatar
      i40e: properly delete VF MAC filters · b085e4dd
      Mitch Williams authored
      [ Upstream commit b36e9ab5 ]
      
      The virtual channel interface was using incorrect semantics to remove
      MAC addresses, which would leave incorrect filters active when using
      VLANs. To correct this, add a new function that unconditionally removes
      MAC addresses from all VLANs, and call this function when the VF
      requests a MAC filter removal.
      
      Change-ID: I69826908ae4f6c847f5bf9b32f11faa760189c74
      Signed-off-by: default avatarMitch Williams <mitch.a.williams@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b085e4dd
    • Kiran Patil's avatar
      i40e: Fix memory leaks, sideband filter programming · 3a87d06f
      Kiran Patil authored
      [ Upstream commit a42e7a36 ]
      
      This patch fixes the memory leak which would be seen otherwise when user
      programs flow-director filter using ethtool (sideband filter programming).
      
      When ethtool is used to program flow directory filter, 'raw_buf' gets
      allocated and it is supposed to be freed as part of queue cleanup. But
      check of 'tx_buffer->skb' was preventing it from being freed.
      
      Change-ID: Ief4f0a1a32a653180498bf6e987c1b4342ab8923
      Signed-off-by: default avatarKiran Patil <kiran.patil@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3a87d06f
    • Jesse Brandeburg's avatar
      i40e: fix: do not sleep in netdev_ops · be98bdf8
      Jesse Brandeburg authored
      [ Upstream commit 0e4425ed ]
      
      The driver was being called by VLAN, bonding, teaming operations
      that expected to be able to hold locks like rcu_read_lock().
      
      This causes the driver to be held to the requirement to not sleep,
      and was found by the kernel debug options for checking sleep
      inside critical section, and the locking validator.
      
      Change-ID: Ibc68c835f5ffa8ffe0638ffe910a66fc5649a7f7
      Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      be98bdf8
    • Anjali Singhai Jain's avatar
      i40e/i40evf: Fix RS bit update in Tx path and disable force WB workaround · f36bb42d
      Anjali Singhai Jain authored
      [ Upstream commit 6a7fded7 ]
      
      This patch fixes the issue of forcing WB too often causing us to not
      benefit from NAPI.
      
      Without this patch we were forcing WB/arming interrupt too often taking
      away the benefits of NAPI and causing a performance impact.
      
      With this patch we disable force WB in the clean routine for X710
      and XL710 adapters. X722 adapters do not enable interrupt to force
      a WB and benefit from WB_ON_ITR and hence force WB is left enabled
      for those adapters.
      For XL710 and X710 adapters if we have less than 4 packets pending
      a software Interrupt triggered from service task will force a WB.
      
      This patch also changes the conditions for setting RS bit as described
      in code comments. This optimizes when the HW does a tail bump amd when
      it does a WB. It also optimizes when we do a wmb.
      
      Change-ID: Id831e1ae7d3e2ec3f52cd0917b41ce1d22d75d9d
      Signed-off-by: default avatarAnjali Singhai Jain <anjali.singhai@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f36bb42d
    • Mitch Williams's avatar
      i40evf: handle many MAC filters correctly · 355528ec
      Mitch Williams authored
      [ Upstream commit 1418c345 ]
      
      When a lot (many hundreds) of MAC or VLAN filters are added at one time,
      we can overflow the Admin Queue buffer size with all the requests.
      Unfortunately, the driver would then calculate the message size
      incorrectly, causing it to be rejected by the PF. Furthermore, there was
      no mechanism to trigger another request to allow for configuring the
      rest of the filters that didn't fit into the first request.
      
      To fix this, recalculate the correct buffer size when we detect the
      overflow condition instead of just assuming the max buffer size. Also,
      don't clear the request bit in adapter->aq_required when we have an
      overflow, so that the rest of the filters can be processed later.
      
      Change-ID: Idd7cbbc5af31315e0dcb1b10e6a02ad9817ce65c
      Signed-off-by: default avatarMitch Williams <mitch.a.williams@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      355528ec
    • Anjali Singhai Jain's avatar
      i40e: Workaround fix for mss < 256 issue · 410d31b9
      Anjali Singhai Jain authored
      [ Upstream commit 4f2f017c ]
      
      HW/NVM sets a limit of no less than 256 bytes for MSS. Stack can send as
      low as 76 bytes MSS. This patch lowers the HW limit to 64 bytes to avoid
      MDDs from firing and causing a reset when the MSS is lower than 256.
      
      Change-ID: I36b500a6bb227d283c3e321a7718e0672b11fab0
      Signed-off-by: default avatarAnjali Singhai Jain <anjali.singhai@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      410d31b9
  2. 07 Sep, 2016 29 commits