This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, api-next has been updated via d4b364849c4abb4c71e0c5260e1a793ebb8dc97d (commit) via 4ddb329e3ed4401c9e5ebd42a2e54af28a1c4df6 (commit) via 0d50939e19104a179af57de555c35d209e5d7ae6 (commit) from f052591a39aa7c08d4868face4e6be17696ee946 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit d4b364849c4abb4c71e0c5260e1a793ebb8dc97d Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Sun Nov 12 17:15:05 2017 +0300
validation: crypto: check error flag being set
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index fdc0db8e..87f0ed93 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -203,6 +203,9 @@ static int alg_packet_op(odp_packet_t pkt, return rc; }
+ if (!result.ok) + CU_ASSERT(odp_packet_has_error(pkt)); + *ok = result.ok;
return 0; @@ -272,6 +275,8 @@ static int alg_packet_op_enq(odp_packet_t pkt, return rc; }
+ CU_ASSERT((!odp_packet_has_error(pkt)) == result.ok); + *ok = result.ok;
return 0;
commit 4ddb329e3ed4401c9e5ebd42a2e54af28a1c4df6 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Sun Nov 12 17:13:44 2017 +0300
linux-gen: crypto: set packet error flag depending on crypto result operation
To speed up fast path of crypto packet operations, set error flag depending on the crypto result operation. This allows applications to fast-forward packets w/o errors and inspect crypto result only for erroneous packets.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index 1ebe4690..6506a1db 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -55,6 +55,7 @@ typedef union { uint32_t udp_err:1; /**< UDP error, checks TBD */ uint32_t l4_chksum:1; /**< L4 checksum error */ uint32_t ipsec_err:1; /**< IPsec error */ + uint32_t crypto_err:1; /**< Crypto packet operation error */ }; } error_flags_t;
diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 2fc611ed..67dd3249 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -1309,6 +1309,7 @@ int odp_crypto_int(odp_packet_t pkt_in, odp_bool_t allocated = false; odp_packet_t out_pkt = *pkt_out; odp_crypto_packet_result_t *op_result; + odp_packet_hdr_t *pkt_hdr;
session = (odp_crypto_generic_session_t *)(intptr_t)param->session;
@@ -1362,6 +1363,9 @@ int odp_crypto_int(odp_packet_t pkt_in, (rc_cipher == ODP_CRYPTO_ALG_ERR_NONE) && (rc_auth == ODP_CRYPTO_ALG_ERR_NONE);
+ pkt_hdr = odp_packet_hdr(out_pkt); + pkt_hdr->p.error_flags.crypto_err = !op_result->ok; + /* Synchronous, simply return results */ *pkt_out = out_pkt;
commit 0d50939e19104a179af57de555c35d209e5d7ae6 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Sun Nov 12 17:13:05 2017 +0300
linux-gen: crypto: drop extra memcpy on result return
There is no need to fill local struct and then copy it to packet. Just fill packet data directly, saving one memcpy call.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 6d0ad709..2fc611ed 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -1306,7 +1306,6 @@ int odp_crypto_int(odp_packet_t pkt_in, odp_crypto_alg_err_t rc_cipher = ODP_CRYPTO_ALG_ERR_NONE; odp_crypto_alg_err_t rc_auth = ODP_CRYPTO_ALG_ERR_NONE; odp_crypto_generic_session_t *session; - odp_crypto_packet_result_t local_result; odp_bool_t allocated = false; odp_packet_t out_pkt = *pkt_out; odp_crypto_packet_result_t *op_result; @@ -1352,18 +1351,16 @@ int odp_crypto_int(odp_packet_t pkt_in, }
/* Fill in result */ - local_result.cipher_status.alg_err = rc_cipher; - local_result.cipher_status.hw_err = ODP_CRYPTO_HW_ERR_NONE; - local_result.auth_status.alg_err = rc_auth; - local_result.auth_status.hw_err = ODP_CRYPTO_HW_ERR_NONE; - local_result.ok = - (rc_cipher == ODP_CRYPTO_ALG_ERR_NONE) && - (rc_auth == ODP_CRYPTO_ALG_ERR_NONE); - _odp_buffer_event_subtype_set(packet_to_buffer(out_pkt), ODP_EVENT_PACKET_CRYPTO); op_result = get_op_result_from_packet(out_pkt); - *op_result = local_result; + op_result->cipher_status.alg_err = rc_cipher; + op_result->cipher_status.hw_err = ODP_CRYPTO_HW_ERR_NONE; + op_result->auth_status.alg_err = rc_auth; + op_result->auth_status.hw_err = ODP_CRYPTO_HW_ERR_NONE; + op_result->ok = + (rc_cipher == ODP_CRYPTO_ALG_ERR_NONE) && + (rc_auth == ODP_CRYPTO_ALG_ERR_NONE);
/* Synchronous, simply return results */ *pkt_out = out_pkt;
-----------------------------------------------------------------------
Summary of changes: .../linux-generic/include/odp_packet_internal.h | 1 + platform/linux-generic/odp_crypto.c | 21 +++++++++++---------- test/validation/api/crypto/odp_crypto_test_inp.c | 5 +++++ 3 files changed, 17 insertions(+), 10 deletions(-)
hooks/post-receive