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

Improve the QUIC_RSTREAM implementation #19794

Closed
wants to merge 14 commits into from

Conversation

t8m
Copy link
Member

@t8m t8m commented Nov 30, 2022

Add API calls to avoid copying data when reading
These are ossl_quic_rstream_get_record() and
ossl_quic_rstream_release_record().

Add side storage for the stream frame data.
When there are too many packets referenced by the
receiving stream the function ossl_quic_rstream_move_to_rbuf() can be called to move the data to a ring buffer.

Checklist
  • tests are added or updated

@t8m t8m added branch: master Merge to master branch triaged: feature The issue/pr requests/adds a feature labels Nov 30, 2022
@t8m
Copy link
Member Author

t8m commented Nov 30, 2022

This is a draft as tests need to be added to cover the new API calls.

@t8m t8m marked this pull request as ready for review December 5, 2022 19:53
@t8m t8m added approval: review pending This pull request needs review by a committer approval: otc review pending This pull request needs review by an OTC member tests: present The PR has suitable tests present labels Dec 5, 2022
Copy link
Member

@hlandau hlandau left a comment

Choose a reason for hiding this comment

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

Looks good. One comment, decision is up to you.

ssl/quic/quic_rstream.c Show resolved Hide resolved
@hlandau hlandau removed the approval: otc review pending This pull request needs review by an OTC member label Dec 16, 2022
@t8m
Copy link
Member Author

t8m commented Dec 16, 2022

@hlandau still OK?

@hlandau hlandau added approval: done This pull request has the required number of approvals approval: review pending This pull request needs review by a committer and removed approval: review pending This pull request needs review by a committer approval: done This pull request has the required number of approvals labels Dec 20, 2022
@openssl-machine
Copy link
Collaborator

This PR is in a state where it requires action by @openssl/committers but the last update was 30 days ago

@hlandau
Copy link
Member

hlandau commented Jan 20, 2023

Needs rebase and second approval

Add API calls to avoid copying data when reading
These are ossl_quic_rstream_get_record() and
ossl_quic_rstream_release_record().

Add side storage for the stream frame data.
When there are too many packets referenced by the
receiving stream the function ossl_quic_rstream_move_to_rbuf()
can be called to move the data to a ring buffer.
@t8m
Copy link
Member Author

t8m commented Jan 20, 2023

Rebased. @hlandau please reconfirm.

Ping @openssl/committers for second approval.

The improvements should be used by the code, but that is a separate work task.

@t8m
Copy link
Member Author

t8m commented Feb 6, 2023

What is the reason for using a cyclic byte buffer rather than a list of datagrams? It seems like it means more fiddling around.

A thread safe list would be beneficial here grin

The reason is to avoid unnecessary allocations/deallocations.

@paulidale
Copy link
Contributor

Hmmm, feels a bit like premature optimisation.

The downside will be extra copies won't it?

@t8m
Copy link
Member Author

t8m commented Feb 6, 2023

Hmmm, feels a bit like premature optimisation.

The downside will be extra copies won't it?

Which extra copies? The ring buffer is used only when we are asked to deallocate the packets. We primarily use a linked list of received frames (with pointers to the packets holding the frames to deallocate later). The ring buffer is used only when the ossl_quic_rstream_move_to_rbuf() is called. That would be called by quic channel if there are too many packets being in process. Detecting that condition is something that still needs to be added to the quic channel implementation.

include/internal/quic_sf_list.h Outdated Show resolved Hide resolved
include/internal/quic_sf_list.h Outdated Show resolved Hide resolved
include/internal/ring_buf.h Outdated Show resolved Hide resolved
ssl/quic/quic_rstream.c Outdated Show resolved Hide resolved
ssl/quic/quic_rstream.c Show resolved Hide resolved
@t8m
Copy link
Member Author

t8m commented Feb 28, 2023

fixup pushed addressing @mattcaswell 's comments. @hlandau @mattcaswell please approve

@mattcaswell
Copy link
Member

CI failure looks relevant.

@t8m
Copy link
Member Author

t8m commented Mar 1, 2023

CI failure looks relevant.

Should be fixed now.

@t8m
Copy link
Member Author

t8m commented Mar 1, 2023

@mattcaswell @hlandau please re-approve

@hlandau hlandau added approval: done This pull request has the required number of approvals and removed approval: review pending This pull request needs review by a committer labels Mar 2, 2023
@openssl-machine openssl-machine added approval: ready to merge The 24 hour grace period has passed, ready to merge and removed approval: done This pull request has the required number of approvals labels Mar 3, 2023
@openssl-machine
Copy link
Collaborator

This pull request is ready to merge

@t8m
Copy link
Member Author

t8m commented Mar 6, 2023

Merged to master branch. Thank you for the reviews.

@t8m t8m closed this Mar 6, 2023
openssl-machine pushed a commit that referenced this pull request Mar 6, 2023
Add API calls to avoid copying data when reading
These are ossl_quic_rstream_get_record() and
ossl_quic_rstream_release_record().

Add side storage for the stream frame data.
When there are too many packets referenced by the
receiving stream the function ossl_quic_rstream_move_to_rbuf()
can be called to move the data to a ring buffer.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from #19794)
openssl-machine pushed a commit that referenced this pull request Mar 6, 2023
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from #19794)
openssl-machine pushed a commit that referenced this pull request Mar 6, 2023
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from #19794)
openssl-machine pushed a commit that referenced this pull request Mar 6, 2023
Reported by Marc Schönefeld.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from #19794)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approval: ready to merge The 24 hour grace period has passed, ready to merge branch: master Merge to master branch tests: present The PR has suitable tests present triaged: feature The issue/pr requests/adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants