1. 11 Jun, 2021 36 commits
  2. 10 Jun, 2021 4 commits
    • David S. Miller's avatar
      Merge branch 'ipa-mem-2' · 76cf404c
      David S. Miller authored
      Alex Elder says:
      
      ====================
      net: ipa: memory region rework, part 2
      
      This is the second portion of a set of patches updating the IPA
      memory region code.
      
      In this portion (part 2), the focus is on adjusting the code so that
      it no longer assumes the memory region descriptor array is indexed
      by the region identifier.  This brings with it some related cleanup.
      
      Three loops are changed so their loop index variable is an unsigned
      rather than an enumerated type.
      
      A set of functions is changed so a region identifier (rather than a
      memory region descriptor pointer) is passed as argument, to simplify
      their call sites.  This isn't entirely related or required, but I
      think it improves the code.
      
      A validation function for filter and route table memory regions is
      changed to take memory region IDs, rather than determining which
      region to validate based on a set of Boolean flags.
      
      Finally, ipa_mem_find() is created to abstract getting a memory
      descriptor based on its ID, and it is used everywhere rather than
      indexing the array.  With that implemented, all of the memory
      regions can be defined by arrays of entries defined without
      providing index designators.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      76cf404c
    • Alex Elder's avatar
      net: ipa: don't index mem data array by ID · c61cfb94
      Alex Elder authored
      Finally the code handles the IPA memory region array in the
      configuration data without assuming it is indexed by region ID.
      Get rid of the array index designators where these arrays are
      initialized.  As a result, there's no more need to define an
      explicitly undefined memory region ID, so get rid of that.
      
      Change ipa_mem_find() so it no longer assumes the ipa->mem[] array
      is indexed by memory region ID.  Instead, have it search the array
      for the entry having the requested memory ID, and return the address
      of the descriptor if found.  Otherwise return NULL.
      
      Stop allowing memory regions to be defined with zero size and zero
      canary value.  Check for this condition in ipa_mem_valid_one().
      As a result, it is not necessary to check for this case in
      ipa_mem_config().
      
      Finally, there is no need for IPA_MEM_UNDEFINED to be defined any
      more, so get rid of it.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c61cfb94
    • Alex Elder's avatar
      net: ipa: introduce ipa_mem_find() · 5e3bc1e5
      Alex Elder authored
      Introduce a new function that abstracts finding information about a
      region in IPA-local memory, given its memory region ID.  For now it
      simply uses the region ID as an index into the IPA memory array.
      If the region is not defined, ipa_mem_find() returns a null pointer.
      
      Update all code that accesses the ipa->mem[] array directly to use
      ipa_mem_find() instead.  The return value must be checked for null
      when optional memory regions are sought.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5e3bc1e5
    • Alex Elder's avatar
      net: ipa: pass memory id to ipa_table_valid_one() · e9f5b276
      Alex Elder authored
      Stop passing most of the Boolean flags to ipa_table_valid_one(), and
      just pass a memory region ID to it instead.  We still need to
      indicate whether we're operating on a routing or filter table.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e9f5b276