#include <vlibapi/api.h>
#include <vlibmemory/api.h>
-#include <vlibsocket/api.h>
+
/* define message IDs */
#include <memif/memif_msg_enum.h>
*/
#define REPLY_MACRO(t) \
do { \
- unix_shared_memory_queue_t * q = \
+ svm_queue_t * q = \
vl_api_client_index_to_input_queue (mp->client_index); \
if (!q) \
return; \
#define REPLY_MACRO2(t, body) \
do { \
- unix_shared_memory_queue_t * q = \
+ svm_queue_t * q = \
vl_api_client_index_to_input_queue (mp->client_index); \
if (!q) \
return; \
#define foreach_memif_plugin_api_msg \
_(MEMIF_CREATE, memif_create) \
_(MEMIF_DELETE, memif_delete) \
-_(MEMIF_DETAILS, memif_details) \
_(MEMIF_DUMP, memif_dump) \
/**
/* role */
args.is_master = (mp->role == 0);
+
+ /* mode */
+ args.mode = mp->mode;
+
+ /* rx/tx queues */
if (args.is_master == 0)
{
- args.rx_queues = mp->rx_queues;
- args.tx_queues = mp->tx_queues;
+ args.rx_queues = MEMIF_DEFAULT_RX_QUEUES;
+ args.tx_queues = MEMIF_DEFAULT_TX_QUEUES;
+ if (mp->rx_queues)
+ {
+ args.rx_queues = mp->rx_queues;
+ }
+ if (mp->tx_queues)
+ {
+ args.tx_queues = mp->tx_queues;
+ }
}
/* ring size */
vl_api_memif_delete_reply_t *rmp;
vnet_hw_interface_t *hi =
vnet_get_sup_hw_interface (vnm, ntohl (mp->sw_if_index));
- memif_if_t *mif = pool_elt_at_index (mm->interfaces, hi->dev_instance);
+ memif_if_t *mif;
int rv = 0;
if (hi == NULL || memif_device_class.index != hi->dev_class_index)
rv = VNET_API_ERROR_INVALID_SW_IF_INDEX;
else
- rv = memif_delete_if (vm, mif);
+ {
+ mif = pool_elt_at_index (mm->interfaces, hi->dev_instance);
+ rv = memif_delete_if (vm, mif);
+ }
REPLY_MACRO (VL_API_MEMIF_DELETE_REPLY);
}
static void
-send_memif_details (unix_shared_memory_queue_t * q,
+send_memif_details (svm_queue_t * q,
memif_if_t * mif,
vnet_sw_interface_t * swif,
u8 * interface_name, u32 context)
vnet_sw_interface_t *swif;
memif_if_t *mif;
u8 *if_name = 0;
- unix_shared_memory_queue_t *q;
+ svm_queue_t *q;
q = vl_api_client_index_to_input_queue (mp->client_index);
if (q == 0)
vec_free (if_name);
}
-/**
- * @brief Message handler for memif_details API.
- * @param mp vl_api_memif_details_t * mp the api message
- */
-void
-vl_api_memif_details_t_handler (vl_api_memif_details_t * mp)
-{
- clib_warning ("BUG");
-}
-
#define vl_msg_name_crc_list
#include <memif/memif_all_api_h.h>
#undef vl_msg_name_crc_list