diff options
author | 2018-08-13 19:23:34 +0530 | |
---|---|---|
committer | 2018-08-13 19:25:27 +0530 | |
commit | 7dc65518819f2b453fd2837e92c115592d8832ec (patch) | |
tree | f9119bb3624ff11af480981c9904b84c172a607c /src/framework/common/mem_mgr | |
parent | bd6e75c243db1b384ba0882ecaf9063ec4cd70bd (diff) |
Feat : LWIP integration part1
Change-Id: Ia26c092d16579c6f845a021ba66bde106363883a
Signed-off-by: Swarup Nayak <swarupnpvt@gmail.com>
Diffstat (limited to 'src/framework/common/mem_mgr')
-rw-r--r-- | src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_mng.c | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_mng.c b/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_mng.c index 270e0f8..2622809 100644 --- a/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_mng.c +++ b/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_mng.c @@ -699,53 +699,6 @@ nsfw_shmem_static (void *handle, nsfw_mem_struct_type type) i32 nsfw_shmem_mbuf_recycle (mpool_handle handle) { -#if 0 - const struct common_mem_mempool *mp = (struct common_mem_mempool *) handle; - struct common_mem_ring *rteRing = NULL; - struct common_mem_mbuf *m_buf = NULL; - uint32_t item; - u32_t *recycle_flg; - uint32_t size = mp->size; - uint32_t threadsize = (size >> 2) * 3; - rteRing = (struct common_mem_ring *) ADDR_SHTOL (mp->ring); - - if (rteRing->prod.tail - rteRing->cons.head < threadsize) - { - for (item = 0; item < size - 1; item++) - { - m_buf = (struct common_mem_mbuf *) ADDR_SHTOL (mp->elt_va_start + item * (mp->header_size + mp->elt_size + mp->trailer_size) + mp->header_size); /*lint !e647 */ - recycle_flg = - (uint32_t *) ((char *) (ADDR_SHTOL (m_buf->buf_addr_align)) + - RTE_PKTMBUF_HEADROOM - sizeof (uint32_t)); - - if (m_buf->refcnt > 0 && *recycle_flg == MBUF_HLD_BY_APP) - { - NSCOMM_LOGINF ("free mbuf hold by app]ring=%p, mbuf=%p", handle, - m_buf); - *recycle_flg = MBUF_UNUSED; - common_mem_pktmbuf_free (m_buf); - } - } - } - - NSCOMM_LOGINF ("To recycle app_tx_pool now]ring=%p,prod.head=%u," - "prod.tail=%u,cons.head=%u,cons.tail=%u.", handle, - rteRing->prod.head, rteRing->prod.tail, - rteRing->cons.head, rteRing->cons.tail); - - /*we Must check and recorrect the Queue if Queue is not correct - 1.if proc.head != proc.tail set proc.head to proc.tail [may lost some buf,but the queue still can use] - App May not putIn Data , just done head++, we can't set proc.tail to proc.head. - 2.if cons.head != cons.tail set cons.tail to cons.head [may lost some buf,but the queue still can use] - App May already finish deque,just not tail++, we can't set cons.head to cons.tail. - */ - if ((rteRing->prod.head != rteRing->prod.tail) - || (rteRing->cons.head != rteRing->cons.tail)) - { - rteRing->prod.head = rteRing->prod.tail; - rteRing->cons.tail = rteRing->cons.head; - } -#endif return NSFW_MEM_OK; } |