@@ -152,20 +152,26 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state)
152152 case 'D' :
153153 if (make_sockaddr (AF_INET6 , arg , DUT_ECHO_PORT ,
154154 & env .dut_addr , NULL )) {
155- fprintf (stderr , "Invalid DUT address: %s\n" , arg );
155+ fprintf (stderr ,
156+ "Invalid address assigned to the Device Under Test: %s\n" ,
157+ arg );
156158 return ARGP_ERR_UNKNOWN ;
157159 }
158160 break ;
159161 case 'C' :
160162 if (make_sockaddr (AF_INET6 , arg , DUT_CTRL_PORT ,
161163 & env .dut_ctrl_addr , NULL )) {
162- fprintf (stderr , "Invalid DUT CTRL address: %s\n" , arg );
164+ fprintf (stderr ,
165+ "Invalid address assigned to the Device Under Test: %s\n" ,
166+ arg );
163167 return ARGP_ERR_UNKNOWN ;
164168 }
165169 break ;
166170 case 'T' :
167171 if (make_sockaddr (AF_INET6 , arg , 0 , & env .tester_addr , NULL )) {
168- fprintf (stderr , "Invalid Tester address: %s\n" , arg );
172+ fprintf (stderr ,
173+ "Invalid address assigned to the Tester device: %s\n" ,
174+ arg );
169175 return ARGP_ERR_UNKNOWN ;
170176 }
171177 break ;
@@ -454,7 +460,8 @@ static int dut_run(struct xdp_features *skel)
454460 & key , sizeof (key ),
455461 & val , sizeof (val ), 0 );
456462 if (err ) {
457- fprintf (stderr , "bpf_map_lookup_elem failed\n" );
463+ fprintf (stderr ,
464+ "bpf_map_lookup_elem failed (%d)\n" , err );
458465 goto end_thread ;
459466 }
460467
@@ -496,7 +503,7 @@ static bool tester_collect_detected_cap(struct xdp_features *skel,
496503 err = bpf_map__lookup_elem (skel -> maps .stats , & key , sizeof (key ),
497504 & val , sizeof (val ), 0 );
498505 if (err ) {
499- fprintf (stderr , "bpf_map_lookup_elem failed\n" );
506+ fprintf (stderr , "bpf_map_lookup_elem failed (%d) \n" , err );
500507 return false;
501508 }
502509
@@ -574,7 +581,8 @@ static int tester_run(struct xdp_features *skel)
574581
575582 sockfd = socket (AF_INET6 , SOCK_STREAM , 0 );
576583 if (sockfd < 0 ) {
577- fprintf (stderr , "Failed to create tester socket\n" );
584+ fprintf (stderr ,
585+ "Failed creating tester service control socket\n" );
578586 return - errno ;
579587 }
580588
@@ -584,7 +592,8 @@ static int tester_run(struct xdp_features *skel)
584592 err = connect (sockfd , (struct sockaddr * )& env .dut_ctrl_addr ,
585593 sizeof (env .dut_ctrl_addr ));
586594 if (err ) {
587- fprintf (stderr , "Failed to connect to the DUT\n" );
595+ fprintf (stderr ,
596+ "Failed connecting to the Device Under Test control socket\n" );
588597 return - errno ;
589598 }
590599
0 commit comments