On Fri, Jun 17, 2022 at 02:55:02PM +0530, SyncMonk Technologies wrote:

> +static int vport_recv(struct transport *t, int fd, void *buf, int buflen,
> +                 struct address *addr, struct hw_timestamp *hwts)
> +{
> +     int cnt;
> +     struct vport *vport = container_of(t, struct vport, t);
> +
> +     addr->len = sizeof(addr->sun);
> +     cnt = recvfrom(fd, buf, buflen, 0, &addr->sa, &addr->len);

This does not generate a receive time stamp, so what is the point?

> +     if (cnt <= 0) {
> +             pr_err("vport: recvfrom failed: %m");
> +             return cnt;
> +     }
> +     vport->address = *addr;
> +     return cnt;
> +}
> +
> +static int vport_send(struct transport *t, struct fdarray *fda,
> +                 enum transport_event event, int peer, void *buf, int buflen,
> +                 struct address *addr, struct hw_timestamp *hwts)
> +{
> +     int cnt, fd = fda->fd[FD_GENERAL];
> +     struct vport *vport = container_of(t, struct vport, t);
> +
> +     if (!addr)
> +             addr = &vport->address;
> +
> +     cnt = sendto(fd, buf, buflen, 0, &addr->sa, addr->len);
> +     if (cnt < 1) {
> +             return -errno;
> +     }

No transmit time stamp?  Kinda useless if you ask me.

> +     return cnt;
> +}

Thanks,
Richard




_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to