On Fri, Nov 11, 2022 at 07:53:46AM -0800, Vadim Fedorenko via Linuxptp-devel
wrote:
> The latest proposal for DC PTP Profile[1] provides logic to make load
> balancing of unicast clients when running multiple GMs in active-active
> mode. This patch adds this logic to ptp4l using already existing
> localPriority field for telecom profile. Together with telecom BMCA
> algorithm it implements sharding based on provided GM priority.
>
> [1] https://www.opencompute.org/documents/ocp-dc-ptp-profile-v1r1-pdf-2
I'll need some time to digest that...
but in the mean time,
> @@ -677,18 +678,27 @@ static int parse_unicast_mtab_line(struct config *cfg,
> char *line, int line_num)
> if (cnt == 1) {
> return config_unicast_mtab_peer(address, line_num);
> }
> - cnt = sscanf(line, " %16s %64s", transport, address);
> - if (cnt != 2) {
> + cnt = sscanf(line, " %16s %64s %d", transport, address, &prio);
> + if (cnt < 2) {
> fprintf(stderr, "bad master table at line %d\n", line_num);
> return -1;
> }
> + if (cnt == 3 && (prio < 0 || prio > 255)) {
> + fprintf(stderr, "bad address priority(%d) at line %d\n", prio,
> line_num);
> + prio = 0;
> + }
> + if (cnt == 2) {
> + fprintf(stderr, "address priority is not parsed at line %d\n",
> line_num);
> + prio = 0;
> + }
You are adding a third, optional element. In order not to alarm
existing users, it is better not to print warning when only two values
are present, hm?
Thanks,
Richard
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel