Skip to contentSkip to conversation

crypto/qat: fix build

PATCH Applied Thomas Monjalon 5 participants 13 messages Dec 30, 2022 – Jan 12, 2023 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto/qat: fix build

When trying to compile on a fresh system, I hit this error:

intel-ipsec-mb.h:333: error: "AES_BLOCK_SIZE" redefined
333 | #define AES_BLOCK_SIZE IMB_AES_BLOCK_SIZE
In file included from drivers/crypto/qat/qat_sym_session.c:8:
/usr/include/openssl/aes.h:26: previous definition
26 | # define AES_BLOCK_SIZE 16

I don't know why it was not seen before.
Is it because of a change in intel-ipsec-mb.h or in OpenSSL?

---
 drivers/crypto/qat/qat_sym_session.c | 1 +
 1 file changed, 1 insertion(+)
drivers/crypto/qat/qat_sym_session.c +1 -0
index 0ebc66f89e..37bde297c0 100644
@@ -10,6 +10,7 @@
 #include <openssl/evp.h>	/* Needed for bpi runt block processing */
 
 #ifdef RTE_QAT_LIBIPSECMB
+#undef AES_BLOCK_SIZE
 #if defined(RTE_ARCH_ARM)
 #include <ipsec-mb.h>
 #else
Signature · 1 line
2.39.0
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Thomas Monjalon

When trying to compile on a fresh system, I hit this error:

intel-ipsec-mb.h:333: error: "AES_BLOCK_SIZE" redefined
333 | #define AES_BLOCK_SIZE IMB_AES_BLOCK_SIZE
In file included from drivers/crypto/qat/qat_sym_session.c:8:
/usr/include/openssl/aes.h:26: previous definition
26 | # define AES_BLOCK_SIZE 16

Quoted 5 lines

I don't know why it was not seen before.
Is it because of a change in intel-ipsec-mb.h or in OpenSSL?

---

owners of intel-ipsec-mb.h should guard against the namespace conflict...

Applied
#2 lore raw
Quoted 12 lines · Thomas Monjalon
Quoted 11 lines

When trying to compile on a fresh system, I hit this error:

intel-ipsec-mb.h:333: error: "AES_BLOCK_SIZE" redefined
333 | #define AES_BLOCK_SIZE IMB_AES_BLOCK_SIZE
In file included from drivers/crypto/qat/qat_sym_session.c:8:
/usr/include/openssl/aes.h:26: previous definition
26 | # define AES_BLOCK_SIZE 16

I don't know why it was not seen before.
Is it because of a change in intel-ipsec-mb.h or in OpenSSL?

Quoted 7 lines
Quoted 2 lines

---

owners of intel-ipsec-mb.h should guard against the namespace conflict...

Applied to dpdk-next-crypto

Thanks.

#3 lore raw

04/01/2023 12:56, Akhil Goyal:

Quoted 15 lines
Quoted 15 lines · Thomas Monjalon
Quoted 13 lines

When trying to compile on a fresh system, I hit this error:

intel-ipsec-mb.h:333: error: "AES_BLOCK_SIZE" redefined
333 | #define AES_BLOCK_SIZE IMB_AES_BLOCK_SIZE
In file included from drivers/crypto/qat/qat_sym_session.c:8:
/usr/include/openssl/aes.h:26: previous definition
26 | # define AES_BLOCK_SIZE 16

I don't know why it was not seen before.
Is it because of a change in intel-ipsec-mb.h or in OpenSSL?

---

Quoted 8 lines
Quoted 4 lines

owners of intel-ipsec-mb.h should guard against the namespace conflict...

Applied to dpdk-next-crypto

Thanks.

I'm concerned to have no answer from Pablo and Kai.
It is real design problem. Is there any plan to have a protected namespace?

#4 lore raw

Waiting for an answer here.
The commit log is not supposed to stay like this with questions.

11/01/2023 10:03, Thomas Monjalon:

Quoted 22 lines

04/01/2023 12:56, Akhil Goyal:

Quoted 21 lines
Quoted 12 lines · Thomas Monjalon
Quoted 11 lines

When trying to compile on a fresh system, I hit this error:

intel-ipsec-mb.h:333: error: "AES_BLOCK_SIZE" redefined
333 | #define AES_BLOCK_SIZE IMB_AES_BLOCK_SIZE
In file included from drivers/crypto/qat/qat_sym_session.c:8:
/usr/include/openssl/aes.h:26: previous definition
26 | # define AES_BLOCK_SIZE 16

I don't know why it was not seen before.
Is it because of a change in intel-ipsec-mb.h or in OpenSSL?

Quoted 7 lines
Quoted 2 lines

---

owners of intel-ipsec-mb.h should guard against the namespace conflict...

Applied to dpdk-next-crypto

If there is no better fix, we should at least add Cc: [email protected] assuming it could be reproduced with an older DPDK.

Quoted 5 lines
Quoted 2 lines

Thanks.

I'm concerned to have no answer from Pablo and Kai.
It is real design problem. Is there any plan to have a protected namespace?

#5 lore raw

Ok, a long story short, this issue should only occurred when RTE_QAT_LIBIPSECMB is enabled.
It was intend to remove Openssl lib dependency in QAT replaced with ipsec_mb lib, but the work was partially done due to limitation of ipsec_mb by the time (FIPS certification)

I'm happy with current fix and please cc: [email protected]
The fully removal of Openssl dependency is already ongoing, I will take a note to fix this properly

Regards

Kai

Quoted 50 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Wednesday, January 11, 2023 11:21 PM
To: Ji, Kai <[email protected]>; De Lara Guarch, Pablo <[email protected]>; Akhil Goyal <[email protected]>
Cc: [email protected]; Tyler Retzlaff <[email protected]>; [email protected]; David Marchand <[email protected]>; Dooley, Brian <[email protected]>; Power, Ciara <[email protected]>; Mcnamara, John <[email protected]>
Subject: Re: [PATCH] crypto/qat: fix build

Waiting for an answer here.
The commit log is not supposed to stay like this with questions.

11/01/2023 10:03, Thomas Monjalon:

Quoted 22 lines

04/01/2023 12:56, Akhil Goyal:

Quoted 21 lines
Quoted 12 lines · Thomas Monjalon
Quoted 11 lines

When trying to compile on a fresh system, I hit this error:

intel-ipsec-mb.h:333: error: "AES_BLOCK_SIZE" redefined
333 | #define AES_BLOCK_SIZE IMB_AES_BLOCK_SIZE
In file included from drivers/crypto/qat/qat_sym_session.c:8:
/usr/include/openssl/aes.h:26: previous definition
26 | # define AES_BLOCK_SIZE 16

I don't know why it was not seen before.
Is it because of a change in intel-ipsec-mb.h or in OpenSSL?

Quoted 7 lines
Quoted 2 lines

---

owners of intel-ipsec-mb.h should guard against the namespace conflict...

Applied to dpdk-next-crypto

If there is no better fix, we should at least add Cc: [email protected] assuming it could be reproduced with an older DPDK.

Quoted 5 lines
Quoted 2 lines

Thanks.

I'm concerned to have no answer from Pablo and Kai.
It is real design problem. Is there any plan to have a protected

namespace?

#6 lore raw

12/01/2023 11:32, Ji, Kai:

Quoted 4 lines

Ok, a long story short, this issue should only occurred when RTE_QAT_LIBIPSECMB is enabled.
It was intend to remove Openssl lib dependency in QAT replaced with ipsec_mb lib, but the work was partially done due to limitation of ipsec_mb by the time (FIPS certification)

I'm happy with current fix and please cc: [email protected]

I'm not happy with this fix. It is a dirty workaround. It would be better to have an #ifdef in ipsec_mb.

Also I would like an answer to the question below. What triggered this error? Is it a new thing in the lib ipsec_mb?
Why defining AES_BLOCK_SIZE while IMB_AES_BLOCK_SIZE can be used and have a proper prefix?

Quoted 46 lines

The fully removal of Openssl dependency is already ongoing, I will take a note to fix this properly

Regards

Kai

Quoted 40 lines

From: Thomas Monjalon <[email protected]>
Subject: Re: [PATCH] crypto/qat: fix build

Waiting for an answer here.
The commit log is not supposed to stay like this with questions.

11/01/2023 10:03, Thomas Monjalon:

Quoted 22 lines

04/01/2023 12:56, Akhil Goyal:

Quoted 21 lines
Quoted 12 lines · Thomas Monjalon
Quoted 11 lines

When trying to compile on a fresh system, I hit this error:

intel-ipsec-mb.h:333: error: "AES_BLOCK_SIZE" redefined
333 | #define AES_BLOCK_SIZE IMB_AES_BLOCK_SIZE
In file included from drivers/crypto/qat/qat_sym_session.c:8:
/usr/include/openssl/aes.h:26: previous definition
26 | # define AES_BLOCK_SIZE 16

I don't know why it was not seen before.
Is it because of a change in intel-ipsec-mb.h or in OpenSSL?

Quoted 7 lines
Quoted 2 lines

---

owners of intel-ipsec-mb.h should guard against the namespace conflict...

Applied to dpdk-next-crypto

If there is no better fix, we should at least add Cc: [email protected] assuming it could be reproduced with an older DPDK.

Quoted 5 lines
Quoted 2 lines

Thanks.

I'm concerned to have no answer from Pablo and Kai.
It is real design problem. Is there any plan to have a protected

namespace?

#7 lore raw

Hi Thomas,

Quoted 20 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Thursday, January 12, 2023 10:41 AM
To: De Lara Guarch, Pablo <[email protected]>; Akhil Goyal <[email protected]>; Ji, Kai <[email protected]>
Cc: [email protected]; Tyler Retzlaff <[email protected]>; [email protected]; David Marchand <[email protected]>; Dooley, Brian <[email protected]>; Power, Ciara <[email protected]>; Mcnamara, John <[email protected]>
Subject: Re: [PATCH] crypto/qat: fix build

12/01/2023 11:32, Ji, Kai:

Quoted 1 line

Ok, a long story short, this issue should only occurred when

RTE_QAT_LIBIPSECMB is enabled.

Quoted 5 lines

It was intend to remove Openssl lib dependency in QAT replaced with ipsec_mb lib, but the work was partially done due to limitation of ipsec_mb by the time (FIPS certification)

I'm happy with current fix and please cc: [email protected]

Quoted 7 lines

I'm not happy with this fix. It is a dirty workaround. It would be better to have an #ifdef in ipsec_mb.

Also I would like an answer to the question below. What triggered this error? Is it a new thing in the lib ipsec_mb?
Why defining AES_BLOCK_SIZE while IMB_AES_BLOCK_SIZE can be used and have a proper prefix?

Apologies for the late response.

This macro was renamed to IMB_AES_BLOCK_SIZE, as you already know.
The problem is that, for compatibility reasons, we had to keep the old macro as well. However, we added a compile time flag to remove these legacy macros, for exactly this reason (NO_COMPAT_IMB_API_053).

I think a solution could be to use this flag in QAT, so the legacy macros are not defined.

I will send a patch to fix this.

Thanks,
Pablo

Quoted 1 line
#8 lore raw

12/01/2023 14:22, De Lara Guarch, Pablo:

Quoted 22 lines

Hi Thomas,

From: Thomas Monjalon <[email protected]>

Quoted 9 lines

12/01/2023 11:32, Ji, Kai:

Quoted 1 line

Ok, a long story short, this issue should only occurred when

RTE_QAT_LIBIPSECMB is enabled.

Quoted 5 lines

It was intend to remove Openssl lib dependency in QAT replaced with ipsec_mb lib, but the work was partially done due to limitation of ipsec_mb by the time (FIPS certification)

I'm happy with current fix and please cc: [email protected]

Quoted 7 lines

I'm not happy with this fix. It is a dirty workaround. It would be better to have an #ifdef in ipsec_mb.

Also I would like an answer to the question below. What triggered this error? Is it a new thing in the lib ipsec_mb?
Why defining AES_BLOCK_SIZE while IMB_AES_BLOCK_SIZE can be used and have a proper prefix?

Apologies for the late response.

Quoted 8 lines

This macro was renamed to IMB_AES_BLOCK_SIZE, as you already know.
The problem is that, for compatibility reasons, we had to keep the old macro as well. However, we added a compile time flag to remove these legacy macros, for exactly this reason (NO_COMPAT_IMB_API_053).

I think a solution could be to use this flag in QAT, so the legacy macros are not defined.

I will send a patch to fix this.

OK good, so we can reject this patch?

#9 lore raw
Quoted 44 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Thursday, January 12, 2023 3:00 PM
To: Akhil Goyal <[email protected]>; Ji, Kai <[email protected]>; De Lara Guarch, Pablo <[email protected]>
Cc: [email protected]; Tyler Retzlaff <[email protected]>; [email protected]; David Marchand <[email protected]>; Dooley, Brian <[email protected]>; Power, Ciara <[email protected]>; Mcnamara, John <[email protected]>
Subject: Re: [PATCH] crypto/qat: fix build

12/01/2023 14:22, De Lara Guarch, Pablo:

Quoted 16 lines

Hi Thomas,

From: Thomas Monjalon <[email protected]>

Quoted 13 lines

12/01/2023 11:32, Ji, Kai:

Quoted 1 line

Ok, a long story short, this issue should only occurred when

RTE_QAT_LIBIPSECMB is enabled.

Quoted 5 lines

It was intend to remove Openssl lib dependency in QAT replaced with ipsec_mb lib, but the work was partially done due to limitation of ipsec_mb by the time (FIPS certification)

I'm happy with current fix and please cc: [email protected]

I'm not happy with this fix. It is a dirty workaround. It would be better to have an #ifdef in ipsec_mb.

Also I would like an answer to the question below. What triggered this

error?

Quoted 2 lines
Quoted 2 lines

Is it a new thing in the lib ipsec_mb?
Why defining AES_BLOCK_SIZE while IMB_AES_BLOCK_SIZE can be used

and

Quoted 6 lines
Quoted 1 line

have a proper prefix?

Apologies for the late response.

This macro was renamed to IMB_AES_BLOCK_SIZE, as you already know. The problem is that, for compatibility reasons, we had to keep the old

macro as well.

Quoted 3 lines

However, we added a compile time flag to remove these legacy macros, for exactly this reason (NO_COMPAT_IMB_API_053).

Quoted 7 lines
Quoted 1 line

I think a solution could be to use this flag in QAT, so the legacy macros are

not defined.

Quoted 2 lines

I will send a patch to fix this.

OK good, so we can reject this patch?

Well, this patch is merged already, but mine will revert it and add the new flag (pointing at the other commit to be fixed), so that should be OK, right?

#10 lore raw

12/01/2023 17:16, De Lara Guarch, Pablo:

Quoted 35 lines

From: Thomas Monjalon <[email protected]>

Quoted 34 lines

12/01/2023 14:22, De Lara Guarch, Pablo:

Quoted 16 lines

Hi Thomas,

From: Thomas Monjalon <[email protected]>

Quoted 13 lines

12/01/2023 11:32, Ji, Kai:

Quoted 1 line

Ok, a long story short, this issue should only occurred when

RTE_QAT_LIBIPSECMB is enabled.

Quoted 5 lines

It was intend to remove Openssl lib dependency in QAT replaced with ipsec_mb lib, but the work was partially done due to limitation of ipsec_mb by the time (FIPS certification)

I'm happy with current fix and please cc: [email protected]

I'm not happy with this fix. It is a dirty workaround. It would be better to have an #ifdef in ipsec_mb.

Also I would like an answer to the question below. What triggered this

error?

Quoted 2 lines
Quoted 2 lines

Is it a new thing in the lib ipsec_mb?
Why defining AES_BLOCK_SIZE while IMB_AES_BLOCK_SIZE can be used

and

Quoted 6 lines
Quoted 1 line

have a proper prefix?

Apologies for the late response.

This macro was renamed to IMB_AES_BLOCK_SIZE, as you already know. The problem is that, for compatibility reasons, we had to keep the old

macro as well.

Quoted 4 lines

However, we added a compile time flag to remove these legacy macros, for exactly this reason (NO_COMPAT_IMB_API_053).

I think a solution could be to use this flag in QAT, so the legacy macros are

not defined.

Quoted 1 line
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

I will send a patch to fix this.

OK good, so we can reject this patch?

Well, this patch is merged already, but mine will revert it and add the new flag (pointing at the other commit to be fixed), so that should be OK, right?

The patch was merged in the crypto tree but we can discard it. Akhil, please remove this patch from your tree, thanks.

#11 lore raw
Quoted 38 lines

12/01/2023 17:16, De Lara Guarch, Pablo:

Quoted 37 lines

From: Thomas Monjalon <[email protected]>

Quoted 36 lines

12/01/2023 14:22, De Lara Guarch, Pablo:

Quoted 16 lines

Hi Thomas,

From: Thomas Monjalon <[email protected]>

Quoted 13 lines

12/01/2023 11:32, Ji, Kai:

Quoted 1 line

Ok, a long story short, this issue should only occurred when

RTE_QAT_LIBIPSECMB is enabled.

Quoted 5 lines

It was intend to remove Openssl lib dependency in QAT replaced with ipsec_mb lib, but the work was partially done due to limitation of ipsec_mb by the time (FIPS certification)

I'm happy with current fix and please cc: [email protected]

I'm not happy with this fix. It is a dirty workaround. It would be better to have an #ifdef in ipsec_mb.

Also I would like an answer to the question below. What triggered this

error?

Quoted 2 lines
Quoted 2 lines

Is it a new thing in the lib ipsec_mb?
Why defining AES_BLOCK_SIZE while IMB_AES_BLOCK_SIZE can be used

and

Quoted 6 lines
Quoted 1 line

have a proper prefix?

Apologies for the late response.

This macro was renamed to IMB_AES_BLOCK_SIZE, as you already know. The problem is that, for compatibility reasons, we had to keep the old

macro as well.

Quoted 4 lines

However, we added a compile time flag to remove these legacy macros, for exactly this reason (NO_COMPAT_IMB_API_053).

I think a solution could be to use this flag in QAT, so the legacy macros are

not defined.

Quoted 2 lines

I will send a patch to fix this.

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

OK good, so we can reject this patch?

Well, this patch is merged already, but mine will revert it and add the new flag (pointing at the other commit to be fixed), so that should be OK, right?

The patch was merged in the crypto tree but we can discard it. Akhil, please remove this patch from your tree, thanks.

Done.

#12 lore raw
In reply to De Lara Guarch, Pablo
Quoted 30 lines · Pablo

Hi Thomas,

Quoted 20 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Thursday, January 12, 2023 10:41 AM
To: De Lara Guarch, Pablo <[email protected]>; Akhil Goyal <[email protected]>; Ji, Kai <[email protected]>
Cc: [email protected]; Tyler Retzlaff <[email protected]>; [email protected]; David Marchand <[email protected]>; Dooley, Brian <[email protected]>; Power, Ciara <[email protected]>; Mcnamara, John <[email protected]>
Subject: Re: [PATCH] crypto/qat: fix build

12/01/2023 11:32, Ji, Kai:

Quoted 1 line

Ok, a long story short, this issue should only occurred when

RTE_QAT_LIBIPSECMB is enabled.

Quoted 5 lines

It was intend to remove Openssl lib dependency in QAT replaced with ipsec_mb lib, but the work was partially done due to limitation of ipsec_mb by the time (FIPS certification)

I'm happy with current fix and please cc: [email protected]

Quoted 7 lines

I'm not happy with this fix. It is a dirty workaround. It would be better to have an #ifdef in ipsec_mb.

Also I would like an answer to the question below. What triggered this error? Is it a new thing in the lib ipsec_mb?
Why defining AES_BLOCK_SIZE while IMB_AES_BLOCK_SIZE can be used and have a proper prefix?

Quoted 4 lines

Apologies for the late response.

This macro was renamed to IMB_AES_BLOCK_SIZE, as you already know.
The problem is that, for compatibility reasons, we had to keep the old macro as well.

doesn't this mean the compat could have been retained with a simple check?

#ifndef AES_BLOCK_SIZE
#define AES_BLOCK_SIZE IMB_AES_BLOCK_SIZE
#endif

anyway, you can ignore this comment if you already worked out a solution on the mail thread.