Changeset 957a72a


Ignore:
Timestamp:
08/18/14 02:37:07 (6 years ago)
Author:
Richard Sanger <rsangerarj@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
5b4d121
Parents:
0862c20
Message:

Fix ocache to always try write/read back a full/empty local cache. This was causing it to never cache packets if running without a limited allocation number (i.e. malloc and free were always being used).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/data-struct/object_cache.c

    r7e4e9b8 r957a72a  
    271271                        lc->used = libtrace_ringbuffer_sread_bulk(rb, lc->cache, lc->total, min_nb_buffers - i);
    272272                else
    273                         lc->used = 0;
     273                        lc->used = libtrace_ringbuffer_sread_bulk(rb, lc->cache, lc->total, 0);
    274274
    275275                if (lc->used == lc->total)
     
    367367
    368368                // Make sure we still meet the minimum requirement
    369                 lc->used = lc->total - libtrace_ringbuffer_swrite_bulk(rb, lc->cache, lc->total, min_nb_buffers - i);
     369                if (i < min_nb_buffers)
     370                        lc->used = lc->total - libtrace_ringbuffer_swrite_bulk(rb, lc->cache, lc->total, min_nb_buffers - i);
     371                else
     372                        lc->used = lc->total - libtrace_ringbuffer_swrite_bulk(rb, lc->cache, lc->total, 0);
     373
    370374                // Re originise fulls to the front
    371375                if (lc->used)
Note: See TracChangeset for help on using the changeset viewer.