Re: [RFC] HEADS UP: s/net_nbuf/net_pkt and separation from net_buf

Paul Sokolovsky


So, this patchset was merged today to the "net" branch, thanks Tomasz
and Jukka!

I updated my BSD Sockets prototype in MicroPython
(, and
tested it to work as expected with the basic manual tests and few
automated tests (whole 4 of them, which I was able to implement so far).

This removed few hacks even in the basic implementation, and I hope to
perform packet queue optimization without gross hacks which were
required previously.

Anyway, my immediate plan is to take renaming opportunity and rework
net_pkt_append() to return length of added data instead of just boolean
status (, hope to do
that tomorrow.


On Sun, 16 Apr 2017 16:48:09 +0300
Paul Sokolovsky <> wrote:

Hello Tomasz,

Thanks for coming forward with this patchset. I eyeballed first 5-6
patches in the set, and just did a smoke test of applying them one by
one and making sure echo_server works. I understand it's just a smoke
test, but well, at least I can say that I tried your patches ;-).

The patchset starts with a couple of truly massive patches, with first
one,, doing nothing but
symbolic renaming, i.e. doesn't affect binary code. At the same time,
it's really huge, so would be constantly broken due to conflicts with
concurrent changes made. Given that further patches show real benefits
of this refactor, like optimizing layouts to save memory, and some
were already reviewed and OKed by Jukka, it would be nice to discuss
plans on getting these changes landed, starting with the big renaming
patch above.

On Wed, 12 Apr 2017 12:02:54 +0200
Tomasz Bursztyka <> wrote:

As a small notice, I quickly checked on the new tests/net/all app
(it compiles the net stack with
as much as possible of its options).

This patch-set gives a bit more than 1Ko of ROM saved, and about
1.5Ko of RAM saved.
The gain can be more visible if some apps was having bigger data
buffer pools etc...
I think 1.5KB of RAM saved is already a very good result. That's a
whole IPv6 or Ethernet packet more, which may mean extra network
connection more, and as we'd usually count them as single digits
anyway, having an extra one isn't too bad. I'm sure that the patchset
you've been working on will show the real benefits of the native
Zephyr IP stack, so keeping fingers crossed that the landing process
will be smooth and soon we'll be able to benefit from it!


Best Regards,
Paul | Open source software for ARM SoCs
Follow Linaro:!/linaroorg -

Join to automatically receive all group messages.