speed = state & GXIO_MPIPE_LINK_SPEED_MASK;
+ new.link_autoneg = (dev->data->dev_conf.link_speeds &
+ ETH_LINK_SPEED_AUTONEG);
if (speed == GXIO_MPIPE_LINK_1G) {
- new.link_speed = ETH_LINK_SPEED_1000;
+ new.link_speed = ETH_SPEED_NUM_1G;
new.link_duplex = ETH_LINK_FULL_DUPLEX;
- new.link_status = 1;
+ new.link_status = ETH_LINK_UP;
} else if (speed == GXIO_MPIPE_LINK_10G) {
- new.link_speed = ETH_LINK_SPEED_10000;
+ new.link_speed = ETH_SPEED_NUM_10G;
new.link_duplex = ETH_LINK_FULL_DUPLEX;
- new.link_status = 1;
+ new.link_status = ETH_LINK_UP;
}
rc = mpipe_link_compare(&old, &new);
int i;
for (i = 0; i < count; i++) {
- mbuf = __rte_mbuf_raw_alloc(priv->rx_mpool);
+ mbuf = rte_mbuf_raw_alloc(priv->rx_mpool);
if (!mbuf)
break;
mpipe_recv_push(priv, mbuf);
/* Start xmit/recv on queues. */
for (queue = 0; queue < priv->nb_tx_queues; queue++)
- mpipe_tx_queue(priv, queue)->q.link_status = 1;
+ mpipe_tx_queue(priv, queue)->q.link_status = ETH_LINK_UP;
for (queue = 0; queue < priv->nb_rx_queues; queue++)
- mpipe_rx_queue(priv, queue)->q.link_status = 1;
+ mpipe_rx_queue(priv, queue)->q.link_status = ETH_LINK_UP;
priv->running = 1;
return 0;
int rc;
for (queue = 0; queue < priv->nb_tx_queues; queue++)
- mpipe_tx_queue(priv, queue)->q.link_status = 0;
+ mpipe_tx_queue(priv, queue)->q.link_status = ETH_LINK_DOWN;
for (queue = 0; queue < priv->nb_rx_queues; queue++)
- mpipe_rx_queue(priv, queue)->q.link_status = 0;
+ mpipe_rx_queue(priv, queue)->q.link_status = ETH_LINK_DOWN;
/* Make sure the link_status writes land. */
rte_wmb();
}
}
-static struct eth_dev_ops mpipe_dev_ops = {
+static const struct eth_dev_ops mpipe_dev_ops = {
.dev_infos_get = mpipe_infos_get,
.dev_configure = mpipe_configure,
.dev_start = mpipe_start,
MPIPE_BUF_DEBT_THRESHOLD)
mpipe_local.mbuf_push_debt[in_port]++;
else {
- mbuf = __rte_mbuf_raw_alloc(priv->rx_mpool);
+ mbuf = rte_mbuf_raw_alloc(priv->rx_mpool);
if (unlikely(!mbuf)) {
nb_nomem++;
gxio_mpipe_iqueue_drop(iqueue, idesc);
return -ENODEV;
}
- eth_dev = rte_eth_dev_allocate(ifname, RTE_ETH_DEV_VIRTUAL);
+ eth_dev = rte_eth_dev_allocate(ifname);
if (!eth_dev) {
RTE_LOG(ERR, PMD, "%s: Failed to allocate device.\n", ifname);
rte_free(priv);
}
static struct rte_driver pmd_mpipe_xgbe_drv = {
- .name = "xgbe",
.type = PMD_VDEV,
.init = rte_pmd_mpipe_devinit,
};
static struct rte_driver pmd_mpipe_gbe_drv = {
- .name = "gbe",
.type = PMD_VDEV,
.init = rte_pmd_mpipe_devinit,
};
-PMD_REGISTER_DRIVER(pmd_mpipe_xgbe_drv);
-PMD_REGISTER_DRIVER(pmd_mpipe_gbe_drv);
+PMD_REGISTER_DRIVER(pmd_mpipe_xgbe_drv, net_mpipe_xgbe);
+PMD_REGISTER_DRIVER(pmd_mpipe_gbe_drv, net_mpipe_gbe);
static void __attribute__((constructor, used))
mpipe_init_contexts(void)