Skip to content

Commit

Permalink
Reduce TX memory further down by some MB
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
fabbione committed Jun 4, 2017
1 parent 09c8534 commit 0226565
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libknet/handle.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,15 @@ static int _init_buffers(knet_handle_t knet_h)
size_t bufsize;

for (i = 0; i < PCKT_FRAG_MAX; i++) {
knet_h->send_to_links_buf[i] = malloc(KNET_HEADER_DATA_SIZE);
bufsize = ceil((float)KNET_MAX_PACKET_SIZE / (i + 1)) + KNET_HEADER_ALL_SIZE;
knet_h->send_to_links_buf[i] = malloc(bufsize);
if (!knet_h->send_to_links_buf[i]) {
savederrno = errno;
log_err(knet_h, KNET_SUB_HANDLE, "Unable to allocate memory datafd to link buffer: %s",
strerror(savederrno));
goto exit_fail;
}
memset(knet_h->send_to_links_buf[i], 0, KNET_HEADER_DATA_SIZE);
memset(knet_h->send_to_links_buf[i], 0, bufsize);

knet_h->recv_from_links_buf[i] = malloc(KNET_DATABUFSIZE);
if (!knet_h->recv_from_links_buf[i]) {
Expand Down

0 comments on commit 0226565

Please sign in to comment.