1. 23 5月, 2020 8 次提交
    • B
      ice: Implement aRFS · 28bf2672
      Brett Creeley 提交于
      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: NBrett Creeley <brett.creeley@intel.com>
      Signed-off-by: NMadhu Chittim <madhu.chittim@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      28bf2672
    • H
      ice: Restore filters following reset · 83af0039
      Henry Tieman 提交于
      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: NHenry Tieman <henry.w.tieman@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      83af0039
    • H
      ice: Enable flex-bytes support · 2c57ffcb
      Henry Tieman 提交于
      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: NHenry Tieman <henry.w.tieman@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      2c57ffcb
    • H
      ice: Support IPv6 Flow Director filters · 165d80d6
      Henry Tieman 提交于
      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: NHenry Tieman <henry.w.tieman@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      165d80d6
    • H
      ice: Support IPv4 Flow Director filters · cac2a27c
      Henry Tieman 提交于
      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: NHenry Tieman <henry.w.tieman@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      cac2a27c
    • H
      ice: Support displaying ntuple rules · 4ab95646
      Henry Tieman 提交于
      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: NHenry Tieman <henry.w.tieman@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      4ab95646
    • H
      ice: Initialize Flow Director resources · 148beb61
      Henry Tieman 提交于
      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: NHenry Tieman <henry.w.tieman@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      148beb61
    • G
      virtchnl: Add missing explicit padding to structures · 65ece6de
      Geert Uytterhoeven 提交于
      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: NGeert Uytterhoeven <geert@linux-m68k.org>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      65ece6de
  2. 22 5月, 2020 24 次提交
  3. 21 5月, 2020 8 次提交