From: Ophir Munk Date: Mon, 28 Dec 2020 09:54:34 +0000 (+0200) Subject: net/mlx5: add Windows stubs X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=59f102074f0f19c36afcd66a22d2ef22f3edf808 net/mlx5: add Windows stubs 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 Acked-by: Matan Azrad --- diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c index e0646670a3..a8bef70fa2 100644 --- a/drivers/net/mlx5/windows/mlx5_os.c +++ b/drivers/net/mlx5/windows/mlx5_os.c @@ -13,10 +13,18 @@ #include #include #include +#include +#include +#include #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, "%s: is not supported", __func__); + 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, "%s: is not supported", __func__); +} + +/** + * 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, "%s: is not supported", __func__); +} + +/** + * 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, "%s: is not supported", __func__); + 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, "%s: is not supported", __func__); +} + +/** + * 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, "%s: is not supported", __func__); +} + +/** + * 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, "%s: is not supported", __func__); + 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, "%s: is not supported", __func__); + 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, "%s: is not supported", __func__); + return -ENOTSUP; +} + +const struct mlx5_flow_driver_ops mlx5_flow_verbs_drv_ops = {0};