Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we'd better get both IPv4 tunnel dst and IPv6 tunnel dst, and set
tunnelDstIP
with valid one.You can also add verification in
traceflow_test.go:testTraceflowInterNode
, to check if the traceflow observation has expected tunnelDstIP.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Even if we get both IPv4 tunnel dst and IPv6 tunnel dst,
tunnelDstIP
value will be decided according toisIPv6
. The current code sets the value oftunnelDstIP
according toisIPv6
directly without getting both tunnel dst. So, why to get both tunnel dst explicitly?testTraceflowInterNode
currently runs in both encap mode and no encap mode. If tunnelDstIP is added then we have to make the test run only in encap mode. Is it ok to change this test to run only in encap mode?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whether it is dual stack / non dual stack, in both the cases handling can be done with isIPv6 flag with right packet type, With this logic isIPv6 flag remain false if packet is not of ipv6 type irrespective of stack and hence tunnelDstIP will be assigned with ipv4 and vice versa.
UT testing can be extended to see the right values in tunnelDstIP, if the mode is encap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because reading both ipv4/ipv6 tunnel dst is more simple to decide the tunnel dst, and it won't depend on the flow logic in OVS table.
Currently only IPv4 tunnel dst is used in DualStack env. Please check: https://github.com/antrea-io/antrea/blob/main/pkg/agent/openflow/client.go#L485
You can add the TunnelDstIP into
testTraceflowInterNode
likeAnd add the comparison into
compareObservations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wenyingd
Do we use peer Node IPv4 as tunnelDst for IPv4 packet and peer Node IPv6 as tunnelDst for IPv6 packet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We prefer to use tunnel format IPv4OverIPv4 and IPv6OverIPv6.