1. 10 11月, 2022 1 次提交
  2. 20 9月, 2022 1 次提交
    • M
      iavf: Fix set max MTU size with port VLAN and jumbo frames · 399c98c4
      Michal Jaron 提交于
      After setting port VLAN and MTU to 9000 on VF with ice driver there
      was an iavf error
      "PF returned error -5 (IAVF_ERR_PARAM) to our request 6".
      
      During queue configuration, VF's max packet size was set to
      IAVF_MAX_RXBUFFER but on ice max frame size was smaller by VLAN_HLEN
      due to making some space for port VLAN as VF is not aware whether it's
      in a port VLAN. This mismatch in sizes caused ice to reject queue
      configuration with ERR_PARAM error. Proper max_mtu is sent from ice PF
      to VF with GET_VF_RESOURCES msg but VF does not look at this.
      
      In iavf change max_frame from IAVF_MAX_RXBUFFER to max_mtu
      received from pf with GET_VF_RESOURCES msg to make vf's
      max_frame_size dependent from pf. Add check if received max_mtu is
      not in eligible range then set it to IAVF_MAX_RXBUFFER.
      
      Fixes: dab86afd ("i40e/i40evf: Change the way we limit the maximum frame size for Rx")
      Signed-off-by: NMichal Jaron <michalx.jaron@intel.com>
      Signed-off-by: NMateusz Palczewski <mateusz.palczewski@intel.com>
      Tested-by: NKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      399c98c4
  3. 19 7月, 2022 1 次提交
  4. 01 7月, 2022 1 次提交
  5. 08 6月, 2022 1 次提交
  6. 09 3月, 2022 1 次提交
  7. 02 3月, 2022 3 次提交
  8. 26 2月, 2022 1 次提交
  9. 18 12月, 2021 4 次提交
    • B
      iavf: Add support for VIRTCHNL_VF_OFFLOAD_VLAN_V2 offload enable/disable · 8afadd1c
      Brett Creeley 提交于
      The new VIRTCHNL_VF_OFFLOAD_VLAN_V2 capability added support that allows
      the VF to support 802.1Q and 802.1ad VLAN insertion and stripping if
      successfully negotiated via VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS.
      Multiple changes were needed to support this new functionality.
      
      1. Added new aq_required flags to support any kind of VLAN stripping and
         insertion offload requests via virtchnl.
      
      2. Added the new method iavf_set_vlan_offload_features() that's
         used during VF initialization, VF reset, and iavf_set_features() to
         set the aq_required bits based on the current VLAN offload
         configuration of the VF's netdev.
      
      3. Added virtchnl handling for VIRTCHNL_OP_ENABLE_STRIPPING_V2,
         VIRTCHNL_OP_DISABLE_STRIPPING_V2, VIRTCHNL_OP_ENABLE_INSERTION_V2,
         and VIRTCHNL_OP_ENABLE_INSERTION_V2.
      Signed-off-by: NBrett Creeley <brett.creeley@intel.com>
      Tested-by: NKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      8afadd1c
    • B
      iavf: Add support for VIRTCHNL_VF_OFFLOAD_VLAN_V2 hotpath · ccd219d2
      Brett Creeley 提交于
      The new VIRTCHNL_VF_OFFLOAD_VLAN_V2 capability added support that allows
      the PF to set the location of the Tx and Rx VLAN tag for insertion and
      stripping offloads. In order to support this functionality a few changes
      are needed.
      
      1. Add a new method to cache the VLAN tag location based on negotiated
         capabilities for the Tx and Rx ring flags. This needs to be called in
         the initialization and reset paths.
      
      2. Refactor the transmit hotpath to account for the new Tx ring flags.
         When IAVF_TXR_FLAGS_VLAN_LOC_L2TAG2 is set, then the driver needs to
         insert the VLAN tag in the L2TAG2 field of the transmit descriptor.
         When the IAVF_TXRX_FLAGS_VLAN_LOC_L2TAG1 is set, then the driver needs
         to use the l2tag1 field of the data descriptor (same behavior as
         before).
      
      3. Refactor the iavf_tx_prepare_vlan_flags() function to simplify
         transmit hardware VLAN offload functionality by only depending on the
         skb_vlan_tag_present() function. This can be done because the OS
         won't request transmit offload for a VLAN unless the driver told the
         OS it's supported and enabled.
      
      4. Refactor the receive hotpath to account for the new Rx ring flags and
         VLAN ethertypes. This requires checking the Rx ring flags and
         descriptor status bits to determine the location of the VLAN tag.
         Also, since only a single ethertype can be supported at a time, check
         the enabled netdev features before specifying a VLAN ethertype in
         __vlan_hwaccel_put_tag().
      Signed-off-by: NBrett Creeley <brett.creeley@intel.com>
      Tested-by: NKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      ccd219d2
    • B
      iavf: Add support VIRTCHNL_VF_OFFLOAD_VLAN_V2 during netdev config · 48ccc43e
      Brett Creeley 提交于
      Based on VIRTCHNL_VF_OFFLOAD_VLAN_V2, the VF can now support more VLAN
      capabilities (i.e. 802.1AD offloads and filtering). In order to
      communicate these capabilities to the netdev layer, the VF needs to
      parse its VLAN capabilities based on whether it was able to negotiation
      VIRTCHNL_VF_OFFLOAD_VLAN or VIRTCHNL_VF_OFFLOAD_VLAN_V2 or neither of
      these.
      
      In order to support this, add the following functionality:
      
      iavf_get_netdev_vlan_hw_features() - This is used to determine the VLAN
      features that the underlying hardware supports and that can be toggled
      off/on based on the negotiated capabiltiies. For example, if
      VIRTCHNL_VF_OFFLOAD_VLAN_V2 was negotiated, then any capability marked
      with VIRTCHNL_VLAN_TOGGLE can be toggled on/off by the VF. If
      VIRTCHNL_VF_OFFLOAD_VLAN was negotiated, then only VLAN insertion and/or
      stripping can be toggled on/off.
      
      iavf_get_netdev_vlan_features() - This is used to determine the VLAN
      features that the underlying hardware supports and that should be
      enabled by default. For example, if VIRTHCNL_VF_OFFLOAD_VLAN_V2 was
      negotiated, then any supported capability that has its ethertype_init
      filed set should be enabled by default. If VIRTCHNL_VF_OFFLOAD_VLAN was
      negotiated, then filtering, stripping, and insertion should be enabled
      by default.
      
      Also, refactor iavf_fix_features() to take into account the new
      capabilities. To do this, query all the supported features (enabled by
      default and toggleable) and make sure the requested change is supported.
      If VIRTCHNL_VF_OFFLOAD_VLAN_V2 is successfully negotiated, there is no
      need to check VIRTCHNL_VLAN_TOGGLE here because the driver already told
      the netdev layer which features can be toggled via netdev->hw_features
      during iavf_process_config(), so only those features will be requested
      to change.
      Signed-off-by: NBrett Creeley <brett.creeley@intel.com>
      Tested-by: NKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      48ccc43e
    • B
      iavf: Add support for VIRTCHNL_VF_OFFLOAD_VLAN_V2 negotiation · 209f2f9c
      Brett Creeley 提交于
      In order to support the new VIRTCHNL_VF_OFFLOAD_VLAN_V2 capability the
      VF driver needs to rework it's initialization state machine and reset
      flow. This has to be done because successful negotiation of
      VIRTCHNL_VF_OFFLOAD_VLAN_V2 requires the VF driver to perform a second
      capability request via VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS before
      configuring the adapter and its netdev.
      
      Add the VIRTCHNL_VF_OFFLOAD_VLAN_V2 bit when sending the
      VIRTHCNL_OP_GET_VF_RESOURECES message. The underlying PF will either
      support VIRTCHNL_VF_OFFLOAD_VLAN or VIRTCHNL_VF_OFFLOAD_VLAN_V2 or
      neither. Both of these offloads should never be supported together.
      
      Based on this, add 2 new states to the initialization state machine:
      
      __IAVF_INIT_GET_OFFLOAD_VLAN_V2_CAPS
      __IAVF_INIT_CONFIG_ADAPTER
      
      The __IAVF_INIT_GET_OFFLOAD_VLAN_V2_CAPS state is used to request/store
      the new VLAN capabilities if and only if VIRTCHNL_VLAN_OFFLOAD_VLAN_V2
      was successfully negotiated in the __IAVF_INIT_GET_RESOURCES state.
      
      The __IAVF_INIT_CONFIG_ADAPTER state is used to configure the
      adapter/netdev after the resource requests have finished. The VF will
      move into this state regardless of whether it successfully negotiated
      VIRTCHNL_VF_OFFLOAD_VLAN or VIRTCHNL_VF_OFFLOAD_VLAN_V2.
      
      Also, add a the new flag IAVF_FLAG_AQ_GET_OFFLOAD_VLAN_V2_CAPS and set
      it during VF reset. If VIRTCHNL_VF_OFFLOAD_VLAN_V2 was successfully
      negotiated then the VF will request its VLAN capabilities via
      VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS during the reset. This is needed
      because the PF may change/modify the VF's configuration during VF reset
      (i.e. modifying the VF's port VLAN configuration).
      
      This also, required the VF to call netdev_update_features() since its
      VLAN features may change during VF reset. Make sure to call this under
      rtnl_lock().
      Signed-off-by: NBrett Creeley <brett.creeley@intel.com>
      Tested-by: NKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      209f2f9c
  10. 01 12月, 2021 3 次提交
  11. 20 11月, 2021 2 次提交
    • B
      iavf: Fix VLAN feature flags after VFR · 5951a2b9
      Brett Creeley 提交于
      When a VF goes through a reset, it's possible for the VF's feature set
      to change. For example it may lose the VIRTCHNL_VF_OFFLOAD_VLAN
      capability after VF reset. Unfortunately, the driver doesn't correctly
      deal with this situation and errors are seen from downing/upping the
      interface and/or moving the interface in/out of a network namespace.
      
      When setting the interface down/up we see the following errors after the
      VIRTCHNL_VF_OFFLOAD_VLAN capability was taken away from the VF:
      
      ice 0000:51:00.1: VF 1 failed opcode 12, retval: -64 iavf 0000:51:09.1:
      Failed to add VLAN filter, error IAVF_NOT_SUPPORTED ice 0000:51:00.1: VF
      1 failed opcode 13, retval: -64 iavf 0000:51:09.1: Failed to delete VLAN
      filter, error IAVF_NOT_SUPPORTED
      
      These add/delete errors are happening because the VLAN filters are
      tracked internally to the driver and regardless of the VLAN_ALLOWED()
      setting the driver tries to delete/re-add them over virtchnl.
      
      Fix the delete failure by making sure to delete any VLAN filter tracking
      in the driver when a removal request is made, while preventing the
      virtchnl request.  This makes it so the driver's VLAN list is up to date
      and the errors are
      
      Fix the add failure by making sure the check for VLAN_ALLOWED() during
      reset is done after the VF receives its capability list from the PF via
      VIRTCHNL_OP_GET_VF_RESOURCES. If VLAN functionality is not allowed, then
      prevent requesting re-adding the filters over virtchnl.
      
      When moving the interface into a network namespace we see the following
      errors after the VIRTCHNL_VF_OFFLOAD_VLAN capability was taken away from
      the VF:
      
      iavf 0000:51:09.1 enp81s0f1v1: NIC Link is Up Speed is 25 Gbps Full Duplex
      iavf 0000:51:09.1 temp_27: renamed from enp81s0f1v1
      iavf 0000:51:09.1 mgmt: renamed from temp_27
      iavf 0000:51:09.1 dev27: set_features() failed (-22); wanted 0x020190001fd54833, left 0x020190001fd54bb3
      
      These errors are happening because we aren't correctly updating the
      netdev capabilities and dealing with ndo_fix_features() and
      ndo_set_features() correctly.
      
      Fix this by only reporting errors in the driver's ndo_set_features()
      callback when VIRTCHNL_VF_OFFLOAD_VLAN is not allowed and any attempt to
      enable the VLAN features is made. Also, make sure to disable VLAN
      insertion, filtering, and stripping since the VIRTCHNL_VF_OFFLOAD_VLAN
      flag applies to all of them and not just VLAN stripping.
      
      Also, after we process the capabilities in the VF reset path, make sure
      to call netdev_update_features() in case the capabilities have changed
      in order to update the netdev's feature set to match the VF's actual
      capabilities.
      
      Lastly, make sure to always report success on VLAN filter delete when
      VIRTCHNL_VF_OFFLOAD_VLAN is not supported. The changed flow in
      iavf_del_vlans() allows the stack to delete previosly existing VLAN
      filters even if VLAN filtering is not allowed. This makes it so the VLAN
      filter list is up to date.
      
      Fixes: 8774370d ("i40e/i40evf: support for VF VLAN tag stripping control")
      Signed-off-by: NBrett Creeley <brett.creeley@intel.com>
      Tested-by: NKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      5951a2b9
    • J
      iavf: Fix refreshing iavf adapter stats on ethtool request · 3b5bdd18
      Jedrzej Jagielski 提交于
      Currently iavf adapter statistics are refreshed only in a
      watchdog task, triggered approximately every two seconds,
      which causes some ethtool requests to return outdated values.
      
      Add explicit statistics refresh when requested by ethtool -S.
      
      Fixes: b476b003 ("iavf: Move commands processing to the separate function")
      Signed-off-by: NJan Sokolowski <jan.sokolowski@intel.com>
      Signed-off-by: NJedrzej Jagielski <jedrzej.jagielski@intel.com>
      Tested-by: NKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      3b5bdd18
  12. 19 10月, 2021 1 次提交
  13. 02 10月, 2021 1 次提交
  14. 20 8月, 2021 1 次提交
  15. 23 4月, 2021 3 次提交
  16. 24 3月, 2021 1 次提交
  17. 23 3月, 2021 2 次提交
  18. 06 1月, 2021 1 次提交
  19. 12 6月, 2020 3 次提交
  20. 11 3月, 2020 1 次提交
  21. 10 1月, 2020 1 次提交
    • S
      iavf: remove current MAC address filter on VF reset · 9e052291
      Stefan Assmann 提交于
      Currently MAC filters are not altered during a VF reset event. This may
      lead to a stale filter when an administratively set MAC is forced by the
      PF.
      
      For an administratively set MAC the PF driver deletes the VFs filters,
      overwrites the VFs MAC address and triggers a VF reset. However
      the VF driver itself is not aware of the filter removal, which is what
      the VF reset is for.
      The VF reset queues all filters present in the VF driver to be re-added
      to the PF filter list (including the filter for the now stale VF MAC
      address) and triggers a VIRTCHNL_OP_GET_VF_RESOURCES event, which
      provides the new MAC address to the VF.
      
      When this happens i40e will complain and reject the stale MAC filter,
      at least in the untrusted VF case.
      i40e 0000:08:00.0: Setting MAC 3c:fa:fa:fa:fa:01 on VF 0
      iavf 0000:08:02.0: Reset warning received from the PF
      iavf 0000:08:02.0: Scheduling reset task
      i40e 0000:08:00.0: Bring down and up the VF interface to make this change effective.
      i40e 0000:08:00.0: VF attempting to override administratively set MAC address, bring down and up the VF interface to resume normal operation
      i40e 0000:08:00.0: VF 0 failed opcode 10, retval: -1
      iavf 0000:08:02.0: Failed to add MAC filter, error IAVF_ERR_NVM
      
      To avoid re-adding the stale MAC filter it needs to be removed from the
      VF driver's filter list before queuing the existing filters. Then during
      the VIRTCHNL_OP_GET_VF_RESOURCES event the correct filter needs to be
      added again, at which point the MAC address has been updated.
      
      As a bonus this change makes bringing the VF down and up again
      superfluous for the administratively set MAC case.
      Signed-off-by: NStefan Assmann <sassmann@kpanic.de>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      9e052291
  22. 12 9月, 2019 1 次提交
  23. 29 6月, 2019 1 次提交
  24. 18 6月, 2019 2 次提交
  25. 31 5月, 2019 2 次提交