-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PATCH v6] API: Crypto API additions #1910
[PATCH v6] API: Crypto API additions #1910
Conversation
include/odp/api/spec/crypto.h
Outdated
@@ -296,6 +296,17 @@ int odp_crypto_op(const odp_packet_t pkt_in[], | |||
* All arrays should be of num_pkt size, except that pkt_out parameter | |||
* is ignored when the crypto operation type is ODP_CRYPTO_OP_TYPE_BASIC. | |||
* | |||
* From packet ordering perspective this function behaves as if each input | |||
* packet was enqueued to a crypto session specific ODP queue in the order | |||
* the packets appear in the parameter array. The conceptial session input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "conceptial".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v2
include/odp/api/spec/crypto_types.h
Outdated
* | ||
* This flag cannot be set when op_mode is ODP_CRYPTO_SYNC. | ||
* | ||
* The default value is false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"," -> "."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v2
@@ -801,6 +815,14 @@ typedef struct odp_crypto_packet_op_param_t { | |||
*/ | |||
int32_t dst_offset_shift; | |||
|
|||
/** Use null crypto algorithms | |||
* | |||
* Process packet using the null cipher and null auth algorithm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean memcpy need to be done based on ranges?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, just like when you do not have the null_crypto flag set but have configured the session with null crypto.
7ecfebb
to
350a078
Compare
v2: fixed typos and reworded one sentence (...f.lag cannot be set... --> ...flag must be set false...). |
350a078
to
cdbc7d0
Compare
v3: added validation tests and implementation |
cdbc7d0
to
8be02df
Compare
v4: rebased |
ODP spec changes look good. Reviewed-by: Anoob Joseph anoobj@marvell.com |
8be02df
to
fca5f41
Compare
Specify that packet order is preserved within one async crypto session but not between sessions. Specify that ordering is as if there was a session specific input queue to async crypto and then rely on generic ordering rules regarding queue enqueue without trying to specify the rules here. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Anoob Joseph <anoobj@marvell.com>
Add a crypto operation parameter that tells that a packet should be processed as if the configured algorithms were the null cipher and null auth algorithm. This makes it possible to direct packets that do not require crypto through the same crypto session as packets that require the crypto configured in the session. That in turn may be useful in preserving packet order between those packets as there are ordering guarantees in async crypto only within the same crypto session. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Anoob Joseph <anoobj@marvell.com>
Add support for the null_crypto crypto operation parameter. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Veridy that the null_crypto flag causes crypto to be skipped when null_crypto is enabled at session creation and that the flag has no effect otherwise. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Add a default case in a switch statement looking at crypto op types. This avoids a compilation failure due to -Wswitch and -Werror if a new crypto operation type is added in ODP API. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Introduce ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP crypto operation type that allows both basic and out-of-place operations in the same session. The actual operation type applied depends on whether an output packet is specified. This can be useful for applications that want to perform both basic and out-of-place operations with the same crypto and cannot have two different sessions due to memory pressure or packet ordering constraints. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Anoob Joseph <anoobj@marvell.com>
Implement the BASIC_AND_OOP crypto op type which allows both basic and out-of-place operations with the same session. Add the support only for the openssl crypto module as that is now the only one which supports out-of-place crypto. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Test session created with the ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP operation type with both basic and out-of-place operatons. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
fca5f41
to
c9c37d6
Compare
api: crypto: clarify packet ordering of async crypto ops
api: crypto: add null_crypto crypto op flag for skipping crypto
api: crypto: allow both basic and out-of-place ops in one session