1. 11 Oct, 2021 7 commits
    • Victor Raj's avatar
      ice: cleanup rules info · 8b8ef05b
      Victor Raj authored
      Change ICE_SW_LKUP_LAST to ICE_MAX_NUM_RECIPES as for now there also can
      be recipes other than the default.
      
      Free all structures created for advanced recipes in cleanup function.
      Write a function to clean allocated structures on advanced rule info.
      Signed-off-by: default avatarVictor Raj <victor.raj@intel.com>
      Signed-off-by: default avatarWojciech Drewek <wojciech.drewek@intel.com>
      Tested-by: default avatarSandeep Penigalapati <sandeep.penigalapati@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      8b8ef05b
    • Shivanshu Shukla's avatar
      ice: allow deleting advanced rules · 8bb98f33
      Shivanshu Shukla authored
      To remove advanced rule the same protocols list like in adding should be
      send to function. Based on this information list of advanced rules is
      searched to find the correct rule id.
      
      Remove advanced rule if it forwards to only one VSI. If it forwards
      to list of VSI remove only input VSI from this list.
      
      Introduce function to remove rule by id. It is used in case rule needs to
      be removed even if it forwards to the list of VSI.
      
      Allow removing all advanced rules from a particular VSI. It is useful in
      rebuilding VSI path.
      Co-developed-by: default avatarDan Nowlin <dan.nowlin@intel.com>
      Signed-off-by: default avatarDan Nowlin <dan.nowlin@intel.com>
      Signed-off-by: default avatarShivanshu Shukla <shivanshu.shukla@intel.com>
      Signed-off-by: default avatarWojciech Drewek <wojciech.drewek@intel.com>
      Tested-by: default avatarSandeep Penigalapati <sandeep.penigalapati@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      8bb98f33
    • Grishma Kotecha's avatar
      ice: allow adding advanced rules · 0f94570d
      Grishma Kotecha authored
      Define dummy packet headers to allow adding advanced rules in HW. This
      header is used as admin queue command parameter for adding a rule.
      The firmware will extract correct fields and will use them in look ups.
      
      Define each supported packets header and offsets to words used in recipe.
      Supported headers:
      - MAC + IPv4 + UDP
      - MAC + VLAN + IPv4 + UDP
      - MAC + IPv4 + TCP
      - MAC + VLAN + IPv4 + TCP
      - MAC + IPv6 + UDP
      - MAC + VLAN + IPv6 + UDP
      - MAC + IPv6 + TCP
      - MAC + VLAN + IPv6 + TCP
      
      Add code for creating an advanced rule. Rule needs to match defined
      dummy packet, if not return error, which means that this type of rule
      isn't currently supported.
      
      The first step in adding advanced rule is searching for an advanced
      recipe matching this kind of rule. If it doesn't exist new recipe is
      created. Dummy packet has to be filled with the correct header field
      value from the rule definition. It will be used to do look up in HW.
      
      Support searching for existing advance rule entry. It is used in case
      of adding the same rule on different VSI. In this case, instead of
      creating new rule, the existing one should be updated with refreshed VSI
      list.
      
      Add initialization for prof_res_bm_init flag to zero so that
      the possible resource for fv in the files can be initialized.
      Co-developed-by: default avatarDan Nowlin <dan.nowlin@intel.com>
      Signed-off-by: default avatarDan Nowlin <dan.nowlin@intel.com>
      Signed-off-by: default avatarGrishma Kotecha <grishma.kotecha@intel.com>
      Signed-off-by: default avatarWojciech Drewek <wojciech.drewek@intel.com>
      Tested-by: default avatarSandeep Penigalapati <sandeep.penigalapati@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      0f94570d
    • Dan Nowlin's avatar
      ice: create advanced switch recipe · fd2a6b71
      Dan Nowlin authored
      These changes introduce code for creating advanced recipes for the
      switch in hardware.
      
      There are a couple of recipes already defined in the HW. They apply to
      matching on basic protocol headers, like MAC, VLAN, MACVLAN,
      ethertype or direction (promiscuous), etc.. If the user wants to match on
      other protocol headers (eg. ip address, src/dst port etc.) or different
      variation of already supported protocols, there is a need to create
      new, more complex recipe. That new recipe is referred as
      'advanced recipe', and the filtering rule created on top of that recipe
      is called 'advanced rule'.
      
      One recipe can have up to 5 words, but the first word is always reserved
      for match on switch id, so the driver can define up to 4 words for one
      recipe. To support recipes with more words up to 5 recipes can be
      chained, so 20 words can be programmed for look up.
      
      Input for adding recipe function is a list of protocols to support. Based
      on this list correct profile is being chosen. Correct profile means
      that it contains all protocol types from a list. Each profile have up to
      48 field vector words and each of this word have protocol id and offset.
      These two fields need to match with input data for adding recipe
      function. If the correct profile can't be found the function returns an
      error.
      
      The next step after finding the correct profile is grouping words into
      groups. One group can have up to 4 words. This is done to simplify
      sending recipes to HW (because recipe also can have up to 4 words).
      
      In case of chaining (so when look up consists of more than 4 words) last
      recipe will always have results from the previous recipes used as words.
      
      A recipe to profile map is used to store information about which profile
      is associate with this recipe. This map is an array of 64 elements (max
      number of recipes) and each element is a 256 bits bitmap (max number of
      profiles)
      
      Profile to recipe map is used to store information about which recipe is
      associate with this profile. This map is an array of 256 elements (max
      number of profiles) and each element is a 64 bits bitmap (max number of
      recipes)
      Signed-off-by: default avatarDan Nowlin <dan.nowlin@intel.com>
      Signed-off-by: default avatarWojciech Drewek <wojciech.drewek@intel.com>
      Tested-by: default avatarSandeep Penigalapati <sandeep.penigalapati@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      fd2a6b71
    • Dan Nowlin's avatar
      ice: manage profiles and field vectors · 450052a4
      Dan Nowlin authored
      Implement functions to manage profiles and field vectors in hardware.
      
      In hardware, there are up to 256 profiles and each of these profiles can
      have 48 field vector words. Each field vector word is described by
      protocol id and offset in the packet. To add a new recipe all used
      profiles need to be searched. If the profile contains all required
      protocol ids and offsets from the recipe it can be used. The driver has
      to add this profile to recipe association to tell hardware that newly
      added recipe is going to be associated with this profile.
      
      The amount of used profiles depend on the package. To avoid searching
      across not used profile, max profile id value is calculated at init flow.
      The profile is considered as unused when all field vector words in the
      profile are invalid (protocol id 0xff and offset 0x1ff).
      
      Profiles are read from the package section ICE_SID_FLD_VEC_SW. Empty
      field vector words can be used for recipe results. Store all unused field
      vector words in prof_res_bm. It is a 256 elements array (max number of
      profiles) each element is a 48 bit bitmap (max number of field vector
      words).
      
      For now, support only non-tunnel profiles type.
      Co-developed-by: default avatarGrishma Kotecha <grishma.kotecha@intel.com>
      Signed-off-by: default avatarGrishma Kotecha <grishma.kotecha@intel.com>
      Signed-off-by: default avatarDan Nowlin <dan.nowlin@intel.com>
      Signed-off-by: default avatarWojciech Drewek <wojciech.drewek@intel.com>
      Tested-by: default avatarSandeep Penigalapati <sandeep.penigalapati@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      450052a4
    • Grishma Kotecha's avatar
      ice: implement low level recipes functions · 7715ec32
      Grishma Kotecha authored
      Add code to manage recipes and profiles on admin queue layer.
      
      Allow the driver to add a new recipe and update an existing one. Get a
      recipe and get a recipe to profile association is mostly used in update
      existing recipes code.
      
      Only default recipes can be updated. An update is done by reading recipes
      from HW, changing their params and calling add recipe command.
      
      Support following admin queue commands:
      - ice_aqc_opc_add_recipe (0x0290) - create a recipe with protocol
      header information and other details that determine how this recipe
      filter works
      - ice_aqc_opc_recipe_to_profile (0x0291) - associate a switch recipe
      to a profile
      - ice_aqc_opc_get_recipe (0x0292) - get details of an existing recipe
      - ice_aqc_opc_get_recipe_to_profile (0x0293) - get a recipe associated
      with profile ID
      
      Define ICE_AQC_RES_TYPE_RECIPE resource type to hold a switch
      recipe. It is needed when a new switch recipe needs to be created.
      Co-developed-by: default avatarDan Nowlin <dan.nowlin@intel.com>
      Signed-off-by: default avatarDan Nowlin <dan.nowlin@intel.com>
      Signed-off-by: default avatarGrishma Kotecha  <grishma.kotecha@intel.com>
      Signed-off-by: default avatarWojciech Drewek <wojciech.drewek@intel.com>
      Tested-by: default avatarSandeep Penigalapati <sandeep.penigalapati@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      7715ec32
    • Stephen Rothwell's avatar
      ethernet: sun: add missing semicolon, fix build · ce8bd03c
      Stephen Rothwell authored
      Fix for this build problem:
      
      drivers/net/ethernet/sun/ldmvsw.c: In function 'vsw_alloc_netdev':
      drivers/net/ethernet/sun/ldmvsw.c:243:2: error: expected ';' before 'sprintf'
        sprintf(dev->name, "vif%d.%d", (int)handle, (int)port_id);
        ^~~~~~~
      
      Fixes: a7639279 ("ethernet: sun: remove direct netdev->dev_addr writes")
      Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Link: https://lore.kernel.org/r/20211011173424.7743035d@canb.auug.org.auSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ce8bd03c
  2. 10 Oct, 2021 22 commits
  3. 09 Oct, 2021 9 commits
  4. 08 Oct, 2021 2 commits