diff --git a/app/sample/sample_util.c b/app/sample/sample_util.c index 5dcd19a85..f50a0e448 100644 --- a/app/sample/sample_util.c +++ b/app/sample/sample_util.c @@ -45,6 +45,7 @@ enum sample_args_cmd { SAMPLE_ARG_RSS_MODE, SAMPLE_ARG_NB_TX_DESC, SAMPLE_ARG_NB_RX_DESC, + SAMPLE_ARG_DHCP, SAMPLE_ARG_TX_VIDEO_URL = 0x200, SAMPLE_ARG_RX_VIDEO_URL, @@ -100,6 +101,7 @@ static struct option sample_args_options[] = { {"rss_mode", required_argument, 0, SAMPLE_ARG_RSS_MODE}, {"nb_tx_desc", required_argument, 0, SAMPLE_ARG_NB_TX_DESC}, {"nb_rx_desc", required_argument, 0, SAMPLE_ARG_NB_RX_DESC}, + {"dhcp", no_argument, 0, SAMPLE_ARG_DHCP}, {"tx_url", required_argument, 0, SAMPLE_ARG_TX_VIDEO_URL}, {"rx_url", required_argument, 0, SAMPLE_ARG_RX_VIDEO_URL}, @@ -252,6 +254,10 @@ static int _sample_parse_args(struct st_sample_context* ctx, int argc, char** ar case SAMPLE_ARG_UDP_LCORE: p->flags |= MTL_FLAG_UDP_LCORE; break; + case SAMPLE_ARG_DHCP: + for (int port = 0; port < MTL_PORT_MAX; port++) + p->net_proto[port] = MTL_PROTO_DHCP; + break; case SAMPLE_ARG_RSS_MODE: if (!strcmp(optarg, "l3")) p->rss_mode = MTL_RSS_MODE_L3; diff --git a/app/udp/udp_client_sample.c b/app/udp/udp_client_sample.c index 5352de8a6..445196cc0 100644 --- a/app/udp/udp_client_sample.c +++ b/app/udp/udp_client_sample.c @@ -139,7 +139,7 @@ int main(int argc, char** argv) { int ret; memset(&ctx, 0, sizeof(ctx)); - ret = sample_parse_args(&ctx, argc, argv, true, false, true); + ret = sample_parse_args(&ctx, argc, argv, true, true, true); if (ret < 0) return ret; ctx.st = mtl_init(&ctx.param); diff --git a/app/udp/udp_server_sample.c b/app/udp/udp_server_sample.c index 082ebd979..73ad6fefd 100644 --- a/app/udp/udp_server_sample.c +++ b/app/udp/udp_server_sample.c @@ -187,7 +187,7 @@ int main(int argc, char** argv) { int ret; memset(&ctx, 0, sizeof(ctx)); - ret = sample_parse_args(&ctx, argc, argv, false, true, true); + ret = sample_parse_args(&ctx, argc, argv, true, true, true); if (ret < 0) return ret; ctx.st = mtl_init(&ctx.param);