[v3,05/15] net/netvsc: make event monitor OS dependent
Checks
Commit Message
Event monitoring is not yet supported on FreeBSD, hence moving it
to the OS specific files
Signed-off-by: Srikanth Kaka <srikanth.k@oneconvergence.com>
Signed-off-by: Vag Singh <vag.singh@oneconvergence.com>
Signed-off-by: Anand Thulasiram <avelu@juniper.net>
---
drivers/net/netvsc/freebsd/hn_os.c | 16 ++++++++++++++++
drivers/net/netvsc/hn_ethdev.c | 7 +++----
drivers/net/netvsc/hn_os.h | 6 ++++++
drivers/net/netvsc/linux/hn_os.c | 21 +++++++++++++++++++++
4 files changed, 46 insertions(+), 4 deletions(-)
create mode 100644 drivers/net/netvsc/freebsd/hn_os.c
create mode 100644 drivers/net/netvsc/hn_os.h
create mode 100644 drivers/net/netvsc/linux/hn_os.c
new file mode 100644
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2016-2021 Microsoft Corporation
+ */
+
+#include <stdio.h>
+
+#include <rte_common.h>
+
+#include "hn_logs.h"
+#include "hn_os.h"
+
+int eth_hn_os_dev_event(void)
+{
+ PMD_DRV_LOG(DEBUG, "rte_dev_event_monitor_start not supported on FreeBSD");
+ return 0;
+}
@@ -39,6 +39,7 @@
#include "hn_rndis.h"
#include "hn_nvs.h"
#include "ndis.h"
+#include "hn_os.h"
#define HN_TX_OFFLOAD_CAPS (RTE_ETH_TX_OFFLOAD_IPV4_CKSUM | \
RTE_ETH_TX_OFFLOAD_TCP_CKSUM | \
@@ -1240,11 +1241,9 @@ static int eth_hn_probe(struct rte_vmbus_driver *drv __rte_unused,
PMD_INIT_FUNC_TRACE();
- ret = rte_dev_event_monitor_start();
- if (ret) {
- PMD_DRV_LOG(ERR, "Failed to start device event monitoring");
+ ret = eth_hn_os_dev_event();
+ if (ret)
return ret;
- }
eth_dev = eth_dev_vmbus_allocate(dev, sizeof(struct hn_data));
if (!eth_dev)
new file mode 100644
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2009-2021 Microsoft Corp.
+ * All rights reserved.
+ */
+
+int eth_hn_os_dev_event(void);
new file mode 100644
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2016-2021 Microsoft Corporation
+ */
+
+#include <unistd.h>
+
+#include <rte_ethdev.h>
+
+#include "hn_logs.h"
+#include "hn_os.h"
+
+int eth_hn_os_dev_event(void)
+{
+ int ret;
+
+ ret = rte_dev_event_monitor_start();
+ if (ret)
+ PMD_DRV_LOG(ERR, "Failed to start device event monitoring");
+
+ return ret;
+}