hv:Replace dynamic memory with static for sbuf

--Config LOG_BUF_SIZE 256KB for per cpu
--Replace 'calloc' with static array for sbuf
--Rename 'alloc_earlylog_sbuf' to 'init_earlylog_sbuf'
--Remove deadcode sbuf_free

v2-->v3:
 -- put the buffer into per_cpu data structure
v1-->v2:
 -- add 'is_early_logbuf' in percpu data structure used for
    check if need to do 'do_copy_earlylog'

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Yan, Like <like.yan@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Mingqiang Chi
2018-10-25 14:25:35 +08:00
committed by lijinxia
parent 9e39732259
commit 2975f9fa65
5 changed files with 28 additions and 113 deletions

View File

@@ -74,8 +74,6 @@ static inline void sbuf_add_flags(struct shared_buf *sbuf, uint64_t flags)
sbuf->flags |= flags;
}
struct shared_buf *sbuf_allocate(uint32_t ele_num, uint32_t ele_size);
void sbuf_free(struct shared_buf *sbuf);
/**
*@pre sbuf != NULL
*@pre data != NULL
@@ -109,18 +107,6 @@ static inline void sbuf_add_flags(
{
}
static inline struct shared_buf *sbuf_allocate(
__unused uint32_t ele_num,
__unused uint32_t ele_size)
{
return NULL;
}
static inline void sbuf_free(
__unused struct shared_buf *sbuf)
{
}
static inline int sbuf_get(
__unused struct shared_buf *sbuf,
__unused uint8_t *data)