* [dpdk-dev] [PATCH 1/2] examples/ip_pipeline: fix crypto queue config @ 2019-12-11 5:25 Hemant Agrawal 2019-12-11 5:25 ` [dpdk-dev] [PATCH 2/2] examples/ip_pipeline: fix to use sock id instead of cpuid Hemant Agrawal ` (2 more replies) 0 siblings, 3 replies; 8+ messages in thread From: Hemant Agrawal @ 2019-12-11 5:25 UTC (permalink / raw) To: dev; +Cc: cristian.dumitrescu, stable, Jun Yang, Hemant Agrawal queue_conf need to have mempool details before pair setup. Fixes: 261bbff75e34 ("examples: use separate crypto session mempools") Cc: stable@dpdk.org Signed-off-by: Jun Yang <jun.yang@nxp.com> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> --- examples/ip_pipeline/cryptodev.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/examples/ip_pipeline/cryptodev.c b/examples/ip_pipeline/cryptodev.c index b0d9f3d217..ae65a90859 100644 --- a/examples/ip_pipeline/cryptodev.c +++ b/examples/ip_pipeline/cryptodev.c @@ -99,17 +99,6 @@ cryptodev_create(const char *name, struct cryptodev_params *params) if (status < 0) return NULL; - queue_conf.nb_descriptors = params->queue_size; - for (i = 0; i < params->n_queues; i++) { - status = rte_cryptodev_queue_pair_setup(dev_id, i, - &queue_conf, socket_id); - if (status < 0) - return NULL; - } - - if (rte_cryptodev_start(dev_id) < 0) - return NULL; - cryptodev = calloc(1, sizeof(struct cryptodev)); if (cryptodev == NULL) { rte_cryptodev_stop(dev_id); @@ -149,6 +138,19 @@ cryptodev_create(const char *name, struct cryptodev_params *params) TAILQ_INSERT_TAIL(&cryptodev_list, cryptodev, node); + queue_conf.nb_descriptors = params->queue_size; + queue_conf.mp_session = cryptodev->mp_create; + queue_conf.mp_session_private = cryptodev->mp_init; + for (i = 0; i < params->n_queues; i++) { + status = rte_cryptodev_queue_pair_setup(dev_id, i, + &queue_conf, socket_id); + if (status < 0) + goto error_exit; + } + + if (rte_cryptodev_start(dev_id) < 0) + goto error_exit; + return cryptodev; error_exit: -- 2.17.1 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH 2/2] examples/ip_pipeline: fix to use sock id instead of cpuid 2019-12-11 5:25 [dpdk-dev] [PATCH 1/2] examples/ip_pipeline: fix crypto queue config Hemant Agrawal @ 2019-12-11 5:25 ` Hemant Agrawal 2020-02-14 11:27 ` Dumitrescu, Cristian 2020-02-14 10:52 ` [dpdk-dev] [PATCH 1/2] examples/ip_pipeline: fix crypto queue config Zhang, Roy Fan 2020-02-14 11:22 ` Dumitrescu, Cristian 2 siblings, 1 reply; 8+ messages in thread From: Hemant Agrawal @ 2019-12-11 5:25 UTC (permalink / raw) To: dev; +Cc: cristian.dumitrescu, Stable, Jun Yang From: Jun Yang <jun.yang@nxp.com> rte_lcore_to_socket_id should be used to convert cpu ID to socket ID. Fixes: 6bfe74f8c93e ("examples/ip_pipeline: add mempool object") Fixes: d75c371e9b46 ("examples/ip_pipeline: add pipeline object") Cc: Stable@dpdk.org Signed-off-by: Jun Yang <jun.yang@nxp.com> --- examples/ip_pipeline/mempool.c | 2 +- examples/ip_pipeline/pipeline.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/ip_pipeline/mempool.c b/examples/ip_pipeline/mempool.c index f5d2a7d108..d7eea85f8f 100644 --- a/examples/ip_pipeline/mempool.c +++ b/examples/ip_pipeline/mempool.c @@ -58,7 +58,7 @@ mempool_create(const char *name, struct mempool_params *params) params->cache_size, 0, params->buffer_size - sizeof(struct rte_mbuf), - params->cpu_id); + rte_lcore_to_socket_id(params->cpu_id)); if (m == NULL) return NULL; diff --git a/examples/ip_pipeline/pipeline.c b/examples/ip_pipeline/pipeline.c index b627310a0c..d8df62d785 100644 --- a/examples/ip_pipeline/pipeline.c +++ b/examples/ip_pipeline/pipeline.c @@ -94,7 +94,7 @@ pipeline_create(const char *name, struct pipeline_params *params) msgq_req = rte_ring_create(msgq_name, PIPELINE_MSGQ_SIZE, - params->cpu_id, + rte_lcore_to_socket_id(params->cpu_id), RING_F_SP_ENQ | RING_F_SC_DEQ); if (msgq_req == NULL) return NULL; @@ -103,7 +103,7 @@ pipeline_create(const char *name, struct pipeline_params *params) msgq_rsp = rte_ring_create(msgq_name, PIPELINE_MSGQ_SIZE, - params->cpu_id, + rte_lcore_to_socket_id(params->cpu_id), RING_F_SP_ENQ | RING_F_SC_DEQ); if (msgq_rsp == NULL) { rte_ring_free(msgq_req); @@ -111,7 +111,7 @@ pipeline_create(const char *name, struct pipeline_params *params) } pp.name = name; - pp.socket_id = (int) params->cpu_id; + pp.socket_id = (int) rte_lcore_to_socket_id(params->cpu_id); pp.offset_port_id = params->offset_port_id; p = rte_pipeline_create(&pp); @@ -332,7 +332,7 @@ pipeline_port_in_create(const char *pipeline_name, if (ap) { action = rte_port_in_action_create(ap->ap, - pipeline->cpu_id); + rte_lcore_to_socket_id(pipeline->cpu_id)); if (action == NULL) return -1; @@ -1002,7 +1002,7 @@ pipeline_table_create(const char *pipeline_name, if (ap) { action = rte_table_action_create(ap->ap, - pipeline->cpu_id); + rte_lcore_to_socket_id(pipeline->cpu_id)); if (action == NULL) return -1; -- 2.17.1 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH 2/2] examples/ip_pipeline: fix to use sock id instead of cpuid 2019-12-11 5:25 ` [dpdk-dev] [PATCH 2/2] examples/ip_pipeline: fix to use sock id instead of cpuid Hemant Agrawal @ 2020-02-14 11:27 ` Dumitrescu, Cristian 2020-02-14 15:18 ` [dpdk-dev] [EXT] " Jun Yang 0 siblings, 1 reply; 8+ messages in thread From: Dumitrescu, Cristian @ 2020-02-14 11:27 UTC (permalink / raw) To: Hemant Agrawal, dev; +Cc: Stable, Jun Yang > -----Original Message----- > From: dev <dev-bounces@dpdk.org> On Behalf Of Hemant Agrawal > Sent: Wednesday, December 11, 2019 5:26 AM > To: dev@dpdk.org > Cc: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>; Stable@dpdk.org; > Jun Yang <jun.yang@nxp.com> > Subject: [dpdk-dev] [PATCH 2/2] examples/ip_pipeline: fix to use sock id > instead of cpuid > > From: Jun Yang <jun.yang@nxp.com> > > rte_lcore_to_socket_id should be used to convert cpu ID to socket ID. > > Fixes: 6bfe74f8c93e ("examples/ip_pipeline: add mempool object") > Fixes: d75c371e9b46 ("examples/ip_pipeline: add pipeline object") > Cc: Stable@dpdk.org > > Signed-off-by: Jun Yang <jun.yang@nxp.com> > --- > examples/ip_pipeline/mempool.c | 2 +- > examples/ip_pipeline/pipeline.c | 10 +++++----- > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/examples/ip_pipeline/mempool.c > b/examples/ip_pipeline/mempool.c > index f5d2a7d108..d7eea85f8f 100644 > --- a/examples/ip_pipeline/mempool.c > +++ b/examples/ip_pipeline/mempool.c > @@ -58,7 +58,7 @@ mempool_create(const char *name, struct > mempool_params *params) > params->cache_size, > 0, > params->buffer_size - sizeof(struct rte_mbuf), > - params->cpu_id); > + rte_lcore_to_socket_id(params->cpu_id)); > > if (m == NULL) > return NULL; > diff --git a/examples/ip_pipeline/pipeline.c > b/examples/ip_pipeline/pipeline.c > index b627310a0c..d8df62d785 100644 > --- a/examples/ip_pipeline/pipeline.c > +++ b/examples/ip_pipeline/pipeline.c > @@ -94,7 +94,7 @@ pipeline_create(const char *name, struct > pipeline_params *params) > > msgq_req = rte_ring_create(msgq_name, > PIPELINE_MSGQ_SIZE, > - params->cpu_id, > + rte_lcore_to_socket_id(params->cpu_id), > RING_F_SP_ENQ | RING_F_SC_DEQ); > if (msgq_req == NULL) > return NULL; > @@ -103,7 +103,7 @@ pipeline_create(const char *name, struct > pipeline_params *params) > > msgq_rsp = rte_ring_create(msgq_name, > PIPELINE_MSGQ_SIZE, > - params->cpu_id, > + rte_lcore_to_socket_id(params->cpu_id), > RING_F_SP_ENQ | RING_F_SC_DEQ); > if (msgq_rsp == NULL) { > rte_ring_free(msgq_req); > @@ -111,7 +111,7 @@ pipeline_create(const char *name, struct > pipeline_params *params) > } > > pp.name = name; > - pp.socket_id = (int) params->cpu_id; > + pp.socket_id = (int) rte_lcore_to_socket_id(params->cpu_id); > pp.offset_port_id = params->offset_port_id; > > p = rte_pipeline_create(&pp); > @@ -332,7 +332,7 @@ pipeline_port_in_create(const char *pipeline_name, > > if (ap) { > action = rte_port_in_action_create(ap->ap, > - pipeline->cpu_id); > + rte_lcore_to_socket_id(pipeline->cpu_id)); > if (action == NULL) > return -1; > > @@ -1002,7 +1002,7 @@ pipeline_table_create(const char *pipeline_name, > > if (ap) { > action = rte_table_action_create(ap->ap, > - pipeline->cpu_id); > + rte_lcore_to_socket_id(pipeline->cpu_id)); > if (action == NULL) > return -1; > > -- > 2.17.1 NACK. This is incorrect, probably a misunderstanding: the params->cpu_id is already the CPU socket ID (passed as parameter), and not the core ID. For core ID, we typically use variable names as core_id or lcore_id, and never cpu_id. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [EXT] RE: [PATCH 2/2] examples/ip_pipeline: fix to use sock id instead of cpuid 2020-02-14 11:27 ` Dumitrescu, Cristian @ 2020-02-14 15:18 ` Jun Yang 2020-02-18 10:47 ` Dumitrescu, Cristian 0 siblings, 1 reply; 8+ messages in thread From: Jun Yang @ 2020-02-14 15:18 UTC (permalink / raw) To: Dumitrescu, Cristian, Hemant Agrawal, dev; +Cc: Stable Hi Cristian, Per my debug log, the CPU ID is actually DPDK current core ID on NXP ARM64 platform whose socket ID is always 0. -----Original Message----- From: Dumitrescu, Cristian [mailto:cristian.dumitrescu@intel.com] Sent: Friday, February 14, 2020 7:27 PM To: Hemant Agrawal <hemant.agrawal@nxp.com>; dev@dpdk.org Cc: Stable@dpdk.org; Jun Yang <jun.yang@nxp.com> Subject: [EXT] RE: [dpdk-dev] [PATCH 2/2] examples/ip_pipeline: fix to use sock id instead of cpuid Caution: EXT Email > -----Original Message----- > From: dev <dev-bounces@dpdk.org> On Behalf Of Hemant Agrawal > Sent: Wednesday, December 11, 2019 5:26 AM > To: dev@dpdk.org > Cc: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>; > Stable@dpdk.org; Jun Yang <jun.yang@nxp.com> > Subject: [dpdk-dev] [PATCH 2/2] examples/ip_pipeline: fix to use sock > id instead of cpuid > > From: Jun Yang <jun.yang@nxp.com> > > rte_lcore_to_socket_id should be used to convert cpu ID to socket ID. > > Fixes: 6bfe74f8c93e ("examples/ip_pipeline: add mempool object") > Fixes: d75c371e9b46 ("examples/ip_pipeline: add pipeline object") > Cc: Stable@dpdk.org > > Signed-off-by: Jun Yang <jun.yang@nxp.com> > --- > examples/ip_pipeline/mempool.c | 2 +- > examples/ip_pipeline/pipeline.c | 10 +++++----- > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/examples/ip_pipeline/mempool.c > b/examples/ip_pipeline/mempool.c index f5d2a7d108..d7eea85f8f 100644 > --- a/examples/ip_pipeline/mempool.c > +++ b/examples/ip_pipeline/mempool.c > @@ -58,7 +58,7 @@ mempool_create(const char *name, struct > mempool_params *params) > params->cache_size, > 0, > params->buffer_size - sizeof(struct rte_mbuf), > - params->cpu_id); > + rte_lcore_to_socket_id(params->cpu_id)); > > if (m == NULL) > return NULL; > diff --git a/examples/ip_pipeline/pipeline.c > b/examples/ip_pipeline/pipeline.c index b627310a0c..d8df62d785 100644 > --- a/examples/ip_pipeline/pipeline.c > +++ b/examples/ip_pipeline/pipeline.c > @@ -94,7 +94,7 @@ pipeline_create(const char *name, struct > pipeline_params *params) > > msgq_req = rte_ring_create(msgq_name, > PIPELINE_MSGQ_SIZE, > - params->cpu_id, > + rte_lcore_to_socket_id(params->cpu_id), > RING_F_SP_ENQ | RING_F_SC_DEQ); > if (msgq_req == NULL) > return NULL; > @@ -103,7 +103,7 @@ pipeline_create(const char *name, struct > pipeline_params *params) > > msgq_rsp = rte_ring_create(msgq_name, > PIPELINE_MSGQ_SIZE, > - params->cpu_id, > + rte_lcore_to_socket_id(params->cpu_id), > RING_F_SP_ENQ | RING_F_SC_DEQ); > if (msgq_rsp == NULL) { > rte_ring_free(msgq_req); @@ -111,7 +111,7 @@ > pipeline_create(const char *name, struct pipeline_params *params) > } > > pp.name = name; > - pp.socket_id = (int) params->cpu_id; > + pp.socket_id = (int) rte_lcore_to_socket_id(params->cpu_id); > pp.offset_port_id = params->offset_port_id; > > p = rte_pipeline_create(&pp); > @@ -332,7 +332,7 @@ pipeline_port_in_create(const char *pipeline_name, > > if (ap) { > action = rte_port_in_action_create(ap->ap, > - pipeline->cpu_id); > + rte_lcore_to_socket_id(pipeline->cpu_id)); > if (action == NULL) > return -1; > > @@ -1002,7 +1002,7 @@ pipeline_table_create(const char *pipeline_name, > > if (ap) { > action = rte_table_action_create(ap->ap, > - pipeline->cpu_id); > + rte_lcore_to_socket_id(pipeline->cpu_id)); > if (action == NULL) > return -1; > > -- > 2.17.1 NACK. This is incorrect, probably a misunderstanding: the params->cpu_id is already the CPU socket ID (passed as parameter), and not the core ID. For core ID, we typically use variable names as core_id or lcore_id, and never cpu_id. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [EXT] RE: [PATCH 2/2] examples/ip_pipeline: fix to use sock id instead of cpuid 2020-02-14 15:18 ` [dpdk-dev] [EXT] " Jun Yang @ 2020-02-18 10:47 ` Dumitrescu, Cristian 2020-02-19 14:17 ` Jun Yang 0 siblings, 1 reply; 8+ messages in thread From: Dumitrescu, Cristian @ 2020-02-18 10:47 UTC (permalink / raw) To: Jun Yang, Hemant Agrawal, dev; +Cc: Stable > -----Original Message----- > From: Jun Yang <jun.yang@nxp.com> > Sent: Friday, February 14, 2020 3:19 PM > To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>; Hemant Agrawal > <hemant.agrawal@nxp.com>; dev@dpdk.org > Cc: Stable@dpdk.org > Subject: RE: [EXT] RE: [dpdk-dev] [PATCH 2/2] examples/ip_pipeline: fix to > use sock id instead of cpuid > > Hi Cristian, > Per my debug log, the CPU ID is actually DPDK current core ID on NXP ARM64 > platform whose socket ID is always 0. > Hi Jun, The params->cpu_id is vendor independent, it is always the CPU socket ID and is consistently used as the NUMA node to allocate memory on. If your system has a single CPU socket, then this parameter should be equal to 0. As clearly documented and stated before, this parameter is never the CPU core ID, which is typically called core_id or lcore_id consistently in the code. Again, not sure where this confusion is coming from. Regards, Cristian ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [EXT] RE: [PATCH 2/2] examples/ip_pipeline: fix to use sock id instead of cpuid 2020-02-18 10:47 ` Dumitrescu, Cristian @ 2020-02-19 14:17 ` Jun Yang 0 siblings, 0 replies; 8+ messages in thread From: Jun Yang @ 2020-02-19 14:17 UTC (permalink / raw) To: Dumitrescu, Cristian, Hemant Agrawal, dev; +Cc: Stable [-- Attachment #1: Type: text/plain, Size: 2225 bytes --] Hi Cristian, If my recall is correct, the issue comes from following commands: ip_pipleline running on DPAA1: #NOTE: rss ip_pipeline is not supported due to the limitation of DPAA1 driver. 1) mkdir -p /mnt/hugepages 2) mount -t hugetlbfs none /mnt/hugepages 3) export DPAA_FMCLESS_MODE=1 4) #firewall ip_pipeline demo: ./ip_pipeline -c 0x3 -n 4 -- -s ./dpaa2_examples/firewall.cli 5) #flow ip_pipeline demo: ./ip_pipeline -c 0xf -n 4 -- -s ./dpaa2_examples/flow.cli 6) #flow crypto ip_pipeline demo: ./ip_pipeline -c 0x7 -n 4 -- -s ./dpaa2_examples/flow_crypto.cli 7) #l2fwd ip_pipeline demo: ./ip_pipeline -c 0x3 -n 4 -- -s ./dpaa2_examples/l2fwd.cli 8) #route ip_pipeline demo: ./ip_pipeline -c 0x3 -n 4 -- -s ./dpaa2_examples/route.cli 9) #route ecmp ip_pipeline demo: ./ip_pipeline -c 0x3 -n 4 -- -s ./dpaa2_examples/route_ecmp.cli -----Original Message----- From: Dumitrescu, Cristian [mailto:cristian.dumitrescu@intel.com] Sent: Tuesday, February 18, 2020 6:48 PM To: Jun Yang <jun.yang@nxp.com>; Hemant Agrawal <hemant.agrawal@nxp.com>; dev@dpdk.org Cc: Stable@dpdk.org Subject: RE: [EXT] RE: [dpdk-dev] [PATCH 2/2] examples/ip_pipeline: fix to use sock id instead of cpuid Caution: EXT Email > -----Original Message----- > From: Jun Yang <jun.yang@nxp.com> > Sent: Friday, February 14, 2020 3:19 PM > To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>; Hemant > Agrawal <hemant.agrawal@nxp.com>; dev@dpdk.org > Cc: Stable@dpdk.org > Subject: RE: [EXT] RE: [dpdk-dev] [PATCH 2/2] examples/ip_pipeline: > fix to use sock id instead of cpuid > > Hi Cristian, > Per my debug log, the CPU ID is actually DPDK current core ID on NXP > ARM64 platform whose socket ID is always 0. > Hi Jun, The params->cpu_id is vendor independent, it is always the CPU socket ID and is consistently used as the NUMA node to allocate memory on. If your system has a single CPU socket, then this parameter should be equal to 0. As clearly documented and stated before, this parameter is never the CPU core ID, which is typically called core_id or lcore_id consistently in the code. Again, not sure where this confusion is coming from. Regards, Cristian [-- Attachment #2: dpaa1_examples.tar.gz --] [-- Type: application/x-gzip, Size: 3188 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH 1/2] examples/ip_pipeline: fix crypto queue config 2019-12-11 5:25 [dpdk-dev] [PATCH 1/2] examples/ip_pipeline: fix crypto queue config Hemant Agrawal 2019-12-11 5:25 ` [dpdk-dev] [PATCH 2/2] examples/ip_pipeline: fix to use sock id instead of cpuid Hemant Agrawal @ 2020-02-14 10:52 ` Zhang, Roy Fan 2020-02-14 11:22 ` Dumitrescu, Cristian 2 siblings, 0 replies; 8+ messages in thread From: Zhang, Roy Fan @ 2020-02-14 10:52 UTC (permalink / raw) To: Hemant Agrawal, dev; +Cc: Dumitrescu, Cristian, stable, Jun Yang > -----Original Message----- > From: dev <dev-bounces@dpdk.org> On Behalf Of Hemant Agrawal > Sent: Wednesday, December 11, 2019 5:26 AM > To: dev@dpdk.org > Cc: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>; stable@dpdk.org; > Jun Yang <jun.yang@nxp.com>; Hemant Agrawal > <hemant.agrawal@nxp.com> > Subject: [dpdk-dev] [PATCH 1/2] examples/ip_pipeline: fix crypto queue > config > > queue_conf need to have mempool details before pair setup. > > Fixes: 261bbff75e34 ("examples: use separate crypto session mempools") > Cc: stable@dpdk.org > > Signed-off-by: Jun Yang <jun.yang@nxp.com> > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> > --- Acked-by: Fan Zhang <roy.fan.zhang@intel.com> ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH 1/2] examples/ip_pipeline: fix crypto queue config 2019-12-11 5:25 [dpdk-dev] [PATCH 1/2] examples/ip_pipeline: fix crypto queue config Hemant Agrawal 2019-12-11 5:25 ` [dpdk-dev] [PATCH 2/2] examples/ip_pipeline: fix to use sock id instead of cpuid Hemant Agrawal 2020-02-14 10:52 ` [dpdk-dev] [PATCH 1/2] examples/ip_pipeline: fix crypto queue config Zhang, Roy Fan @ 2020-02-14 11:22 ` Dumitrescu, Cristian 2 siblings, 0 replies; 8+ messages in thread From: Dumitrescu, Cristian @ 2020-02-14 11:22 UTC (permalink / raw) To: Hemant Agrawal, dev; +Cc: stable, Jun Yang, Zhang, Roy Fan > -----Original Message----- > From: dev <dev-bounces@dpdk.org> On Behalf Of Hemant Agrawal > Sent: Wednesday, December 11, 2019 5:26 AM > To: dev@dpdk.org > Cc: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>; stable@dpdk.org; > Jun Yang <jun.yang@nxp.com>; Hemant Agrawal > <hemant.agrawal@nxp.com> > Subject: [dpdk-dev] [PATCH 1/2] examples/ip_pipeline: fix crypto queue > config > > queue_conf need to have mempool details before pair setup. > > Fixes: 261bbff75e34 ("examples: use separate crypto session mempools") > Cc: stable@dpdk.org > > Signed-off-by: Jun Yang <jun.yang@nxp.com> > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> > --- > examples/ip_pipeline/cryptodev.c | 24 +++++++++++++----------- > 1 file changed, 13 insertions(+), 11 deletions(-) > > diff --git a/examples/ip_pipeline/cryptodev.c > b/examples/ip_pipeline/cryptodev.c > index b0d9f3d217..ae65a90859 100644 > --- a/examples/ip_pipeline/cryptodev.c > +++ b/examples/ip_pipeline/cryptodev.c > @@ -99,17 +99,6 @@ cryptodev_create(const char *name, struct > cryptodev_params *params) > if (status < 0) > return NULL; > > - queue_conf.nb_descriptors = params->queue_size; > - for (i = 0; i < params->n_queues; i++) { > - status = rte_cryptodev_queue_pair_setup(dev_id, i, > - &queue_conf, socket_id); > - if (status < 0) > - return NULL; > - } > - > - if (rte_cryptodev_start(dev_id) < 0) > - return NULL; > - > cryptodev = calloc(1, sizeof(struct cryptodev)); > if (cryptodev == NULL) { > rte_cryptodev_stop(dev_id); > @@ -149,6 +138,19 @@ cryptodev_create(const char *name, struct > cryptodev_params *params) > > TAILQ_INSERT_TAIL(&cryptodev_list, cryptodev, node); > > + queue_conf.nb_descriptors = params->queue_size; > + queue_conf.mp_session = cryptodev->mp_create; > + queue_conf.mp_session_private = cryptodev->mp_init; > + for (i = 0; i < params->n_queues; i++) { > + status = rte_cryptodev_queue_pair_setup(dev_id, i, > + &queue_conf, socket_id); > + if (status < 0) > + goto error_exit; > + } > + > + if (rte_cryptodev_start(dev_id) < 0) > + goto error_exit; > + > return cryptodev; > > error_exit: > -- > 2.17.1 Idea is correct, implementation is broken, so rework is needed. The cryptodev->mp_create and cryptodev->mp_init are not valid at this point where you assign them to queue_conf.mp_session and queue_conf.mp_session_private, as they only get created later in this same function. Please fix. ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2020-02-19 21:31 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-12-11 5:25 [dpdk-dev] [PATCH 1/2] examples/ip_pipeline: fix crypto queue config Hemant Agrawal 2019-12-11 5:25 ` [dpdk-dev] [PATCH 2/2] examples/ip_pipeline: fix to use sock id instead of cpuid Hemant Agrawal 2020-02-14 11:27 ` Dumitrescu, Cristian 2020-02-14 15:18 ` [dpdk-dev] [EXT] " Jun Yang 2020-02-18 10:47 ` Dumitrescu, Cristian 2020-02-19 14:17 ` Jun Yang 2020-02-14 10:52 ` [dpdk-dev] [PATCH 1/2] examples/ip_pipeline: fix crypto queue config Zhang, Roy Fan 2020-02-14 11:22 ` Dumitrescu, Cristian
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).