[dpdk-dev,2/2] examples/ip_pipeline: modify source port default parameter
Commit Message
The default value of ``file_name`` parameter of the source port structure is
changed from ``NULL`` to ``./config/packets.pcap``.
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
---
examples/ip_pipeline/app.h | 4 ++--
examples/ip_pipeline/config_parse.c | 6 +-----
2 files changed, 3 insertions(+), 7 deletions(-)
Comments
> -----Original Message-----
> From: Singh, Jasvinder
> Sent: Tuesday, August 9, 2016 9:31 AM
> To: dev@dpdk.org
> Cc: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> Subject: [PATCH 2/2] examples/ip_pipeline: modify source port default
> parameter
>
> The default value of ``file_name`` parameter of the source port structure is
> changed from ``NULL`` to ``./config/packets.pcap``.
>
> Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
> ---
> examples/ip_pipeline/app.h | 4 ++--
> examples/ip_pipeline/config_parse.c | 6 +-----
> 2 files changed, 3 insertions(+), 7 deletions(-)
>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
> > The default value of ``file_name`` parameter of the source port structure is
> > changed from ``NULL`` to ``./config/packets.pcap``.
> >
> > Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
>
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Series applied, thanks
@@ -182,14 +182,14 @@ struct app_pktq_source_params {
uint32_t parsed;
uint32_t mempool_id; /* Position in the app->mempool_params array */
uint32_t burst;
- char *file_name; /* Full path of PCAP file to be copied to mbufs */
+ const char *file_name; /* Full path of PCAP file to be copied to mbufs */
uint32_t n_bytes_per_pkt;
};
struct app_pktq_sink_params {
char *name;
uint8_t parsed;
- char *file_name; /* Full path of PCAP file to be copied to mbufs */
+ const char *file_name; /* Full path of PCAP file to be copied to mbufs */
uint32_t n_pkts_to_dump;
};
@@ -207,7 +207,7 @@ struct app_pktq_source_params default_source_params = {
.parsed = 0,
.mempool_id = 0,
.burst = 32,
- .file_name = NULL,
+ .file_name = "./config/packets.pcap",
.n_bytes_per_pkt = 0,
};
@@ -3083,10 +3083,6 @@ app_config_init(struct app_params *app)
memcpy(app, &app_params_default, sizeof(struct app_params));
- /* configure default_source_params */
- default_source_params.file_name = strdup("./config/packets.pcap");
- PARSE_ERROR_MALLOC(default_source_params.file_name != NULL);
-
for (i = 0; i < RTE_DIM(app->mempool_params); i++)
memcpy(&app->mempool_params[i],
&mempool_params_default,