[PATCH v4 01/14] bus/vmbus: move independent code from Linux
Stephen Hemminger
stephen at networkplumber.org
Tue Apr 19 16:49:47 CEST 2022
On Mon, 18 Apr 2022 09:59:02 +0530
Srikanth Kaka <srikanth.k at oneconvergence.com> wrote:
> Move the OS independent code from Linux dir in-order to be used
> by FreeBSD
>
> Signed-off-by: Srikanth Kaka <srikanth.k at oneconvergence.com>
> Signed-off-by: Vag Singh <vag.singh at oneconvergence.com>
> Signed-off-by: Anand Thulasiram <avelu at juniper.net>
> ---
> drivers/bus/vmbus/linux/vmbus_bus.c | 13 +------------
> drivers/bus/vmbus/meson.build | 5 +++++
> drivers/bus/vmbus/osi/vmbus_osi.h | 11 +++++++++++
> drivers/bus/vmbus/osi/vmbus_osi_bus.c | 20 ++++++++++++++++++++
> 4 files changed, 37 insertions(+), 12 deletions(-)
> create mode 100644 drivers/bus/vmbus/osi/vmbus_osi.h
> create mode 100644 drivers/bus/vmbus/osi/vmbus_osi_bus.c
>
> diff --git a/drivers/bus/vmbus/linux/vmbus_bus.c b/drivers/bus/vmbus/linux/vmbus_bus.c
> index f502783f7a..c9a07041a7 100644
> --- a/drivers/bus/vmbus/linux/vmbus_bus.c
> +++ b/drivers/bus/vmbus/linux/vmbus_bus.c
> @@ -21,22 +21,11 @@
>
> #include "eal_filesystem.h"
> #include "private.h"
> +#include "vmbus_osi.h"
>
> /** Pathname of VMBUS devices directory. */
> #define SYSFS_VMBUS_DEVICES "/sys/bus/vmbus/devices"
>
> -/*
> - * GUID associated with network devices
> - * {f8615163-df3e-46c5-913f-f2d2f965ed0e}
> - */
> -static const rte_uuid_t vmbus_nic_uuid = {
> - 0xf8, 0x61, 0x51, 0x63,
> - 0xdf, 0x3e,
> - 0x46, 0xc5,
> - 0x91, 0x3f,
> - 0xf2, 0xd2, 0xf9, 0x65, 0xed, 0xe
> -};
> -
> extern struct rte_vmbus_bus rte_vmbus_bus;
>
> /* Read sysfs file to get UUID */
> diff --git a/drivers/bus/vmbus/meson.build b/drivers/bus/vmbus/meson.build
> index 3892cbf67f..cbcba44e16 100644
> --- a/drivers/bus/vmbus/meson.build
> +++ b/drivers/bus/vmbus/meson.build
> @@ -16,6 +16,11 @@ sources = files(
> 'vmbus_common_uio.c',
> )
>
> +includes += include_directories('osi')
> +sources += files(
> + 'osi/vmbus_osi_bus.c'
> +)
> +
> if is_linux
> sources += files('linux/vmbus_bus.c',
> 'linux/vmbus_uio.c')
> diff --git a/drivers/bus/vmbus/osi/vmbus_osi.h b/drivers/bus/vmbus/osi/vmbus_osi.h
> new file mode 100644
> index 0000000000..2db9399181
> --- /dev/null
> +++ b/drivers/bus/vmbus/osi/vmbus_osi.h
Having common code is good, we are already doing it now in DPDK EAL.
But the name osi seems odd to me.
Could you use unix instead (same as EAL)
drivers/bus/vmbus/unix/vmbus.h
Or drivers/bus/vmbus/common
More information about the dev
mailing list