event/dlb: add flexible interface
authorTimothy McDaniel <timothy.mcdaniel@intel.com>
Sun, 1 Nov 2020 23:29:59 +0000 (17:29 -0600)
committerJerin Jacob <jerinj@marvell.com>
Mon, 2 Nov 2020 13:46:01 +0000 (14:46 +0100)
This commit introduces the flexible interface. This
interface allows the core code to operate in PF mode (direct
hardware access) or bifurcated mode (hardware configured via
kernel driver). This driver currently only supports PF modei,
but bifurcated mode will be added in a future patch-set.
Note that the flexible interface is not used for data path
operations, and thus there are no performance concerns
related to the use of function pointers.

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
Reviewed-by: Gage Eads <gage.eads@intel.com>
drivers/event/dlb/dlb.c
drivers/event/dlb/dlb_iface.c [new file with mode: 0644]
drivers/event/dlb/dlb_iface.h [new file with mode: 0644]
drivers/event/dlb/meson.build
drivers/event/dlb/pf/dlb_pf.c

index 1659f93..8008a50 100644 (file)
@@ -33,6 +33,7 @@
 #include <rte_eventdev_pmd.h>
 
 #include "dlb_priv.h"
+#include "dlb_iface.h"
 #include "dlb_inline_fns.h"
 
 /*
diff --git a/drivers/event/dlb/dlb_iface.c b/drivers/event/dlb/dlb_iface.c
new file mode 100644 (file)
index 0000000..dd72120
--- /dev/null
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2016-2020 Intel Corporation
+ */
+
+#include <stdint.h>
+
+#include "dlb_priv.h"
+
+/* DLB PMD Internal interface function pointers.
+ * If VDEV (bifurcated PMD),  these will resolve to functions that issue ioctls
+ * serviced by DLB kernel module.
+ * If PCI (PF PMD),  these will be implemented locally in user mode.
+ */
+
+void (*dlb_iface_low_level_io_init)(struct dlb_eventdev *dlb);
+
+int (*dlb_iface_open)(struct dlb_hw_dev *handle, const char *name);
+
+int (*dlb_iface_get_device_version)(struct dlb_hw_dev *handle,
+                                   uint8_t *revision);
+
+int (*dlb_iface_get_num_resources)(struct dlb_hw_dev *handle,
+                                  struct dlb_get_num_resources_args *rsrcs);
+
+int (*dlb_iface_get_cq_poll_mode)(struct dlb_hw_dev *handle,
+                                 enum dlb_cq_poll_modes *mode);
+
diff --git a/drivers/event/dlb/dlb_iface.h b/drivers/event/dlb/dlb_iface.h
new file mode 100644 (file)
index 0000000..416d1b3
--- /dev/null
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2016-2020 Intel Corporation
+ */
+
+#ifndef _DLB_IFACE_H
+#define _DLB_IFACE_H
+
+/* DLB PMD Internal interface function pointers.
+ * If VDEV (bifurcated PMD), these will resolve to functions that issue ioctls
+ * serviced by DLB kernel module.
+ * If PCI (PF PMD), these will be implemented locally in user mode.
+ */
+
+extern void (*dlb_iface_low_level_io_init)(struct dlb_eventdev *dlb);
+
+extern int (*dlb_iface_open)(struct dlb_hw_dev *handle, const char *name);
+
+extern int (*dlb_iface_get_device_version)(struct dlb_hw_dev *handle,
+                                          uint8_t *revision);
+
+extern int (*dlb_iface_get_num_resources)(struct dlb_hw_dev *handle,
+                                  struct dlb_get_num_resources_args *rsrcs);
+
+extern int (*dlb_iface_get_cq_poll_mode)(struct dlb_hw_dev *handle,
+                                        enum dlb_cq_poll_modes *mode);
+
+#endif /* _DLB_IFACE_H */
index 61c0182..0e66cdc 100644 (file)
@@ -8,6 +8,7 @@ if not is_linux or not dpdk_conf.has('RTE_ARCH_X86_64')
 endif
 
 sources = files('dlb.c',
+               'dlb_iface.c',
                'pf/dlb_main.c',
                'pf/dlb_pf.c'
 )
index 3f836f3..05fd76c 100644 (file)
@@ -27,6 +27,7 @@
 #include <rte_string_fns.h>
 
 #include "../dlb_priv.h"
+#include "../dlb_iface.h"
 #include "../dlb_inline_fns.h"
 #include "dlb_main.h"
 #include "base/dlb_hw_types.h"