1. 17 7月, 2021 2 次提交
  2. 05 6月, 2021 1 次提交
  3. 27 5月, 2021 1 次提交
  4. 17 4月, 2021 1 次提交
  5. 12 3月, 2021 2 次提交
  6. 04 2月, 2021 4 次提交
  7. 02 2月, 2021 1 次提交
    • K
      igc: Report speed and duplex as unknown when device is runtime suspended · 2e99dedc
      Kai-Heng Feng 提交于
      Similar to commit 165ae7a8 ("igb: Report speed and duplex as unknown
      when device is runtime suspended"), if we try to read speed and duplex
      sysfs while the device is runtime suspended, igc will complain and
      stops working:
      
      [  123.449883] igc 0000:03:00.0 enp3s0: PCIe link lost, device now detached
      [  123.450052] BUG: kernel NULL pointer dereference, address: 0000000000000008
      [  123.450056] #PF: supervisor read access in kernel mode
      [  123.450058] #PF: error_code(0x0000) - not-present page
      [  123.450059] PGD 0 P4D 0
      [  123.450064] Oops: 0000 [#1] SMP NOPTI
      [  123.450068] CPU: 0 PID: 2525 Comm: udevadm Tainted: G     U  W  OE     5.10.0-1002-oem #2+rkl2-Ubuntu
      [  123.450078] RIP: 0010:igc_rd32+0x1c/0x90 [igc]
      [  123.450080] Code: c0 5d c3 b8 fd ff ff ff c3 0f 1f 44 00 00 0f 1f 44 00 00 55 89 f0 48 89 e5 41 56 41 55 41 54 49 89 c4 53 48 8b 57 08 48 01 d0 <44> 8b 28 41 83 fd ff 74 0c 5b 44 89 e8 41 5c 41 5d 4
      
      [  123.450083] RSP: 0018:ffffb0d100d6fcc0 EFLAGS: 00010202
      [  123.450085] RAX: 0000000000000008 RBX: ffffb0d100d6fd30 RCX: 0000000000000000
      [  123.450087] RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff945a12716c10
      [  123.450089] RBP: ffffb0d100d6fce0 R08: ffff945a12716550 R09: ffff945a09874000
      [  123.450090] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000008
      [  123.450092] R13: ffff945a12716000 R14: ffff945a037da280 R15: ffff945a037da290
      [  123.450094] FS:  00007f3b34c868c0(0000) GS:ffff945b89200000(0000) knlGS:0000000000000000
      [  123.450096] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  123.450098] CR2: 0000000000000008 CR3: 00000001144de006 CR4: 0000000000770ef0
      [  123.450100] PKRU: 55555554
      [  123.450101] Call Trace:
      [  123.450111]  igc_ethtool_get_link_ksettings+0xd6/0x1b0 [igc]
      [  123.450118]  __ethtool_get_link_ksettings+0x71/0xb0
      [  123.450123]  duplex_show+0x74/0xc0
      [  123.450129]  dev_attr_show+0x1d/0x40
      [  123.450134]  sysfs_kf_seq_show+0xa1/0x100
      [  123.450137]  kernfs_seq_show+0x27/0x30
      [  123.450142]  seq_read+0xb7/0x400
      [  123.450148]  ? common_file_perm+0x72/0x170
      [  123.450151]  kernfs_fop_read+0x35/0x1b0
      [  123.450155]  vfs_read+0xb5/0x1b0
      [  123.450157]  ksys_read+0x67/0xe0
      [  123.450160]  __x64_sys_read+0x1a/0x20
      [  123.450164]  do_syscall_64+0x38/0x90
      [  123.450168]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      [  123.450170] RIP: 0033:0x7f3b351fe142
      [  123.450173] Code: c0 e9 c2 fe ff ff 50 48 8d 3d 3a ca 0a 00 e8 f5 19 02 00 0f 1f 44 00 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 0f 05 <48> 3d 00 f0 ff ff 77 56 c3 0f 1f 44 00 00 48 83 ec 28 48 89 54 24
      [  123.450174] RSP: 002b:00007fffef2ec138 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
      [  123.450177] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f3b351fe142
      [  123.450179] RDX: 0000000000001001 RSI: 00005644c047f070 RDI: 0000000000000003
      [  123.450180] RBP: 00007fffef2ec340 R08: 00005644c047f070 R09: 00007f3b352d9320
      [  123.450182] R10: 00005644c047c010 R11: 0000000000000246 R12: 00005644c047cbf0
      [  123.450184] R13: 00005644c047e6d0 R14: 0000000000000003 R15: 00007fffef2ec140
      [  123.450189] Modules linked in: rfcomm ccm cmac algif_hash algif_skcipher af_alg bnep toshiba_acpi industrialio toshiba_haps hp_accel lis3lv02d btusb btrtl btbcm btintel bluetooth ecdh_generic ecc joydev input_leds nls_iso8859_1 snd_sof_pci snd_sof_intel_byt snd_sof_intel_ipc snd_sof_intel_hda_common snd_soc_hdac_hda snd_hda_codec_hdmi snd_sof_xtensa_dsp snd_sof_intel_hda snd_sof snd_hda_ext_core snd_soc_acpi_intel_match snd_soc_acpi snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio snd_hda_intel snd_intel_dspcfg soundwire_intel soundwire_generic_allocation soundwire_cadence snd_hda_codec snd_hda_core ath10k_pci snd_hwdep intel_rapl_msr intel_rapl_common ath10k_core soundwire_bus snd_soc_core x86_pkg_temp_thermal ath intel_powerclamp snd_compress ac97_bus snd_pcm_dmaengine mac80211 snd_pcm coretemp snd_seq_midi snd_seq_midi_event snd_rawmidi kvm_intel cfg80211 snd_seq snd_seq_device snd_timer mei_hdcp kvm libarc4 snd crct10dif_pclmul ghash_clmulni_intel aesni_intel
       mei_me dell_wmi
      [  123.450266]  dell_smbios soundcore sparse_keymap dcdbas crypto_simd cryptd mei dell_uart_backlight glue_helper ee1004 wmi_bmof intel_wmi_thunderbolt dell_wmi_descriptor mac_hid efi_pstore acpi_pad acpi_tad intel_cstate sch_fq_codel parport_pc ppdev lp parport ip_tables x_tables autofs4 btrfs blake2b_generic raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multipath linear dm_mirror dm_region_hash dm_log hid_generic usbhid hid i915 i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops cec crc32_pclmul rc_core drm intel_lpss_pci i2c_i801 ahci igc intel_lpss i2c_smbus idma64 xhci_pci libahci virt_dma xhci_pci_renesas wmi video pinctrl_tigerlake
      [  123.450335] CR2: 0000000000000008
      [  123.450338] ---[ end trace 9f731e38b53c35cc ]---
      
      The more generic approach will be wrap get_link_ksettings() with begin()
      and complete() callbacks, and calls runtime resume and runtime suspend
      routine respectively. However, igc is like igb, runtime resume routine
      uses rtnl_lock() which upper ethtool layer also uses.
      
      So to prevent a deadlock on rtnl, take a different approach, use
      pm_runtime_suspended() to avoid reading register while device is runtime
      suspended.
      
      Fixes: 8c5ad0da ("igc: Add ethtool support")
      Signed-off-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      Acked-by: NSasha Neftin <sasha.neftin@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      2e99dedc
  8. 27 1月, 2021 1 次提交
    • C
      igc: fix link speed advertising · 329a3678
      Corinna Vinschen 提交于
      Link speed advertising in igc has two problems:
      
      - When setting the advertisement via ethtool, the link speed is converted
        to the legacy 32 bit representation for the intel PHY code.
        This inadvertently drops ETHTOOL_LINK_MODE_2500baseT_Full_BIT (being
        beyond bit 31).  As a result, any call to `ethtool -s ...' drops the
        2500Mbit/s link speed from the PHY settings.  Only reloading the driver
        alleviates that problem.
      
        Fix this by converting the ETHTOOL_LINK_MODE_2500baseT_Full_BIT to the
        Intel PHY ADVERTISE_2500_FULL bit explicitly.
      
      - Rather than checking the actual PHY setting, the .get_link_ksettings
        function always fills link_modes.advertising with all link speeds
        the device is capable of.
      
        Fix this by checking the PHY autoneg_advertised settings and report
        only the actually advertised speeds up to ethtool.
      
      Fixes: 8c5ad0da ("igc: Add ethtool support")
      Signed-off-by: NCorinna Vinschen <vinschen@redhat.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      329a3678
  9. 29 9月, 2020 1 次提交
  10. 02 7月, 2020 1 次提交
  11. 30 6月, 2020 1 次提交
  12. 26 6月, 2020 1 次提交
    • J
      net/intel: remove driver versions from Intel drivers · 34a2a3b8
      Jeff Kirsher 提交于
      As with other networking drivers, remove the unnecessary driver version
      from the Intel drivers. The ethtool driver information and module version
      will then report the kernel version instead.
      
      For ixgbe, i40e and ice drivers, the driver passes the driver version to
      the firmware to confirm that we are up and running.  So we now pass the
      value of UTS_RELEASE to the firmware.  This adminq call is required per
      the HAS document.  The Device then sends an indication to the BMC that the
      PF driver is present. This is done using Host NC Driver Status Indication
      in NC-SI Get Link command or via the Host Network Controller Driver Status
      Change AEN.
      
      What the BMC may do with this information is implementation-dependent, but
      this is a standard NC-SI 1.1 command we honor per the HAS.
      
      CC: Bruce Allan <bruce.w.allan@intel.com>
      CC: Jesse Brandeburg <jesse.brandeburg@intel.com>
      CC: Alek Loktionov <aleksandr.loktionov@intel.com>
      CC: Kevin Liedtke <kevin.d.liedtke@intel.com>
      CC: Aaron Rowden <aaron.f.rowden@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Co-developed-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      34a2a3b8
  13. 29 5月, 2020 1 次提交
    • A
      igc: Reject NFC rules with multiple matches · 3d3e9b6b
      Andre Guedes 提交于
      The way Rx queue assignment based on mac address, Ethertype and VLAN
      priority filtering operates in I225 doesn't allow us to properly support
      NFC rules with multiple matches.
      
      Consider the following example which assigns to queue 2 frames matching
      the address MACADDR *and* Ethertype ETYPE.
      
      $ ethtool -N eth0 flow-type ether dst <MACADDR> proto <ETYPE> queue 2
      
      When such rule is applied, we have 2 unwanted behaviors:
      
          1) Any frame matching MACADDR will be assigned to queue 2. It
             doesn't matter the ETYPE value.
      
          2) Any accepted frame that has Ethertype equals to ETYPE, no matter
             the mac address, will be assigned to queue 2 as well.
      
      In current code, multiple-match filters are accepted by the driver, even
      though it doesn't support them properly. This patch adds a check for
      multiple-match rules in igc_ethtool_is_nfc_rule_valid() so they are
      rejected.
      Signed-off-by: NAndre Guedes <andre.guedes@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      3d3e9b6b
  14. 23 5月, 2020 8 次提交
    • A
      igc: Change adapter->nfc_rule_lock to mutex · 42fc5dc0
      Andre Guedes 提交于
      This patch changes adapter->nfc_rule_lock type from spin_lock to mutex
      so we avoid unnecessary busy waiting on lock contention.
      
      A closer look at the execution context of NFC rule API users shows that
      all of them run in process context. The API users are: ethtool ops,
      igc_configure(), called when interface is brought up by user or reset
      workequeue thread, igc_down(), called when interface is brought down,
      and igc_remove(), called when driver is unloaded.
      Signed-off-by: NAndre Guedes <andre.guedes@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      42fc5dc0
    • A
      igc: Fix NFC rule validation · 1894df0c
      Andre Guedes 提交于
      If we try to overwrite an existing rule with the same filter but
      different action, we get EEXIST error as shown below.
      
      $ ethtool -N eth0 flow-type ether dst <MACADDR> action 1 loc 10
      $ ethtool -N eth0 flow-type ether dst <MACADDR> action 2 loc 10
      rmgr: Cannot insert RX class rule: File exists
      
      The second command is expected to overwrite the previous rule in location
      10 and succeed.
      
      This patch fixes igc_ethtool_check_nfc_rule() so it also checks the
      rules location. In case they match, the rule under evaluation should not
      be considered invalid.
      Signed-off-by: NAndre Guedes <andre.guedes@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      1894df0c
    • A
      igc: Refactor igc_ethtool_update_nfc_rule() · 36fa2152
      Andre Guedes 提交于
      Current implementation of igc_ethtool_update_nfc_rule() is a bit
      convoluted since it handles too many things: rule lookup, deletion
      and addition. This patch breaks it into three functions so we simplify
      the code and improve code reuse.
      
      Code related to rule lookup is refactored out to a new function called
      igc_get_nfc_rule().
      
      Code related to rule addition is refactored out to a new function called
      igc_add_nfc_rule(). This function enables the rule in hardware and adds
      it to the adapter's list.
      
      Code related to rule deletion is refactored out to a new function called
      igc_del_nfc_rule(). This function disables the rule in hardware, removes
      it from adapter's list, and deletes it.
      
      As a byproduct of this refactoring, igc_enable_nfc_rule() and
      igc_disable_nfc_rule() are moved to igc_main.c since they are not used
      in igc_ethtool.c anymore, and igc_restore_nfc_rules() and igc_nfc_rule_
      exit() are moved around to avoid forward declaration.
      
      Also, since this patch already touches igc_ethtool_get_nfc_rule(), it
      takes the opportunity to remove the 'match_flags' check. Empty flags
      are not allowed to be added so no need to check that.
      Signed-off-by: NAndre Guedes <andre.guedes@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      36fa2152
    • A
      igc: Fix NFC rules restoration · d957c601
      Andre Guedes 提交于
      When network interface is brought up, the driver re-enables the NFC
      rules previously configured. However, this is done in reverse order
      the rules were added and hardware filters are configured differently.
      
      For example, consider the following rules:
      
      $ ethtool -N eth0 flow-type ether dst 00:00:00:00:00:AA queue 0
      $ ethtool -N eth0 flow-type ether dst 00:00:00:00:00:BB queue 1
      $ ethtool -N eth0 flow-type ether dst 00:00:00:00:00:CC queue 2
      $ ethtool -N eth0 flow-type ether dst 00:00:00:00:00:DD queue 3
      
      RAL/RAH registers are configure so filter index 1 has address ending
      with AA, filter index 2 has address ending in BB, and so on.
      
      If we bring the interface down and up again, RAL/RAH registers are
      configured so filter index 1 has address ending in DD, filter index 2
      has CC, and so on. IOW, in reverse order we had before bringing the
      interface down.
      
      This issue can be fixed by traversing adapter->nfc_rule_list in
      backwards when restoring the rules. Since hlist doesn't support
      backwards traversal, this patch replaces it by list_head and fixes
      igc_restore_nfc_rules() accordingly.
      Signed-off-by: NAndre Guedes <andre.guedes@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      d957c601
    • A
      igc: Fix NFC rule overwrite cases · 4bdf89e8
      Andre Guedes 提交于
      When the 'loc' argument is passed in ethtool, the input rule overwrites
      any rule present in that location. In this situation we must disable the
      old rule otherwise it is left enabled in hardware. This patch fixes
      the issue by always calling igc_disable_nfc_rule() when deleting the
      old rule, no matter the value of 'input' argument.
      Signed-off-by: NAndre Guedes <andre.guedes@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      4bdf89e8
    • A
      igc: Fix locking issue when retrieving NFC rules · b500350a
      Andre Guedes 提交于
      Access to NFC rules stored in adapter->nfc_rule_list is protect by
      adapter->nfc_rule_lock. The functions igc_ethtool_get_nfc_rule()
      and igc_ethtool_get_nfc_rules() are missing to hold the lock while
      accessing rule objects.
      Signed-off-by: NAndre Guedes <andre.guedes@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      b500350a
    • A
      igc: Fix 'sw_idx' type in struct igc_nfc_rule · d3ba9e6f
      Andre Guedes 提交于
      The 'sw_idx' field from 'struct igc_nfc_rule' is u16 type but it is
      assigned an u32 value in igc_ethtool_init_nfc_rule(). This patch changes
      'sw_idx' type to u32 so they match. Also, it makes more sense to call
      this field 'location' since it holds the NFC rule location.
      Signed-off-by: NAndre Guedes <andre.guedes@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      d3ba9e6f
    • A
      igc: Refactor igc_ethtool_add_nfc_rule() · 16fdc16c
      Andre Guedes 提交于
      Current implementation of igc_ethtool_add_nfc_rule() is quite long and a
      bit convoluted so this patch does a code refactoring to improve the
      code.
      
      Code related to NFC rule object initialization is refactored out to the
      local helper function igc_ethtool_init_nfc_rule(). Likewise, code
      related to NFC rule validation is refactored out to another local
      helper, igc_ethtool_is_nfc_rule_valid().
      
      RX_CLS_FLOW_DISC check is removed since it is redundant. The macro is
      defined as the max value fsp->ring_cookie can have, so checking if
      fsp->ring_cookie >= adapter->num_rx_queues is already sufficient.
      
      Finally, some log messages are improved or added, and obvious comments
      are removed.
      Signed-off-by: NAndre Guedes <andre.guedes@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      16fdc16c
  15. 22 5月, 2020 8 次提交
  16. 21 5月, 2020 1 次提交
  17. 20 5月, 2020 5 次提交