Changeset 5d8280a


Ignore:
Timestamp:
11/14/17 11:15:06 (4 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
cachetimestamps, develop, dpdk-ndag, etsilive, master, ndag_format, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance
Children:
eb70703
Parents:
639d952
Message:

Increased buffer number and batch size for ndag receiving.

Only call recvmmsg if there are a decent number of buffers
available to fill -- the overhead is not worth it if we've only
got one or two buffers available and, in that case, we must have
plenty of buffered packets ready for reading anyway.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_ndag.c

    r639d952 r5d8280a  
    2626#define ENCAP_BUFSIZE (10000)
    2727#define CTRL_BUF_SIZE (10000)
    28 #define ENCAP_BUFFERS (100)
    29 
    30 #define RECV_BATCH_SIZE (20)
     28#define ENCAP_BUFFERS (1000)
     29
     30#define RECV_BATCH_SIZE (50)
    3131
    3232#define FORMAT_DATA ((ndag_format_data_t *)libtrace->format_data)
     
    598598                 * move on. */
    599599                ssock->savedsize[nr] = 0;
    600                 nr = (nr + 1) % ENCAP_BUFFERS;
     600                nr ++;
     601                if (nr == ENCAP_BUFFERS) {
     602                        nr = 0;
     603                }
    601604                ssock->nextread = ssock->saved[nr] + sizeof(ndag_common_t) +
    602605                                sizeof(ndag_encap_t);
     
    874877                /* All buffers were full, so something must be
    875878                 * available. */
     879                return 1;
     880        }
     881
     882        if (avail < RECV_BATCH_SIZE / 2) {
    876883                return 1;
    877884        }
Note: See TracChangeset for help on using the changeset viewer.