-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add label values into traffic in agent side and retrieve the values from traffic in transit side #478
Conversation
…om traffic in transit side
Can you see the labels on the wire? (e.g. tcpdump capture on the egress NIC of the node) |
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 should handle the cases where there are no labels, and cases where just one of the labels (pod / ns) are present as well.
[Hong] label value = 0 covers the cases.
Please add unit tests. [Hong] There is no unit test for this part (src/xdp/*). And this part was written in a way of non unit testable. Let's consider whether we should put some efforts to enforce unit test for this part. |
What do we have under mizar/src/tests and mizar/tests and mizar/testse2e ? |
In the description, can you please add tcpdump trace of packets captured on the wire for each of the 4 cases for simple ping test? Scenarios: No labels, both ns and pod labels, only pod label, only ns label. You can create two pods so that they are scheduled on different worker nodes, and ping one pod from the other using this example yaml:
Then look for ICMP packets doing tcpdump on the veth of the kind-node with the ping source pod. e.g
|
Also, if you want to respond to my comment, please reply below or quote-reply. If you edit my comment, I don't get notification. I don't think we should even have that permission to edit someone else's comments. Let me investigate that .. |
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.
Looks ok to me
} | ||
|
||
pkt->namespace_label_value_opt = (void *)pkt->pod_label_value_opt + sizeof(*pkt->pod_label_value_opt); | ||
if (pkt->namespace_label_value_opt + 1 > pkt->data_end) { |
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.
Also check the option class like above
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.
Also I see option type is not checked or used anywhere in transit xdp. Should we check here as well?
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.
Added check for both class and type.
@@ -729,6 +729,22 @@ static __inline int trn_process_geneve(struct transit_packet *pkt) | |||
return XDP_ABORTED; | |||
} | |||
|
|||
pkt->pod_label_value_opt = (void *)pkt->scaled_ep_opt + sizeof(*pkt->scaled_ep_opt); | |||
if (pkt->pod_label_value_opt + 1 > pkt->data_end) { |
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.
Also check the option class like above
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.
Same as above for option type comment.
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.
Added check for both class and type.
I added a new issue and let's work on this 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.
Addressed comments
} | ||
|
||
pkt->namespace_label_value_opt = (void *)pkt->pod_label_value_opt + sizeof(*pkt->pod_label_value_opt); | ||
if (pkt->namespace_label_value_opt + 1 > pkt->data_end) { |
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.
Added check for both class and type.
@@ -729,6 +729,22 @@ static __inline int trn_process_geneve(struct transit_packet *pkt) | |||
return XDP_ABORTED; | |||
} | |||
|
|||
pkt->pod_label_value_opt = (void *)pkt->scaled_ep_opt + sizeof(*pkt->scaled_ep_opt); | |||
if (pkt->pod_label_value_opt + 1 > pkt->data_end) { |
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.
Added check for both class and type.
/approve |
@phudtran Does it look good to you now? |
What does this PR do?
How was this tested?
I did manual e2e test and label values can be retrieved correctly in transit side from packet.
Are there any user facing / API changes?
No.