From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 5F4DCA04B5;
	Sun, 13 Dec 2020 11:31:47 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id C4335CACE;
	Sun, 13 Dec 2020 11:22:34 +0100 (CET)
Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])
 by dpdk.org (Postfix) with ESMTP id F30ECC9C0
 for <dev@dpdk.org>; Sun, 13 Dec 2020 11:21:48 +0100 (CET)
Received: from Internal Mail-Server by MTLPINE1 (envelope-from
 talshn@nvidia.com) with SMTP; 13 Dec 2020 12:21:44 +0200
Received: from nvidia.com (l-wincomp04-vm.mtl.labs.mlnx [10.237.1.5])
 by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0BDALe1u018562;
 Sun, 13 Dec 2020 12:21:44 +0200
From: Tal Shnaiderman <talshn@nvidia.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, matan@nvidia.com, rasland@nvidia.com,
 ophirmu@nvidia.com
Date: Sun, 13 Dec 2020 12:20:54 +0200
Message-Id: <20201213102056.11380-31-talshn@nvidia.com>
X-Mailer: git-send-email 2.16.1.windows.4
In-Reply-To: <20201213102056.11380-1-talshn@nvidia.com>
References: <20201210150648.8784-2-talshn@nvidia.com>
 <20201213102056.11380-1-talshn@nvidia.com>
Subject: [dpdk-dev] [PATCH v3 30/32] net/mlx5/windows: add mlx5_os.c stubs
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

From: Ophir Munk <ophirmu@nvidia.com>

mlx5_os_set_nonblock_channel_fd
mlx5_os_dev_shared_handler_install
mlx5_os_dev_shared_handler_uninstall
mlx5_os_read_dev_stat
mlx5_os_mac_addr_flush
mlx5_os_mac_addr_remove
mlx5_os_vf_mac_addr_modify
mlx5_os_set_promisc
mlx5_os_set_allmulti

Set struct mlx5_flow_driver_ops mlx5_flow_verbs_drv_ops with NULL
pointers.

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
---
 drivers/net/mlx5/windows/mlx5_os.c | 187 +++++++++++++++++++++++++++++++++++++
 1 file changed, 187 insertions(+)

diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c
index e0646670a3..bef10aba30 100644
--- a/drivers/net/mlx5/windows/mlx5_os.c
+++ b/drivers/net/mlx5/windows/mlx5_os.c
@@ -13,10 +13,18 @@
 #include <mlx5_glue.h>
 #include <mlx5_devx_cmds.h>
 #include <mlx5_common.h>
+#include <mlx5_common_mp.h>
+#include <mlx5_common_mr.h>
+#include <mlx5_malloc.h>
 
 #include "mlx5_defs.h"
 #include "mlx5.h"
+#include "mlx5_common_os.h"
+#include "mlx5_utils.h"
+#include "mlx5_rxtx.h"
 #include "mlx5_autoconf.h"
+#include "mlx5_mr.h"
+#include "mlx5_flow.h"
 
 /**
  * Get mlx5 device attributes.
@@ -73,3 +81,182 @@ mlx5_os_get_dev_attr(void *ctx, struct mlx5_dev_attr *device_attr)
 	}
 	return err;
 }
+
+/**
+ * Set the completion channel file descriptor interrupt as non-blocking.
+ * Currently it has no support under Windows.
+ *
+ * @param[in] rxq_obj
+ *   Pointer to RQ channel object, which includes the channel fd
+ *
+ * @param[out] fd
+ *   The file descriptor (representing the intetrrupt) used in this channel.
+ *
+ * @return
+ *   0 on successfully setting the fd to non-blocking, non-zero otherwise.
+ */
+int
+mlx5_os_set_nonblock_channel_fd(int fd)
+{
+	(void)fd;
+	DRV_LOG(WARNING, "mlx5_os_set_nonblock_channel_fd is not support");
+	return -ENOTSUP;
+}
+
+/**
+ * This function should share events between multiple ports of single IB
+ * device.  Currently it has no support under Windows.
+ *
+ * @param sh
+ *   Pointer to mlx5_dev_ctx_shared object.
+ */
+void
+mlx5_os_dev_shared_handler_install(struct mlx5_dev_ctx_shared *sh)
+{
+	(void)sh;
+	DRV_LOG(WARNING, "mlx5_os_dev_shared_handler_install is not support");
+}
+
+/**
+ * This function should share events between multiple ports of single IB
+ * device.  Currently it has no support under Windows.
+ *
+ * @param dev
+ *   Pointer to mlx5_dev_ctx_shared object.
+ */
+void
+mlx5_os_dev_shared_handler_uninstall(struct mlx5_dev_ctx_shared *sh)
+{
+	(void)sh;
+	DRV_LOG(WARNING, "mlx5_os_dev_shared_handler_uninstall is not support");
+}
+
+/**
+ * Read statistics by a named counter.
+ *
+ * @param[in] priv
+ *   Pointer to the private device data structure.
+ * @param[in] ctr_name
+ *   Pointer to the name of the statistic counter to read
+ * @param[out] stat
+ *   Pointer to read statistic value.
+ * @return
+ *   0 on success and stat is valud, 1 if failed to read the value
+ *   rte_errno is set.
+ *
+ */
+int
+mlx5_os_read_dev_stat(struct mlx5_priv *priv, const char *ctr_name,
+		      uint64_t *stat)
+{
+	RTE_SET_USED(priv);
+	RTE_SET_USED(ctr_name);
+	RTE_SET_USED(stat);
+	DRV_LOG(WARNING, "mlx5_os_read_dev_stat is not support");
+	return -ENOTSUP;
+}
+
+/**
+ * Flush device MAC addresses
+ * Currently it has no support under Windows.
+ *
+ * @param dev
+ *   Pointer to Ethernet device structure.
+ *
+ */
+void
+mlx5_os_mac_addr_flush(struct rte_eth_dev *dev)
+{
+	(void)dev;
+	DRV_LOG(WARNING, "mlx5_os_mac_addr_flush is not support");
+}
+
+/**
+ * Remove a MAC address from device
+ * Currently it has no support under Windows.
+ *
+ * @param dev
+ *   Pointer to Ethernet device structure.
+ * @param index
+ *   MAC address index.
+ */
+void
+mlx5_os_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index)
+{
+	(void)dev;
+	(void)(index);
+	DRV_LOG(WARNING, "mlx5_os_mac_addr_remove is not support");
+}
+
+/**
+ * Modify a VF MAC address
+ * Currently it has no support under Windows.
+ *
+ * @param priv
+ *   Pointer to device private data.
+ * @param mac_addr
+ *   MAC address to modify into.
+ * @param iface_idx
+ *   Net device interface index
+ * @param vf_index
+ *   VF index
+ *
+ * @return
+ *   0 on success, a negative errno value otherwise
+ */
+int
+mlx5_os_vf_mac_addr_modify(struct mlx5_priv *priv,
+			   unsigned int iface_idx,
+			   struct rte_ether_addr *mac_addr,
+			   int vf_index)
+{
+	(void)priv;
+	(void)iface_idx;
+	(void)mac_addr;
+	(void)vf_index;
+	DRV_LOG(WARNING, "mlx5_os_vf_mac_addr_modify is not support");
+	return -ENOTSUP;
+}
+
+/**
+ * Set device promiscuous mode
+ * Currently it has no support under Windows.
+ *
+ * @param dev
+ *   Pointer to Ethernet device structure.
+ * @param enable
+ *   0 - promiscuous is disabled, otherwise - enabled
+ *
+ * @return
+ *   0 on success, a negative error value otherwise
+ */
+int
+mlx5_os_set_promisc(struct rte_eth_dev *dev, int enable)
+{
+	(void)dev;
+	(void)enable;
+	DRV_LOG(WARNING, "mlx5_os_set_promisc is not support");
+	return -ENOTSUP;
+}
+
+/**
+ * Set device allmulti mode
+ *
+ * @param dev
+ *   Pointer to Ethernet device structure.
+ * @param enable
+ *   0 - all multicase is disabled, otherwise - enabled
+ *
+ * @return
+ *   0 on success, a negative error value otherwise
+ */
+int
+mlx5_os_set_allmulti(struct rte_eth_dev *dev, int enable)
+{
+	(void)dev;
+	(void)enable;
+	DRV_LOG(WARNING, "mlx5_os_set_allmulti is not support");
+	return -ENOTSUP;
+}
+
+const struct mlx5_flow_driver_ops mlx5_flow_verbs_drv_ops = {0};
-- 
2.16.1.windows.4