• Horia Geantă's avatar
    crypto: caam - add Queue Interface (QI) backend support · 67c2315d
    Horia Geantă authored
    CAAM engine supports two interfaces for crypto job submission:
    -job ring interface - already existing caam/jr driver
    -Queue Interface (QI) - caam/qi driver added in current patch
    
    QI is present in CAAM engines found on DPAA platforms.
    QI gets its I/O (frame descriptors) from QMan (Queue Manager) queues.
    
    This patch adds a platform device for accessing CAAM's queue interface.
    The requests are submitted to CAAM using one frame queue per
    cryptographic context. Each crypto context has one shared descriptor.
    This shared descriptor is attached to frame queue associated with
    corresponding driver context using context_a.
    
    The driver hides the mechanics of FQ creation, initialisation from its
    applications. Each cryptographic context needs to be associated with
    driver context which houses the FQ to be used to transport the job to
    CAAM. The driver provides API for:
    (a) Context creation
    (b) Job submission
    (c) Context deletion
    (d) Congestion indication - whether path to/from CAAM is congested
    
    The driver supports affining its context to a particular CPU.
    This means that any responses from CAAM for the context in question
    would arrive at the given CPU. This helps in implementing one CPU
    per packet round trip in IPsec application.
    
    The driver processes CAAM responses under NAPI contexts.
    NAPI contexts are instantiated only on cores with affined portals since
    only cores having their own portal can receive responses from DQRR.
    
    The responses from CAAM for all cryptographic contexts ride on a fixed
    set of FQs. We use one response FQ per portal owning core. The response
    FQ is configured in each core's and thus portal's dedicated channel.
    This gives the flexibility to direct CAAM's responses for a crypto
    context on a given core.
    Signed-off-by: default avatarVakul Garg <vakul.garg@nxp.com>
    Signed-off-by: default avatarAlex Porosanu <alexandru.porosanu@nxp.com>
    Signed-off-by: default avatarHoria Geantă <horia.geanta@nxp.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    67c2315d
qi.c 20.2 KB