Skip to content
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

Feature to perform pkt capturing on RX sides of interfaces #415

Merged
merged 14 commits into from
Nov 9, 2023

Conversation

byteocean
Copy link
Contributor

The details are documented in the committed file capture_offloaded_rx_pkts.md

@github-actions github-actions bot added size/XXL documentation Improvements or additions to documentation enhancement New feature or request labels Oct 25, 2023
@byteocean byteocean force-pushed the feature/pkt_capture branch from 292018e to 23d27f2 Compare October 25, 2023 15:16
@guvenc
Copy link
Collaborator

guvenc commented Oct 26, 2023

@byteocean PR branch doesnt compile in the CI.

@byteocean byteocean force-pushed the feature/pkt_capture branch 2 times, most recently from 4e3236f to b7601a9 Compare October 26, 2023 08:56
Copy link
Contributor

@PlagueCZ PlagueCZ left a comment

Choose a reason for hiding this comment

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

Okay, this is one big PR. I tried to cover all I saw, but that unfortunately means the comments are ranging from bugs to nitpicks, so please do not be discouraged, as a whole it looks really nicely done.

docs/deployment/capture_offloaded_rx_pkts.md Outdated Show resolved Hide resolved
docs/deployment/capture_offloaded_rx_pkts.md Show resolved Hide resolved
docs/deployment/capture_offloaded_rx_pkts.md Outdated Show resolved Hide resolved
docs/deployment/capture_offloaded_rx_pkts.md Outdated Show resolved Hide resolved
docs/deployment/capture_offloaded_rx_pkts.md Outdated Show resolved Hide resolved
src/rte_flow/dp_rte_flow_traffic_forward.c Show resolved Hide resolved
src/rte_flow/dp_rte_flow_traffic_forward.c Outdated Show resolved Hide resolved
src/rte_flow/dp_rte_flow_traffic_forward.c Outdated Show resolved Hide resolved
src/rte_flow/dp_rte_flow_traffic_forward.c Outdated Show resolved Hide resolved
src/rte_flow/dp_rte_flow_traffic_forward.c Show resolved Hide resolved
@PlagueCZ
Copy link
Contributor

PlagueCZ commented Oct 28, 2023

What will happen if you call for example start on vf1 and then separately start on vf2? If I read the code correctly, it will pass and now two interfaces will be captured?

And then what if you call start on vf1,vf2 and then start on vf3,vf2? This will fail and also will have to do a rollback of the vf3 rule right?

From the architecture, I understand why this "additive" behavior could be easier on the service, but on our last sync on this we talked about this being without any state, so I am trying to clarify how this works now.

(and also if we indeed do have a state, we would need a capture list command for the operator to know what is currently under capture)

@PlagueCZ
Copy link
Contributor

How is isolation handled? Currently only IP-IP packets are allowed into dpservice, so this traffic will not enter it.
But what will happen once we start using IPv6? Or is that also planned to be in the tunnel so this is a non-issue even for the future?

@byteocean
Copy link
Contributor Author

How is isolation handled? Currently only IP-IP packets are allowed into dpservice, so this traffic will not enter it. But what will happen once we start using IPv6? Or is that also planned to be in the tunnel so this is a non-issue even for the future?

Not extra isolation is needed. as we could just use native tcpdump on the pf ports, these extra packets will be captured together with other host packets. if a filter is applied to tcpdump to match udp ports, then only these extra packets will be written to file. IPv6 is also no problem, as they are part of the payload of UDP, and the extra bits for outer IPv6 and UDP can be stripped out by the tool in the readme.

@byteocean
Copy link
Contributor Author

What will happen if you call for example start on vf1 and then separately start on vf2? If I read the code correctly, it will pass and now two interfaces will be captured?

And then what if you call start on vf1,vf2 and then start on vf3,vf2? This will fail and also will have to do a rollback of the vf3 rule right?

From the architecture, I understand why this "additive" behavior could be easier on the service, but on our last sync on this we talked about this being without any state, so I am trying to clarify how this works now.

(and also if we indeed do have a state, we would need a capture list command for the operator to know what is currently under capture)

the code is adjusted a bit to leave no state in between and operations on the interface set (union or subtraction) are not allowed. Additive behaviour was not part of the intention. To start capturing on a new set of interfaces, the stopping command has to be called first. Otherwise, the second start simply failed. this point is documented.

@byteocean byteocean force-pushed the feature/pkt_capture branch 6 times, most recently from b9dfd43 to 24ca48c Compare November 3, 2023 10:51
@byteocean byteocean force-pushed the feature/pkt_capture branch from 24ca48c to 3f785d2 Compare November 3, 2023 10:59
include/monitoring/dp_monitoring.h Outdated Show resolved Hide resolved
src/grpc/dp_grpc_impl.c Show resolved Hide resolved
src/monitoring/dp_monitoring.c Outdated Show resolved Hide resolved
src/nodes/rx_node.c Outdated Show resolved Hide resolved
src/rte_flow/dp_rte_flow_init.c Outdated Show resolved Hide resolved
include/dp_error.h Outdated Show resolved Hide resolved
src/rte_flow/dp_rte_flow_init.c Outdated Show resolved Hide resolved
src/rte_flow/dp_rte_flow_init.c Outdated Show resolved Hide resolved
src/rte_flow/dp_rte_flow_init.c Outdated Show resolved Hide resolved
src/rte_flow/dp_rte_flow_init.c Outdated Show resolved Hide resolved
@byteocean byteocean force-pushed the feature/pkt_capture branch 2 times, most recently from f5bb2d1 to b0817e4 Compare November 3, 2023 16:33
src/rte_flow/dp_rte_flow_capture.c Outdated Show resolved Hide resolved
src/rte_flow/dp_rte_flow_capture.c Outdated Show resolved Hide resolved
src/rte_flow/dp_rte_flow_capture.c Outdated Show resolved Hide resolved
src/rte_flow/dp_rte_flow_capture.c Outdated Show resolved Hide resolved
@byteocean byteocean force-pushed the feature/pkt_capture branch 3 times, most recently from 1ab2cc2 to 8c70068 Compare November 6, 2023 10:19
include/grpc/dp_grpc_api.h Outdated Show resolved Hide resolved
src/grpc/dp_grpc_impl.c Outdated Show resolved Hide resolved
src/rte_flow/dp_rte_flow_traffic_forward.c Show resolved Hide resolved
@byteocean byteocean force-pushed the feature/pkt_capture branch from 3b08995 to 4a02a0c Compare November 6, 2023 14:14
@PlagueCZ PlagueCZ requested a review from guvenc November 6, 2023 14:27
@byteocean byteocean force-pushed the feature/pkt_capture branch from 4a02a0c to ef08cc6 Compare November 7, 2023 10:16
src/grpc/dp_grpc_impl.c Outdated Show resolved Hide resolved
@byteocean byteocean force-pushed the feature/pkt_capture branch from ef08cc6 to 9463c1e Compare November 7, 2023 10:45
@byteocean byteocean marked this pull request as ready for review November 7, 2023 11:21
proto/dpdk.proto Show resolved Hide resolved
proto/dpdk.proto Show resolved Hide resolved
proto/dpdk.proto Outdated Show resolved Hide resolved
docs/deployment/capture_offloaded_rx_pkts.md Outdated Show resolved Hide resolved
proto/dpdk.proto Outdated Show resolved Hide resolved
proto/dpdk.proto Show resolved Hide resolved
@byteocean byteocean force-pushed the feature/pkt_capture branch 3 times, most recently from 9699e38 to 7dd5333 Compare November 9, 2023 10:42
include/grpc/dp_async_grpc.h Outdated Show resolved Hide resolved
src/grpc/dp_async_grpc.cpp Outdated Show resolved Hide resolved
@byteocean byteocean force-pushed the feature/pkt_capture branch from 7dd5333 to 61e826c Compare November 9, 2023 11:04
@guvenc guvenc merged commit 6b53179 into main Nov 9, 2023
7 checks passed
@guvenc guvenc deleted the feature/pkt_capture branch November 9, 2023 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request size/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants