net/mlx5: add VLAN stubs on Windows
authorOphir Munk <ophirmu@nvidia.com>
Mon, 28 Dec 2020 12:32:42 +0000 (14:32 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 8 Jan 2021 15:03:08 +0000 (16:03 +0100)
This commit adds stubs to VLAN VM operations.  It is the Windows
equivalent implementation of [1].  The Linux implementation was based on
Netlink APIs which are not supported in Windows.

[1]
commit 7af10d29a4a0 ("net/mlx5/linux: refactor VLAN")

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
drivers/net/mlx5/windows/meson.build
drivers/net/mlx5/windows/mlx5_vlan_os.c [new file with mode: 0644]

index d7d501c..62355d6 100644 (file)
@@ -6,4 +6,5 @@ sources += files(
        'mlx5_os.c',
        'mlx5_mp_os.c',
        'mlx5_ethdev_os.c',
+       'mlx5_vlan_os.c',
 )
diff --git a/drivers/net/mlx5/windows/mlx5_vlan_os.c b/drivers/net/mlx5/windows/mlx5_vlan_os.c
new file mode 100644 (file)
index 0000000..d3b11e0
--- /dev/null
@@ -0,0 +1,83 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright 2020 Mellanox Technologies, Ltd
+ */
+
+#include <stddef.h>
+#include <errno.h>
+#include <stdint.h>
+#include <unistd.h>
+
+/*
+ * Not needed by this file; included to work around the lack of off_t
+ * definition for mlx5dv.h with unpatched rdma-core versions.
+ */
+#include <sys/types.h>
+
+#include <rte_ethdev_driver.h>
+#include <rte_common.h>
+
+#include <mlx5.h>
+#include <mlx5_malloc.h>
+
+/*
+ * Release VLAN network device, created for VM workaround.
+ *
+ * @param[in] dev
+ *   Ethernet device object, Netlink context provider.
+ * @param[in] vlan
+ *   Object representing the network device to release.
+ */
+void
+mlx5_vlan_vmwa_release(struct rte_eth_dev *dev,
+                           struct mlx5_vf_vlan *vlan)
+{
+       RTE_SET_USED(dev);
+       RTE_SET_USED(vlan);
+}
+
+/**
+ * Acquire VLAN interface with specified tag for VM workaround.
+ *
+ * @param[in] dev
+ *   Ethernet device object, Netlink context provider.
+ * @param[in] vlan
+ *   Object representing the network device to acquire.
+ */
+void
+mlx5_vlan_vmwa_acquire(struct rte_eth_dev *dev,
+                           struct mlx5_vf_vlan *vlan)
+{
+       RTE_SET_USED(dev);
+       RTE_SET_USED(vlan);
+}
+
+/*
+ * Create per ethernet device VLAN VM workaround context
+ *
+ * @param dev
+ *   Pointer to Ethernet device structure.
+ * @param ifindex
+ *   Interface index.
+ *
+ * @Return
+ *   Pointer to mlx5_nl_vlan_vmwa_context
+ */
+void *
+mlx5_vlan_vmwa_init(struct rte_eth_dev *dev, uint32_t ifindex)
+{
+       RTE_SET_USED(dev);
+       RTE_SET_USED(ifindex);
+       return NULL;
+}
+
+/*
+ * Destroy per ethernet device VLAN VM workaround context
+ *
+ * @param dev
+ *   Pointer to VM context
+ */
+void
+mlx5_vlan_vmwa_exit(void *vmctx)
+{
+       RTE_SET_USED(vmctx);
+}