git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/mlx5: support Sub-Function
[dpdk.git]
/
drivers
/
net
/
mlx5
/
mlx5_trigger.c
diff --git
a/drivers/net/mlx5/mlx5_trigger.c
b/drivers/net/mlx5/mlx5_trigger.c
index
c88cb22
..
a9d5d58
100644
(file)
--- a/
drivers/net/mlx5/mlx5_trigger.c
+++ b/
drivers/net/mlx5/mlx5_trigger.c
@@
-15,8
+15,8
@@
#include "mlx5.h"
#include "mlx5_mr.h"
#include "mlx5.h"
#include "mlx5_mr.h"
-#include "mlx5_rxtx.h"
#include "mlx5_rx.h"
#include "mlx5_rx.h"
+#include "mlx5_tx.h"
#include "mlx5_utils.h"
#include "rte_pmd_mlx5.h"
#include "mlx5_utils.h"
#include "rte_pmd_mlx5.h"
@@
-697,7
+697,7
@@
mlx5_hairpin_bind_single_port(struct rte_eth_dev *dev, uint16_t rx_port)
uint32_t explicit;
uint16_t rx_queue;
uint32_t explicit;
uint16_t rx_queue;
- if (mlx5_eth_find_next(rx_port,
priv->pci_dev
) != rx_port) {
+ if (mlx5_eth_find_next(rx_port,
dev->device
) != rx_port) {
rte_errno = ENODEV;
DRV_LOG(ERR, "Rx port %u does not belong to mlx5", rx_port);
return -rte_errno;
rte_errno = ENODEV;
DRV_LOG(ERR, "Rx port %u does not belong to mlx5", rx_port);
return -rte_errno;
@@
-835,7
+835,7
@@
mlx5_hairpin_unbind_single_port(struct rte_eth_dev *dev, uint16_t rx_port)
int ret;
uint16_t cur_port = priv->dev_data->port_id;
int ret;
uint16_t cur_port = priv->dev_data->port_id;
- if (mlx5_eth_find_next(rx_port,
priv->pci_dev
) != rx_port) {
+ if (mlx5_eth_find_next(rx_port,
dev->device
) != rx_port) {
rte_errno = ENODEV;
DRV_LOG(ERR, "Rx port %u does not belong to mlx5", rx_port);
return -rte_errno;
rte_errno = ENODEV;
DRV_LOG(ERR, "Rx port %u does not belong to mlx5", rx_port);
return -rte_errno;
@@
-893,7
+893,6
@@
mlx5_hairpin_bind(struct rte_eth_dev *dev, uint16_t rx_port)
{
int ret = 0;
uint16_t p, pp;
{
int ret = 0;
uint16_t p, pp;
- struct mlx5_priv *priv = dev->data->dev_private;
/*
* If the Rx port has no hairpin configuration with the current port,
/*
* If the Rx port has no hairpin configuration with the current port,
@@
-902,7
+901,7
@@
mlx5_hairpin_bind(struct rte_eth_dev *dev, uint16_t rx_port)
* information updating.
*/
if (rx_port == RTE_MAX_ETHPORTS) {
* information updating.
*/
if (rx_port == RTE_MAX_ETHPORTS) {
- MLX5_ETH_FOREACH_DEV(p,
priv->pci_dev
) {
+ MLX5_ETH_FOREACH_DEV(p,
dev->device
) {
ret = mlx5_hairpin_bind_single_port(dev, p);
if (ret != 0)
goto unbind;
ret = mlx5_hairpin_bind_single_port(dev, p);
if (ret != 0)
goto unbind;
@@
-912,7
+911,7
@@
mlx5_hairpin_bind(struct rte_eth_dev *dev, uint16_t rx_port)
return mlx5_hairpin_bind_single_port(dev, rx_port);
}
unbind:
return mlx5_hairpin_bind_single_port(dev, rx_port);
}
unbind:
- MLX5_ETH_FOREACH_DEV(pp,
priv->pci_dev
)
+ MLX5_ETH_FOREACH_DEV(pp,
dev->device
)
if (pp < p)
mlx5_hairpin_unbind_single_port(dev, pp);
return ret;
if (pp < p)
mlx5_hairpin_unbind_single_port(dev, pp);
return ret;
@@
-927,10
+926,9
@@
mlx5_hairpin_unbind(struct rte_eth_dev *dev, uint16_t rx_port)
{
int ret = 0;
uint16_t p;
{
int ret = 0;
uint16_t p;
- struct mlx5_priv *priv = dev->data->dev_private;
if (rx_port == RTE_MAX_ETHPORTS)
if (rx_port == RTE_MAX_ETHPORTS)
- MLX5_ETH_FOREACH_DEV(p,
priv->pci_dev
) {
+ MLX5_ETH_FOREACH_DEV(p,
dev->device
) {
ret = mlx5_hairpin_unbind_single_port(dev, p);
if (ret != 0)
return ret;
ret = mlx5_hairpin_unbind_single_port(dev, p);
if (ret != 0)
return ret;
@@
-1068,6
+1066,12
@@
mlx5_dev_start(struct rte_eth_dev *dev)
dev->data->port_id, strerror(rte_errno));
goto error;
}
dev->data->port_id, strerror(rte_errno));
goto error;
}
+ if ((priv->config.devx && priv->config.dv_flow_en &&
+ priv->config.dest_tir) && priv->obj_ops.lb_dummy_queue_create) {
+ ret = priv->obj_ops.lb_dummy_queue_create(dev);
+ if (ret)
+ goto error;
+ }
ret = mlx5_txq_start(dev);
if (ret) {
DRV_LOG(ERR, "port %u Tx queue allocation failed: %s",
ret = mlx5_txq_start(dev);
if (ret) {
DRV_LOG(ERR, "port %u Tx queue allocation failed: %s",
@@
-1148,6
+1152,8
@@
error:
mlx5_traffic_disable(dev);
mlx5_txq_stop(dev);
mlx5_rxq_stop(dev);
mlx5_traffic_disable(dev);
mlx5_txq_stop(dev);
mlx5_rxq_stop(dev);
+ if (priv->obj_ops.lb_dummy_queue_release)
+ priv->obj_ops.lb_dummy_queue_release(dev);
mlx5_txpp_stop(dev); /* Stop last. */
rte_errno = ret; /* Restore rte_errno. */
return -rte_errno;
mlx5_txpp_stop(dev); /* Stop last. */
rte_errno = ret; /* Restore rte_errno. */
return -rte_errno;
@@
-1179,12
+1185,15
@@
mlx5_dev_stop(struct rte_eth_dev *dev)
/* Control flows for default traffic can be removed firstly. */
mlx5_traffic_disable(dev);
/* All RX queue flags will be cleared in the flush interface. */
/* Control flows for default traffic can be removed firstly. */
mlx5_traffic_disable(dev);
/* All RX queue flags will be cleared in the flush interface. */
- mlx5_flow_list_flush(dev, &priv->flows, true);
+ mlx5_flow_list_flush(dev, MLX5_FLOW_TYPE_GEN, true);
+ mlx5_flow_meter_rxq_flush(dev);
mlx5_rx_intr_vec_disable(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_rx_intr_vec_disable(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);
+ if (priv->obj_ops.lb_dummy_queue_release)
+ priv->obj_ops.lb_dummy_queue_release(dev);
mlx5_txpp_stop(dev);
return 0;
mlx5_txpp_stop(dev);
return 0;
@@
-1250,7
+1259,7
@@
mlx5_traffic_enable(struct rte_eth_dev *dev)
}
mlx5_txq_release(dev, i);
}
}
mlx5_txq_release(dev, i);
}
- if (priv->config.dv_esw_en && !priv->config.vf) {
+ if (priv->config.dv_esw_en && !priv->config.vf
&& !priv->config.sf
) {
if (mlx5_flow_create_esw_table_zero_flow(dev))
priv->fdb_def_rule = 1;
else
if (mlx5_flow_create_esw_table_zero_flow(dev))
priv->fdb_def_rule = 1;
else
@@
-1359,7
+1368,7
@@
mlx5_traffic_enable(struct rte_eth_dev *dev)
return 0;
error:
ret = rte_errno; /* Save rte_errno before cleanup. */
return 0;
error:
ret = rte_errno; /* Save rte_errno before cleanup. */
- mlx5_flow_list_flush(dev,
&priv->ctrl_flows
, false);
+ mlx5_flow_list_flush(dev,
MLX5_FLOW_TYPE_CTL
, false);
rte_errno = ret; /* Restore rte_errno. */
return -rte_errno;
}
rte_errno = ret; /* Restore rte_errno. */
return -rte_errno;
}
@@
-1374,9
+1383,7
@@
error:
void
mlx5_traffic_disable(struct rte_eth_dev *dev)
{
void
mlx5_traffic_disable(struct rte_eth_dev *dev)
{
- struct mlx5_priv *priv = dev->data->dev_private;
-
- mlx5_flow_list_flush(dev, &priv->ctrl_flows, false);
+ mlx5_flow_list_flush(dev, MLX5_FLOW_TYPE_CTL, false);
}
/**
}
/**