-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
inet: Do not copy pbuf when it already meets the PacketBuffer memory #23376
inet: Do not copy pbuf when it already meets the PacketBuffer memory #23376
Conversation
PR #23376: Size comparison from 753cb9c to 84c267d Increases (21 builds for bl602, bl702, cc13x2_26x2, efr32, esp32, psoc6, telink)
Decreases (7 builds for cc13x2_26x2, telink)
Full report (47 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, psoc6, qpg, telink)
|
That said, is there a reason this wasn't done via the approach described in #20923 (comment) ? That seem like it would avoid the copy even for the non-contiguous buffer case.... |
84c267d
to
c97997f
Compare
I am not sure whether we should use adopt the non-contiguous buffer to the PacketBuffer model in Matter. Many APIs of the PacketBuffer is designed based on the contiguous model. |
PR #23376: Size comparison from 81a64dc to c97997f Increases (20 builds for bl602, bl702, cc13x2_26x2, efr32, esp32, psoc6, telink)
Decreases (8 builds for cc13x2_26x2, qpg, telink)
Full report (49 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
Apart from the ones dealing with reserved space, which ones? @wqx6 |
For example, when we call |
It should fail for the non-contiguous case.
It should keep returning 0. |
…roject-chip#23376) * inet: Do not copy pbuf when it already meets the PacketBuffer memory model on LwIP platforms * Restyled by clang-format * Review changes Co-authored-by: Restyled.io <[email protected]>
…roject-chip#23376) * inet: Do not copy pbuf when it already meets the PacketBuffer memory model on LwIP platforms * Restyled by clang-format * Review changes Co-authored-by: Restyled.io <[email protected]>
In #20923, the LwIP pbuf will always be copied to a new created PacketBuffer.
We should adopt the LwIP pbuf to the Packet Buffer if it already meets the PacketBuffer memory model.