1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

Changed signature of memory_ib_get_mr.

Furthermore, a preprocessor macro pool_buffer was added to get the
address of a pool's buffer.

Discussed in #193.
This commit is contained in:
Dennis Potter 2018-08-13 12:32:04 +02:00
parent 36c3161fa8
commit 14a7b5cf8d
4 changed files with 7 additions and 8 deletions

View file

@ -28,4 +28,4 @@ struct memory_ib {
struct memory_type *parent;
};
struct ibv_mr * memory_ib_get_mr(struct sample *smps);
struct ibv_mr * memory_ib_get_mr(void *ptr);

View file

@ -50,6 +50,7 @@ struct pool {
};
#define INLINE static inline __attribute__((unused))
#define pool_buffer(p) ((char *) (p) + (p)->buffer_off)
/** Initiazlize a pool
*

View file

@ -27,16 +27,14 @@
#include <villas/utils.h>
#include <villas/memory/ib.h>
struct ibv_mr * memory_ib_get_mr(struct sample *smps)
struct ibv_mr * memory_ib_get_mr(void *ptr)
{
struct memory_allocation *ma;
struct pool *p;
struct ibv_mr *mr;
p = sample_pool(smps);
ma = memory_get_allocation((char *) (p) + p->buffer_off);
ma = memory_get_allocation(ptr);
mr = ma->ib.mr;
return mr;
}

View file

@ -803,7 +803,7 @@ int ib_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *relea
}
// Get Memory Region
mr = memory_ib_get_mr(smps[0]);
mr = memory_ib_get_mr( pool_buffer( sample_pool(smps[0]) ) );
for (int i = 0; i < max_wr_post; i++) {
int j = 0;
@ -915,7 +915,7 @@ int ib_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *rele
// First, write
// Get Memory Region
mr = memory_ib_get_mr(smps[0]);
mr = memory_ib_get_mr( pool_buffer( sample_pool(smps[0]) ) );
for (sent = 0; sent < cnt; sent++) {
int j = 0;