• Marco Chiappero's avatar
    crypto: qat - support fast ACKs in the PFVF protocol · 73ef8f33
    Marco Chiappero authored
    The original design and current implementation of the PFVF protocol
    expects the sender to both acquire and relinquish the ownership of the
    shared CSR by setting and clearing the "in use" pattern on the remote
    half of the register when sending a message. This happens regardless of
    the acknowledgment of the reception, to guarantee changes, including
    collisions, are surely detected.
    
    However, in the case of a request that requires a response, collisions
    can also be detected by the lack of a reply. This can be exploited to
    speed up and simplify the above behaviour, letting the receiver both
    acknowledge the message and release the CSR in a single transaction:
    
    1) the sender can return as soon as the message has been acknowledged
    2) the receiver doesn't have to wait long before acquiring ownership
    of the CSR for the response message, greatly improving the overall
    throughput.
    
    Howerver, this improvement cannot be leveraged for fire-and-forget
    notifications, as it would be impossible for the sender to clearly
    distinguish between a collision and an ack immediately followed by a new
    message.
    
    This patch implements this optimization in a new version of the protocol
    (v3), which applies the fast-ack logic only whenever possible and
    guarantees backward compatibility with older versions. For requests, a
    new retry loop guarantees a correct behaviour.
    Signed-off-by: default avatarMarco Chiappero <marco.chiappero@intel.com>
    Reviewed-by: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
    Reviewed-by: default avatarFiona Trahe <fiona.trahe@intel.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    73ef8f33
adf_pfvf_pf_proto.c 8.64 KB