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

lib/ukfile: Add utility inlines for iovec I/O #1396

Merged
merged 1 commit into from May 21, 2024

Conversation

andreittr
Copy link
Contributor

Description of changes

This change adds a utility header providing convenience inlines for doing I/O on buffers described by struct iovec, namely:

  • zero out
  • scatter data from buffer to iov
  • gather data from iov into buffer

This code is not used by any lib or core component yet, however, the following PRs may benefit:

If the above are merged before this PR, will append commits w/ patches here.

Prerequisite checklist

  • Read the contribution guidelines regarding submitting new changes to the project;
  • Tested your changes against relevant architectures and platforms;
  • Ran the checkpatch.uk on your commit series before opening this PR;
  • Updated relevant documentation.

Base target

  • Architecture(s): [e.g. x86_64 or N/A]
  • Platform(s): [e.g. kvm, xen or N/A]
  • Application(s): [e.g. app-python3 or N/A]

Additional configuration

N/A

@andreittr andreittr requested a review from a team as a code owner April 24, 2024 11:31
@github-actions github-actions bot added the area/lib Internal Unikraft Microlibrary label Apr 24, 2024
@razvand razvand requested review from Mihnea27, SerbanSo and eduardvintila and removed request for a team April 28, 2024 05:28
@razvand razvand added kind/enhancement New feature or request lib/ukfile ukfile Librry labels Apr 28, 2024
@razvand razvand added this to the v0.17.0 (Calypso) milestone Apr 28, 2024
@SerbanSo
Copy link

Looks good.

I see the only difference between uk_iov_scatter and uk_iov_gather is the source and destination in the memcpy function. One idea would be to make a more general method that contains the code while making uk_iov_scatter and uk_iov_gather wrappers around that method. I don't think it will be a big improvement for the moment, but it might be useful in the future.

Reviewed by: Serban Sorohan serban.sorohan@gmail.com

Copy link

@Mihnea27 Mihnea27 left a comment

Choose a reason for hiding this comment

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

Suggested a couple changes, they apply for all functions not just the first one. Besides those, everything looks correct.

Reviewed by: Mihnea Popeanga popeanga.mihnea@gmail.com

lib/ukfile/include/uk/file/iovutil.h Show resolved Hide resolved
lib/ukfile/include/uk/file/iovutil.h Show resolved Hide resolved
This change adds a utility header providing convenience inlines for
doing I/O on buffers described by struct iovec, namely:
- zero out
- scatter data from buffer to iov
- gather data from iov into buffer

Signed-off-by: Andrei Tatar <andrei@unikraft.io>
Copy link

@Mihnea27 Mihnea27 left a comment

Choose a reason for hiding this comment

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

Everything looks good now!

Reviewed by: Mihnea Popeanga popeanga.mihnea@gmail.com

Copy link
Member

@eduardvintila eduardvintila left a comment

Choose a reason for hiding this comment

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

Nice addition, thanks.

Reviewed-by: Eduard Vintilă eduard.vintila47@gmail.com

Copy link
Member

@mschlumpp mschlumpp left a comment

Choose a reason for hiding this comment

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

Approved-by: Marco Schlumpp marco@unikraft.io

@razvand razvand changed the base branch from staging to staging-1396 May 21, 2024 20:57
@razvand razvand merged commit 4c289d3 into unikraft:staging-1396 May 21, 2024
14 checks passed
razvand pushed a commit that referenced this pull request May 21, 2024
This change adds a utility header providing convenience inlines for
doing I/O on buffers described by struct iovec, namely:
- zero out
- scatter data from buffer to iov
- gather data from iov into buffer

Signed-off-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Approved-by: Marco Schlumpp <marco@unikraft.io>
GitHub-Closes: #1396
@andreittr andreittr deleted the ttr/ukfile-iovutil branch May 24, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/lib Internal Unikraft Microlibrary kind/enhancement New feature or request lib/ukfile ukfile Librry
Projects
Status: Done!
Development

Successfully merging this pull request may close these issues.

None yet

6 participants