event/dlb2: add flexible interface
authorTimothy McDaniel <timothy.mcdaniel@intel.com>
Sun, 1 Nov 2020 23:37:47 +0000 (17:37 -0600)
committerJerin Jacob <jerinj@marvell.com>
Mon, 2 Nov 2020 06:25:49 +0000 (07:25 +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 mode
but bifurcated mode will be added in a future DPDK 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/dlb2/dlb2_iface.c [new file with mode: 0644]
drivers/event/dlb2/dlb2_iface.h [new file with mode: 0644]
drivers/event/dlb2/meson.build

diff --git a/drivers/event/dlb2/dlb2_iface.c b/drivers/event/dlb2/dlb2_iface.c
new file mode 100644 (file)
index 0000000..0fc9991
--- /dev/null
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2016-2020 Intel Corporation
+ */
+
+#include <stdint.h>
+
+#include "dlb2_priv.h"
+
+/* DLB2 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 (*dlb2_iface_low_level_io_init)(void);
+
+int (*dlb2_iface_open)(struct dlb2_hw_dev *handle, const char *name);
+
+int (*dlb2_iface_get_device_version)(struct dlb2_hw_dev *handle,
+                                    uint8_t *revision);
+
+void (*dlb2_iface_hardware_init)(struct dlb2_hw_dev *handle);
+
+int (*dlb2_iface_get_cq_poll_mode)(struct dlb2_hw_dev *handle,
+                                  enum dlb2_cq_poll_modes *mode);
+
+int (*dlb2_iface_get_num_resources)(struct dlb2_hw_dev *handle,
+                               struct dlb2_get_num_resources_args *rsrcs);
diff --git a/drivers/event/dlb2/dlb2_iface.h b/drivers/event/dlb2/dlb2_iface.h
new file mode 100644 (file)
index 0000000..4fb416e
--- /dev/null
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2016-2020 Intel Corporation
+ */
+
+#ifndef _DLB2_IFACE_H_
+#define _DLB2_IFACE_H_
+
+/* DLB2 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 (*dlb2_iface_low_level_io_init)(void);
+
+extern int (*dlb2_iface_open)(struct dlb2_hw_dev *handle, const char *name);
+
+extern int (*dlb2_iface_get_device_version)(struct dlb2_hw_dev *handle,
+                                           uint8_t *revision);
+
+extern void (*dlb2_iface_hardware_init)(struct dlb2_hw_dev *handle);
+
+extern int (*dlb2_iface_get_cq_poll_mode)(struct dlb2_hw_dev *handle,
+                                         enum dlb2_cq_poll_modes *mode);
+
+extern int (*dlb2_iface_get_num_resources)(struct dlb2_hw_dev *handle,
+                               struct dlb2_get_num_resources_args *rsrcs);
+
+#endif /* _DLB2_IFACE_H_ */
index 2855dd5..c2fb347 100644 (file)
@@ -8,6 +8,7 @@ if not is_linux or not dpdk_conf.has('RTE_ARCH_X86_64')
 endif
 
 sources = files('dlb2.c',
+               'dlb2_iface.c',
                'pf/dlb2_main.c',
                'pf/dlb2_pf.c'
 )