net_pkt: Removing legacy net_dir
This is actually useless as there is only 1 RX memory slab, and thus can be removed to reduce net_pkt structure size. Change-Id: I62d716515120e7356ee1e2d75bbe1ec32e22c35d Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
parent
db11fcd174
commit
2e331de690
2 changed files with 1 additions and 24 deletions
|
@ -33,14 +33,6 @@ extern "C" {
|
|||
|
||||
struct net_context;
|
||||
|
||||
enum net_dir {
|
||||
/* TX must be first and must have value 0 so that it is selected
|
||||
* by default.
|
||||
*/
|
||||
NET_TX = 0,
|
||||
NET_RX = 1,
|
||||
};
|
||||
|
||||
struct net_pkt {
|
||||
/** FIFO uses first 4 bytes itself, reserve space */
|
||||
int _unused;
|
||||
|
@ -100,7 +92,6 @@ struct net_pkt {
|
|||
uint8_t ip_hdr_len; /* pre-filled in order to avoid func call */
|
||||
uint8_t ext_len; /* length of extension headers */
|
||||
uint8_t ext_bitmap;
|
||||
uint8_t net_dir; /* is this RX or TX pkt */
|
||||
|
||||
#if defined(CONFIG_NET_IPV6)
|
||||
uint8_t ext_opt_len; /* IPv6 ND option length */
|
||||
|
@ -216,16 +207,6 @@ static inline void net_pkt_add_ext_bitmap(struct net_pkt *pkt, uint8_t bm)
|
|||
pkt->ext_bitmap |= bm;
|
||||
}
|
||||
|
||||
static inline uint8_t net_pkt_dir(struct net_pkt *pkt)
|
||||
{
|
||||
return pkt->net_dir;
|
||||
}
|
||||
|
||||
static inline void net_pkt_set_dir(struct net_pkt *pkt, enum net_dir dir)
|
||||
{
|
||||
pkt->net_dir = dir;
|
||||
}
|
||||
|
||||
static inline uint8_t *net_pkt_next_hdr(struct net_pkt *pkt)
|
||||
{
|
||||
return pkt->next_hdr;
|
||||
|
|
|
@ -316,10 +316,6 @@ struct net_pkt *net_pkt_get_reserve(struct k_mem_slab *slab,
|
|||
|
||||
net_pkt_set_ll_reserve(pkt, reserve_head);
|
||||
|
||||
if (slab == &rx_pkts) {
|
||||
net_pkt_set_dir(pkt, NET_RX);
|
||||
}
|
||||
|
||||
pkt->ref = 1;
|
||||
pkt->slab = slab;
|
||||
|
||||
|
@ -406,7 +402,7 @@ struct net_buf *net_pkt_get_frag(struct net_pkt *pkt,
|
|||
}
|
||||
#endif /* CONFIG_NET_CONTEXT_NET_PKT_POOL */
|
||||
|
||||
if (net_pkt_dir(pkt) == NET_RX) {
|
||||
if (pkt->slab == &rx_pkts) {
|
||||
#if defined(CONFIG_NET_DEBUG_NET_PKT)
|
||||
return net_pkt_get_reserve_rx_data_debug(
|
||||
net_pkt_ll_reserve(pkt), timeout, caller, line);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue