summaryrefslogtreecommitdiffstats
path: root/src/vnet/dev/pci.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2023-11-03 13:47:05 +0000
committerAndrew Yourtchenko <ayourtch@gmail.com>2023-11-08 13:28:19 +0000
commitb8dd9815ef01b804f6a9b4aa47e486b8823a0c50 (patch)
tree1281dff1f5f1c4f0cae98fd8ddd3493e9e44c799 /src/vnet/dev/pci.c
parent29d07dbef986dd5ebe180b6bfcac9089946e95df (diff)
dev: interrupt mode support
Type: improvement Change-Id: I4a0578598182339bcf76e6b01da76b590a06f773 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/dev/pci.c')
-rw-r--r--src/vnet/dev/pci.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/vnet/dev/pci.c b/src/vnet/dev/pci.c
index 3310841c6c7..d35c5f9824f 100644
--- a/src/vnet/dev/pci.c
+++ b/src/vnet/dev/pci.c
@@ -2,16 +2,15 @@
* Copyright (c) 2023 Cisco Systems, Inc.
*/
-#include "vlib/pci/pci.h"
#include <vnet/vnet.h>
#include <vnet/dev/dev.h>
#include <vnet/dev/pci.h>
#include <vnet/dev/log.h>
+#include <vlib/unix/unix.h>
VLIB_REGISTER_LOG_CLASS (dev_log, static) = {
.class_name = "dev",
.subclass_name = "pci",
- .default_syslog_level = VLIB_LOG_LEVEL_DEBUG,
};
static int
@@ -317,6 +316,18 @@ vnet_dev_pci_msix_add_handler (vlib_main_t *vm, vnet_dev_t *dev,
return VNET_DEV_OK;
}
+void
+vnet_dev_pci_msix_set_polling_thread (vlib_main_t *vm, vnet_dev_t *dev,
+ u16 line, u16 thread_index)
+{
+ vlib_pci_dev_handle_t h = vnet_dev_get_pci_handle (dev);
+ u32 index;
+
+ index = vlib_pci_get_msix_file_index (vm, h, line);
+
+ clib_file_set_polling_thread (&file_main, index, thread_index);
+}
+
vnet_dev_rv_t
vnet_dev_pci_msix_remove_handler (vlib_main_t *vm, vnet_dev_t *dev, u16 first,
u16 count)