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

docs: add Program Types/XDP documentation #155

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

shard77
Copy link

@shard77 shard77 commented Apr 24, 2024

Added documentation for https://aya-rs.dev/book/programs/xdp/
Feel free to make reviews and suggest improvements.

Copy link

netlify bot commented Apr 24, 2024

Deploy Preview for aya-rs ready!

Name Link
🔨 Latest commit 471d5b4
🔍 Latest deploy log https://app.netlify.com/sites/aya-rs/deploys/6658c95d68cf450008d7e950
😎 Deploy Preview https://deploy-preview-155--aya-rs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@vadorovsky vadorovsky left a comment

Choose a reason for hiding this comment

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

Thanks for working on this 🙏 Left some comments, but I will review again later today.


## What is XBP in eBPF?

XBP (eXpress Data Path) is a type of eBPF program that attaches to the network interface. It allows for the processing of network packets as soon as they are received from the network driver, even before they enter the networking stack. XDP enables efficient packet filtering, manipulation and redirection at the earliest possible stage, resulting in low-latency and high-throughput.
Copy link
Member

Choose a reason for hiding this comment

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

Can we stick to 80-100 character limit per line?

Copy link
Author

Choose a reason for hiding this comment

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

Can we stick to 80-100 character limit per line?

Not sure what you mean per line, you want to break to a newline after max 100 chars?
On my side I don't see the lines go further than > 100 chars, it's always around 90 chars max per line.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I want to break to a new line after max 100 characters.

This exact sentence which I commented exceeds this limit and it's quite hard to read in some editors. The whole line 10 has 317 characters:

~> python3                                                                                                       04/30/24 13:30:49 PM
Python 3.11.5 (main, Aug 24 2023, 15:09:45) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> len("XDP (eXpress Data Path) is a type of eBPF program that attaches to the network interface. It enables filtering, manipulation and refirection of network packets as soon as they are received from the network driver, even before they enter the Linux kernel networking stack, resulting in low latency and high throughput.")
317

We should probably introduce some markdown linter to catch stuff like that, but for now can we just split the obviously too large lines?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, I want to break to a new line after max 100 characters.

This exact sentence which I commented exceeds this limit and it's quite hard to read in some editors. The whole line 10 has 317 characters:

~> python3                                                                                                       04/30/24 13:30:49 PM
Python 3.11.5 (main, Aug 24 2023, 15:09:45) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> len("XDP (eXpress Data Path) is a type of eBPF program that attaches to the network interface. It enables filtering, manipulation and refirection of network packets as soon as they are received from the network driver, even before they enter the Linux kernel networking stack, resulting in low latency and high throughput.")
317

We should probably introduce some markdown linter to catch stuff like that, but for now can we just split the obviously too large lines?

Sure, makes sense, the only thing I'm worried about is that it may be less nice to read on bigger screens or on the site directly

Copy link
Author

@shard77 shard77 Apr 30, 2024

Choose a reason for hiding this comment

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

For example, on a bigger screen/on the site, it would look like:

image

Maybe it's just me but I find it harder to read with all the line breaks here

Copy link
Author

@shard77 shard77 May 7, 2024

Choose a reason for hiding this comment

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

For example, on a bigger screen/on the site, it would look like:

image

Maybe it's just me but I find it harder to read with all the line breaks here

@vadorovsky Any news? I don't mind adding the line breaks, just thought it would make sense to reconsider it.

Copy link
Member

Choose a reason for hiding this comment

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

OK, I had no idea that breaking the lines even with a single \n makes it being rendered on the website. Let me test myself. If that's really the case, let's leave the long lines.

Copy link
Author

@shard77 shard77 May 30, 2024

Choose a reason for hiding this comment

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

OK, I had no idea that breaking the lines even with a single \n makes it being rendered on the website. Let me test myself. If that's really the case, let's leave the long lines.

my bad, I tried with <br> for line breaks (for some reason I thought you'd also like to render those on the website), going to try with single \n, it shouldn't render on the website.

Copy link
Author

Choose a reason for hiding this comment

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

@vadorovsky indeed it doesn't change anything on the website when adding single \n, I have added some line breaks for bigger sentences, let me know if I should change anything else 👍

docs/book/programs/xdp.md Outdated Show resolved Hide resolved
docs/book/programs/xdp.md Outdated Show resolved Hide resolved
docs/book/programs/xdp.md Outdated Show resolved Hide resolved
shard77 and others added 5 commits April 30, 2024 09:32
Co-authored-by: Michal Rostecki <vadorovsky@protonmail.com>
Co-authored-by: Michal Rostecki <vadorovsky@protonmail.com>
@shard77
Copy link
Author

shard77 commented Apr 30, 2024

Applied your reviews, also corrected some typos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants