[commtech] Make BUF_SIZE definition be per tech
Don't define BUF_SIZE globally anymore, but per communication technique
This commit is contained in:
parent
7c515200e7
commit
22c97ab418
|
@ -4,6 +4,10 @@
|
||||||
/* Non standard include */
|
/* Non standard include */
|
||||||
#include <commtech.h>
|
#include <commtech.h>
|
||||||
|
|
||||||
|
#ifndef BUF_SIZE
|
||||||
|
#define BUF_SIZE (32 * CACHE_LINE_SIZE)
|
||||||
|
#endif
|
||||||
|
|
||||||
/* This is not an error, we need this two-macro system */
|
/* This is not an error, we need this two-macro system */
|
||||||
#define toString(x) doStringification(x)
|
#define toString(x) doStringification(x)
|
||||||
#define doStringification(x) #x
|
#define doStringification(x) #x
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
#define _COMMTECH_H_ 1
|
#define _COMMTECH_H_ 1
|
||||||
|
|
||||||
#define CACHE_LINE_SIZE 64
|
#define CACHE_LINE_SIZE 64
|
||||||
#define BUF_SIZE CACHE_LINE_SIZE
|
|
||||||
|
|
||||||
#define likely(x) __builtin_expect(!!(x), 1)
|
#define likely(x) __builtin_expect(!!(x), 1)
|
||||||
#define unlikely(x) __builtin_expect((x), 0)
|
#define unlikely(x) __builtin_expect((x), 0)
|
||||||
|
|
|
@ -4,6 +4,10 @@
|
||||||
/* Non standard include */
|
/* Non standard include */
|
||||||
#include <commtech.h>
|
#include <commtech.h>
|
||||||
|
|
||||||
|
#ifndef BUF_SIZE
|
||||||
|
#define BUF_SIZE CACHE_LINE_SIZE
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef SLOTS
|
#ifndef SLOTS
|
||||||
#define SLOTS 64 /* Value used in the article, section V.A */
|
#define SLOTS 64 /* Value used in the article, section V.A */
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -8,6 +8,10 @@
|
||||||
#define SHARED_SPACE_SIZE (16 * BUF_SIZE)
|
#define SHARED_SPACE_SIZE (16 * BUF_SIZE)
|
||||||
#define SHARED_SPACE_VOIDPTR (SHARED_SPACE_SIZE / sizeof(void *))
|
#define SHARED_SPACE_VOIDPTR (SHARED_SPACE_SIZE / sizeof(void *))
|
||||||
|
|
||||||
|
#ifndef BUF_SIZE
|
||||||
|
#define BUF_SIZE CACHE_LINE_SIZE
|
||||||
|
#endif
|
||||||
|
|
||||||
#define DANGER (2 * BUF_SIZE / sizeof(void *))
|
#define DANGER (2 * BUF_SIZE / sizeof(void *))
|
||||||
#define GOOD (6 * BUF_SIZE / sizeof(void *))
|
#define GOOD (6 * BUF_SIZE / sizeof(void *))
|
||||||
#define ADJUST_FREQ 64
|
#define ADJUST_FREQ 64
|
||||||
|
|
|
@ -4,6 +4,10 @@
|
||||||
/* Non standard include */
|
/* Non standard include */
|
||||||
#include <commtech.h>
|
#include <commtech.h>
|
||||||
|
|
||||||
|
#ifndef BUF_SIZE
|
||||||
|
#define BUF_SIZE CACHE_LINE_SIZE
|
||||||
|
#endif
|
||||||
|
|
||||||
#define SHARED_SPACE_SIZE (2 * BUF_SIZE)
|
#define SHARED_SPACE_SIZE (2 * BUF_SIZE)
|
||||||
#define SHARED_SPACE_VOIDPTR (SHARED_SPACE_SIZE / sizeof(void *))
|
#define SHARED_SPACE_VOIDPTR (SHARED_SPACE_SIZE / sizeof(void *))
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
/* Non standard include */
|
/* Non standard include */
|
||||||
#include <commtech.h>
|
#include <commtech.h>
|
||||||
|
|
||||||
#define SHARED_SPACE_SIZE (2 * BUF_SIZE)
|
#define SHARED_SPACE_SIZE (250 * CACHE_LINE_SIZE) // Check with batchSize
|
||||||
#define SHARED_SPACE_VOIDPTR (SHARED_SPACE_SIZE / sizeof(void *))
|
#define SHARED_SPACE_VOIDPTR (SHARED_SPACE_SIZE / sizeof(void *))
|
||||||
|
|
||||||
struct control
|
struct control
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
/* Non standard include */
|
/* Non standard include */
|
||||||
#include <commtech.h>
|
#include <commtech.h>
|
||||||
|
|
||||||
#define SHARED_SPACE_SIZE (2 * BUF_SIZE)
|
#define SHARED_SPACE_SIZE (2 * CACHE_LINE_SIZE)
|
||||||
#define SHARED_SPACE_VOIDPTR (SHARED_SPACE_SIZE / sizeof(void *))
|
#define SHARED_SPACE_VOIDPTR (SHARED_SPACE_SIZE / sizeof(void *))
|
||||||
|
|
||||||
struct comm
|
struct comm
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
|
|
||||||
__thread struct comm *comm;
|
__thread struct comm *comm;
|
||||||
const int batchSize = BUF_SIZE / sizeof(void *);
|
const int batchSize = 50; // Check with SHARED_SPACE_SIZE
|
||||||
|
|
||||||
int init_library(void)
|
int init_library(void)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue