From: Richard Cochran <richardcoch...@gmail.com>
Sent: 05 December 2022 04:16

>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.
>>
>> 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?

It's a good point, but it will hide an issue when third element is provided in
a form that cannot be parsed as a digit. I do agree that there is no need to
alarm existing users and will try to find a better way to check for 3rd element.
Or will send v2 with simply removing this print if there is no better way.

Thanks,
Vadim

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

Reply via email to