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

add memory alignment for ARM32 #4208

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/platform/datapath_epoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ typedef struct DATAPATH_RX_IO_BLOCK {

} DATAPATH_RX_IO_BLOCK;

typedef struct DATAPATH_RX_PACKET {
typedef struct __attribute__((aligned(16))) DATAPATH_RX_PACKET {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add more info in your PR description as to why this helps and is necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not 100% sure yet, so trying to run automation first

Copy link
Member

Choose a reason for hiding this comment

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

Are you sure yet? 😄

Copy link
Member

Choose a reason for hiding this comment

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

I did play with this little bit more and it is also sufficient (as far as I can tell) to increase RecvBlockStride

Datapath->RecvBlockStride =
sizeof(DATAPATH_RX_PACKET) + ClientRecvDataLength;

I originally added +4 but it also works for me with +1 or +2. I sort of expected corrupted pointer if something overrides the location.

It seems like we are casting bunch of packets to single big buffer, right @nibanks? Are we positive the structures always land on aligned boundary? It seems like the issue is triggered only when we pack multiple packets into single buffer. In the test we look at with @ami-GS, there is single packet and then we have few together. As @ami-GS noticed it was always crashing on processing third one, e.g. first that is packed second in the buffer.

Copy link
Member

Choose a reason for hiding this comment

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

@ami-GS can we shoot to get this merged this week? Please address my comment above, and associate this PR with the bug that's tracking the issue.

//
// The IO block that owns the packet.
//
Expand Down
Loading