DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] example/ip_pipeline: fix source port mempool assignment
@ 2015-12-04 14:28 Fan Zhang
  2015-12-07  0:18 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Fan Zhang @ 2015-12-04 14:28 UTC (permalink / raw)
  To: dev

Fixes the wrong source port mempool assignment (commit id eb32fe7c). The
source port is now assigned by parsed mempool id index value either by
default or configured by CFG file.

Previously, the mempool id for locating source port's mempool pointer was
the port id. When multiple source ports exist in the same pipeline, and
the default mempool configuration is used (one MEMPOOL0 is shared between
all source ports), the invalid mempool pointer (NULL) will be assigned to
source ports other than first source port.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 examples/ip_pipeline/init.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/examples/ip_pipeline/init.c b/examples/ip_pipeline/init.c
index 46d044e..28e959b 100644
--- a/examples/ip_pipeline/init.c
+++ b/examples/ip_pipeline/init.c
@@ -1064,6 +1064,7 @@ static void app_pipeline_params_get(struct app_params *app,
 	struct pipeline_params *p_out)
 {
 	uint32_t i;
+	uint32_t mempool_id;
 
 	strcpy(p_out->name, p_in->name);
 
@@ -1147,8 +1148,9 @@ static void app_pipeline_params_get(struct app_params *app,
 			out->burst_size = app->tm_params[in->id].burst_read;
 			break;
 		case APP_PKTQ_IN_SOURCE:
+			mempool_id = app->source_params[in->id].mempool_id;
 			out->type = PIPELINE_PORT_IN_SOURCE;
-			out->params.source.mempool = app->mempool[in->id];
+			out->params.source.mempool = app->mempool[mempool_id];
 			out->burst_size = app->source_params[in->id].burst;
 			break;
 		default:
-- 
2.5.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] example/ip_pipeline: fix source port mempool assignment
  2015-12-04 14:28 [dpdk-dev] [PATCH] example/ip_pipeline: fix source port mempool assignment Fan Zhang
@ 2015-12-07  0:18 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2015-12-07  0:18 UTC (permalink / raw)
  To: Fan Zhang; +Cc: dev

2015-12-04 14:28, Fan Zhang:
> Fixes the wrong source port mempool assignment (commit id eb32fe7c). The
> source port is now assigned by parsed mempool id index value either by
> default or configured by CFG file.
> 
> Previously, the mempool id for locating source port's mempool pointer was
> the port id. When multiple source ports exist in the same pipeline, and
> the default mempool configuration is used (one MEMPOOL0 is shared between
> all source ports), the invalid mempool pointer (NULL) will be assigned to
> source ports other than first source port.
> 
> Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-07  0:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-04 14:28 [dpdk-dev] [PATCH] example/ip_pipeline: fix source port mempool assignment Fan Zhang
2015-12-07  0:18 ` Thomas Monjalon

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).