Skip to content
  1. Oct 30, 2021
    • Przemyslaw Patynowski's avatar
      iavf: Fix kernel BUG in free_msi_irqs · 605ca7c5
      Przemyslaw Patynowski authored
      
      
      Fix driver not freeing VF's traffic irqs, prior to calling
      pci_disable_msix in iavf_remove.
      There were possible 2 erroneous states in which, iavf_close would
      not be called.
      One erroneous state is fixed by allowing netdev to register, when state
      is already running. It was possible for VF adapter to enter state loop
      from running to resetting, where iavf_open would subsequently fail.
      If user would then unload driver/remove VF pci, iavf_close would not be
      called, as the netdev was not registered, leaving traffic pcis still
      allocated.
      Fixed this by breaking loop, allowing netdev to open device when adapter
      state is __IAVF_RUNNING and it is not explicitily downed.
      Other possiblity is entering to iavf_remove from __IAVF_RESETTING state,
      where iavf_close would not free irqs, but just return 0.
      Fixed this by checking for last adapter state and then removing irqs.
      
      Kernel panic:
      [ 2773.628585] kernel BUG at drivers/pci/msi.c:375!
      ...
      [ 2773.631567] RIP: 0010:free_msi_irqs+0x180/0x1b0
      ...
      [ 2773.640939] Call Trace:
      [ 2773.641572]  pci_disable_msix+0xf7/0x120
      [ 2773.642224]  iavf_reset_interrupt_capability.part.41+0x15/0x30 [iavf]
      [ 2773.642897]  iavf_remove+0x12e/0x500 [iavf]
      [ 2773.643578]  pci_device_remove+0x3b/0xc0
      [ 2773.644266]  device_release_driver_internal+0x103/0x1f0
      [ 2773.644948]  pci_stop_bus_device+0x69/0x90
      [ 2773.645576]  pci_stop_and_remove_bus_device+0xe/0x20
      [ 2773.646215]  pci_iov_remove_virtfn+0xba/0x120
      [ 2773.646862]  sriov_disable+0x2f/0xe0
      [ 2773.647531]  ice_free_vfs+0x2f8/0x350 [ice]
      [ 2773.648207]  ice_sriov_configure+0x94/0x960 [ice]
      [ 2773.648883]  ? _kstrtoull+0x3b/0x90
      [ 2773.649560]  sriov_numvfs_store+0x10a/0x190
      [ 2773.650249]  kernfs_fop_write+0x116/0x190
      [ 2773.650948]  vfs_write+0xa5/0x1a0
      [ 2773.651651]  ksys_write+0x4f/0xb0
      [ 2773.652358]  do_syscall_64+0x5b/0x1a0
      [ 2773.653075]  entry_SYSCALL_64_after_hwframe+0x65/0xca
      
      Fixes: 22ead37f ("i40evf: Add longer wait after remove module")
      Signed-off-by: default avatarPrzemyslaw Patynowski <przemyslawx.patynowski@intel.com>
      Signed-off-by: default avatarMateusz Palczewski <mateusz.palczewski@intel.com>
      Tested-by: default avatarKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      605ca7c5
    • Karen Sornek's avatar
      iavf: Add helper function to go from pci_dev to adapter · 247aa001
      Karen Sornek authored
      
      
      Add helper function to go from pci_dev to adapter to make work simple -
      to go from a pci_dev to the adapter structure and make netdev assignment
      instead of having to go to the net_device then the adapter.
      
      Signed-off-by: default avatarBrett Creeley <brett.creeley@intel.com>
      Signed-off-by: default avatarKaren Sornek <karen.sornek@intel.com>
      Tested-by: default avatarKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      247aa001
    • Brett Creeley's avatar
      virtchnl: Use the BIT() macro for capability/offload flags · 4a15022f
      Brett Creeley authored
      
      
      Currently raw hex values are used to define specific bits for each
      capability/offload in virtchnl.h. Using raw hex values makes it
      unclear which bits are used/available. Fix this by using the BIT()
      macro so it's immediately obvious which bits are used/available.
      
      Also, move the VIRTCHNL_VF_CAP_ADV_LINK_SPEED define in the correct
      place to line up with the other bit values and add a comment for its
      purpose.
      
      Signed-off-by: default avatarBrett Creeley <brett.creeley@intel.com>
      Tested-by: default avatarTony Brelinski <tony.brelinski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      4a15022f
    • Brett Creeley's avatar
      virtchnl: Remove unused VIRTCHNL_VF_OFFLOAD_RSVD define · 5bf84b29
      Brett Creeley authored
      
      
      Remove unused define that is currently marked as reserved. This will
      open up space for a new feature if/when it's introduced. Also, there is
      no reason to keep unused defines around.
      
      Suggested-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: default avatarBrett Creeley <brett.creeley@intel.com>
      Tested-by: default avatarTony Brelinski <tony.brelinski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      5bf84b29
    • Marcin Szycik's avatar
      ice: Hide bus-info in ethtool for PRs in switchdev mode · bfaaba99
      Marcin Szycik authored
      
      
      Disable showing bus-info information for port representors in switchdev
      mode. This fixes a bug that caused displaying wrong netdev descriptions in
      lshw tool - one port representor displayed PF branding string, and in turn
      one PF displayed a "generic" description. The bug occurs when many devices
      show the same bus-info in ethtool, which was the case in switchdev mode (PF
      and its port representors displayed the same bus-info). The bug occurs only
      if a port representor netdev appears before PF netdev in /proc/net/dev.
      
      In the examples below:
      ens6fX is PF
      ens6fXvY is VF
      ethX is port representor
      One irrelevant column was removed from output
      
      Before:
      $ sudo lshw -c net -businfo
      Bus info          Device      Description
      =========================================
      pci@0000:02:00.0  eth102       Ethernet Controller E810-XXV for SFP
      pci@0000:02:00.1  ens6f1       Ethernet Controller E810-XXV for SFP
      pci@0000:02:01.0  ens6f0v0     Ethernet Adaptive Virtual Function
      pci@0000:02:01.1  ens6f0v1     Ethernet Adaptive Virtual Function
      pci@0000:02:01.2  ens6f0v2     Ethernet Adaptive Virtual Function
      pci@0000:02:00.0  ens6f0       Ethernet interface
      
      Notice that eth102 and ens6f0 have the same bus-info and their descriptions
      are swapped.
      
      After:
      $ sudo lshw -c net -businfo
      Bus info          Device      Description
      =========================================
      pci@0000:02:00.0  ens6f0      Ethernet Controller E810-XXV for SFP
      pci@0000:02:00.1  ens6f1      Ethernet Controller E810-XXV for SFP
      pci@0000:02:01.0  ens6f0v0    Ethernet Adaptive Virtual Function
      pci@0000:02:01.1  ens6f0v1    Ethernet Adaptive Virtual Function
      pci@0000:02:01.2  ens6f0v2    Ethernet Adaptive Virtual Function
      
      Fixes: 7aae80ce ("ice: add port representor ethtool ops and stats")
      Signed-off-by: default avatarMarcin Szycik <marcin.szycik@linux.intel.com>
      Tested-by: default avatarSandeep Penigalapati <sandeep.penigalapati@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      bfaaba99
    • Marcin Szycik's avatar
      ice: Clear synchronized addrs when adding VFs in switchdev mode · c79bb28e
      Marcin Szycik authored
      
      
      When spawning VFs in switchdev mode, internal filter list of VSIs is
      cleared, which includes MAC rules. However MAC entries stay on netdev's
      multicast list, which causes error message when bringing link up after
      spawning VFs ("Failed to delete MAC filters"). __dev_mc_sync() is
      called and tries to unsync addresses that were already removed
      internally when adding VFs.
      
      This can be reproduced with:
      1) Load ice driver
      2) Change PF to switchdev mode
      3) Bring PF link up
      4) Bring PF link down
      5) Create a VF on PF
      6) Bring PF link up
      
      Added clearing of netdev's multicast (and also unicast) list when
      spawning VFs in switchdev mode, so the state of internal rule list and
      netdev's MAC list is consistent.
      
      Fixes: 1a1c40df ("ice: set and release switchdev environment")
      Signed-off-by: default avatarMarcin Szycik <marcin.szycik@linux.intel.com>
      Tested-by: default avatarSandeep Penigalapati <sandeep.penigalapati@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      c79bb28e
    • Brett Creeley's avatar
      ice: Remove boolean vlan_promisc flag from function · 29e71f41
      Brett Creeley authored
      
      
      Currently, the vlan_promisc flag is used exclusively by VF VSI to
      determine whether or not to toggle VLAN pruning along with
      trusted/true-promiscuous mode. This is not needed for a couple of
      reasons. First, trusted/true-promiscuous mode is only supposed to allow
      all MAC filters within VLANs that a VF has added filters for, so VLAN
      pruning should not be disabled. Second, the boolean argument makes the
      function confusing and unintuitive. Remove this flag.
      
      Signed-off-by: default avatarBrett Creeley <brett.creeley@intel.com>
      Tested-by: default avatarTony Brelinski <tony.brelinski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      29e71f41
  2. Oct 29, 2021