net/net_pkt: Fully separate struct net_pkt from struct net_buf

- net_pkt becomes a stand-alone structure with network packet meta
  information.
- network packet data is still managed through net_buf, mostly named
  'frag'.
- net_pkt memory management is done through k_mem_slab
- function got introduced or relevantly renamed to target eithe net_pkt
  or net_buf fragments.
- net_buf's sent_list ends up in net_pkt now, and thus helps to save
  memory when TCP is enabled.

Change-Id: Ibd5c17df4f75891dec79db723a4c9fc704eb843d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2017-04-05 08:37:44 +02:00 committed by Jukka Rissanen
commit db11fcd174
122 changed files with 5510 additions and 5480 deletions

View file

@ -57,6 +57,7 @@ extern "C" {
#include <kernel.h>
struct net_buf;
struct net_pkt;
struct net_context;
struct net_if;
@ -71,21 +72,21 @@ enum net_verdict {
};
/* Called by lower network stack when a network packet has been received */
int net_recv_data(struct net_if *iface, struct net_buf *buf);
int net_recv_data(struct net_if *iface, struct net_pkt *pkt);
/**
* @brief Send data to network.
*
* @details Send data to network. This should not be used normally by
* applications as it requires that the buffer and fragments are properly
* applications as it requires that the pktfer and fragments are properly
* constructed.
*
* @param buf Network buffer.
* @param pkt Network packet.
*
* @return 0 if ok, <0 if error. If <0 is returned, then the caller needs
* to unref the buf in order to avoid buffer leak.
* to unref the pkt in order to avoid memory leak.
*/
int net_send_data(struct net_buf *buf);
int net_send_data(struct net_pkt *pkt);
struct net_stack_info {
char *stack;