31                       16 15                        0
+-------------+-------------+-------------+-------------+
|  bgack_cnt  |  ugack_cnt  |            len            |
+-------------+-------------+-------------+-------------+  -
|            gap            |            ack            |   |
+-------------+-------------+-------------+-------------+    > bc gacks
:                           :                           :   |
+-------------+-------------+-------------+-------------+  -
|            gap            |            ack            |   |
+-------------+-------------+-------------+-------------+    > uc gacks
:                           :                           :   |
+-------------+-------------+-------------+-------------+  -

which is "automatically" backward-compatible.

===
[Ying] In my opinion,  this patch will cause the backward-compatible issue 
below:

1) On the TIPC node with the patch:
When sending a 'PROTOCOL/STATE_MSG' message , its 'Gap ACK blocks' data field 
only contains bcl gap ack blocks, but no any unicast link gap ack block.
2) On the TIPC node without the patch:
Upon receiving the message sent by the node of case 1), this node will suppose 
its 'Gap ACK blocks' data field are unicast link gap ack blocks rather than 
broadcast link gap ack blocks.

[Tuong]: As you can see in the figure above, we have two different 
"b/ugack_cnt" fields which determine the number of broadcast/unicast gap ack 
blocks in the message. The "ugack_cnt" is fully identical to the "gack_cnt" in 
the old version (- without the patch) i.e. indicating the number of unicast gap 
ack blocks anyway, whereas the "bgack_cnt" was a reserved field.
So, in your situation, the sending side will send the message with the 
"ugack_cnt" = 0 and this is completely compatible to the old version that the 
receiving side will see no unicast gap ack blocks and just ignore the broadcast 
gap ack blocks (- it doesn't really know). Actually, there is also a sanity 
check on the length in the old code that will shortly ignore such the gap ack 
block report... So, we have no problem at all. That is why I've declared it 
backward compatible automatically.

>>[Ying]: Thanks for your clarification. Yes, you are right. Now it's really 
>>compatible between old and new versions.

So I wonder no backward-compatible issue will exist and everything will become 
pretty easy if we use LINK_PROTOCOL to only contain unicast gap ack blocks and 
use BCAST_PROTOCOL to convey broadcast gap ack blocks.
In other words, we don't need to enlarge current gap ack block space, and we 
don't need to change the current code related unicast gap ack blocks. Instead, 
we just need to add the support for broadcast gap ack blocks through 
BCAST_PROTOCOL rather than LINK_PROTOCOL. 

[Tuong]: The BCAST_PROTOCOL is currently only used for broadcast initializing 
or synching when a new peer joins, the old mechanism as broadcast NACKs is 
deprecated... I suppose that using the LINK_PROTOCOL is much more convenient 
since the traditional ack/gap reports for broadcast link is also made via the 
message, so we don't need to create a new code flow to handle the gap/ack 
blocks.
Actually, the change in the current code related unicast gap ack blocks is just 
to optimize the code e.g. removing an old functions, etc., there is no impact 
in its functionality.

>>[Ying]: Sorry, I forgot this comment: 
>>https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=02d11ca20091fcef904f05defda80c53e5b4e793.
It made broadcast NACK delivered through link state. 

Okay, both unicast link and bcl gap ack blocked can be transferred in the same 
link state message. 

>>[Ying]: By the way, I have another minor comment:

As  "bgack_cnt" is defined after " ugack_cnt " in struct tipc_gap_ack_blks, 
please reverse their order in this struct description section.

/* struct tipc_gap_ack_blks
  * @len: actual length of the record
- * @gack_cnt: number of Gap ACK blocks in the record
+ * @bgack_cnt: number of Gap ACK blocks for broadcast in the record
+ * @ugack_cnt: number of Gap ACK blocks for unicast (following the broadcast
+ *             ones)
+ * @start_index: starting index for "valid" broadcast Gap ACK blocks
  * @gacks: array of Gap ACK blocks
  */
 struct tipc_gap_ack_blks {
        __be16 len;
-       u8 gack_cnt;
-       u8 reserved;
+       union {
+               u8 ugack_cnt;
+               u8 start_index;
+       };
+       u8 bgack_cnt;
        struct tipc_gap_ack gacks[];
 };




_______________________________________________
tipc-discussion mailing list
tipc-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tipc-discussion

Reply via email to