Other Parts Discussed in Thread: AM6442
Dear TI:
with Linux kernel version : ti-processor-sdk-linux-rt-j7-evm-08_02_00_01/board-support/linux-rt-5.10.100, we run gPTP stack with two J721E EVM board, this can align the the eth0 hardware timestamp from master to slave;
but after six hours, can not get the right hardware timestamp(we test more times, it can duplicate with run more than six hours);
for example: now get the hardware timestamp is 22414217445338ns, but after 125ms, get the hardware timestamp is 1654687951323214838, it is abnormal. the code get timestramp as below:
param.fd = ifa->fd[ifa->fdType];
param.buf = buf;
param.buflen = len;
param.use_swts = ifa->use_swts;
param.timestamp = ×tamp;
param.flags = MSG_DONTWAIT;
(void)memset(control, 0, sizeof(control));
(void)memset(&msg, 0, sizeof(msg));
msg.msg_name = &ss;
msg.msg_namelen = sizeof(ss);
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
msg.msg_control = control;
msg.msg_controllen = sizeof(control);
cnt = (int)recvmsg(param->fd, &msg, param->flags);
if (cnt < 0) {
GPTP_ERR("recvmsg%sfailed, fd %d: %m", (param->flags == MSG_ERRQUEUE) ? " tx timestamp " : " ", param->fd);
return -3;
}
for (cm = CMSG_FIRSTHDR(&msg); cm != NULL; cm = CMSG_NXTHDR(&msg, cm)) {
level = cm->cmsg_level;
type = cm->cmsg_type;
if (SOL_SOCKET == level && SO_TIMESTAMPING == type) {
if (cm->cmsg_len < sizeof(*ts) * 3) {
GPTP_WARN("short SO_TIMESTAMPING message");
return -EMSGSIZE;
}
ts = (struct timespec *) CMSG_DATA(cm);
}
}
if (!ts) {
return cnt;
}
if (param->use_swts) {
(void)memcpy(param->timestamp, &ts[0], sizeof(struct timespec));
}
else {
(void)memcpy(param->timestamp, &ts[2], sizeof(struct timespec));
}
we also do other test: 1, we run same gPTP stack code with AM6442 board for more than six hours (AM6442 Linux kernel is same as J721 EVM board), it is normal;
2. we run gPTP stack with same J721 evm board, but with QNX version for more than six hours, it is normal also.
so we think that maybe linux kernel eth0 mac driver have some overflow? do you meet same issue?