Skip to content
Snippets Groups Projects
  1. Jun 15, 2020
  2. May 28, 2020
  3. May 08, 2020
    • Iuliana Prodan's avatar
      crypto: engine - support for batch requests · 8d908226
      Iuliana Prodan authored
      
      Added support for batch requests, per crypto engine.
      A new callback is added, do_batch_requests, which executes a
      batch of requests. This has the crypto_engine structure as argument
      (for cases when more than one crypto-engine is used).
      The crypto_engine_alloc_init_and_set function, initializes
      crypto-engine, but also, sets the do_batch_requests callback.
      On crypto_pump_requests, if do_batch_requests callback is
      implemented in a driver, this will be executed. The link between
      the requests will be done in driver, if possible.
      do_batch_requests is available only if the hardware has support
      for multiple request.
      
      Signed-off-by: default avatarIuliana Prodan <iuliana.prodan@nxp.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      8d908226
    • Iuliana Prodan's avatar
      crypto: engine - support for parallel requests based on retry mechanism · 6a89f492
      Iuliana Prodan authored
      
      Added support for executing multiple requests, in parallel,
      for crypto engine based on a retry mechanism.
      If hardware was unable to execute a backlog request, enqueue it
      back in front of crypto-engine queue, to keep the order
      of requests.
      
      A new variable is added, retry_support (this is to keep the
      backward compatibility of crypto-engine) , which keeps track
      whether the hardware has support for retry mechanism and,
      also, if can run multiple requests.
      
      If do_one_request() returns:
      >= 0: hardware executed the request successfully;
      < 0: this is the old error path. If hardware has support for retry
      mechanism, the request is put back in front of crypto-engine queue.
      For backwards compatibility, if the retry support is not available,
      the crypto-engine will work as before.
      If hardware queue is full (-ENOSPC), requeue request regardless
      of MAY_BACKLOG flag.
      If hardware throws any other error code (like -EIO, -EINVAL,
      -ENOMEM, etc.) only MAY_BACKLOG requests are enqueued back into
      crypto-engine's queue, since the others can be dropped.
      
      The new crypto_engine_alloc_init_and_set function, initializes
      crypto-engine, sets the maximum size for crypto-engine software
      queue (not hardcoded anymore) and the retry_support variable
      is set, by default, to false.
      On crypto_pump_requests(), if do_one_request() returns >= 0,
      a new request is send to hardware, until there is no space in
      hardware and do_one_request() returns < 0.
      
      By default, retry_support is false and crypto-engine will
      work as before - will send requests to hardware,
      one-by-one, on crypto_pump_requests(), and complete it, on
      crypto_finalize_request(), and so on.
      
      To support multiple requests, in each driver, retry_support
      must be set on true, and if do_one_request() returns an error
      the request must not be freed, since it will be enqueued back
      into crypto-engine's queue.
      
      When all drivers, that use crypto-engine now, will be updated for
      retry mechanism, the retry_support variable can be removed.
      
      Signed-off-by: default avatarIuliana Prodan <iuliana.prodan@nxp.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      6a89f492
  4. Nov 17, 2019
  5. Aug 09, 2019
    • Peter Zijlstra's avatar
      crypto: engine - Reduce default RT priority · d13dfae3
      Peter Zijlstra authored
      
      The crypto engine initializes its kworker thread to FIFO-99 (when
      requesting RT priority), reduce this to FIFO-50.
      
      FIFO-99 is the very highest priority available to SCHED_FIFO and
      it not a suitable default; it would indicate the crypto work is the
      most important work on the machine.
      
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: linux-crypto@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      d13dfae3
  6. May 30, 2019
  7. Feb 15, 2018
  8. Jun 19, 2017
  9. Mar 02, 2017
  10. Oct 25, 2016
    • Petr Mladek's avatar
      crypto: engine - Handle the kthread worker using the new API · c4ca2b0b
      Petr Mladek authored
      
      Use the new API to create and destroy the crypto engine kthread
      worker. The API hides some implementation details.
      
      In particular, kthread_create_worker() allocates and initializes
      struct kthread_worker. It runs the kthread the right way
      and stores task_struct into the worker structure.
      
      kthread_destroy_worker() flushes all pending works, stops
      the kthread and frees the structure.
      
      This patch does not change the existing behavior except for
      dynamically allocating struct kthread_worker and storing
      only the pointer of this structure.
      
      It is compile tested only because I did not find an easy
      way how to run the code. Well, it should be pretty safe
      given the nature of the change.
      
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      c4ca2b0b
  11. Oct 11, 2016
    • Petr Mladek's avatar
      kthread: kthread worker API cleanup · 3989144f
      Petr Mladek authored
      A good practice is to prefix the names of functions by the name
      of the subsystem.
      
      The kthread worker API is a mix of classic kthreads and workqueues.  Each
      worker has a dedicated kthread.  It runs a generic function that process
      queued works.  It is implemented as part of the kthread subsystem.
      
      This patch renames the existing kthread worker API to use
      the corresponding name from the workqueues API prefixed by
      kthread_:
      
      __init_kthread_worker()		-> __kthread_init_worker()
      init_kthread_worker()		-> kthread_init_worker()
      init_kthread_work()		-> kthread_init_work()
      insert_kthread_work()		-> kthread_insert_work()
      queue_kthread_work()		-> kthread_queue_work()
      flush_kthread_work()		-> kthread_flush_work()
      flush_kthread_worker()		-> kthread_flush_worker()
      
      Note that the names of DEFINE_KTHREAD_WORK*() macros stay
      as they are. It is common that the "DEFINE_" prefix has
      precedence over the subsystem names.
      
      Note that INIT() macros and init() functions use different
      naming scheme. There is no good solution. There are several
      reasons for this solution:
      
        + "init" in the function names stands for the verb "initialize"
          aka "initialize worker". While "INIT" in the macro names
          stands for the noun "INITIALIZER" aka "worker initializer".
      
        + INIT() macros are used only in DEFINE() macros
      
        + init() functions are used close to the other kthread()
          functions. It looks much better if all the functions
          use the same scheme.
      
        + There will be also kthread_destroy_worker() that will
          be used close to kthread_cancel_work(). It is related
          to the init() function. Again it looks better if all
          functions use the same naming scheme.
      
        + there are several precedents for such init() function
          names, e.g. amd_iommu_init_device(), free_area_init_node(),
          jump_label_init_type(),  regmap_init_mmio_clk(),
      
        + It is not an argument but it was inconsistent even before.
      
      [arnd@arndb.de: fix linux-next merge conflict]
       Link: http://lkml.kernel.org/r/20160908135724.1311726-1-arnd@arndb.de
      Link: http://lkml.kernel.org/r/1470754545-17632-3-git-send-email-pmladek@suse.com
      
      
      Suggested-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: Josh Triplett <josh@joshtriplett.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3989144f
  12. Sep 07, 2016
  13. Feb 01, 2016
Loading