diff options
author | Milan Lenco <milan.lenco@pantheon.tech> | 2017-06-22 09:10:07 +0200 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2017-06-25 08:07:58 +0000 |
commit | 5fa72c8f1f8ec3304f6c8dc51662416b3b16936f (patch) | |
tree | cf212d05cc00d6d57527632ecfa6055d79e44558 | |
parent | aad20988b6a0a5058e520948d2a5835cfbc3b523 (diff) |
memif: If rx/tx_queues are unset, use default values
The standard behaviour for binary API is that zeroed arguments are
treated as if the default values were set. This way the configurator
does not need to know what default values are.
This, however, wasn't the case for rx_queues and tx_queues in
memif_create binary API message.
Change-Id: Ib588b472823f6bbb5ef12a798d68b0dda6dd2139
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
-rw-r--r-- | src/plugins/memif/memif_api.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/plugins/memif/memif_api.c b/src/plugins/memif/memif_api.c index 533e84822f2..65a4a09a09e 100644 --- a/src/plugins/memif/memif_api.c +++ b/src/plugins/memif/memif_api.c @@ -133,10 +133,20 @@ vl_api_memif_create_t_handler (vl_api_memif_create_t * mp) /* role */ args.is_master = (mp->role == 0); + + /* 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 */ |