X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fnet%2Fmlx5%2Fmlx5_trigger.c;h=29aef543c2d998f965d9a667cb32aee61657588e;hb=3b025c0ca425a634b7eead08420fa5a5cfaa1445;hp=feb9154199cb1d44e7a9efa11b02d8eba6a65e11;hpb=6c55b622a95693c6269ef8add75328813ee08e95;p=dpdk.git diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c index feb9154199..29aef543c2 100644 --- a/drivers/net/mlx5/mlx5_trigger.c +++ b/drivers/net/mlx5/mlx5_trigger.c @@ -59,7 +59,9 @@ mlx5_txq_start(struct rte_eth_dev *dev) } else { txq_alloc_elts(txq_ctrl); txq_ctrl->obj = mlx5_txq_obj_new - (dev, i, MLX5_TXQ_OBJ_TYPE_IBV); + (dev, i, priv->txpp_en ? + MLX5_TXQ_OBJ_TYPE_DEVX_SQ : + MLX5_TXQ_OBJ_TYPE_IBV); } if (!txq_ctrl->obj) { rte_errno = ENOMEM; @@ -112,7 +114,6 @@ mlx5_rxq_start(struct rte_eth_dev *dev) for (i = 0; i < priv->rxqs_n; ++i) { rxq = (*priv->rxqs)[i]; - if (rxq && rxq->lro) { obj_type = MLX5_RXQ_OBJ_TYPE_DEVX_RQ; break; @@ -270,6 +271,7 @@ error: int mlx5_dev_start(struct rte_eth_dev *dev) { + struct mlx5_priv *priv = dev->data->dev_private; int ret; int fine_inline; @@ -288,25 +290,29 @@ mlx5_dev_start(struct rte_eth_dev *dev) return -rte_errno; } } + ret = mlx5_txpp_start(dev); + if (ret) { + DRV_LOG(ERR, "port %u Tx packet pacing init failed: %s", + dev->data->port_id, strerror(rte_errno)); + goto error; + } ret = mlx5_txq_start(dev); if (ret) { DRV_LOG(ERR, "port %u Tx queue allocation failed: %s", dev->data->port_id, strerror(rte_errno)); - return -rte_errno; + goto error; } ret = mlx5_rxq_start(dev); if (ret) { DRV_LOG(ERR, "port %u Rx queue allocation failed: %s", dev->data->port_id, strerror(rte_errno)); - mlx5_txq_stop(dev); - return -rte_errno; + goto error; } ret = mlx5_hairpin_bind(dev); if (ret) { DRV_LOG(ERR, "port %u hairpin binding failed: %s", dev->data->port_id, strerror(rte_errno)); - mlx5_txq_stop(dev); - return -rte_errno; + goto error; } /* Set started flag here for the following steps like control flow. */ dev->data->dev_started = 1; @@ -316,7 +322,7 @@ mlx5_dev_start(struct rte_eth_dev *dev) dev->data->port_id); goto error; } - mlx5_stats_init(dev); + mlx5_os_stats_init(dev); ret = mlx5_traffic_enable(dev); if (ret) { DRV_LOG(ERR, "port %u failed to set defaults flows", @@ -325,6 +331,8 @@ mlx5_dev_start(struct rte_eth_dev *dev) } /* Set a mask and offset of dynamic metadata flows into Rx queues*/ mlx5_flow_rxq_dynf_metadata_set(dev); + /* Set a mask and offset of scheduling on timestamp into Tx queues*/ + mlx5_txq_dynf_timestamp_set(dev); /* * In non-cached mode, it only needs to start the default mreg copy * action and no flow created by application exists anymore. @@ -341,7 +349,18 @@ mlx5_dev_start(struct rte_eth_dev *dev) dev->rx_pkt_burst = mlx5_select_rx_function(dev); /* Enable datapath on secondary process. */ mlx5_mp_req_start_rxtx(dev); - mlx5_dev_interrupt_handler_install(dev); + if (priv->sh->intr_handle.fd >= 0) { + priv->sh->port[priv->dev_port - 1].ih_port_id = + (uint32_t)dev->data->port_id; + } else { + DRV_LOG(INFO, "port %u starts without LSC and RMV interrupts.", + dev->data->port_id); + dev->data->dev_conf.intr_conf.lsc = 0; + dev->data->dev_conf.intr_conf.rmv = 0; + } + if (priv->sh->intr_handle_devx.fd >= 0) + priv->sh->port[priv->dev_port - 1].devx_ih_port_id = + (uint32_t)dev->data->port_id; return 0; error: ret = rte_errno; /* Save rte_errno before cleanup. */ @@ -351,6 +370,7 @@ error: mlx5_traffic_disable(dev); mlx5_txq_stop(dev); mlx5_rxq_stop(dev); + mlx5_txpp_stop(dev); /* Stop last. */ rte_errno = ret; /* Restore rte_errno. */ return -rte_errno; } @@ -383,9 +403,11 @@ mlx5_dev_stop(struct rte_eth_dev *dev) /* All RX queue flags will be cleared in the flush interface. */ mlx5_flow_list_flush(dev, &priv->flows, true); mlx5_rx_intr_vec_disable(dev); - mlx5_dev_interrupt_handler_uninstall(dev); + priv->sh->port[priv->dev_port - 1].ih_port_id = RTE_MAX_ETHPORTS; + priv->sh->port[priv->dev_port - 1].devx_ih_port_id = RTE_MAX_ETHPORTS; mlx5_txq_stop(dev); mlx5_rxq_stop(dev); + mlx5_txpp_stop(dev); } /** @@ -452,6 +474,15 @@ mlx5_traffic_enable(struct rte_eth_dev *dev) " configured - only Eswitch group 0 flows are" " supported.", dev->data->port_id); } + if (!priv->config.lacp_by_user && priv->pf_bond >= 0) { + ret = mlx5_flow_lacp_miss(dev); + if (ret) + DRV_LOG(INFO, "port %u LACP rule cannot be created - " + "forward LACP to kernel.", dev->data->port_id); + else + DRV_LOG(INFO, "LACP traffic will be missed in port %u." + , dev->data->port_id); + } if (priv->isolated) return 0; if (dev->data->promiscuous) {