You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/03/14 08:24:48 UTC
[GitHub] [incubator-nuttx-apps] wenliangxue opened a new pull request #1066: Modifying the ping command
wenliangxue opened a new pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066
## Summary
1、Round trip times in the ping command range from millisecond to subtle
2、Add statistics on RTT related min/avg/Max/mdev in ping program
3、The ping command supports ctrl+c interruption operations
## Impact
The ping and ping6 commands are affected
## Testing
PASSED
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] xiaoxiang781216 merged pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] wenliangxue commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
wenliangxue commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r827567951
##########
File path: netutils/ping/icmp_ping.c
##########
@@ -59,11 +61,21 @@
*/
static uint16_t g_pingid = 0;
+static volatile bool exiting = false;
Review comment:
'g_pingid' is a counting variable, it needs an initial value, and 'exiting' can be modified
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] wenliangxue commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
wenliangxue commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r827919869
##########
File path: netutils/ping/icmpv6_ping.c
##########
@@ -58,11 +60,21 @@
*/
static uint16_t g_ping6_id = 0;
+static volatile bool exiting = false;
Review comment:
down
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] davids5 commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
davids5 commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r828029803
##########
File path: netutils/ping/icmpv6_ping.c
##########
@@ -57,12 +59,22 @@
* separate instance of g_ping6_id in every process space.
*/
-static uint16_t g_ping6_id = 0;
+static uint16_t g_ping6_id;
+static volatile bool exiting;
Review comment:
```suggestion
static volatile bool g_exiting;
```
##########
File path: netutils/ping/icmp_ping.c
##########
@@ -58,12 +60,22 @@
* separate instance of g_pingid in every process space.
*/
-static uint16_t g_pingid = 0;
+static uint16_t g_pingid;
+static volatile bool exiting;
Review comment:
g_ prefix need;
```suggestion
static volatile bool g_exiting;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] wenliangxue commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
wenliangxue commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r828779829
##########
File path: system/ping/ping.c
##########
@@ -131,21 +139,21 @@ static void ping_result(FAR const struct ping_result_s *result)
break;
case ICMP_E_SENDTO:
- fprintf(stderr, "ERROR: sendto failed at seqno %u: %d\n",
+ fprintf(stderr, "ERROR: sendto failed at seqno %u: %ld\n",
Review comment:
all seqno remain unchanged
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] wenliangxue commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
wenliangxue commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r826900858
##########
File path: netutils/ping/icmpv6_ping.c
##########
@@ -289,7 +308,7 @@ void icmp6_ping(FAR const struct ping6_info_s *info)
goto done;
}
- elapsed = (unsigned int)TICK2MSEC(clock() - start);
+ elapsed = (unsigned int)TICK2USEC(clock() - start);
Review comment:
The return value of the ping command is accurate to milliseconds
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] pkarashchenko commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r827660917
##########
File path: netutils/ping/icmp_ping.c
##########
@@ -59,11 +61,21 @@
*/
static uint16_t g_pingid = 0;
+static volatile bool exiting = false;
Review comment:
Global symbols are zero initialized according to C standard, so only non-zero initializers are needed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] pkarashchenko commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r827660917
##########
File path: netutils/ping/icmp_ping.c
##########
@@ -59,11 +61,21 @@
*/
static uint16_t g_pingid = 0;
+static volatile bool exiting = false;
Review comment:
Global symbols are zero initialized by C standard, so only non-zero initializers are needed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] wenliangxue commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
wenliangxue commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r826898947
##########
File path: netutils/ping/icmp_ping.c
##########
@@ -59,11 +60,21 @@
*/
static uint16_t g_pingid = 0;
+static volatile int exiting = 0;
Review comment:
It has been modified
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] wenliangxue commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
wenliangxue commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r826931328
##########
File path: netutils/ping/icmpv6_ping.c
##########
@@ -289,7 +308,7 @@ void icmp6_ping(FAR const struct ping6_info_s *info)
goto done;
}
- elapsed = (unsigned int)TICK2MSEC(clock() - start);
+ elapsed = (unsigned int)TICK2USEC(clock() - start);
Review comment:
Statistics are performed in milliseconds. The time value in the returned packet of the ping command cannot be accurate to two decimal places.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] pkarashchenko commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r825718966
##########
File path: netutils/ping/icmpv6_ping.c
##########
@@ -58,11 +59,21 @@
*/
static uint16_t g_ping6_id = 0;
+static volatile int exiting = 0;
Review comment:
```suggestion
static uint16_t g_ping6_id;
static volatile int exiting;
```
##########
File path: netutils/ping/icmp_ping.c
##########
@@ -59,11 +60,21 @@
*/
static uint16_t g_pingid = 0;
+static volatile int exiting = 0;
Review comment:
```suggestion
static uint16_t g_pingid;
static volatile int exiting;
```
##########
File path: netutils/ping/icmp_ping.c
##########
@@ -59,11 +60,21 @@
*/
static uint16_t g_pingid = 0;
+static volatile int exiting = 0;
Review comment:
can we use `bool` instead of `int`?
##########
File path: netutils/ping/icmpv6_ping.c
##########
@@ -289,7 +308,7 @@ void icmp6_ping(FAR const struct ping6_info_s *info)
goto done;
}
- elapsed = (unsigned int)TICK2MSEC(clock() - start);
+ elapsed = (unsigned int)TICK2USEC(clock() - start);
Review comment:
why do we need to switch from `TICK2MSEC` to `TICK2USEC`?
##########
File path: netutils/ping/icmpv6_ping.c
##########
@@ -261,7 +280,7 @@ void icmp6_ping(FAR const struct ping6_info_s *info)
recvfd.events = POLLIN;
recvfd.revents = 0;
- ret = poll(&recvfd, 1, info->timeout - elapsed);
+ ret = poll(&recvfd, 1, info->timeout - elapsed / USEC_PER_MSEC);
Review comment:
Don't we need the same change in `netutils/ping/icmp_ping.c`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] pkarashchenko commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r827932933
##########
File path: system/ping/ping.c
##########
@@ -217,8 +238,25 @@ static void ping_result(FAR const struct ping_result_s *result)
result->nrequests;
printf("%u packets transmitted, %u received, %u%% packet loss, "
- "time %d ms\n",
- result->nrequests, result->nreplies, tmp, result->extra);
+ "time %ld ms\n",
+ result->nrequests, result->nreplies, tmp,
+ result->extra / USEC_PER_MSEC);
+ if (result->nreplies > 0)
+ {
+ long avg = priv->tsum / result->nreplies;
+ long long tempnum = priv->tsum2 / result->nreplies -
+ (long long)avg * avg;
+ long tmdev = ub16toi(ub32sqrtub16(uitoub32(tempnum)));
Review comment:
great that you switched to int math
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] wenliangxue commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
wenliangxue commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r827679621
##########
File path: netutils/ping/icmp_ping.c
##########
@@ -388,7 +409,7 @@ void icmp_ping(FAR const struct ping_info_s *info)
}
done:
- icmp_callback(&result, ICMP_I_FINISH, TICK2MSEC(clock() - kickoff));
+ icmp_callback(&result, ICMP_I_FINISH, TICK2USEC(clock() - kickoff));
Review comment:
I plan to modify to long type
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] wenliangxue commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
wenliangxue commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r826899944
##########
File path: netutils/ping/icmpv6_ping.c
##########
@@ -261,7 +280,7 @@ void icmp6_ping(FAR const struct ping6_info_s *info)
recvfd.events = POLLIN;
recvfd.revents = 0;
- ret = poll(&recvfd, 1, info->timeout - elapsed);
+ ret = poll(&recvfd, 1, info->timeout - elapsed / USEC_PER_MSEC);
Review comment:
It has been modified
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] davids5 commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
davids5 commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r828033810
##########
File path: system/ping/ping.c
##########
@@ -131,21 +139,21 @@ static void ping_result(FAR const struct ping_result_s *result)
break;
case ICMP_E_SENDTO:
- fprintf(stderr, "ERROR: sendto failed at seqno %u: %d\n",
+ fprintf(stderr, "ERROR: sendto failed at seqno %u: %ld\n",
Review comment:
For: seqno use PRI macros for uint16_t and another non native types
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] pkarashchenko commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r827660917
##########
File path: netutils/ping/icmp_ping.c
##########
@@ -59,11 +61,21 @@
*/
static uint16_t g_pingid = 0;
+static volatile bool exiting = false;
Review comment:
Global symbols are zero initialized by C standard
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] wenliangxue commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
wenliangxue commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r828667075
##########
File path: netutils/ping/icmp_ping.c
##########
@@ -58,12 +60,22 @@
* separate instance of g_pingid in every process space.
*/
-static uint16_t g_pingid = 0;
+static uint16_t g_pingid;
+static volatile bool exiting;
Review comment:
It has been modified
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r828683317
##########
File path: system/ping6/ping6.c
##########
@@ -240,6 +278,10 @@ int main(int argc, FAR char *argv[])
info.callback = ping6_result;
info.priv = &priv;
priv.code = ICMPv6_I_OK;
+ priv.tmin = INT_MAX;
Review comment:
all INT_MAX->LONG_MAX
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] xiaoxiang781216 merged pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] wenliangxue commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
wenliangxue commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r828668494
##########
File path: netutils/ping/icmpv6_ping.c
##########
@@ -57,12 +59,22 @@
* separate instance of g_ping6_id in every process space.
*/
-static uint16_t g_ping6_id = 0;
+static uint16_t g_ping6_id;
+static volatile bool exiting;
Review comment:
Static variables cannot be repeated with those in ping.c, so they are modified to g_exiting6
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] wenliangxue commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
wenliangxue commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r827920415
##########
File path: netutils/ping/icmpv6_ping.c
##########
@@ -289,7 +309,7 @@ void icmp6_ping(FAR const struct ping6_info_s *info)
goto done;
}
- elapsed = (unsigned int)TICK2MSEC(clock() - start);
+ elapsed = (unsigned int)TICK2USEC(clock() - start);
Review comment:
has been modified to long type
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] wenliangxue commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
wenliangxue commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r827919154
##########
File path: netutils/ping/icmp_ping.c
##########
@@ -290,7 +310,7 @@ void icmp_ping(FAR const struct ping_info_s *info)
goto done;
}
- elapsed = (unsigned int)TICK2MSEC(clock() - start);
+ elapsed = (unsigned int)TICK2USEC(clock() - start);
Review comment:
Unified modification to long type
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] wenliangxue commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
wenliangxue commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r827679258
##########
File path: netutils/ping/icmp_ping.c
##########
@@ -59,11 +61,21 @@
*/
static uint16_t g_pingid = 0;
+static volatile bool exiting = false;
Review comment:
ok, i'll change it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] pkarashchenko commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r826978792
##########
File path: netutils/ping/icmp_ping.c
##########
@@ -59,11 +61,21 @@
*/
static uint16_t g_pingid = 0;
+static volatile bool exiting = false;
Review comment:
```suggestion
static uint16_t g_pingid;
static volatile bool exiting;
```
##########
File path: netutils/ping/icmpv6_ping.c
##########
@@ -289,7 +309,7 @@ void icmp6_ping(FAR const struct ping6_info_s *info)
goto done;
}
- elapsed = (unsigned int)TICK2MSEC(clock() - start);
+ elapsed = (unsigned int)TICK2USEC(clock() - start);
Review comment:
```suggestion
elapsed = (int32_t)TICK2USEC(clock() - start);
```
##########
File path: netutils/ping/icmp_ping.c
##########
@@ -290,7 +310,7 @@ void icmp_ping(FAR const struct ping_info_s *info)
goto done;
}
- elapsed = (unsigned int)TICK2MSEC(clock() - start);
+ elapsed = (unsigned int)TICK2USEC(clock() - start);
Review comment:
```suggestion
elapsed = (int32_t)TICK2USEC(clock() - start);
```
##########
File path: netutils/ping/icmpv6_ping.c
##########
@@ -58,11 +60,21 @@
*/
static uint16_t g_ping6_id = 0;
+static volatile bool exiting = false;
Review comment:
```suggestion
static uint16_t g_ping6_id;
static volatile bool exiting;
```
##########
File path: netutils/ping/icmp_ping.c
##########
@@ -388,7 +409,7 @@ void icmp_ping(FAR const struct ping_info_s *info)
}
done:
- icmp_callback(&result, ICMP_I_FINISH, TICK2MSEC(clock() - kickoff));
+ icmp_callback(&result, ICMP_I_FINISH, TICK2USEC(clock() - kickoff));
Review comment:
Should we modify `int extra; /* Extra information for code */` and `icmp_callback` parameter and change type from `int` to `int32_t` to carry increased precision?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] pkarashchenko commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r826978229
##########
File path: netutils/ping/icmpv6_ping.c
##########
@@ -289,7 +308,7 @@ void icmp6_ping(FAR const struct ping6_info_s *info)
goto done;
}
- elapsed = (unsigned int)TICK2MSEC(clock() - start);
+ elapsed = (unsigned int)TICK2USEC(clock() - start);
Review comment:
ok.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r828738400
##########
File path: system/ping/ping.c
##########
@@ -131,21 +139,21 @@ static void ping_result(FAR const struct ping_result_s *result)
break;
case ICMP_E_SENDTO:
- fprintf(stderr, "ERROR: sendto failed at seqno %u: %d\n",
+ fprintf(stderr, "ERROR: sendto failed at seqno %u: %ld\n",
Review comment:
@davids5 we don't need apply PRI macro to uint16_t, since C standard require all type which's size is small than [unsigned]int must be promote to [unsigned]int for vararg function.
@wenliangxue please revert all seqno related change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] pkarashchenko commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r826917667
##########
File path: netutils/ping/icmpv6_ping.c
##########
@@ -289,7 +308,7 @@ void icmp6_ping(FAR const struct ping6_info_s *info)
goto done;
}
- elapsed = (unsigned int)TICK2MSEC(clock() - start);
+ elapsed = (unsigned int)TICK2USEC(clock() - start);
Review comment:
So what was the problem of using time base on milliseconds? I mean why we change from milliseconds to microseconds?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] wenliangxue commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
wenliangxue commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r827918790
##########
File path: netutils/ping/icmpv6_ping.c
##########
@@ -58,11 +60,21 @@
*/
static uint16_t g_ping6_id = 0;
+static volatile bool exiting = false;
Review comment:
Unified modification to long type
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] wenliangxue commented on a change in pull request #1066: Modifying the ping command
Posted by GitBox <gi...@apache.org>.
wenliangxue commented on a change in pull request #1066:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1066#discussion_r828779283
##########
File path: system/ping6/ping6.c
##########
@@ -240,6 +278,10 @@ int main(int argc, FAR char *argv[])
info.callback = ping6_result;
info.priv = &priv;
priv.code = ICMPv6_I_OK;
+ priv.tmin = INT_MAX;
Review comment:
down
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org