X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fcxgbe%2Fcxgbevf_ethdev.c;h=c2918f5356e88c73b6ab10b7afa1121c41c63d41;hb=c3bbc381477f299eef3078ab7c4ef57165fe3121;hp=a6458d533c2230dd2bc26115041b2f20010e0882;hpb=854f4bf07cd2f857eae1af10a92a01673f262a5b;p=dpdk.git diff --git a/drivers/net/cxgbe/cxgbevf_ethdev.c b/drivers/net/cxgbe/cxgbevf_ethdev.c index a6458d533c..c2918f5356 100644 --- a/drivers/net/cxgbe/cxgbevf_ethdev.c +++ b/drivers/net/cxgbe/cxgbevf_ethdev.c @@ -28,7 +28,7 @@ /* *... and the PCI ID Table itself ... */ -#include "t4_pci_id_tbl.h" +#include "base/t4_pci_id_tbl.h" /* * Get port statistics. @@ -36,7 +36,7 @@ static int cxgbevf_dev_stats_get(struct rte_eth_dev *eth_dev, struct rte_eth_stats *eth_stats) { - struct port_info *pi = (struct port_info *)(eth_dev->data->dev_private); + struct port_info *pi = eth_dev->data->dev_private; struct adapter *adapter = pi->adapter; struct sge *s = &adapter->sge; struct port_stats ps; @@ -55,7 +55,7 @@ static int cxgbevf_dev_stats_get(struct rte_eth_dev *eth_dev, for (i = 0; i < pi->n_rx_qsets; i++) { struct sge_eth_rxq *rxq = - &s->ethrxq[pi->first_qset + i]; + &s->ethrxq[pi->first_rxqset + i]; eth_stats->q_ipackets[i] = rxq->stats.pkts; eth_stats->q_ibytes[i] = rxq->stats.rx_bytes; @@ -65,11 +65,10 @@ static int cxgbevf_dev_stats_get(struct rte_eth_dev *eth_dev, for (i = 0; i < pi->n_tx_qsets; i++) { struct sge_eth_txq *txq = - &s->ethtxq[pi->first_qset + i]; + &s->ethtxq[pi->first_txqset + i]; eth_stats->q_opackets[i] = txq->stats.pkts; eth_stats->q_obytes[i] = txq->stats.tx_bytes; - eth_stats->q_errors[i] = txq->stats.mapping_err; } return 0; } @@ -107,7 +106,7 @@ static const struct eth_dev_ops cxgbevf_eth_dev_ops = { */ static int eth_cxgbevf_dev_init(struct rte_eth_dev *eth_dev) { - struct port_info *pi = (struct port_info *)(eth_dev->data->dev_private); + struct port_info *pi = eth_dev->data->dev_private; struct rte_pci_device *pci_dev; char name[RTE_ETH_NAME_MAX_LEN]; struct adapter *adapter = NULL; @@ -163,6 +162,9 @@ static int eth_cxgbevf_dev_init(struct rte_eth_dev *eth_dev) adapter->pdev = pci_dev; adapter->eth_dev = eth_dev; pi->adapter = adapter; + + cxgbe_process_devargs(adapter); + err = cxgbevf_probe(adapter); if (err) { dev_err(adapter, "%s: cxgbevf probe failed with err %d\n", @@ -179,12 +181,15 @@ out_free_adapter: static int eth_cxgbevf_dev_uninit(struct rte_eth_dev *eth_dev) { - struct port_info *pi = (struct port_info *)(eth_dev->data->dev_private); - struct adapter *adap = pi->adapter; + struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); + uint16_t port_id; + int err = 0; /* Free up other ports and all resources */ - cxgbe_close(adap); - return 0; + RTE_ETH_FOREACH_DEV_OF(port_id, &pci_dev->device) + err |= rte_eth_dev_close(port_id); + + return err == 0 ? 0 : -EIO; } static int eth_cxgbevf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, @@ -209,3 +214,7 @@ static struct rte_pci_driver rte_cxgbevf_pmd = { RTE_PMD_REGISTER_PCI(net_cxgbevf, rte_cxgbevf_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_cxgbevf, cxgb4vf_pci_tbl); RTE_PMD_REGISTER_KMOD_DEP(net_cxgbevf, "* igb_uio | vfio-pci"); +RTE_PMD_REGISTER_PARAM_STRING(net_cxgbevf, + CXGBE_DEVARG_CMN_KEEP_OVLAN "=<0|1> " + CXGBE_DEVARG_CMN_TX_MODE_LATENCY "=<0|1> " + CXGBE_DEVARG_VF_FORCE_LINK_UP "=<0|1> ");