X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fmpipe%2Fmpipe_tilegx.c;h=7bbd168bcb419b0cadd66f9c6e7907b862d1113b;hb=73db5badb042c2ba668cdc096168932c5d5e692d;hp=1a77c7a8864777fb60df0af81b8b6eac853ba7aa;hpb=39fd068a27237ff0f825d8efd9ba9ed9a28cacb0;p=dpdk.git diff --git a/drivers/net/mpipe/mpipe_tilegx.c b/drivers/net/mpipe/mpipe_tilegx.c index 1a77c7a886..7bbd168bcb 100644 --- a/drivers/net/mpipe/mpipe_tilegx.c +++ b/drivers/net/mpipe/mpipe_tilegx.c @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include #include @@ -87,7 +87,6 @@ struct mpipe_local { static __thread struct mpipe_local mpipe_local; static struct mpipe_context mpipe_contexts[GXIO_MPIPE_INSTANCE_MAX]; static int mpipe_instances; -static const char *drivername = "MPIPE PMD"; /* Per queue statistics. */ struct mpipe_queue_stats { @@ -394,6 +393,8 @@ mpipe_link_update(struct rte_eth_dev *dev, int wait_to_complete) 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_SPEED_NUM_1G; new.link_duplex = ETH_LINK_FULL_DUPLEX; @@ -514,7 +515,7 @@ mpipe_recv_fill_stack(struct mpipe_dev_priv *priv, int count) 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); @@ -1450,7 +1451,7 @@ mpipe_do_recv(struct mpipe_rx_queue *rx_queue, struct rte_mbuf **rx_pkts, 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); @@ -1547,7 +1548,7 @@ mpipe_link_mac(const char *ifname, uint8_t *mac) } static int -rte_pmd_mpipe_devinit(const char *ifname, +rte_pmd_mpipe_probe_common(struct rte_vdev_driver *drv, const char *ifname, const char *params __rte_unused) { gxio_mpipe_context_t *context; @@ -1585,7 +1586,7 @@ rte_pmd_mpipe_devinit(const char *ifname, 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); @@ -1601,10 +1602,9 @@ rte_pmd_mpipe_devinit(const char *ifname, eth_dev->data->dev_private = priv; eth_dev->data->mac_addrs = &priv->mac_addr; - eth_dev->data->dev_flags = 0; eth_dev->data->kdrv = RTE_KDRV_NONE; eth_dev->driver = NULL; - eth_dev->data->drv_name = drivername; + eth_dev->data->drv_name = drv->driver.name; eth_dev->data->numa_node = instance; eth_dev->dev_ops = &mpipe_dev_ops; @@ -1621,20 +1621,30 @@ rte_pmd_mpipe_devinit(const char *ifname, return 0; } -static struct rte_driver pmd_mpipe_xgbe_drv = { - .name = "xgbe", - .type = PMD_VDEV, - .init = rte_pmd_mpipe_devinit, +static int +rte_pmd_mpipe_xgbe_probe(const char *ifname, const char *params __rte_unused) +{ + return rte_pmd_mpipe_probe_common(&pmd_mpipe_xgbe_drv, ifname, params); +} + +static int +rte_pmd_mpipe_gbe_probe(const char *ifname, const char *params __rte_unused) +{ + return rte_pmd_mpipe_probe_common(&pmd_mpipe_gbe_drv, ifname, params); +} + +static struct rte_vdev_driver pmd_mpipe_xgbe_drv = { + .probe = rte_pmd_mpipe_xgbe_probe, }; -static struct rte_driver pmd_mpipe_gbe_drv = { - .name = "gbe", - .type = PMD_VDEV, - .init = rte_pmd_mpipe_devinit, +static struct rte_vdev_driver pmd_mpipe_gbe_drv = { + .probe = rte_pmd_mpipe_gbe_probe, }; -PMD_REGISTER_DRIVER(pmd_mpipe_xgbe_drv); -PMD_REGISTER_DRIVER(pmd_mpipe_gbe_drv); +RTE_PMD_REGISTER_VDEV(net_mpipe_xgbe, pmd_mpipe_xgbe_drv); +RTE_PMD_REGISTER_ALIAS(net_mpipe_xgbe, xgbe); +RTE_PMD_REGISTER_VDEV(net_mpipe_gbe, pmd_mpipe_gbe_drv); +RTE_PMD_REGISTER_ALIAS(net_mpipe_gbe, gbe); static void __attribute__((constructor, used)) mpipe_init_contexts(void)