Skip to content

Add TLV to the ICMP payload#11

Merged
lolyu merged 11 commits intosonic-net:masterfrom
lolyu:add_tlv
Jan 12, 2022
Merged

Add TLV to the ICMP payload#11
lolyu merged 11 commits intosonic-net:masterfrom
lolyu:add_tlv

Conversation

@lolyu
Copy link
Copy Markdown
Contributor

@lolyu lolyu commented Dec 9, 2021

Description of PR

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Test case(new/improvement)

Approach

What is the motivation for this PR?

Add TLV support for the ICMP payload.

How did you do it?

This PR introduces a few changes to IcmpPayload

  1. Change the IcmpPayload format as:
|cookie(4bytes)|version(4bytes)|uuid(8bytes)|seq(8bytes)|
  1. Introduce TlvCommand and TlvSentinel
  • TlvCommand is used for signaling peer ToR to switch status
|type(1bytes) = 0x1|length(2bytes) = 1|command(1bytes)|
  • TlvSentinel is used for marking the end of the ICMP packet
|type(1bytes) = 0xff|length(2bytes) = 0|

How did you verify/test it?

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

@lolyu lolyu changed the title Add tlv [draft] Add tlv Dec 9, 2021
@lguohan
Copy link
Copy Markdown
Contributor

lguohan commented Dec 9, 2021

in general, can we get better description for the pr?

@lolyu lolyu force-pushed the add_tlv branch 4 times, most recently from 5479758 to da05b00 Compare December 13, 2021 13:41
Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
@lolyu lolyu marked this pull request as ready for review December 13, 2021 14:55
@lolyu lolyu changed the title [draft] Add tlv Add TLV to the ICMP payload Dec 13, 2021
@lolyu
Copy link
Copy Markdown
Contributor Author

lolyu commented Dec 13, 2021

in general, can we get better description for the pr?

Updated, thanks!

@lolyu lolyu requested review from lguohan, yxieca and zjswhhh December 13, 2021 15:25
@lolyu lolyu force-pushed the add_tlv branch 2 times, most recently from f2fd3b4 to c062704 Compare December 16, 2021 01:57
Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
@lolyu
Copy link
Copy Markdown
Contributor Author

lolyu commented Dec 17, 2021

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@lolyu lolyu force-pushed the add_tlv branch 2 times, most recently from 1a2520e to 7edbd5e Compare December 21, 2021 06:26
Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
icmpPayload->command = htonl(static_cast<uint32_t> (Command::COMMAND_NONE));
computeChecksum(icmpHeader, sizeof(icmphdr) + sizeof(*icmpPayload));
resetTxBufferTlv();
appendTlvSentinel();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we only append TlvCommand when it's COMMAND_SWITCH_ACTIVE instead of having it in every heartbeat (COMMAND_NONE)? Shouldn't we have it in every heartbeat?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, currently the logic is to put command tlv only if there is need to send COMMAND_SWITCH_ACTIVE. Since now we remove the fixed command field from IcmpPayload and wrap it as a TLV, no TlvCommand is the same a TlvCommand with COMMAND_NONE.

lolyu added 2 commits January 6, 2022 05:17
Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
lolyu added 5 commits January 6, 2022 08:48
Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
@lolyu lolyu requested a review from yxieca January 7, 2022 05:17
@lolyu lolyu merged commit 0ba431f into sonic-net:master Jan 12, 2022
yxieca pushed a commit that referenced this pull request Jan 14, 2022
Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
zjswhhh pushed a commit to zjswhhh/sonic-linkmgrd that referenced this pull request Jan 19, 2022
Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
zjswhhh added a commit to zjswhhh/sonic-linkmgrd that referenced this pull request Jan 19, 2022
zjswhhh pushed a commit to zjswhhh/sonic-linkmgrd that referenced this pull request Jan 24, 2022
Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
@lolyu lolyu deleted the add_tlv branch January 19, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants