@@ -172,6 +172,7 @@ static void ans_print_usage(const char *prgname)
172172 " --config (port,queue,lcore): rx queues configuration\n"
173173 " --no-numa: optional, disable numa awareness\n"
174174 " --enable-kni: optional, disable kni awareness\n"
175+ " --enable-ipsync: optional, sync ip/route from kernel kni interface\n"
175176 " --enable-jumbo: enable jumbo frame"
176177 " which max packet len is PKTLEN in decimal (64-9600)\n" ,
177178 prgname );
@@ -326,6 +327,7 @@ int ans_parse_args(int argc, char **argv, struct ans_user_config *user_conf)
326327 {CMD_LINE_OPT_CONFIG , 1 , 0 , 0 },
327328 {CMD_LINE_OPT_NO_NUMA , 0 , 0 , 0 },
328329 {CMD_LINE_OPT_ENABLE_KNI , 0 , 0 , 0 },
330+ {CMD_LINE_OPT_ENABLE_IPSYNC , 0 , 0 , 0 },
329331 {CMD_LINE_OPT_ENABLE_JUMBO , 0 , 0 , 0 },
330332 {NULL , 0 , 0 , 0 }
331333 };
@@ -357,48 +359,54 @@ int ans_parse_args(int argc, char **argv, struct ans_user_config *user_conf)
357359 /* long options */
358360 case 0 :
359361 if (!strncmp (lgopts [option_index ].name , CMD_LINE_OPT_CONFIG , sizeof (CMD_LINE_OPT_CONFIG )))
360- {
361- ret = ans_parse_config (optarg , user_conf );
362- if (ret )
363- {
364- printf ("Invalid config\n" );
365- ans_print_usage (prgname );
366- return -1 ;
367- }
362+ {
363+ ret = ans_parse_config (optarg , user_conf );
364+ if (ret )
365+ {
366+ printf ("Invalid config\n" );
367+ ans_print_usage (prgname );
368+ return -1 ;
369+ }
368370 }
369371
370372 if (!strncmp (lgopts [option_index ].name , CMD_LINE_OPT_NO_NUMA , sizeof (CMD_LINE_OPT_NO_NUMA )))
371- {
372- printf ("numa is disabled \n" );
373- user_conf -> numa_on = 0 ;
373+ {
374+ printf ("numa is disabled \n" );
375+ user_conf -> numa_on = 0 ;
374376 }
375377
376378 if (!strncmp (lgopts [option_index ].name , CMD_LINE_OPT_ENABLE_KNI , sizeof (CMD_LINE_OPT_ENABLE_KNI )))
377- {
378- printf ("KNI is enable \n" );
379- user_conf -> kni_on = 1 ;
379+ {
380+ printf ("KNI is enable \n" );
381+ user_conf -> kni_on = 1 ;
380382 }
381383
384+ if (!strncmp (lgopts [option_index ].name , CMD_LINE_OPT_ENABLE_IPSYNC , sizeof (CMD_LINE_OPT_ENABLE_IPSYNC )))
385+ {
386+ printf ("IPSYNC is enable \n" );
387+ user_conf -> ipsync_on = 1 ;
388+ }
389+
382390 if (!strncmp (lgopts [option_index ].name , CMD_LINE_OPT_ENABLE_JUMBO , sizeof (CMD_LINE_OPT_ENABLE_JUMBO )))
383- {
384- struct option lenopts = {"max-pkt-len" , required_argument , 0 , 0 };
385-
386- printf ("jumbo frame is enabled - disabling simple TX path\n" );
387- user_conf -> jumbo_frame_on = 1 ;
388-
389- /* if no max-pkt-len set, use the default value ETHER_MAX_LEN */
390- if (0 == getopt_long (argc , argvopt , "" , & lenopts , & option_index ))
391- {
392- ret = ans_parse_max_pkt_len (optarg );
393- if ((ret < 64 ) || (ret > MAX_JUMBO_PKT_LEN ))
394- {
395- printf ("invalid packet length\n" );
396- ans_print_usage (prgname );
397- return -1 ;
391+ {
392+ struct option lenopts = {"max-pkt-len" , required_argument , 0 , 0 };
393+
394+ printf ("jumbo frame is enabled - disabling simple TX path\n" );
395+ user_conf -> jumbo_frame_on = 1 ;
396+
397+ /* if no max-pkt-len set, use the default value ETHER_MAX_LEN */
398+ if (0 == getopt_long (argc , argvopt , "" , & lenopts , & option_index ))
399+ {
400+ ret = ans_parse_max_pkt_len (optarg );
401+ if ((ret < 64 ) || (ret > MAX_JUMBO_PKT_LEN ))
402+ {
403+ printf ("invalid packet length\n" );
404+ ans_print_usage (prgname );
405+ return -1 ;
406+ }
407+ user_conf -> max_rx_pkt_len = ret ;
398408 }
399- user_conf -> max_rx_pkt_len = ret ;
400- }
401- printf ("set jumbo frame max packet length to %u\n" , (unsigned int )user_conf -> max_rx_pkt_len );
409+ printf ("set jumbo frame max packet length to %u\n" , (unsigned int )user_conf -> max_rx_pkt_len );
402410 }
403411 break ;
404412
0 commit comments