X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fnet%2Fszedata2%2Frte_eth_szedata2.c;h=821bb346c31080d0926f54b160aac37d78014294;hb=f26c2b39b271cdcd857ba518c5e48c78cb1c30af;hp=8f92e72f220209e2bfb096545c78ac5f3242948c;hpb=323e7b667f18376c60351282950b28d4d0cc6165;p=dpdk.git diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c index 8f92e72f22..821bb346c3 100644 --- a/drivers/net/szedata2/rte_eth_szedata2.c +++ b/drivers/net/szedata2/rte_eth_szedata2.c @@ -105,7 +105,7 @@ struct szedata2_tx_queue { int szedata2_logtype_init; int szedata2_logtype_driver; -static struct ether_addr eth_addr = { +static struct rte_ether_addr eth_addr = { .addr_bytes = { 0x00, 0x11, 0x17, 0x00, 0x00, 0x00 } }; @@ -1044,7 +1044,7 @@ eth_dev_configure(struct rte_eth_dev *dev) return 0; } -static void +static int eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { @@ -1061,6 +1061,8 @@ eth_dev_info(struct rte_eth_dev *dev, dev_info->rx_queue_offload_capa = 0; dev_info->tx_queue_offload_capa = 0; dev_info->speed_capa = ETH_LINK_SPEED_100G; + + return 0; } static int @@ -1093,7 +1095,6 @@ eth_stats_get(struct rte_eth_dev *dev, if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) { stats->q_opackets[i] = txq->tx_pkts; stats->q_obytes[i] = txq->tx_bytes; - stats->q_errors[i] = txq->err_pkts; } tx_total += txq->tx_pkts; tx_total_bytes += txq->tx_bytes; @@ -1110,7 +1111,7 @@ eth_stats_get(struct rte_eth_dev *dev, return 0; } -static void +static int eth_stats_reset(struct rte_eth_dev *dev) { uint16_t i; @@ -1129,6 +1130,8 @@ eth_stats_reset(struct rte_eth_dev *dev) txq->tx_bytes = 0; txq->err_pkts = 0; } + + return 0; } static void @@ -1158,12 +1161,15 @@ eth_tx_queue_release(void *q) static void eth_dev_close(struct rte_eth_dev *dev) { + struct pmd_internals *internals = dev->data->dev_private; uint16_t i; uint16_t nb_rx = dev->data->nb_rx_queues; uint16_t nb_tx = dev->data->nb_tx_queues; eth_dev_stop(dev); + free(internals->sze_dev_path); + for (i = 0; i < nb_rx; i++) { eth_rx_queue_release(dev->data->rx_queues[i]); dev->data->rx_queues[i] = NULL; @@ -1174,6 +1180,9 @@ eth_dev_close(struct rte_eth_dev *dev) dev->data->tx_queues[i] = NULL; } dev->data->nb_tx_queues = 0; + + rte_free(dev->data->mac_addrs); + dev->data->mac_addrs = NULL; } static int @@ -1332,35 +1341,39 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, static int eth_mac_addr_set(struct rte_eth_dev *dev __rte_unused, - struct ether_addr *mac_addr __rte_unused) + struct rte_ether_addr *mac_addr __rte_unused) { return 0; } -static void +static int eth_promiscuous_enable(struct rte_eth_dev *dev __rte_unused) { PMD_DRV_LOG(WARNING, "Enabling promiscuous mode is not supported. " "The card is always in promiscuous mode."); + return 0; } -static void +static int eth_promiscuous_disable(struct rte_eth_dev *dev __rte_unused) { PMD_DRV_LOG(WARNING, "Disabling promiscuous mode is not supported. " "The card is always in promiscuous mode."); + return -ENOTSUP; } -static void +static int eth_allmulticast_enable(struct rte_eth_dev *dev __rte_unused) { PMD_DRV_LOG(WARNING, "Enabling allmulticast mode is not supported."); + return -ENOTSUP; } -static void +static int eth_allmulticast_disable(struct rte_eth_dev *dev __rte_unused) { PMD_DRV_LOG(WARNING, "Disabling allmulticast mode is not supported."); + return -ENOTSUP; } static const struct eth_dev_ops ops = { @@ -1474,7 +1487,10 @@ rte_szedata2_eth_dev_init(struct rte_eth_dev *dev, struct port_info *pi) PMD_INIT_FUNC_TRACE(); PMD_INIT_LOG(INFO, "Initializing eth_dev %s (driver %s)", data->name, - dev->device->driver->name); + RTE_STR(RTE_SZEDATA2_DRIVER_NAME)); + + /* Let rte_eth_dev_close() release the port resources */ + dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE; /* Fill internal private structure. */ internals->dev = dev; @@ -1514,7 +1530,7 @@ rte_szedata2_eth_dev_init(struct rte_eth_dev *dev, struct port_info *pi) eth_link_update(dev, 0); /* Allocate space for one mac address */ - data->mac_addrs = rte_zmalloc(data->name, sizeof(struct ether_addr), + data->mac_addrs = rte_zmalloc(data->name, sizeof(struct rte_ether_addr), RTE_CACHE_LINE_SIZE); if (data->mac_addrs == NULL) { PMD_INIT_LOG(ERR, "Could not alloc space for MAC address!"); @@ -1522,10 +1538,10 @@ rte_szedata2_eth_dev_init(struct rte_eth_dev *dev, struct port_info *pi) return -ENOMEM; } - ether_addr_copy(ð_addr, data->mac_addrs); + rte_ether_addr_copy(ð_addr, data->mac_addrs); PMD_INIT_LOG(INFO, "%s device %s successfully initialized", - dev->device->driver->name, data->name); + RTE_STR(RTE_SZEDATA2_DRIVER_NAME), data->name); return 0; } @@ -1538,16 +1554,12 @@ rte_szedata2_eth_dev_init(struct rte_eth_dev *dev, struct port_info *pi) static int rte_szedata2_eth_dev_uninit(struct rte_eth_dev *dev) { - struct pmd_internals *internals = (struct pmd_internals *) - dev->data->dev_private; - PMD_INIT_FUNC_TRACE(); - free(internals->sze_dev_path); - rte_free(dev->data->mac_addrs); + eth_dev_close(dev); PMD_DRV_LOG(INFO, "%s device %s successfully uninitialized", - dev->device->driver->name, dev->data->name); + RTE_STR(RTE_SZEDATA2_DRIVER_NAME), dev->data->name); return 0; } @@ -1569,6 +1581,14 @@ static const struct rte_pci_id rte_szedata2_pci_id_table[] = { RTE_PCI_DEVICE(PCI_VENDOR_ID_NETCOPE, PCI_DEVICE_ID_NETCOPE_NFB200G2QL) }, + { + RTE_PCI_DEVICE(PCI_VENDOR_ID_SILICOM, + PCI_DEVICE_ID_FB2CGG3) + }, + { + RTE_PCI_DEVICE(PCI_VENDOR_ID_SILICOM, + PCI_DEVICE_ID_FB2CGG3D) + }, { .vendor_id = 0, }