net/mlx5: prefix Tx structures and functions
[dpdk.git] / drivers / net / mlx5 / mlx5.c
index 6541ee3..7aea5a4 100644 (file)
@@ -201,10 +201,6 @@ mlx5_dev_close(struct rte_eth_dev *dev)
        priv_mac_addrs_disable(priv);
        priv_destroy_hash_rxqs(priv);
 
-       /* Remove flow director elements. */
-       priv_fdir_disable(priv);
-       priv_fdir_delete_filters_list(priv);
-
        /* Prevent crashes when queues are still in use. */
        dev->rx_pkt_burst = removed_rx_burst;
        dev->tx_pkt_burst = removed_tx_burst;
@@ -212,14 +208,14 @@ mlx5_dev_close(struct rte_eth_dev *dev)
                /* XXX race condition if mlx5_rx_burst() is still running. */
                usleep(1000);
                for (i = 0; (i != priv->rxqs_n); ++i) {
-                       struct rxq *rxq = (*priv->rxqs)[i];
-                       struct rxq_ctrl *rxq_ctrl;
+                       struct mlx5_rxq_data *rxq = (*priv->rxqs)[i];
+                       struct mlx5_rxq_ctrl *rxq_ctrl;
 
                        if (rxq == NULL)
                                continue;
-                       rxq_ctrl = container_of(rxq, struct rxq_ctrl, rxq);
+                       rxq_ctrl = container_of(rxq, struct mlx5_rxq_ctrl, rxq);
                        (*priv->rxqs)[i] = NULL;
-                       rxq_cleanup(rxq_ctrl);
+                       mlx5_rxq_cleanup(rxq_ctrl);
                        rte_free(rxq_ctrl);
                }
                priv->rxqs_n = 0;
@@ -229,14 +225,14 @@ mlx5_dev_close(struct rte_eth_dev *dev)
                /* XXX race condition if mlx5_tx_burst() is still running. */
                usleep(1000);
                for (i = 0; (i != priv->txqs_n); ++i) {
-                       struct txq *txq = (*priv->txqs)[i];
-                       struct txq_ctrl *txq_ctrl;
+                       struct mlx5_txq_data *txq = (*priv->txqs)[i];
+                       struct mlx5_txq_ctrl *txq_ctrl;
 
                        if (txq == NULL)
                                continue;
-                       txq_ctrl = container_of(txq, struct txq_ctrl, txq);
+                       txq_ctrl = container_of(txq, struct mlx5_txq_ctrl, txq);
                        (*priv->txqs)[i] = NULL;
-                       txq_cleanup(txq_ctrl);
+                       mlx5_txq_cleanup(txq_ctrl);
                        rte_free(txq_ctrl);
                }
                priv->txqs_n = 0;
@@ -303,6 +299,18 @@ static const struct eth_dev_ops mlx5_dev_ops = {
        .rx_queue_intr_disable = mlx5_rx_intr_disable,
 };
 
+
+static const struct eth_dev_ops mlx5_dev_sec_ops = {
+       .stats_get = mlx5_stats_get,
+       .stats_reset = mlx5_stats_reset,
+       .xstats_get = mlx5_xstats_get,
+       .xstats_reset = mlx5_xstats_reset,
+       .xstats_get_names = mlx5_xstats_get_names,
+       .dev_infos_get = mlx5_dev_infos_get,
+       .rx_descriptor_status = mlx5_rx_descriptor_status,
+       .tx_descriptor_status = mlx5_tx_descriptor_status,
+};
+
 static struct {
        struct rte_pci_addr pci_addr; /* associated PCI address */
        uint32_t ports; /* physical ports bitfield. */
@@ -640,7 +648,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
                                goto error;
                        }
                        eth_dev->device = &pci_dev->device;
-                       eth_dev->dev_ops = NULL;
+                       eth_dev->dev_ops = &mlx5_dev_sec_ops;
                        priv = eth_dev->data->dev_private;
                        /* Receive command fd from primary process */
                        err = priv_socket_connect(priv);
@@ -707,6 +715,8 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
                }
 
                priv->ctx = ctx;
+               strncpy(priv->ibdev_path, priv->ctx->device->ibdev_path,
+                       sizeof(priv->ibdev_path));
                priv->device_attr = device_attr;
                priv->port = port;
                priv->pd = pd;
@@ -830,10 +840,6 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
                claim_zero(priv_mac_addr_add(priv, 0,
                                             (const uint8_t (*)[ETHER_ADDR_LEN])
                                             mac.addr_bytes));
-               /* Initialize FD filters list. */
-               err = fdir_init_filters_list(priv);
-               if (err)
-                       goto port_error;
 #ifndef NDEBUG
                {
                        char ifname[IF_NAMESIZE];