X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fszedata2%2Frte_eth_szedata2.c;h=821bb346c31080d0926f54b160aac37d78014294;hb=c59e2faf147339e9b8375e2698919b8c053b0666;hp=43a66432a0d1bb3ca29c2d414b507585f64d51fa;hpb=6d13ea8e8e49ab957deae2bba5ecf4a4bfe747d1;p=dpdk.git diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c index 43a66432a0..821bb346c3 100644 --- a/drivers/net/szedata2/rte_eth_szedata2.c +++ b/drivers/net/szedata2/rte_eth_szedata2.c @@ -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 @@ -1337,30 +1346,34 @@ eth_mac_addr_set(struct rte_eth_dev *dev __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 = { @@ -1476,6 +1489,9 @@ rte_szedata2_eth_dev_init(struct rte_eth_dev *dev, struct port_info *pi) PMD_INIT_LOG(INFO, "Initializing eth_dev %s (driver %s)", data->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; /* Get index of szedata2 device file and create path to device file */ @@ -1522,7 +1538,7 @@ 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", RTE_STR(RTE_SZEDATA2_DRIVER_NAME), data->name); @@ -1538,12 +1554,9 @@ 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); + eth_dev_close(dev); PMD_DRV_LOG(INFO, "%s device %s successfully uninitialized", RTE_STR(RTE_SZEDATA2_DRIVER_NAME), dev->data->name); @@ -1568,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, }