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

[PATCH v10] api: dma: support source free and destination allocation features #2179

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

VamsiKrishnaA99
Copy link

No description provided.

@odpbuild odpbuild changed the title [PATCH v5] api: dma: support source free and destination allocation features [PATCH v6] api: dma: support source free and destination allocation features Jan 27, 2025
Copy link
Collaborator

@TuomasTaipale TuomasTaipale left a comment

Choose a reason for hiding this comment

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

Still a few comments from internal review, we're getting there.

For better trackability, you can rebase-amend the commits with the fixes locally on your branch and then force-push to your fork-remote-branch. The changes then appear in this same pull request and GitHub can track the diff between versions (GitHub automatically updates the "[PATCH vX]" prefix when new stuff is pushed to the PR-branch).

@VamsiKrishnaA99
Copy link
Author

Sure Tuomas, thanks for reviewing it.

@odpbuild odpbuild changed the title [PATCH v6] api: dma: support source free and destination allocation features [PATCH v7] api: dma: support source free and destination allocation features Feb 2, 2025
@VamsiKrishnaA99
Copy link
Author

Addressed V6 review comments.

@TuomasTaipale
Copy link
Collaborator

#2171 and #2176 for reference.

@odpbuild odpbuild changed the title [PATCH v7] api: dma: support source free and destination allocation features [PATCH v8] api: dma: support source free and destination allocation features Feb 4, 2025
@odpbuild odpbuild changed the title [PATCH v8] api: dma: support source free and destination allocation features [PATCH v9] api: dma: support source free and destination allocation features Feb 4, 2025
* destination packet. Indexes should appear in ascending order, starting
* from index 0.
*/
uint16_t index;
Copy link
Collaborator

Choose a reason for hiding this comment

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

For consistency (to match pkt_len), name of this field could be pkt_index. Also, "pkt_index" is less likely to collide later if another "index" field needs to be added into this struct.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe the naming is now fine, but additionally the type of the index could be changed from uint16_t to uint32_t, this would then be more consistent with odp_dma_transfer_param_t::num_dst and odp_dma_result_t::num_dst which are both uint32_t.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thank you for fixing the field name. I agree with Tuomas that uint32_t could be used instead. It does not increase struct size and harmonizes numbers DMA segments/packets parameter types.

Vamsi Attunuru added 2 commits February 14, 2025 14:28
This specification change details the necessary fields for
advertising the source segment freeing offload for data
format #ODP_DMA_FORMAT_PACKET. It also defines the required
fields to enable this feature.

Application can free all the source segments using
odp_dma_transfer_t:seg_free field. The 'unique_src_segs'
field can be used to indicate if the source packet is
reused across multiple segments to avoid any double-free
issues.

Additionally, application can use dma transfer options field
odp_dma_transfer_t:single_pool to free all source segments
to a single pool, provided all segments belong to a same pool.

Signed-off-by: Vamsi Attunuru <[email protected]>
Reviewed-by: Tuomas Taipale <[email protected]>
This specification change outlines the necessary fields to advertise
the destination segment allocation offload feature. It also defines
the required fields in odp_dma_transfer_param_t and odp_dma_seg_t to
leverage this feature.

When the application opts for destination packet allocation, it will
receive the allocated packet details in odp_dma_result_t::dst_pkt
array after the DMA completion.

Signed-off-by: Vamsi Attunuru <[email protected]>
Reviewed-by: Tuomas Taipale <[email protected]>
@odpbuild odpbuild changed the title [PATCH v9] api: dma: support source free and destination allocation features [PATCH v10] api: dma: support source free and destination allocation features Feb 14, 2025
@VamsiKrishnaA99
Copy link
Author

Thanks Petri for the comments, fixed them in v10.

* descriptor. Same pkt_index can be reused across subsequent segments if
* application wishes to transfer to different offsets of the same
* destination packet. This means that if application for example uses
* segment index 0 in each destination segment descriptor (with different
Copy link
Collaborator

Choose a reason for hiding this comment

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

Typo: "segment index 0 ..." -> "packet index 0 ..."

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.

3 participants