diff options
author | Damjan Marion <damarion@cisco.com> | 2023-11-03 13:47:05 +0000 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2023-11-08 13:28:19 +0000 |
commit | b8dd9815ef01b804f6a9b4aa47e486b8823a0c50 (patch) | |
tree | 1281dff1f5f1c4f0cae98fd8ddd3493e9e44c799 /src/vnet/dev/api.c | |
parent | 29d07dbef986dd5ebe180b6bfcac9089946e95df (diff) |
dev: interrupt mode support
Type: improvement
Change-Id: I4a0578598182339bcf76e6b01da76b590a06f773
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/dev/api.c')
-rw-r--r-- | src/vnet/dev/api.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vnet/dev/api.c b/src/vnet/dev/api.c index 4d556c72367..73d315db519 100644 --- a/src/vnet/dev/api.c +++ b/src/vnet/dev/api.c @@ -143,6 +143,7 @@ vnet_dev_api_create_port_if (vlib_main_t *vm, vnet_dev_t *dev = vnet_dev_by_id (args->device_id); vnet_dev_port_t *port = 0; u16 n_threads = vlib_get_n_threads (); + int default_is_intr_mode; log_debug (dev, "create_port_if: device '%s' port %u intf_name '%s' num_rx_q %u " @@ -168,6 +169,13 @@ vnet_dev_api_create_port_if (vlib_main_t *vm, if (port->interface_created) return VNET_DEV_ERR_ALREADY_EXISTS; + default_is_intr_mode = (args->flags.e & VNET_DEV_PORT_F_INTERRUPT_MODE) != 0; + if (default_is_intr_mode && port->attr.caps.interrupt_mode == 0) + { + log_err (dev, "interrupt mode requested and port doesn't support it"); + return VNET_DEV_ERR_NOT_SUPPORTED; + } + if (args->num_rx_queues) { if (args->num_rx_queues > port->attr.max_rx_queues) @@ -207,6 +215,7 @@ vnet_dev_api_create_port_if (vlib_main_t *vm, port->intf.txq_sz = port->tx_queue_config.default_size; clib_memcpy (port->intf.name, args->intf_name, sizeof (port->intf.name)); + port->intf.default_is_intr_mode = default_is_intr_mode; return vnet_dev_process_call_port_op (vm, port, vnet_dev_port_if_create); } |