Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory problems and ipv4 stats bug fixes #909

Open
wants to merge 3 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/ipv4.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ extern rte_spinlock_t ip4_stats_lock;
#define IP4_UPD_PO_STATS(field, val) \
do { \
rte_spinlock_lock(&ip4_stats_lock); \
__IP4_ADD_STATS(field##pkts, (val)); \
__IP4_ADD_STATS(field##pkts, (1)); \
__IP4_ADD_STATS(field##octets, (val)); \
rte_spinlock_unlock(&ip4_stats_lock); \
} while (0)
Expand Down
2 changes: 0 additions & 2 deletions include/parser/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
static inline void* xmalloc(uint32_t sz)
{
void *mem = rte_zmalloc("cfgfile", sz, RTE_CACHE_LINE_SIZE);
if (mem)
memset(mem, 0, sz);

return mem;
}
Expand Down
2 changes: 0 additions & 2 deletions src/iftraf.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,6 @@ static void inline iftraf_tlb_add(struct iftraf_pkt *param)
return;
}

memset(entry, 0, sizeof(struct iftraf_entry));
entry->af = param->af;
entry->cid = param->cid;
entry->devid = param->devid;
Expand Down Expand Up @@ -578,7 +577,6 @@ static void inline iftraf_iftlb_add(struct iftraf_pkt *param)
return;
}

memset(entry, 0, sizeof(struct iftraf_entry));
entry->af = param->af;
entry->cid = param->cid;
entry->devid = param->devid;
Expand Down
4 changes: 2 additions & 2 deletions src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,9 @@ void *set_value(vector_t tokens)
str = VECTOR_SLOT(tokens, i);
len += strlen(str);
if (!alloc)
alloc = (char *) MALLOC(sizeof(char *) * (len + 1));
alloc = (char *) MALLOC(sizeof(char) * (len + 1));
else {
alloc = REALLOC(alloc, sizeof(char *) * (len + 1));
alloc = REALLOC(alloc, sizeof(char) * (len + 1));
tmp = VECTOR_SLOT(tokens, i - 1);
if ( *str != '"' && *tmp != '"')
strncat(alloc, " ", 1);
Expand Down