bmp->context = ntohl (0xfeedface);
bmp->options[APP_OPTIONS_FLAGS] =
APP_OPTIONS_FLAGS_USE_FIFO | APP_OPTIONS_FLAGS_ADD_SEGMENT;
+ bmp->options[APP_OPTIONS_PREALLOC_FIFO_PAIRS] = 16;
bmp->options[SESSION_OPTIONS_RX_FIFO_SIZE] = fifo_size;
bmp->options[SESSION_OPTIONS_TX_FIFO_SIZE] = fifo_size;
bmp->options[SESSION_OPTIONS_ADD_SEGMENT_SIZE] = 128 << 20;
}
utm->our_event_queue =
- (unix_shared_memory_queue_t *) mp->app_event_queue_address;
+ uword_to_pointer (mp->app_event_queue_address,
+ unix_shared_memory_queue_t *);
utm->state = STATE_ATTACHED;
}
return;
}
- utm->vpp_event_queue = (unix_shared_memory_queue_t *)
- mp->vpp_event_queue_address;
+ utm->vpp_event_queue =
+ uword_to_pointer (mp->vpp_event_queue_address,
+ unix_shared_memory_queue_t *);
/*
* Setup session
pool_get (utm->sessions, session);
session_index = session - utm->sessions;
- rx_fifo = (svm_fifo_t *) mp->server_rx_fifo;
+ rx_fifo = uword_to_pointer (mp->server_rx_fifo, svm_fifo_t *);
rx_fifo->client_session_index = session_index;
- tx_fifo = (svm_fifo_t *) mp->server_tx_fifo;
+ tx_fifo = uword_to_pointer (mp->server_tx_fifo, svm_fifo_t *);
tx_fifo->client_session_index = session_index;
session->server_rx_fifo = rx_fifo;
ip_str = format (0, "%U", format_ip46_address, &mp->ip, mp->is_ip4);
clib_warning ("Accepted session from: %s:%d", ip_str,
clib_net_to_host_u16 (mp->port));
- utm->vpp_event_queue = (unix_shared_memory_queue_t *)
- mp->vpp_event_queue_address;
+ utm->vpp_event_queue =
+ uword_to_pointer (mp->vpp_event_queue_address,
+ unix_shared_memory_queue_t *);
/* Allocate local session and set it up */
pool_get (utm->sessions, session);
session_index = session - utm->sessions;
- rx_fifo = (svm_fifo_t *) mp->server_rx_fifo;
+ rx_fifo = uword_to_pointer (mp->server_rx_fifo, svm_fifo_t *);
rx_fifo->client_session_index = session_index;
- tx_fifo = (svm_fifo_t *) mp->server_tx_fifo;
+ tx_fifo = uword_to_pointer (mp->server_tx_fifo, svm_fifo_t *);
tx_fifo->client_session_index = session_index;
session->server_rx_fifo = rx_fifo;