1. 23 4月, 2021 2 次提交
  2. 26 3月, 2021 1 次提交
  3. 23 3月, 2021 1 次提交
    • Q
      ice: Enable FDIR Configure for AVF · 1f7ea1cd
      Qi Zhang 提交于
      The virtual channel is going to be extended to support FDIR and
      RSS configure from AVF. New data structures and OP codes will be
      added, the patch enable the FDIR part.
      
      To support above advanced AVF feature, we need to figure out
      what kind of data structure should be passed from VF to PF to describe
      an FDIR rule or RSS config rule. The common part of the requirement is
      we need a data structure to represent the input set selection of a rule's
      hash key.
      
      An input set selection is a group of fields be selected from one or more
      network protocol layers that could be identified as a specific flow.
      For example, select dst IP address from an IPv4 header combined with
      dst port from the TCP header as the input set for an IPv4/TCP flow.
      
      The patch adds a new data structure virtchnl_proto_hdrs to abstract
      a network protocol headers group which is composed of layers of network
      protocol header(virtchnl_proto_hdr).
      
      A protocol header contains a 32 bits mask (field_selector) to describe
      which fields are selected as input sets, as well as a header type
      (enum virtchnl_proto_hdr_type). Each bit is mapped to a field in
      enum virtchnl_proto_hdr_field guided by its header type.
      
      +------------+-----------+------------------------------+
      |            | Proto Hdr | Header Type A                |
      |            |           +------------------------------+
      |            |           | BIT 31 | ... | BIT 1 | BIT 0 |
      |            |-----------+------------------------------+
      |Proto Hdrs  | Proto Hdr | Header Type B                |
      |            |           +------------------------------+
      |            |           | BIT 31 | ... | BIT 1 | BIT 0 |
      |            |-----------+------------------------------+
      |            | Proto Hdr | Header Type C                |
      |            |           +------------------------------+
      |            |           | BIT 31 | ... | BIT 1 | BIT 0 |
      |            |-----------+------------------------------+
      |            |    ....                                  |
      +-------------------------------------------------------+
      
      All fields in enum virtchnl_proto_hdr_fields are grouped with header type
      and the value of the first field of a header type is always 32 aligned.
      
      enum proto_hdr_type {
              header_type_A = 0;
              header_type_B = 1;
              ....
      }
      
      enum proto_hdr_field {
              /* header type A */
              header_A_field_0 = 0,
              header_A_field_1 = 1,
              header_A_field_2 = 2,
              header_A_field_3 = 3,
      
              /* header type B */
              header_B_field_0 = 32, // = header_type_B << 5
              header_B_field_0 = 33,
              header_B_field_0 = 34
              header_B_field_0 = 35,
              ....
      };
      
      So we have:
      proto_hdr_type = proto_hdr_field / 32
      bit offset = proto_hdr_field % 32
      
      To simply the protocol header's operations, couple help macros are added.
      For example, to select src IP and dst port as input set for an IPv4/UDP
      flow.
      
      we have:
      struct virtchnl_proto_hdr hdr[2];
      
      VIRTCHNL_SET_PROTO_HDR_TYPE(&hdr[0], IPV4)
      VIRTCHNL_ADD_PROTO_HDR_FIELD(&hdr[0], IPV4, SRC)
      
      VIRTCHNL_SET_PROTO_HDR_TYPE(&hdr[1], UDP)
      VIRTCHNL_ADD_PROTO_HDR_FIELD(&hdr[1], UDP, DST)
      
      The byte array is used to store the protocol header of a training package.
      The byte array must be network order.
      
      The patch added virtual channel support for iAVF FDIR add/validate/delete
      filter. iAVF FDIR is Flow Director for Intel Adaptive Virtual Function
      which can direct Ethernet packets to the queues of the Network Interface
      Card. Add/delete command is adding or deleting one rule for each virtual
      channel message, while validate command is just verifying if this rule
      is valid without any other operations.
      
      To add or delete one rule, driver needs to config TCAM and Profile,
      build training packets which contains the input set value, and send
      the training packets through FDIR Tx queue. In addition, driver needs to
      manage the software context to avoid adding duplicated rules, deleting
      non-existent rule, input set conflicts and other invalid cases.
      
      NOTE:
      Supported pattern/actions and their parse functions are not be included in
      this patch, they will be added in a separate one.
      Signed-off-by: NJeff Guo <jia.guo@intel.com>
      Signed-off-by: NYahui Cao <yahui.cao@intel.com>
      Signed-off-by: NSimei Su <simei.su@intel.com>
      Signed-off-by: NBeilei Xing <beilei.xing@intel.com>
      Signed-off-by: NQi Zhang <qi.z.zhang@intel.com>
      Tested-by: NChen Bo <BoX.C.Chen@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      1f7ea1cd
  4. 23 5月, 2020 1 次提交
    • 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
  5. 27 6月, 2019 1 次提交
  6. 05 6月, 2019 1 次提交
  7. 15 11月, 2018 2 次提交
  8. 01 11月, 2018 1 次提交
  9. 03 10月, 2018 1 次提交
  10. 31 8月, 2018 1 次提交
  11. 14 5月, 2018 1 次提交
  12. 15 2月, 2018 3 次提交
  13. 14 10月, 2017 1 次提交
    • A
      i40e/i40evf: don't trust VF to reset itself · 17a9422d
      Alan Brady 提交于
      When using 'ethtool -L' on a VF to change number of requested queues
      from PF, we shouldn't trust the VF to reset itself after making the
      request.  Doing it that way opens the door for a potentially malicious
      VF to do nasty things to the PF which should never be the case.
      
      This makes it such that after VF makes a successful request, PF will
      then reset the VF to institute required changes.  Only if the request
      fails will PF send a message back to VF letting it know the request was
      unsuccessful.
      
      Testing-hints:
      There should be no real functional changes.  This is simply hardening
      against a potentially malicious VF.
      Signed-off-by: NAlan Brady <alan.brady@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      17a9422d
  14. 30 9月, 2017 1 次提交
    • A
      i40e: Enable VF to negotiate number of allocated queues · a3f5aa90
      Alan Brady 提交于
      Currently the PF allocates a default number of queues for each VF and
      cannot be changed.  This patch enables the VF to request a different
      number of queues allocated to it.  This patch also adds a new virtchnl
      op and capability flag to facilitate this negotiation.
      
      After the PF receives a request message, it will set a requested number
      of queues for that VF.  Then when the VF resets, its VSI will get a new
      number of queues allocated to it.
      
      This is a best effort request and since we only allocate a guaranteed
      default number, if the VF tries to ask for more than the guaranteed
      number, there may not be enough in HW to accommodate it unless other
      queues for other VFs are freed. It should also be noted decreasing the
      number queues allocated to a VF to below the default will NOT enable the
      allocation of more than 32 VFs per PF and will not free queues guaranteed
      to each VF by default.
      Signed-off-by: NAlan Brady <alan.brady@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      a3f5aa90
  15. 28 8月, 2017 1 次提交
  16. 26 8月, 2017 1 次提交
  17. 02 6月, 2017 10 次提交
  18. 31 5月, 2017 1 次提交
  19. 07 4月, 2017 1 次提交
  20. 15 3月, 2017 1 次提交
  21. 12 2月, 2017 1 次提交
  22. 29 10月, 2016 1 次提交
  23. 25 9月, 2016 1 次提交
  24. 07 4月, 2016 1 次提交
  25. 13 12月, 2015 1 次提交
  26. 15 10月, 2015 1 次提交
  27. 08 10月, 2015 1 次提交