net/mlx5: remove redundant started flag
This flag is already present in the Ethernet device. Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com> Acked-by: Yongseok Koh <yskoh@mellanox.com>
This commit is contained in:
parent
991b04f682
commit
8bb00fb185
@ -104,7 +104,6 @@ struct priv {
|
|||||||
/* Device properties. */
|
/* Device properties. */
|
||||||
uint16_t mtu; /* Configured MTU. */
|
uint16_t mtu; /* Configured MTU. */
|
||||||
uint8_t port; /* Physical port number. */
|
uint8_t port; /* Physical port number. */
|
||||||
unsigned int started:1; /* Device started, flows enabled. */
|
|
||||||
unsigned int promisc_req:1; /* Promiscuous mode requested. */
|
unsigned int promisc_req:1; /* Promiscuous mode requested. */
|
||||||
unsigned int allmulti_req:1; /* All multicast mode requested. */
|
unsigned int allmulti_req:1; /* All multicast mode requested. */
|
||||||
unsigned int hw_csum:1; /* Checksum offload is supported. */
|
unsigned int hw_csum:1; /* Checksum offload is supported. */
|
||||||
|
@ -1052,7 +1052,7 @@ priv_flow_create_action_queue_drop(struct priv *priv,
|
|||||||
++flow->ibv_attr->num_of_specs;
|
++flow->ibv_attr->num_of_specs;
|
||||||
flow->offset += sizeof(struct ibv_flow_spec_action_drop);
|
flow->offset += sizeof(struct ibv_flow_spec_action_drop);
|
||||||
rte_flow->ibv_attr = flow->ibv_attr;
|
rte_flow->ibv_attr = flow->ibv_attr;
|
||||||
if (!priv->started)
|
if (!priv->dev->data->dev_started)
|
||||||
return rte_flow;
|
return rte_flow;
|
||||||
rte_flow->qp = priv->flow_drop_queue->qp;
|
rte_flow->qp = priv->flow_drop_queue->qp;
|
||||||
rte_flow->ibv_flow = ibv_create_flow(rte_flow->qp,
|
rte_flow->ibv_flow = ibv_create_flow(rte_flow->qp,
|
||||||
@ -1158,7 +1158,7 @@ priv_flow_create_action_queue(struct priv *priv,
|
|||||||
NULL, "cannot allocate QP");
|
NULL, "cannot allocate QP");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if (!priv->started)
|
if (!priv->dev->data->dev_started)
|
||||||
return rte_flow;
|
return rte_flow;
|
||||||
rte_flow->ibv_flow = ibv_create_flow(rte_flow->qp,
|
rte_flow->ibv_flow = ibv_create_flow(rte_flow->qp,
|
||||||
rte_flow->ibv_attr);
|
rte_flow->ibv_attr);
|
||||||
@ -1618,7 +1618,7 @@ mlx5_flow_isolate(struct rte_eth_dev *dev,
|
|||||||
struct priv *priv = dev->data->dev_private;
|
struct priv *priv = dev->data->dev_private;
|
||||||
|
|
||||||
priv_lock(priv);
|
priv_lock(priv);
|
||||||
if (priv->started) {
|
if (dev->data->dev_started) {
|
||||||
rte_flow_error_set(error, EBUSY,
|
rte_flow_error_set(error, EBUSY,
|
||||||
RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
|
RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -1150,7 +1150,7 @@ mlx5_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
|
|||||||
if (rxq != NULL) {
|
if (rxq != NULL) {
|
||||||
DEBUG("%p: reusing already allocated queue index %u (%p)",
|
DEBUG("%p: reusing already allocated queue index %u (%p)",
|
||||||
(void *)dev, idx, (void *)rxq);
|
(void *)dev, idx, (void *)rxq);
|
||||||
if (priv->started) {
|
if (dev->data->dev_started) {
|
||||||
priv_unlock(priv);
|
priv_unlock(priv);
|
||||||
return -EEXIST;
|
return -EEXIST;
|
||||||
}
|
}
|
||||||
|
@ -61,10 +61,6 @@ mlx5_dev_start(struct rte_eth_dev *dev)
|
|||||||
return -E_RTE_SECONDARY;
|
return -E_RTE_SECONDARY;
|
||||||
|
|
||||||
priv_lock(priv);
|
priv_lock(priv);
|
||||||
if (priv->started) {
|
|
||||||
priv_unlock(priv);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
/* Update Rx/Tx callback. */
|
/* Update Rx/Tx callback. */
|
||||||
priv_dev_select_tx_function(priv, dev);
|
priv_dev_select_tx_function(priv, dev);
|
||||||
priv_dev_select_rx_function(priv, dev);
|
priv_dev_select_rx_function(priv, dev);
|
||||||
@ -72,8 +68,6 @@ mlx5_dev_start(struct rte_eth_dev *dev)
|
|||||||
err = priv_create_hash_rxqs(priv);
|
err = priv_create_hash_rxqs(priv);
|
||||||
if (!err)
|
if (!err)
|
||||||
err = priv_rehash_flows(priv);
|
err = priv_rehash_flows(priv);
|
||||||
if (!err)
|
|
||||||
priv->started = 1;
|
|
||||||
else {
|
else {
|
||||||
ERROR("%p: an error occurred while configuring hash RX queues:"
|
ERROR("%p: an error occurred while configuring hash RX queues:"
|
||||||
" %s",
|
" %s",
|
||||||
@ -82,7 +76,6 @@ mlx5_dev_start(struct rte_eth_dev *dev)
|
|||||||
}
|
}
|
||||||
err = priv_flow_start(priv);
|
err = priv_flow_start(priv);
|
||||||
if (err) {
|
if (err) {
|
||||||
priv->started = 0;
|
|
||||||
ERROR("%p: an error occurred while configuring flows:"
|
ERROR("%p: an error occurred while configuring flows:"
|
||||||
" %s",
|
" %s",
|
||||||
(void *)priv, strerror(err));
|
(void *)priv, strerror(err));
|
||||||
@ -125,10 +118,6 @@ mlx5_dev_stop(struct rte_eth_dev *dev)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
priv_lock(priv);
|
priv_lock(priv);
|
||||||
if (!priv->started) {
|
|
||||||
priv_unlock(priv);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
DEBUG("%p: cleaning up and destroying hash RX queues", (void *)dev);
|
DEBUG("%p: cleaning up and destroying hash RX queues", (void *)dev);
|
||||||
priv_special_flow_disable_all(priv);
|
priv_special_flow_disable_all(priv);
|
||||||
priv_mac_addrs_disable(priv);
|
priv_mac_addrs_disable(priv);
|
||||||
@ -136,6 +125,5 @@ mlx5_dev_stop(struct rte_eth_dev *dev)
|
|||||||
priv_flow_stop(priv);
|
priv_flow_stop(priv);
|
||||||
priv_rx_intr_vec_disable(priv);
|
priv_rx_intr_vec_disable(priv);
|
||||||
priv_dev_interrupt_handler_uninstall(priv, dev);
|
priv_dev_interrupt_handler_uninstall(priv, dev);
|
||||||
priv->started = 0;
|
|
||||||
priv_unlock(priv);
|
priv_unlock(priv);
|
||||||
}
|
}
|
||||||
|
@ -490,7 +490,7 @@ mlx5_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
|
|||||||
if (txq != NULL) {
|
if (txq != NULL) {
|
||||||
DEBUG("%p: reusing already allocated queue index %u (%p)",
|
DEBUG("%p: reusing already allocated queue index %u (%p)",
|
||||||
(void *)dev, idx, (void *)txq);
|
(void *)dev, idx, (void *)txq);
|
||||||
if (priv->started) {
|
if (dev->data->dev_started) {
|
||||||
priv_unlock(priv);
|
priv_unlock(priv);
|
||||||
return -EEXIST;
|
return -EEXIST;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user