On Fri, Jan 21, 2022 at 12:42:49PM +0800, Hangbin Liu wrote:
> In clock_create(), try get ts info first, if failed, try the old way.
How does this sentence relate to this...
> @@ -1001,10 +1001,16 @@ struct clock *clock_create(enum clock_type type,
> struct config *config,
> c->timestamping = timestamping;
> required_modes = clock_required_modes(c);
> STAILQ_FOREACH(iface, &config->interfaces, list) {
> - memset(ts_label, 0, sizeof(ts_label));
> - if (!rtnl_get_ts_device(interface_name(iface), ts_label))
> - interface_set_label(iface, ts_label);
> - interface_get_tsinfo(iface);
> + /* try find lowerlay device if we can't get iface tsinfo
> directly */
> + if (interface_get_tsinfo(iface) ||
> + (interface_tsinfo_valid(iface) &&
> + !interface_tsmodes_supported(iface, required_modes))) {
> + memset(ts_label, 0, sizeof(ts_label));
> + if (!rtnl_get_ts_device(interface_name(iface),
> ts_label))
> + interface_set_label(iface, ts_label);
> + interface_get_tsinfo(iface);
> + }
I really have no idea what this is supposed to do.
Why test for
interface_tsinfo_valid(iface) && !interface_tsmodes_supported(iface,
required_modes)
twice in a row !?!?!?
> +
> if (interface_tsinfo_valid(iface) &&
> !interface_tsmodes_supported(iface, required_modes)) {
See that ? ^^^^^^^^^^^^^^^^^^^
Thanks,
Richard
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel