* [dpdk-dev] [PATCH] crypto/qat: fix segmentation fault in QAT PMD
@ 2019-04-08 10:48 Bernard Iremonger
2019-04-08 10:48 ` Bernard Iremonger
2019-04-08 12:09 ` Ananyev, Konstantin
0 siblings, 2 replies; 10+ messages in thread
From: Bernard Iremonger @ 2019-04-08 10:48 UTC (permalink / raw)
To: dev, fiona.trahe, konstantin.ananyev, akhil.goyal; +Cc: Bernard Iremonger
While running the IPsec unit test program the following
segmentation fault is occurring:
Thread 1 "test" received signal SIGSEGV, Segmentation fault.
0x0000000000beaece in qat_sym_build_request(in_op=0x0,
out_msg=0x100450580 "", op_cookie=0x101c6fd80, qat_dev_gen=QAT_GEN1)
at /root/dpdk_ipsec_master-1/drivers/crypto/qat/qat_sym.c:165
165 if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op oriented")
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
drivers/crypto/qat/qat_sym.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
index 8801ca5..4a7d11e 100644
--- a/drivers/crypto/qat/qat_sym.c
+++ b/drivers/crypto/qat/qat_sym.c
@@ -162,6 +162,12 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
struct qat_sym_op_cookie *cookie =
(struct qat_sym_op_cookie *)op_cookie;
+ if (op == NULL) {
+ QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto "
+ "operation requests, op (%p) is NULL", op);
+ return -EINVAL;
+ }
+
if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto "
"operation requests, op (%p) is not a "
--
2.7.4
^ permalink raw reply [flat|nested] 10+ messages in thread
* [dpdk-dev] [PATCH] crypto/qat: fix segmentation fault in QAT PMD
2019-04-08 10:48 [dpdk-dev] [PATCH] crypto/qat: fix segmentation fault in QAT PMD Bernard Iremonger
@ 2019-04-08 10:48 ` Bernard Iremonger
2019-04-08 12:09 ` Ananyev, Konstantin
1 sibling, 0 replies; 10+ messages in thread
From: Bernard Iremonger @ 2019-04-08 10:48 UTC (permalink / raw)
To: dev, fiona.trahe, konstantin.ananyev, akhil.goyal; +Cc: Bernard Iremonger
While running the IPsec unit test program the following
segmentation fault is occurring:
Thread 1 "test" received signal SIGSEGV, Segmentation fault.
0x0000000000beaece in qat_sym_build_request(in_op=0x0,
out_msg=0x100450580 "", op_cookie=0x101c6fd80, qat_dev_gen=QAT_GEN1)
at /root/dpdk_ipsec_master-1/drivers/crypto/qat/qat_sym.c:165
165 if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op oriented")
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
drivers/crypto/qat/qat_sym.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
index 8801ca5..4a7d11e 100644
--- a/drivers/crypto/qat/qat_sym.c
+++ b/drivers/crypto/qat/qat_sym.c
@@ -162,6 +162,12 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
struct qat_sym_op_cookie *cookie =
(struct qat_sym_op_cookie *)op_cookie;
+ if (op == NULL) {
+ QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto "
+ "operation requests, op (%p) is NULL", op);
+ return -EINVAL;
+ }
+
if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto "
"operation requests, op (%p) is not a "
--
2.7.4
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] crypto/qat: fix segmentation fault in QAT PMD
2019-04-08 10:48 [dpdk-dev] [PATCH] crypto/qat: fix segmentation fault in QAT PMD Bernard Iremonger
2019-04-08 10:48 ` Bernard Iremonger
@ 2019-04-08 12:09 ` Ananyev, Konstantin
2019-04-08 12:09 ` Ananyev, Konstantin
` (2 more replies)
1 sibling, 3 replies; 10+ messages in thread
From: Ananyev, Konstantin @ 2019-04-08 12:09 UTC (permalink / raw)
To: Iremonger, Bernard, dev, Trahe, Fiona, akhil.goyal
Hi Bernard,
>
> While running the IPsec unit test program the following
> segmentation fault is occurring:
>
> Thread 1 "test" received signal SIGSEGV, Segmentation fault.
> 0x0000000000beaece in qat_sym_build_request(in_op=0x0,
> out_msg=0x100450580 "", op_cookie=0x101c6fd80, qat_dev_gen=QAT_GEN1)
> at /root/dpdk_ipsec_master-1/drivers/crypto/qat/qat_sym.c:165
> 165 if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
>
> Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op oriented")
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
> drivers/crypto/qat/qat_sym.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
> index 8801ca5..4a7d11e 100644
> --- a/drivers/crypto/qat/qat_sym.c
> +++ b/drivers/crypto/qat/qat_sym.c
> @@ -162,6 +162,12 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
> struct qat_sym_op_cookie *cookie =
> (struct qat_sym_op_cookie *)op_cookie;
>
> + if (op == NULL) {
> + QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto "
> + "operation requests, op (%p) is NULL", op);
> + return -EINVAL;
> + }
> +
> if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
> QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto "
> "operation requests, op (%p) is not a "
This is crypto-dev enqueue data-path, if I am not mistaken.
I think in that case it is caller responsibility to make sure that ops[] contain valid crypto-ops
(as in majority of other data-path functions).
Suppose the main question here - why ipsec UT passes NULL as crypto-op here?
Konstantin
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] crypto/qat: fix segmentation fault in QAT PMD
2019-04-08 12:09 ` Ananyev, Konstantin
@ 2019-04-08 12:09 ` Ananyev, Konstantin
2019-04-08 12:31 ` Iremonger, Bernard
2019-04-08 16:29 ` Trahe, Fiona
2 siblings, 0 replies; 10+ messages in thread
From: Ananyev, Konstantin @ 2019-04-08 12:09 UTC (permalink / raw)
To: Iremonger, Bernard, dev, Trahe, Fiona, akhil.goyal
Hi Bernard,
>
> While running the IPsec unit test program the following
> segmentation fault is occurring:
>
> Thread 1 "test" received signal SIGSEGV, Segmentation fault.
> 0x0000000000beaece in qat_sym_build_request(in_op=0x0,
> out_msg=0x100450580 "", op_cookie=0x101c6fd80, qat_dev_gen=QAT_GEN1)
> at /root/dpdk_ipsec_master-1/drivers/crypto/qat/qat_sym.c:165
> 165 if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
>
> Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op oriented")
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
> drivers/crypto/qat/qat_sym.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
> index 8801ca5..4a7d11e 100644
> --- a/drivers/crypto/qat/qat_sym.c
> +++ b/drivers/crypto/qat/qat_sym.c
> @@ -162,6 +162,12 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
> struct qat_sym_op_cookie *cookie =
> (struct qat_sym_op_cookie *)op_cookie;
>
> + if (op == NULL) {
> + QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto "
> + "operation requests, op (%p) is NULL", op);
> + return -EINVAL;
> + }
> +
> if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
> QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto "
> "operation requests, op (%p) is not a "
This is crypto-dev enqueue data-path, if I am not mistaken.
I think in that case it is caller responsibility to make sure that ops[] contain valid crypto-ops
(as in majority of other data-path functions).
Suppose the main question here - why ipsec UT passes NULL as crypto-op here?
Konstantin
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] crypto/qat: fix segmentation fault in QAT PMD
2019-04-08 12:09 ` Ananyev, Konstantin
2019-04-08 12:09 ` Ananyev, Konstantin
@ 2019-04-08 12:31 ` Iremonger, Bernard
2019-04-08 12:31 ` Iremonger, Bernard
2019-04-08 16:29 ` Trahe, Fiona
2 siblings, 1 reply; 10+ messages in thread
From: Iremonger, Bernard @ 2019-04-08 12:31 UTC (permalink / raw)
To: Ananyev, Konstantin, dev, Trahe, Fiona, akhil.goyal
Hi Konstantin,
<snip>
> Subject: RE: [PATCH] crypto/qat: fix segmentation fault in QAT PMD
>
> Hi Bernard,
>
> >
> > While running the IPsec unit test program the following segmentation
> > fault is occurring:
> >
> > Thread 1 "test" received signal SIGSEGV, Segmentation fault.
> > 0x0000000000beaece in qat_sym_build_request(in_op=0x0,
> > out_msg=0x100450580 "", op_cookie=0x101c6fd80,
> qat_dev_gen=QAT_GEN1)
> > at /root/dpdk_ipsec_master-1/drivers/crypto/qat/qat_sym.c:165
> > 165 if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
> >
> > Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op
> > oriented")
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> > drivers/crypto/qat/qat_sym.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/crypto/qat/qat_sym.c
> > b/drivers/crypto/qat/qat_sym.c index 8801ca5..4a7d11e 100644
> > --- a/drivers/crypto/qat/qat_sym.c
> > +++ b/drivers/crypto/qat/qat_sym.c
> > @@ -162,6 +162,12 @@ qat_sym_build_request(void *in_op, uint8_t
> *out_msg,
> > struct qat_sym_op_cookie *cookie =
> > (struct qat_sym_op_cookie *)op_cookie;
> >
> > + if (op == NULL) {
> > + QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto "
> > + "operation requests, op (%p) is NULL", op);
> > + return -EINVAL;
> > + }
> > +
> > if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
> > QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto "
> > "operation requests, op (%p) is not a "
>
> This is crypto-dev enqueue data-path, if I am not mistaken.
> I think in that case it is caller responsibility to make sure that ops[] contain valid
> crypto-ops (as in majority of other data-path functions).
> Suppose the main question here - why ipsec UT passes NULL as crypto-op here?
> Konstantin
I will investigate further.
Regards,
Bernard.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] crypto/qat: fix segmentation fault in QAT PMD
2019-04-08 12:31 ` Iremonger, Bernard
@ 2019-04-08 12:31 ` Iremonger, Bernard
0 siblings, 0 replies; 10+ messages in thread
From: Iremonger, Bernard @ 2019-04-08 12:31 UTC (permalink / raw)
To: Ananyev, Konstantin, dev, Trahe, Fiona, akhil.goyal
Hi Konstantin,
<snip>
> Subject: RE: [PATCH] crypto/qat: fix segmentation fault in QAT PMD
>
> Hi Bernard,
>
> >
> > While running the IPsec unit test program the following segmentation
> > fault is occurring:
> >
> > Thread 1 "test" received signal SIGSEGV, Segmentation fault.
> > 0x0000000000beaece in qat_sym_build_request(in_op=0x0,
> > out_msg=0x100450580 "", op_cookie=0x101c6fd80,
> qat_dev_gen=QAT_GEN1)
> > at /root/dpdk_ipsec_master-1/drivers/crypto/qat/qat_sym.c:165
> > 165 if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
> >
> > Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op
> > oriented")
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> > drivers/crypto/qat/qat_sym.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/crypto/qat/qat_sym.c
> > b/drivers/crypto/qat/qat_sym.c index 8801ca5..4a7d11e 100644
> > --- a/drivers/crypto/qat/qat_sym.c
> > +++ b/drivers/crypto/qat/qat_sym.c
> > @@ -162,6 +162,12 @@ qat_sym_build_request(void *in_op, uint8_t
> *out_msg,
> > struct qat_sym_op_cookie *cookie =
> > (struct qat_sym_op_cookie *)op_cookie;
> >
> > + if (op == NULL) {
> > + QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto "
> > + "operation requests, op (%p) is NULL", op);
> > + return -EINVAL;
> > + }
> > +
> > if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
> > QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto "
> > "operation requests, op (%p) is not a "
>
> This is crypto-dev enqueue data-path, if I am not mistaken.
> I think in that case it is caller responsibility to make sure that ops[] contain valid
> crypto-ops (as in majority of other data-path functions).
> Suppose the main question here - why ipsec UT passes NULL as crypto-op here?
> Konstantin
I will investigate further.
Regards,
Bernard.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] crypto/qat: fix segmentation fault in QAT PMD
2019-04-08 12:09 ` Ananyev, Konstantin
2019-04-08 12:09 ` Ananyev, Konstantin
2019-04-08 12:31 ` Iremonger, Bernard
@ 2019-04-08 16:29 ` Trahe, Fiona
2019-04-08 16:29 ` Trahe, Fiona
2019-04-10 16:21 ` Iremonger, Bernard
2 siblings, 2 replies; 10+ messages in thread
From: Trahe, Fiona @ 2019-04-08 16:29 UTC (permalink / raw)
To: Ananyev, Konstantin, Iremonger, Bernard, dev, akhil.goyal; +Cc: Trahe, Fiona
Hi Bernard, Konstantin,
> -----Original Message-----
> From: Ananyev, Konstantin
> Sent: Monday, April 8, 2019 1:10 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; dev@dpdk.org; Trahe, Fiona
> <fiona.trahe@intel.com>; akhil.goyal@nxp.com
> Subject: RE: [PATCH] crypto/qat: fix segmentation fault in QAT PMD
>
> Hi Bernard,
>
> >
> > While running the IPsec unit test program the following
> > segmentation fault is occurring:
> >
> > Thread 1 "test" received signal SIGSEGV, Segmentation fault.
> > 0x0000000000beaece in qat_sym_build_request(in_op=0x0,
> > out_msg=0x100450580 "", op_cookie=0x101c6fd80, qat_dev_gen=QAT_GEN1)
> > at /root/dpdk_ipsec_master-1/drivers/crypto/qat/qat_sym.c:165
> > 165 if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
> >
> > Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op oriented")
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> > drivers/crypto/qat/qat_sym.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
> > index 8801ca5..4a7d11e 100644
> > --- a/drivers/crypto/qat/qat_sym.c
> > +++ b/drivers/crypto/qat/qat_sym.c
> > @@ -162,6 +162,12 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
> > struct qat_sym_op_cookie *cookie =
> > (struct qat_sym_op_cookie *)op_cookie;
> >
> > + if (op == NULL) {
> > + QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto "
> > + "operation requests, op (%p) is NULL", op);
> > + return -EINVAL;
> > + }
> > +
> > if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
> > QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto "
> > "operation requests, op (%p) is not a "
>
> This is crypto-dev enqueue data-path, if I am not mistaken.
> I think in that case it is caller responsibility to make sure that ops[] contain valid crypto-ops
> (as in majority of other data-path functions).
> Suppose the main question here - why ipsec UT passes NULL as crypto-op here?
> Konstantin
[Fiona] Agree with Konstantin - it's the data-path - we expect a valid op ptr.
Can the real issue be related to the recent addition of asymmetric QAT PMD?
Not all QAT PMDs support symmetric crypto now.
Is IPSec unit test finding a QAT asymm PMD and not checking it's capabilities
or checking but not handling the result well and following a path that passes a NULL op to it?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] crypto/qat: fix segmentation fault in QAT PMD
2019-04-08 16:29 ` Trahe, Fiona
@ 2019-04-08 16:29 ` Trahe, Fiona
2019-04-10 16:21 ` Iremonger, Bernard
1 sibling, 0 replies; 10+ messages in thread
From: Trahe, Fiona @ 2019-04-08 16:29 UTC (permalink / raw)
To: Ananyev, Konstantin, Iremonger, Bernard, dev, akhil.goyal; +Cc: Trahe, Fiona
Hi Bernard, Konstantin,
> -----Original Message-----
> From: Ananyev, Konstantin
> Sent: Monday, April 8, 2019 1:10 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; dev@dpdk.org; Trahe, Fiona
> <fiona.trahe@intel.com>; akhil.goyal@nxp.com
> Subject: RE: [PATCH] crypto/qat: fix segmentation fault in QAT PMD
>
> Hi Bernard,
>
> >
> > While running the IPsec unit test program the following
> > segmentation fault is occurring:
> >
> > Thread 1 "test" received signal SIGSEGV, Segmentation fault.
> > 0x0000000000beaece in qat_sym_build_request(in_op=0x0,
> > out_msg=0x100450580 "", op_cookie=0x101c6fd80, qat_dev_gen=QAT_GEN1)
> > at /root/dpdk_ipsec_master-1/drivers/crypto/qat/qat_sym.c:165
> > 165 if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
> >
> > Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op oriented")
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> > drivers/crypto/qat/qat_sym.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
> > index 8801ca5..4a7d11e 100644
> > --- a/drivers/crypto/qat/qat_sym.c
> > +++ b/drivers/crypto/qat/qat_sym.c
> > @@ -162,6 +162,12 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
> > struct qat_sym_op_cookie *cookie =
> > (struct qat_sym_op_cookie *)op_cookie;
> >
> > + if (op == NULL) {
> > + QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto "
> > + "operation requests, op (%p) is NULL", op);
> > + return -EINVAL;
> > + }
> > +
> > if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
> > QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto "
> > "operation requests, op (%p) is not a "
>
> This is crypto-dev enqueue data-path, if I am not mistaken.
> I think in that case it is caller responsibility to make sure that ops[] contain valid crypto-ops
> (as in majority of other data-path functions).
> Suppose the main question here - why ipsec UT passes NULL as crypto-op here?
> Konstantin
[Fiona] Agree with Konstantin - it's the data-path - we expect a valid op ptr.
Can the real issue be related to the recent addition of asymmetric QAT PMD?
Not all QAT PMDs support symmetric crypto now.
Is IPSec unit test finding a QAT asymm PMD and not checking it's capabilities
or checking but not handling the result well and following a path that passes a NULL op to it?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] crypto/qat: fix segmentation fault in QAT PMD
2019-04-08 16:29 ` Trahe, Fiona
2019-04-08 16:29 ` Trahe, Fiona
@ 2019-04-10 16:21 ` Iremonger, Bernard
2019-04-10 16:21 ` Iremonger, Bernard
1 sibling, 1 reply; 10+ messages in thread
From: Iremonger, Bernard @ 2019-04-10 16:21 UTC (permalink / raw)
To: Trahe, Fiona, Ananyev, Konstantin, dev, akhil.goyal
Hi Fiona,
<snip>
> > Subject: RE: [PATCH] crypto/qat: fix segmentation fault in QAT PMD
> >
> > Hi Bernard,
> >
> > >
> > > While running the IPsec unit test program the following segmentation
> > > fault is occurring:
> > >
> > > Thread 1 "test" received signal SIGSEGV, Segmentation fault.
> > > 0x0000000000beaece in qat_sym_build_request(in_op=0x0,
> > > out_msg=0x100450580 "", op_cookie=0x101c6fd80,
> qat_dev_gen=QAT_GEN1)
> > > at /root/dpdk_ipsec_master-1/drivers/crypto/qat/qat_sym.c:165
> > > 165 if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
> > >
> > > Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op
> > > oriented")
> > > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > > ---
> > > drivers/crypto/qat/qat_sym.c | 6 ++++++
> > > 1 file changed, 6 insertions(+)
> > >
> > > diff --git a/drivers/crypto/qat/qat_sym.c
> > > b/drivers/crypto/qat/qat_sym.c index 8801ca5..4a7d11e 100644
> > > --- a/drivers/crypto/qat/qat_sym.c
> > > +++ b/drivers/crypto/qat/qat_sym.c
> > > @@ -162,6 +162,12 @@ qat_sym_build_request(void *in_op, uint8_t
> *out_msg,
> > > struct qat_sym_op_cookie *cookie =
> > > (struct qat_sym_op_cookie *)op_cookie;
> > >
> > > + if (op == NULL) {
> > > + QAT_DP_LOG(ERR, "QAT PMD only supports symmetric
> crypto "
> > > + "operation requests, op (%p) is NULL", op);
> > > + return -EINVAL;
> > > + }
> > > +
> > > if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
> > > QAT_DP_LOG(ERR, "QAT PMD only supports symmetric
> crypto "
> > > "operation requests, op (%p) is not a "
> >
> > This is crypto-dev enqueue data-path, if I am not mistaken.
> > I think in that case it is caller responsibility to make sure that
> > ops[] contain valid crypto-ops (as in majority of other data-path functions).
> > Suppose the main question here - why ipsec UT passes NULL as crypto-op
> here?
> > Konstantin
> [Fiona] Agree with Konstantin - it's the data-path - we expect a valid op ptr.
> Can the real issue be related to the recent addition of asymmetric QAT PMD?
> Not all QAT PMDs support symmetric crypto now.
> Is IPSec unit test finding a QAT asymm PMD and not checking it's capabilities
> or checking but not handling the result well and following a path that passes a
> NULL op to it?
Self NAK, issue found in test_ipsec code.
Regards,
Bernard.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] crypto/qat: fix segmentation fault in QAT PMD
2019-04-10 16:21 ` Iremonger, Bernard
@ 2019-04-10 16:21 ` Iremonger, Bernard
0 siblings, 0 replies; 10+ messages in thread
From: Iremonger, Bernard @ 2019-04-10 16:21 UTC (permalink / raw)
To: Trahe, Fiona, Ananyev, Konstantin, dev, akhil.goyal
Hi Fiona,
<snip>
> > Subject: RE: [PATCH] crypto/qat: fix segmentation fault in QAT PMD
> >
> > Hi Bernard,
> >
> > >
> > > While running the IPsec unit test program the following segmentation
> > > fault is occurring:
> > >
> > > Thread 1 "test" received signal SIGSEGV, Segmentation fault.
> > > 0x0000000000beaece in qat_sym_build_request(in_op=0x0,
> > > out_msg=0x100450580 "", op_cookie=0x101c6fd80,
> qat_dev_gen=QAT_GEN1)
> > > at /root/dpdk_ipsec_master-1/drivers/crypto/qat/qat_sym.c:165
> > > 165 if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
> > >
> > > Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op
> > > oriented")
> > > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > > ---
> > > drivers/crypto/qat/qat_sym.c | 6 ++++++
> > > 1 file changed, 6 insertions(+)
> > >
> > > diff --git a/drivers/crypto/qat/qat_sym.c
> > > b/drivers/crypto/qat/qat_sym.c index 8801ca5..4a7d11e 100644
> > > --- a/drivers/crypto/qat/qat_sym.c
> > > +++ b/drivers/crypto/qat/qat_sym.c
> > > @@ -162,6 +162,12 @@ qat_sym_build_request(void *in_op, uint8_t
> *out_msg,
> > > struct qat_sym_op_cookie *cookie =
> > > (struct qat_sym_op_cookie *)op_cookie;
> > >
> > > + if (op == NULL) {
> > > + QAT_DP_LOG(ERR, "QAT PMD only supports symmetric
> crypto "
> > > + "operation requests, op (%p) is NULL", op);
> > > + return -EINVAL;
> > > + }
> > > +
> > > if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
> > > QAT_DP_LOG(ERR, "QAT PMD only supports symmetric
> crypto "
> > > "operation requests, op (%p) is not a "
> >
> > This is crypto-dev enqueue data-path, if I am not mistaken.
> > I think in that case it is caller responsibility to make sure that
> > ops[] contain valid crypto-ops (as in majority of other data-path functions).
> > Suppose the main question here - why ipsec UT passes NULL as crypto-op
> here?
> > Konstantin
> [Fiona] Agree with Konstantin - it's the data-path - we expect a valid op ptr.
> Can the real issue be related to the recent addition of asymmetric QAT PMD?
> Not all QAT PMDs support symmetric crypto now.
> Is IPSec unit test finding a QAT asymm PMD and not checking it's capabilities
> or checking but not handling the result well and following a path that passes a
> NULL op to it?
Self NAK, issue found in test_ipsec code.
Regards,
Bernard.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2019-04-10 16:21 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-08 10:48 [dpdk-dev] [PATCH] crypto/qat: fix segmentation fault in QAT PMD Bernard Iremonger
2019-04-08 10:48 ` Bernard Iremonger
2019-04-08 12:09 ` Ananyev, Konstantin
2019-04-08 12:09 ` Ananyev, Konstantin
2019-04-08 12:31 ` Iremonger, Bernard
2019-04-08 12:31 ` Iremonger, Bernard
2019-04-08 16:29 ` Trahe, Fiona
2019-04-08 16:29 ` Trahe, Fiona
2019-04-10 16:21 ` Iremonger, Bernard
2019-04-10 16:21 ` Iremonger, Bernard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).