1. 11 Oct, 2021 4 commits
    • 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 5 commits