Skip to content
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 v3] linux-dpdk: crypto: properly sort crypto capabilities #51

Closed
wants to merge 1 commit into from

Conversation

lumag
Copy link
Contributor

@lumag lumag commented Jul 19, 2018

ODP API specifies that cipher & auth capabilities are returned sorted.
Currently it is not the case, capabilities of different crypto devices
are just concatenated together. Sort them according to the API spec and
remove duplicates.

Signed-off-by: Dmitry Eremin-Solenikov [email protected]

@muvarov muvarov changed the title linux-dpdk: crypto: properly sort crypto capabilities [PATCH v1] linux-dpdk: crypto: properly sort crypto capabilities Jul 19, 2018
@MatiasElo
Copy link
Contributor

Checkpatch still throws some minor warnings and most of the crypto validations tests fail with a QAT card:

Suite: odp_crypto_sync_inp
  Test: crypto_test_enc_alg_null ...passed
  Test: crypto_test_dec_alg_null ...passed
  Test: crypto_test_enc_alg_3des_cbc ...FAILED
    1. odp_crypto_test_inp.c:553  - rc == cipher_num
  Test: crypto_test_dec_alg_3des_cbc ...FAILED
    1. odp_crypto_test_inp.c:553  - rc == cipher_num
  Test: crypto_test_enc_alg_3des_cbc_ovr_iv ...FAILED
    1. odp_crypto_test_inp.c:553  - rc == cipher_num
  Test: crypto_test_dec_alg_3des_cbc_ovr_iv ...FAILED
    1. odp_crypto_test_inp.c:553  - rc == cipher_num
  Test: crypto_test_enc_alg_aes_cbc ...FAILED
    1. odp_crypto_test_inp.c:553  - rc == cipher_num
  Test: crypto_test_dec_alg_aes_cbc ...FAILED
    1. odp_crypto_test_inp.c:553  - rc == cipher_num
  Test: crypto_test_enc_alg_aes_cbc_ovr_iv ...FAILED
    1. odp_crypto_test_inp.c:553  - rc == cipher_num
  Test: crypto_test_dec_alg_aes_cbc_ovr_iv ...FAILED
    1. odp_crypto_test_inp.c:553  - rc == cipher_num
...

@MatiasElo
Copy link
Contributor

Cipher debug:

Test: crypto_test_enc_alg_3des_cbc ...
          RC: 2
  CIPHER_NUM: 4
FAILED
    1. odp_crypto_test_inp.c:557  - rc == cipher_num
  Test: crypto_test_dec_alg_3des_cbc ...
          RC: 2
  CIPHER_NUM: 4
FAILED
    1. odp_crypto_test_inp.c:557  - rc == cipher_num
  Test: crypto_test_enc_alg_3des_cbc_ovr_iv ...
          RC: 2
  CIPHER_NUM: 4
FAILED
    1. odp_crypto_test_inp.c:557  - rc == cipher_num
  Test: crypto_test_dec_alg_3des_cbc_ovr_iv ...
          RC: 2
  CIPHER_NUM: 4
FAILED
    1. odp_crypto_test_inp.c:557  - rc == cipher_num
  Test: crypto_test_enc_alg_aes_cbc ...
          RC: 3
  CIPHER_NUM: 6
FAILED
    1. odp_crypto_test_inp.c:557  - rc == cipher_num

Auth:

Test: crypto_test_gen_alg_hmac_md5 ...
        RC: 16
  AUTH_NUM: 32
FAILED
    1. odp_crypto_test_inp.c:564  - rc == auth_num
  Test: crypto_test_check_alg_hmac_md5 ...
        RC: 16
  AUTH_NUM: 32
FAILED
    1. odp_crypto_test_inp.c:564  - rc == auth_num
  Test: crypto_test_gen_alg_hmac_sha1 ...
        RC: 20
  AUTH_NUM: 40
FAILED
    1. odp_crypto_test_inp.c:564  - rc == auth_num
  Test: crypto_test_check_alg_hmac_sha1 ...
        RC: 20
  AUTH_NUM: 40
FAILED
    1. odp_crypto_test_inp.c:564  - rc == auth_num
  Test: crypto_test_gen_alg_hmac_sha256 ...
        RC: 32
  AUTH_NUM: 64
FAILED

@lumag
Copy link
Contributor Author

lumag commented Jul 20, 2018

@MatiasElo @psavol @Bill-Fischofer-Linaro
Oh, I now understand, why this now fails. Previously it was easy to count 'Number of capability structures', because we just concatenated them. With this pach I've tried to remove duplicate capabilities (which is logical), but now it is not that easy to estimate number of caps in case of input array overflowing (because some caps might be removed, but we can not really calculate that in advance).
I might split this into several patches:

  • Just sort caps (and do not drop anything)
  • Drop duplicates (this PR)
  • Try to merge AAD fields (not implemented yet).

@muvarov muvarov changed the title [PATCH v1] linux-dpdk: crypto: properly sort crypto capabilities [PATCH v2] linux-dpdk: crypto: properly sort crypto capabilities Jul 23, 2018
@lumag
Copy link
Contributor Author

lumag commented Jul 23, 2018

@MatiasElo @psavol I've updated PR to include all capabilities (in other words, include duplicates). This should fix testing with QAT card. Also I've opened issue OpenDataPlane/odp#652 to further discuss this.

@MatiasElo
Copy link
Contributor

I've updated PR to include all capabilities (in other words, include duplicates). This should fix testing with QAT card. Also I've opened issue OpenDataPlane/odp#652 to further discuss this.

@lumag The patch works now with QAT cards. Please fix the remaining checkpatch warnings and I'll add reviewed tag.

ODP API specifies that cipher & auth capabilities are returned sorted.
Currently it is not the case, capabilities of different crypto devices
are just concatenated together. Sort them according to the API spec and
remove duplicates.

Signed-off-by: Dmitry Eremin-Solenikov <[email protected]>
@muvarov muvarov changed the title [PATCH v2] linux-dpdk: crypto: properly sort crypto capabilities [PATCH v3] linux-dpdk: crypto: properly sort crypto capabilities Jul 23, 2018
@lumag
Copy link
Contributor Author

lumag commented Jul 23, 2018 via email

Copy link
Contributor

@MatiasElo MatiasElo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-and-tested-by: Matias Elo [email protected]

@muvarov
Copy link
Contributor

muvarov commented Jul 24, 2018

Merged.

@muvarov muvarov closed this Jul 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants