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

Support one continuous net_buf for TCP TX case #83260

Open
MaochenWang1 opened this issue Dec 20, 2024 · 1 comment
Open

Support one continuous net_buf for TCP TX case #83260

MaochenWang1 opened this issue Dec 20, 2024 · 1 comment
Assignees
Labels
area: Networking Enhancement Changes/Updates/Additions to existing features

Comments

@MaochenWang1
Copy link
Collaborator

Is your enhancement proposal related to a problem? Please describe.
Currently in function tcp_out_ext, for TCP TX, it will use two separate net_buf, one contains ip and tcp header, another contains data payload.
It has two side effects:
(1) for running TCP throughput case, the num of net_buf should be twice of net_pkt, and consume more memory.
(2) non-continuous buffer will decrease the memcpy efficiency when copy to lower interface.

Describe the solution you'd like
Use single net_buf for TCP TX data when NET_BUF_DATA_SIZE is large enough.

@MaochenWang1 MaochenWang1 added Enhancement Changes/Updates/Additions to existing features area: Networking labels Dec 20, 2024
@jukkar
Copy link
Member

jukkar commented Dec 20, 2024

If memory is an issue, it is actually better to set CONFIG_NET_BUF_DATA_SIZE to smaller value so that buffers are utilized better if the amount of data to be sent is small. Other option is to use CONFIG_NET_BUF_VARIABLE_DATA_SIZE which uses malloc to allocate just enough memory to the data to be sent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Networking Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

No branches or pull requests

3 participants