1. 23 May, 2020 12 commits
    • Brett Creeley's avatar
      ice: Check if unicast MAC exists before setting VF MAC · 47ebc7b0
      Brett Creeley authored
      Currently if a unicast MAC is set via ndo_set_vf_mac, the PF driver will
      set the VF's dflt_lan_addr.addr once some basic checks have passed. The
      VF is then reset. During reset the PF driver will attempt to program the
      VF's MAC from the dflt_lan_addr.addr field. This fails when the MAC
      already exists on the PF's switch.
      
      This is causing the VF to be completely disabled until removing/enabling
      any VFs via sysfs.
      
      Fix this by checking if the unicast MAC exists before triggering a VF
      reset directly in ndo_set_vf_mac. Also, add a check if the unicast MAC
      is set to the same value as before and return 0 if that is the case.
      Signed-off-by: default avatarBrett Creeley <brett.creeley@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      47ebc7b0
    • Brett Creeley's avatar
      ice: Fix Tx timeout when link is toggled on a VF's interface · 4dc926d3
      Brett Creeley authored
      Currently if the iavf is loaded and a VF link transitions from up to
      down to up again a Tx timeout will be triggered. This happens because
      Tx/Rx queue interrupts are only enabled when receiving the
      VIRTCHNL_OP_CONFIG_MAP_IRQ message, which happens on reset or initial
      iavf driver load, but not when bringing link up. This is problematic
      because they are disabled on the VIRTCHNL_OP_DISABLE_QUEUES message,
      which is part of bringing a VF's link down. However, they are not
      enabled on the VIRTCHNL_OP_ENABLE_QUEUES message, which is part of
      bringing a VF's link up.
      
      Fix this by re-enabling the VF's Rx and Tx queue interrupts when they
      were previously configured. This is done by first checking to make
      sure the previous value in QINT_[R|T]QCTL.MSIX_INDX is not 0, which
      is used to represent the OICR in the VF's interrupt space. If the
      MSIX_INDX is non-zero then enable the interrupt by setting the
      QINT_[R|T]CTL.CAUSE_ENA bit to 1.
      Signed-off-by: default avatarBrett Creeley <brett.creeley@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      4dc926d3
    • Paul Greenwalt's avatar
      ice: print Rx MDD auto reset message before VF reset · 7438a3b0
      Paul Greenwalt authored
      Rx MDD auto reset message was not being logged because logging occurred
      after the VF reset and the VF MDD data was reinitialized.
      
      Log the Rx MDD auto reset message before triggering the VF reset.
      Signed-off-by: default avatarPaul Greenwalt <paul.greenwalt@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      7438a3b0
    • Anirudh Venkataramanan's avatar
      ice: Call ice_aq_set_mac_cfg · 42449105
      Anirudh Venkataramanan authored
      As per the specification, the driver needs to call set_mac_cfg
      (opcode 0x0603) to be able to exercise jumbo frames. Call the
      function during initialization and the post reset rebuild flow.
      Signed-off-by: default avatarAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      42449105
    • Brett Creeley's avatar
      ice: Implement aRFS · 28bf2672
      Brett Creeley authored
      Enable accelerated Receive Flow Steering (aRFS). It is used to steer Rx
      flows to a specific queue. This functionality is triggered by the network
      stack through ndo_rx_flow_steer and requires Flow Director (ntuple on) to
      function.
      
      The fltr_info is used to add/remove/update flow rules in the HW, the
      fltr_state is used to determine what to do with the filter with respect
      to HW and/or SW, and the flow_id is used in co-ordination with the
      network stack.
      
      The work for aRFS is split into two paths: the ndo_rx_flow_steer
      operation and the ice_service_task. The former is where the kernel hands
      us an Rx SKB among other items to setup aRFS and the latter is where
      the driver adds/updates/removes filter rules from HW and updates filter
      state.
      
      In the Rx path the following things can happen:
              1. New aRFS entries are added to the hash table and the state is
                 set to ICE_ARFS_INACTIVE so the filter can be updated in HW
                 by the ice_service_task path.
              2. aRFS entries have their Rx Queue updated if we receive a
                 pre-existing flow_id and the filter state is ICE_ARFS_ACTIVE.
                 The state is set to ICE_ARFS_INACTIVE so the filter can be
                 updated in HW by the ice_service_task path.
              3. aRFS entries marked as ICE_ARFS_TODEL are deleted
      
      In the ice_service_task path the following things can happen:
              1. New aRFS entries marked as ICE_ARFS_INACTIVE are added or
                 updated in HW.
                 and their state is updated to ICE_ARFS_ACTIVE.
              2. aRFS entries are deleted from HW and their state is updated
                 to ICE_ARFS_TODEL.
      Signed-off-by: default avatarBrett Creeley <brett.creeley@intel.com>
      Signed-off-by: default avatarMadhu Chittim <madhu.chittim@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      28bf2672
    • Henry Tieman's avatar
      ice: Restore filters following reset · 83af0039
      Henry Tieman authored
      Following a reset, Flow Director filters are cleared from the hardware.
      Rebuild the filters using the software structures containing the filter
      rules.
      Signed-off-by: default avatarHenry Tieman <henry.w.tieman@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      83af0039
    • Henry Tieman's avatar
      ice: Enable flex-bytes support · 2c57ffcb
      Henry Tieman authored
      Flex-bytes allows for packet matching based on an offset and value. This
      is supported via the ethtool user-def option.  It is specified by providing
      an offset followed by a 2 byte match value. Offset is measured from the
      start of the MAC address.
      
      The following restrictions apply to flex-bytes. The specified offset must
      be an even number and be smaller than 0x1fe.
      
      Example usage:
      
      ethtool -N eth0 flow-type tcp4 src-ip 192.168.0.55 dst-ip 172.16.0.55 \
      src-port 12 dst-port 13 user-def 0x10ffff action 32
      Signed-off-by: default avatarHenry Tieman <henry.w.tieman@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      2c57ffcb
    • Henry Tieman's avatar
      ice: Support IPv6 Flow Director filters · 165d80d6
      Henry Tieman authored
      Extend supported filters to allow for IPv6 filters.
      
      Supported fields are: src-ip, dst-ip, src-port, and dst-port
      Supported flow-types are: tcp6, udp6, sctp6, ip6
      
      Example usage:
      
      ethtool -N eth0 flow-type tcp6 src-port 12 dst-port 13 \
      src-ip fce0::1:34 dst-ip fce0::1:35 action 32
      Signed-off-by: default avatarHenry Tieman <henry.w.tieman@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      165d80d6
    • Henry Tieman's avatar
      ice: Support IPv4 Flow Director filters · cac2a27c
      Henry Tieman authored
      Support the addition and deletion of IPv4 filters.
      
      Supported fields are: src-ip, dst-ip, src-port, and dst-port
      Supported flow-types are: tcp4, udp4, sctp4, ip4
      
      Example usage:
      
      ethtool -N eth0 flow-type tcp4 src-ip 192.168.0.55 dst-ip 172.16.0.55 \
      src-port 16 dst-port 12 action 32
      Signed-off-by: default avatarHenry Tieman <henry.w.tieman@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      cac2a27c
    • Henry Tieman's avatar
      ice: Support displaying ntuple rules · 4ab95646
      Henry Tieman authored
      Add functionality for ethtool --show-ntuple, allowing for filters to be
      displayed when set functionality is added. Add statistics related to
      Flow Director matches and status.
      Signed-off-by: default avatarHenry Tieman <henry.w.tieman@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      4ab95646
    • Henry Tieman's avatar
      ice: Initialize Flow Director resources · 148beb61
      Henry Tieman authored
      Flow Director allows for redirection based on ntuple rules. Rules are
      programmed using the ethtool set-ntuple interface. Supported actions are
      redirect to queue and drop.
      
      Setup the initial framework to process Flow Director filters. Create and
      allocate resources to manage and program filters to the hardware. Filters
      are processed via a sideband interface; a control VSI is created to manage
      communication and process requests through the sideband. Upon allocation of
      resources, update the hardware tables to accept perfect filters.
      Signed-off-by: default avatarHenry Tieman <henry.w.tieman@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      148beb61
    • Geert Uytterhoeven's avatar
      virtchnl: Add missing explicit padding to structures · 65ece6de
      Geert Uytterhoeven authored
      On e.g. m68k, the alignment of 32-bit values is only 2 bytes, leading
      to the following:
      
          ./include/linux/avf/virtchnl.h:147:36: warning: division by zero [-Wdiv-by-zero]
            { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      					^
          ./include/linux/avf/virtchnl.h:577:1: note: in expansion of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
           VIRTCHNL_CHECK_STRUCT_LEN(272, virtchnl_filter);
           ^~~~~~~~~~~~~~~~~~~~~~~~~
          ./include/linux/avf/virtchnl.h:577:32: error: enumerator value for ‘virtchnl_static_assert_virtchnl_filter’ is not an integer constant
           VIRTCHNL_CHECK_STRUCT_LEN(272, virtchnl_filter);
      				    ^~~~~~~~~~~~~~~
          ./include/linux/avf/virtchnl.h:147:53: note: in definition of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
            { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      							 ^
          ./include/linux/avf/virtchnl.h:147:36: warning: division by zero [-Wdiv-by-zero]
            { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      					^
          ./include/linux/avf/virtchnl.h:619:1: note: in expansion of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
           VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_pf_event);
           ^~~~~~~~~~~~~~~~~~~~~~~~~
          ./include/linux/avf/virtchnl.h:619:31: error: enumerator value for ‘virtchnl_static_assert_virtchnl_pf_event’ is not an integer constant
           VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_pf_event);
      				   ^~~~~~~~~~~~~~~~~
          ./include/linux/avf/virtchnl.h:147:53: note: in definition of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
            { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      							 ^
          ./include/linux/avf/virtchnl.h:147:36: warning: division by zero [-Wdiv-by-zero]
            { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      					^
          ./include/linux/avf/virtchnl.h:640:1: note: in expansion of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
           VIRTCHNL_CHECK_STRUCT_LEN(12, virtchnl_iwarp_qv_info);
           ^~~~~~~~~~~~~~~~~~~~~~~~~
          ./include/linux/avf/virtchnl.h:640:31: error: enumerator value for ‘virtchnl_static_assert_virtchnl_iwarp_qv_info’ is not an integer constant
           VIRTCHNL_CHECK_STRUCT_LEN(12, virtchnl_iwarp_qv_info);
      				   ^~~~~~~~~~~~~~~~~~~~~~
          ./include/linux/avf/virtchnl.h:147:53: note: in definition of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
            { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      							 ^
          ./include/linux/avf/virtchnl.h:147:36: warning: division by zero [-Wdiv-by-zero]
            { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      					^
          ./include/linux/avf/virtchnl.h:647:1: note: in expansion of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
           VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_iwarp_qvlist_info);
           ^~~~~~~~~~~~~~~~~~~~~~~~~
          ./include/linux/avf/virtchnl.h:647:31: error: enumerator value for ‘virtchnl_static_assert_virtchnl_iwarp_qvlist_info’ is not an integer constant
           VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_iwarp_qvlist_info);
      				   ^~~~~~~~~~~~~~~~~~~~~~~~~~
          ./include/linux/avf/virtchnl.h:147:53: note: in definition of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
            { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      							 ^
      
      Fix this by adding explicit padding to structures with holes.
      
      Reported-by: <noreply@ellerman.id.au>
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      65ece6de
  2. 22 May, 2020 24 commits
  3. 21 May, 2020 4 commits