X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fmlx5%2Fwindows%2Fmlx5_ethdev_os.c;h=c709dd19be052df2f5bafba57f30bfbea785238e;hb=cdc32d127e68d711d2c072883983e4bcf792fa61;hp=f0355ac671eace29d869726fede515a0d3f33b07;hpb=49c797f8ab605b5b7752222fbee3c497a8ddaf3b;p=dpdk.git diff --git a/drivers/net/mlx5/windows/mlx5_ethdev_os.c b/drivers/net/mlx5/windows/mlx5_ethdev_os.c index f0355ac671..c709dd19be 100644 --- a/drivers/net/mlx5/windows/mlx5_ethdev_os.c +++ b/drivers/net/mlx5/windows/mlx5_ethdev_os.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include @@ -56,7 +56,7 @@ mlx5_get_mac(struct rte_eth_dev *dev, uint8_t (*mac)[RTE_ETHER_ADDR_LEN]) * 0 on success, a negative errno value otherwise and rte_errno is set. */ int -mlx5_get_ifname(const struct rte_eth_dev *dev, char (*ifname)[IF_NAMESIZE]) +mlx5_get_ifname(const struct rte_eth_dev *dev, char (*ifname)[MLX5_NAMESIZE]) { struct mlx5_priv *priv; mlx5_context_st *context_obj; @@ -67,7 +67,7 @@ mlx5_get_ifname(const struct rte_eth_dev *dev, char (*ifname)[IF_NAMESIZE]) } priv = dev->data->dev_private; context_obj = (mlx5_context_st *)priv->sh->ctx; - strncpy(*ifname, context_obj->mlx5_dev.name, IF_NAMESIZE); + strncpy(*ifname, context_obj->mlx5_dev.name, MLX5_NAMESIZE); return 0; } @@ -254,7 +254,7 @@ mlx5_link_update(struct rte_eth_dev *dev, int wait_to_complete) } priv = dev->data->dev_private; context_obj = (mlx5_context_st *)priv->sh->ctx; - dev_link.link_speed = context_obj->mlx5_dev.link_speed / (1024 * 1024); + dev_link.link_speed = context_obj->mlx5_dev.link_speed / (1000 * 1000); dev_link.link_status = (context_obj->mlx5_dev.link_state == 1 && !mlx5_is_removed(dev)) ? 1 : 0; @@ -369,3 +369,23 @@ mlx5_read_clock(struct rte_eth_dev *dev, uint64_t *clock) *clock = *(uint64_t volatile *)mlx5_clock.p_iseg_internal_timer; return 0; } + +/** + * Check if mlx5 device was removed. + * + * @param dev + * Pointer to Ethernet device structure. + * + * @return + * 1 when device is removed, otherwise 0. + */ +int +mlx5_is_removed(struct rte_eth_dev *dev) +{ + struct mlx5_priv *priv = dev->data->dev_private; + mlx5_context_st *context_obj = (mlx5_context_st *)priv->sh->ctx; + + if (*context_obj->shutdown_event_obj.p_flag) + return 1; + return 0; +}