git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/txgbe: support VF promiscuous and allmulticast
[dpdk.git]
/
drivers
/
net
/
mlx4
/
mlx4_ethdev.c
diff --git
a/drivers/net/mlx4/mlx4_ethdev.c
b/drivers/net/mlx4/mlx4_ethdev.c
index
b5706bb
..
783ff94
100644
(file)
--- a/
drivers/net/mlx4/mlx4_ethdev.c
+++ b/
drivers/net/mlx4/mlx4_ethdev.c
@@
-8,7
+8,6
@@
* Miscellaneous control operations for mlx4 driver.
*/
* Miscellaneous control operations for mlx4 driver.
*/
-#include <assert.h>
#include <dirent.h>
#include <errno.h>
#include <linux/ethtool.h>
#include <dirent.h>
#include <errno.h>
#include <linux/ethtool.h>
@@
-35,7
+34,7
@@
#include <rte_bus_pci.h>
#include <rte_errno.h>
#include <rte_bus_pci.h>
#include <rte_errno.h>
-#include <
rte_
ethdev_driver.h>
+#include <ethdev_driver.h>
#include <rte_ether.h>
#include <rte_flow.h>
#include <rte_pci.h>
#include <rte_ether.h>
#include <rte_flow.h>
#include <rte_pci.h>
@@
-414,11
+413,14
@@
mlx4_promiscuous_disable(struct rte_eth_dev *dev)
*
* @param dev
* Pointer to Ethernet device structure.
*
* @param dev
* Pointer to Ethernet device structure.
+ *
+ * @return
+ * 0 on success, a negative errno value otherwise and rte_errno is set.
*/
*/
-void
+int
mlx4_allmulticast_enable(struct rte_eth_dev *dev)
{
mlx4_allmulticast_enable(struct rte_eth_dev *dev)
{
- mlx4_rxmode_toggle(dev, RXMODE_TOGGLE_ALLMULTI_ON);
+
return
mlx4_rxmode_toggle(dev, RXMODE_TOGGLE_ALLMULTI_ON);
}
/**
}
/**
@@
-426,11
+428,14
@@
mlx4_allmulticast_enable(struct rte_eth_dev *dev)
*
* @param dev
* Pointer to Ethernet device structure.
*
* @param dev
* Pointer to Ethernet device structure.
+ *
+ * @return
+ * 0 on success, a negative errno value otherwise and rte_errno is set.
*/
*/
-void
+int
mlx4_allmulticast_disable(struct rte_eth_dev *dev)
{
mlx4_allmulticast_disable(struct rte_eth_dev *dev)
{
- mlx4_rxmode_toggle(dev, RXMODE_TOGGLE_ALLMULTI_OFF);
+
return
mlx4_rxmode_toggle(dev, RXMODE_TOGGLE_ALLMULTI_OFF);
}
/**
}
/**
@@
-640,9
+645,8
@@
mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
*/
max = ((priv->device_attr.max_cq > priv->device_attr.max_qp) ?
priv->device_attr.max_qp : priv->device_attr.max_cq);
*/
max = ((priv->device_attr.max_cq > priv->device_attr.max_qp) ?
priv->device_attr.max_qp : priv->device_attr.max_cq);
- /* If max >= 65535 then max = 0, max_rx_queues is uint16_t. */
- if (max >= 65535)
- max = 65535;
+ /* max_rx_queues is uint16_t. */
+ max = RTE_MIN(max, (unsigned int)UINT16_MAX);
info->max_rx_queues = max;
info->max_tx_queues = max;
info->max_mac_addrs = RTE_DIM(priv->mac);
info->max_rx_queues = max;
info->max_tx_queues = max;
info->max_mac_addrs = RTE_DIM(priv->mac);
@@
-746,8
+750,11
@@
mlx4_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
*
* @param dev
* Pointer to Ethernet device structure.
*
* @param dev
* Pointer to Ethernet device structure.
+ *
+ * @return
+ * alwasy 0 on success
*/
*/
-void
+int
mlx4_stats_reset(struct rte_eth_dev *dev)
{
unsigned int i;
mlx4_stats_reset(struct rte_eth_dev *dev)
{
unsigned int i;
@@
-768,6
+775,8
@@
mlx4_stats_reset(struct rte_eth_dev *dev)
.idx = txq->stats.idx,
};
}
.idx = txq->stats.idx,
};
}
+
+ return 0;
}
/**
}
/**
@@
-863,7
+872,7
@@
mlx4_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
fc_conf->mode = RTE_FC_NONE;
ret = 0;
out:
fc_conf->mode = RTE_FC_NONE;
ret = 0;
out:
-
assert
(ret >= 0);
+
MLX4_ASSERT
(ret >= 0);
return -ret;
}
return -ret;
}
@@
-909,7
+918,7
@@
mlx4_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
}
ret = 0;
out:
}
ret = 0;
out:
-
assert
(ret >= 0);
+
MLX4_ASSERT
(ret >= 0);
return -ret;
}
return -ret;
}