@@ -132,10 +132,10 @@ odp_class_init(void)
/* create packet & ofpbuf pool */
- params.buf_size = SHM_PKT_POOL_BUF_SIZE + SHM_OFPBUF_POOL_BUF_SIZE;
- params.buf_align = ODP_CACHE_LINE_SIZE;
- params.num_bufs = SHM_PKT_POOL_NUM_BUFS;
- params.buf_type = ODP_BUFFER_TYPE_PACKET;
+ params.pkt.len= SHM_PKT_POOL_BUF_SIZE + SHM_OFPBUF_POOL_BUF_SIZE;
+ params.pkt.seg_len = 0;
+ params.pkt.num = SHM_PKT_POOL_NUM_BUFS;
+ params.type = ODP_POOL_PACKET;
pool = odp_pool_create("packet_pool", ODP_SHM_NULL, ¶ms);
@@ -146,8 +146,8 @@ odp_class_init(void)
odp_pool_print(pool);
/* Allocate all the packets from the pool and initialize ofpbuf part */
- pkts = malloc(sizeof(odp_packet_t) * params.num_bufs);
- for (i = 0; i < params.num_bufs; ++i) {
+ pkts = malloc(sizeof(odp_packet_t) * params.pkt.num);
+ for (i = 0; i < params.pkt.num; ++i) {
struct dpif_packet *packet;
char *start;
pkts[i] = odp_packet_alloc(pool, 0);
@@ -166,7 +166,7 @@ odp_class_init(void)
}
/* Free our packets up */
- for (i = 0; i < params.num_bufs; i++)
+ for (i = 0; i < params.pkt.num; i++)
odp_packet_free(pkts[i]);
free(pkts);
@@ -174,8 +174,9 @@ odp_class_init(void)
/* create pool for structures */
- params.buf_size = SHM_STRUCT_POOL_BUF_SIZE;
- params.num_bufs = SHM_STRUCT_POOL_NUM_BUFS;
+ params.type = ODP_POOL_BUFFER;
+ params.buf.size = SHM_STRUCT_POOL_BUF_SIZE;
+ params.buf.num = SHM_STRUCT_POOL_NUM_BUFS;
struct_pool = odp_pool_create("struct_pool", ODP_SHM_NULL, ¶ms);
@@ -237,7 +238,7 @@ netdev_odp_construct(struct netdev *netdev_)
goto out_err;
}
- netdev->max_frame_len = info.params.buf_size;
+ netdev->max_frame_len = info.params.pkt.len;
ovs_mutex_init(&netdev->mutex);
Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org> --- lib/netdev-odp.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)