Commit 12da68e2 authored by David S. Miller's avatar David S. Miller

Merge tag 'mlx5-updates-2023-12-13' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux

Saeed Mahameed says:

====================
mlx5-updates-2023-12-13

Preparation for mlx5e socket direct feature.

Socket direct will allow multiple PF devices attached to different
NUMA nodes but sharing the same physical port.

The following series is a small refactoring series in preparation
to support socket direct in the following submission.

Highlights:
 - Define required device registers and bits related to socket direct
 - Flow steering re-arrangements
 - Generalize TX objects (TISs) and store them in a common object, will
   be useful in the next series for per function object management.
 - Decouple raw CQ objects from their parent netdev priv
 - Prepare devcom for Socket Direct device group discovery.

Please see the individual patches for more information.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents d6beb085 952f9a5f
...@@ -72,7 +72,6 @@ struct page_pool; ...@@ -72,7 +72,6 @@ struct page_pool;
#define MLX5E_HW2SW_MTU(params, hwmtu) ((hwmtu) - ((params)->hard_mtu)) #define MLX5E_HW2SW_MTU(params, hwmtu) ((hwmtu) - ((params)->hard_mtu))
#define MLX5E_SW2HW_MTU(params, swmtu) ((swmtu) + ((params)->hard_mtu)) #define MLX5E_SW2HW_MTU(params, swmtu) ((swmtu) + ((params)->hard_mtu))
#define MLX5E_MAX_NUM_TC 8
#define MLX5E_MAX_NUM_MQPRIO_CH_TC TC_QOPT_MAX_QUEUE #define MLX5E_MAX_NUM_MQPRIO_CH_TC TC_QOPT_MAX_QUEUE
#define MLX5_RX_HEADROOM NET_SKB_PAD #define MLX5_RX_HEADROOM NET_SKB_PAD
...@@ -364,7 +363,7 @@ struct mlx5e_cq { ...@@ -364,7 +363,7 @@ struct mlx5e_cq {
/* control */ /* control */
struct net_device *netdev; struct net_device *netdev;
struct mlx5_core_dev *mdev; struct mlx5_core_dev *mdev;
struct mlx5e_priv *priv; struct workqueue_struct *workqueue;
struct mlx5_wq_ctrl wq_ctrl; struct mlx5_wq_ctrl wq_ctrl;
} ____cacheline_aligned_in_smp; } ____cacheline_aligned_in_smp;
...@@ -758,7 +757,7 @@ struct mlx5e_channel { ...@@ -758,7 +757,7 @@ struct mlx5e_channel {
/* data path */ /* data path */
struct mlx5e_rq rq; struct mlx5e_rq rq;
struct mlx5e_xdpsq rq_xdpsq; struct mlx5e_xdpsq rq_xdpsq;
struct mlx5e_txqsq sq[MLX5E_MAX_NUM_TC]; struct mlx5e_txqsq sq[MLX5_MAX_NUM_TC];
struct mlx5e_icosq icosq; /* internal control operations */ struct mlx5e_icosq icosq; /* internal control operations */
struct mlx5e_txqsq __rcu * __rcu *qos_sqs; struct mlx5e_txqsq __rcu * __rcu *qos_sqs;
bool xdp; bool xdp;
...@@ -808,7 +807,7 @@ struct mlx5e_channels { ...@@ -808,7 +807,7 @@ struct mlx5e_channels {
struct mlx5e_channel_stats { struct mlx5e_channel_stats {
struct mlx5e_ch_stats ch; struct mlx5e_ch_stats ch;
struct mlx5e_sq_stats sq[MLX5E_MAX_NUM_TC]; struct mlx5e_sq_stats sq[MLX5_MAX_NUM_TC];
struct mlx5e_rq_stats rq; struct mlx5e_rq_stats rq;
struct mlx5e_rq_stats xskrq; struct mlx5e_rq_stats xskrq;
struct mlx5e_xdpsq_stats rq_xdpsq; struct mlx5e_xdpsq_stats rq_xdpsq;
...@@ -818,8 +817,8 @@ struct mlx5e_channel_stats { ...@@ -818,8 +817,8 @@ struct mlx5e_channel_stats {
struct mlx5e_ptp_stats { struct mlx5e_ptp_stats {
struct mlx5e_ch_stats ch; struct mlx5e_ch_stats ch;
struct mlx5e_sq_stats sq[MLX5E_MAX_NUM_TC]; struct mlx5e_sq_stats sq[MLX5_MAX_NUM_TC];
struct mlx5e_ptp_cq_stats cq[MLX5E_MAX_NUM_TC]; struct mlx5e_ptp_cq_stats cq[MLX5_MAX_NUM_TC];
struct mlx5e_rq_stats rq; struct mlx5e_rq_stats rq;
} ____cacheline_aligned_in_smp; } ____cacheline_aligned_in_smp;
...@@ -887,7 +886,6 @@ struct mlx5e_priv { ...@@ -887,7 +886,6 @@ struct mlx5e_priv {
struct mlx5e_rq drop_rq; struct mlx5e_rq drop_rq;
struct mlx5e_channels channels; struct mlx5e_channels channels;
u32 tisn[MLX5_MAX_PORTS][MLX5E_MAX_NUM_TC];
struct mlx5e_rx_res *rx_res; struct mlx5e_rx_res *rx_res;
u32 *tx_rates; u32 *tx_rates;
...@@ -985,6 +983,8 @@ struct mlx5e_profile { ...@@ -985,6 +983,8 @@ struct mlx5e_profile {
void (*update_stats)(struct mlx5e_priv *priv); void (*update_stats)(struct mlx5e_priv *priv);
void (*update_carrier)(struct mlx5e_priv *priv); void (*update_carrier)(struct mlx5e_priv *priv);
int (*max_nch_limit)(struct mlx5_core_dev *mdev); int (*max_nch_limit)(struct mlx5_core_dev *mdev);
u32 (*get_tisn)(struct mlx5_core_dev *mdev, struct mlx5e_priv *priv,
u8 lag_port, u8 tc);
unsigned int (*stats_grps_num)(struct mlx5e_priv *priv); unsigned int (*stats_grps_num)(struct mlx5e_priv *priv);
mlx5e_stats_grp_t *stats_grps; mlx5e_stats_grp_t *stats_grps;
const struct mlx5e_rx_handlers *rx_handlers; const struct mlx5e_rx_handlers *rx_handlers;
...@@ -992,6 +992,11 @@ struct mlx5e_profile { ...@@ -992,6 +992,11 @@ struct mlx5e_profile {
u32 features; u32 features;
}; };
u32 mlx5e_profile_get_tisn(struct mlx5_core_dev *mdev,
struct mlx5e_priv *priv,
const struct mlx5e_profile *profile,
u8 lag_port, u8 tc);
#define mlx5e_profile_feature_cap(profile, feature) \ #define mlx5e_profile_feature_cap(profile, feature) \
((profile)->features & BIT(MLX5E_PROFILE_FEATURE_##feature)) ((profile)->features & BIT(MLX5E_PROFILE_FEATURE_##feature))
...@@ -1039,6 +1044,8 @@ int mlx5e_open_xdpsq(struct mlx5e_channel *c, struct mlx5e_params *params, ...@@ -1039,6 +1044,8 @@ int mlx5e_open_xdpsq(struct mlx5e_channel *c, struct mlx5e_params *params,
void mlx5e_close_xdpsq(struct mlx5e_xdpsq *sq); void mlx5e_close_xdpsq(struct mlx5e_xdpsq *sq);
struct mlx5e_create_cq_param { struct mlx5e_create_cq_param {
struct net_device *netdev;
struct workqueue_struct *wq;
struct napi_struct *napi; struct napi_struct *napi;
struct mlx5e_ch_stats *ch_stats; struct mlx5e_ch_stats *ch_stats;
int node; int node;
...@@ -1046,7 +1053,7 @@ struct mlx5e_create_cq_param { ...@@ -1046,7 +1053,7 @@ struct mlx5e_create_cq_param {
}; };
struct mlx5e_cq_param; struct mlx5e_cq_param;
int mlx5e_open_cq(struct mlx5e_priv *priv, struct dim_cq_moder moder, int mlx5e_open_cq(struct mlx5_core_dev *mdev, struct dim_cq_moder moder,
struct mlx5e_cq_param *param, struct mlx5e_create_cq_param *ccp, struct mlx5e_cq_param *param, struct mlx5e_create_cq_param *ccp,
struct mlx5e_cq *cq); struct mlx5e_cq *cq);
void mlx5e_close_cq(struct mlx5e_cq *cq); void mlx5e_close_cq(struct mlx5e_cq *cq);
...@@ -1133,8 +1140,6 @@ void mlx5e_close_drop_rq(struct mlx5e_rq *drop_rq); ...@@ -1133,8 +1140,6 @@ void mlx5e_close_drop_rq(struct mlx5e_rq *drop_rq);
int mlx5e_create_tis(struct mlx5_core_dev *mdev, void *in, u32 *tisn); int mlx5e_create_tis(struct mlx5_core_dev *mdev, void *in, u32 *tisn);
void mlx5e_destroy_tis(struct mlx5_core_dev *mdev, u32 tisn); void mlx5e_destroy_tis(struct mlx5_core_dev *mdev, u32 tisn);
int mlx5e_create_tises(struct mlx5e_priv *priv);
void mlx5e_destroy_tises(struct mlx5e_priv *priv);
int mlx5e_update_nic_rx(struct mlx5e_priv *priv); int mlx5e_update_nic_rx(struct mlx5e_priv *priv);
void mlx5e_update_carrier(struct mlx5e_priv *priv); void mlx5e_update_carrier(struct mlx5e_priv *priv);
int mlx5e_close(struct net_device *netdev); int mlx5e_close(struct net_device *netdev);
......
...@@ -36,7 +36,7 @@ int mlx5e_monitor_counter_supported(struct mlx5e_priv *priv) ...@@ -36,7 +36,7 @@ int mlx5e_monitor_counter_supported(struct mlx5e_priv *priv)
return true; return true;
} }
void mlx5e_monitor_counter_arm(struct mlx5e_priv *priv) static void mlx5e_monitor_counter_arm(struct mlx5e_priv *priv)
{ {
u32 in[MLX5_ST_SZ_DW(arm_monitor_counter_in)] = {}; u32 in[MLX5_ST_SZ_DW(arm_monitor_counter_in)] = {};
......
...@@ -7,6 +7,5 @@ ...@@ -7,6 +7,5 @@
int mlx5e_monitor_counter_supported(struct mlx5e_priv *priv); int mlx5e_monitor_counter_supported(struct mlx5e_priv *priv);
void mlx5e_monitor_counter_init(struct mlx5e_priv *priv); void mlx5e_monitor_counter_init(struct mlx5e_priv *priv);
void mlx5e_monitor_counter_cleanup(struct mlx5e_priv *priv); void mlx5e_monitor_counter_cleanup(struct mlx5e_priv *priv);
void mlx5e_monitor_counter_arm(struct mlx5e_priv *priv);
#endif /* __MLX5_MONITOR_H__ */ #endif /* __MLX5_MONITOR_H__ */
...@@ -669,6 +669,8 @@ void mlx5e_build_rq_params(struct mlx5_core_dev *mdev, ...@@ -669,6 +669,8 @@ void mlx5e_build_rq_params(struct mlx5_core_dev *mdev,
void mlx5e_build_create_cq_param(struct mlx5e_create_cq_param *ccp, struct mlx5e_channel *c) void mlx5e_build_create_cq_param(struct mlx5e_create_cq_param *ccp, struct mlx5e_channel *c)
{ {
*ccp = (struct mlx5e_create_cq_param) { *ccp = (struct mlx5e_create_cq_param) {
.netdev = c->netdev,
.wq = c->priv->wq,
.napi = &c->napi, .napi = &c->napi,
.ch_stats = c->stats, .ch_stats = c->stats,
.node = cpu_to_node(c->cpu), .node = cpu_to_node(c->cpu),
......
...@@ -518,9 +518,11 @@ static int mlx5e_ptp_open_txqsqs(struct mlx5e_ptp *c, ...@@ -518,9 +518,11 @@ static int mlx5e_ptp_open_txqsqs(struct mlx5e_ptp *c,
for (tc = 0; tc < num_tc; tc++) { for (tc = 0; tc < num_tc; tc++) {
int txq_ix = ix_base + tc; int txq_ix = ix_base + tc;
u32 tisn;
err = mlx5e_ptp_open_txqsq(c, c->priv->tisn[c->lag_port][tc], txq_ix, tisn = mlx5e_profile_get_tisn(c->mdev, c->priv, c->priv->profile,
cparams, tc, &c->ptpsq[tc]); c->lag_port, tc);
err = mlx5e_ptp_open_txqsq(c, tisn, txq_ix, cparams, tc, &c->ptpsq[tc]);
if (err) if (err)
goto close_txqsq; goto close_txqsq;
} }
...@@ -555,6 +557,8 @@ static int mlx5e_ptp_open_tx_cqs(struct mlx5e_ptp *c, ...@@ -555,6 +557,8 @@ static int mlx5e_ptp_open_tx_cqs(struct mlx5e_ptp *c,
num_tc = mlx5e_get_dcb_num_tc(params); num_tc = mlx5e_get_dcb_num_tc(params);
ccp.netdev = c->netdev;
ccp.wq = c->priv->wq;
ccp.node = dev_to_node(mlx5_core_dma_dev(c->mdev)); ccp.node = dev_to_node(mlx5_core_dma_dev(c->mdev));
ccp.ch_stats = c->stats; ccp.ch_stats = c->stats;
ccp.napi = &c->napi; ccp.napi = &c->napi;
...@@ -565,7 +569,7 @@ static int mlx5e_ptp_open_tx_cqs(struct mlx5e_ptp *c, ...@@ -565,7 +569,7 @@ static int mlx5e_ptp_open_tx_cqs(struct mlx5e_ptp *c,
for (tc = 0; tc < num_tc; tc++) { for (tc = 0; tc < num_tc; tc++) {
struct mlx5e_cq *cq = &c->ptpsq[tc].txqsq.cq; struct mlx5e_cq *cq = &c->ptpsq[tc].txqsq.cq;
err = mlx5e_open_cq(c->priv, ptp_moder, cq_param, &ccp, cq); err = mlx5e_open_cq(c->mdev, ptp_moder, cq_param, &ccp, cq);
if (err) if (err)
goto out_err_txqsq_cq; goto out_err_txqsq_cq;
} }
...@@ -574,7 +578,7 @@ static int mlx5e_ptp_open_tx_cqs(struct mlx5e_ptp *c, ...@@ -574,7 +578,7 @@ static int mlx5e_ptp_open_tx_cqs(struct mlx5e_ptp *c,
struct mlx5e_cq *cq = &c->ptpsq[tc].ts_cq; struct mlx5e_cq *cq = &c->ptpsq[tc].ts_cq;
struct mlx5e_ptpsq *ptpsq = &c->ptpsq[tc]; struct mlx5e_ptpsq *ptpsq = &c->ptpsq[tc];
err = mlx5e_open_cq(c->priv, ptp_moder, cq_param, &ccp, cq); err = mlx5e_open_cq(c->mdev, ptp_moder, cq_param, &ccp, cq);
if (err) if (err)
goto out_err_ts_cq; goto out_err_ts_cq;
...@@ -602,6 +606,8 @@ static int mlx5e_ptp_open_rx_cq(struct mlx5e_ptp *c, ...@@ -602,6 +606,8 @@ static int mlx5e_ptp_open_rx_cq(struct mlx5e_ptp *c,
struct mlx5e_cq_param *cq_param; struct mlx5e_cq_param *cq_param;
struct mlx5e_cq *cq = &c->rq.cq; struct mlx5e_cq *cq = &c->rq.cq;
ccp.netdev = c->netdev;
ccp.wq = c->priv->wq;
ccp.node = dev_to_node(mlx5_core_dma_dev(c->mdev)); ccp.node = dev_to_node(mlx5_core_dma_dev(c->mdev));
ccp.ch_stats = c->stats; ccp.ch_stats = c->stats;
ccp.napi = &c->napi; ccp.napi = &c->napi;
...@@ -609,7 +615,7 @@ static int mlx5e_ptp_open_rx_cq(struct mlx5e_ptp *c, ...@@ -609,7 +615,7 @@ static int mlx5e_ptp_open_rx_cq(struct mlx5e_ptp *c,
cq_param = &cparams->rq_param.cqp; cq_param = &cparams->rq_param.cqp;
return mlx5e_open_cq(c->priv, ptp_moder, cq_param, &ccp, cq); return mlx5e_open_cq(c->mdev, ptp_moder, cq_param, &ccp, cq);
} }
static void mlx5e_ptp_close_tx_cqs(struct mlx5e_ptp *c) static void mlx5e_ptp_close_tx_cqs(struct mlx5e_ptp *c)
......
...@@ -49,7 +49,7 @@ enum { ...@@ -49,7 +49,7 @@ enum {
struct mlx5e_ptp { struct mlx5e_ptp {
/* data path */ /* data path */
struct mlx5e_ptpsq ptpsq[MLX5E_MAX_NUM_TC]; struct mlx5e_ptpsq ptpsq[MLX5_MAX_NUM_TC];
struct mlx5e_rq rq; struct mlx5e_rq rq;
struct napi_struct napi; struct napi_struct napi;
struct device *pdev; struct device *pdev;
......
...@@ -77,6 +77,7 @@ int mlx5e_open_qos_sq(struct mlx5e_priv *priv, struct mlx5e_channels *chs, ...@@ -77,6 +77,7 @@ int mlx5e_open_qos_sq(struct mlx5e_priv *priv, struct mlx5e_channels *chs,
struct mlx5e_params *params; struct mlx5e_params *params;
struct mlx5e_channel *c; struct mlx5e_channel *c;
struct mlx5e_txqsq *sq; struct mlx5e_txqsq *sq;
u32 tisn;
params = &chs->params; params = &chs->params;
...@@ -123,11 +124,13 @@ int mlx5e_open_qos_sq(struct mlx5e_priv *priv, struct mlx5e_channels *chs, ...@@ -123,11 +124,13 @@ int mlx5e_open_qos_sq(struct mlx5e_priv *priv, struct mlx5e_channels *chs,
memset(&param_cq, 0, sizeof(param_cq)); memset(&param_cq, 0, sizeof(param_cq));
mlx5e_build_sq_param(priv->mdev, params, &param_sq); mlx5e_build_sq_param(priv->mdev, params, &param_sq);
mlx5e_build_tx_cq_param(priv->mdev, params, &param_cq); mlx5e_build_tx_cq_param(priv->mdev, params, &param_cq);
err = mlx5e_open_cq(priv, params->tx_cq_moderation, &param_cq, &ccp, &sq->cq); err = mlx5e_open_cq(c->mdev, params->tx_cq_moderation, &param_cq, &ccp, &sq->cq);
if (err) if (err)
goto err_free_sq; goto err_free_sq;
err = mlx5e_open_txqsq(c, priv->tisn[c->lag_port][0], txq_ix, params,
&param_sq, sq, 0, hw_id, tisn = mlx5e_profile_get_tisn(c->mdev, c->priv, c->priv->profile,
c->lag_port, 0);
err = mlx5e_open_txqsq(c, tisn, txq_ix, params, &param_sq, sq, 0, hw_id,
priv->htb_qos_sq_stats[node_qid]); priv->htb_qos_sq_stats[node_qid]);
if (err) if (err)
goto err_close_cq; goto err_close_cq;
......
...@@ -68,11 +68,13 @@ static int mlx5e_open_trap_rq(struct mlx5e_priv *priv, struct mlx5e_trap *t) ...@@ -68,11 +68,13 @@ static int mlx5e_open_trap_rq(struct mlx5e_priv *priv, struct mlx5e_trap *t)
node = dev_to_node(mdev->device); node = dev_to_node(mdev->device);
ccp.netdev = priv->netdev;
ccp.wq = priv->wq;
ccp.node = node; ccp.node = node;
ccp.ch_stats = t->stats; ccp.ch_stats = t->stats;
ccp.napi = &t->napi; ccp.napi = &t->napi;
ccp.ix = 0; ccp.ix = 0;
err = mlx5e_open_cq(priv, trap_moder, &rq_param->cqp, &ccp, &rq->cq); err = mlx5e_open_cq(priv->mdev, trap_moder, &rq_param->cqp, &ccp, &rq->cq);
if (err) if (err)
return err; return err;
......
...@@ -127,7 +127,7 @@ int mlx5e_open_xsk(struct mlx5e_priv *priv, struct mlx5e_params *params, ...@@ -127,7 +127,7 @@ int mlx5e_open_xsk(struct mlx5e_priv *priv, struct mlx5e_params *params,
mlx5e_build_xsk_cparam(priv->mdev, params, xsk, priv->q_counter, cparam); mlx5e_build_xsk_cparam(priv->mdev, params, xsk, priv->q_counter, cparam);
err = mlx5e_open_cq(c->priv, params->rx_cq_moderation, &cparam->rq.cqp, &ccp, err = mlx5e_open_cq(c->mdev, params->rx_cq_moderation, &cparam->rq.cqp, &ccp,
&c->xskrq.cq); &c->xskrq.cq);
if (unlikely(err)) if (unlikely(err))
goto err_free_cparam; goto err_free_cparam;
...@@ -136,7 +136,7 @@ int mlx5e_open_xsk(struct mlx5e_priv *priv, struct mlx5e_params *params, ...@@ -136,7 +136,7 @@ int mlx5e_open_xsk(struct mlx5e_priv *priv, struct mlx5e_params *params,
if (unlikely(err)) if (unlikely(err))
goto err_close_rx_cq; goto err_close_rx_cq;
err = mlx5e_open_cq(c->priv, params->tx_cq_moderation, &cparam->xdp_sq.cqp, &ccp, err = mlx5e_open_cq(c->mdev, params->tx_cq_moderation, &cparam->xdp_sq.cqp, &ccp,
&c->xsksq.cq); &c->xsksq.cq);
if (unlikely(err)) if (unlikely(err))
goto err_close_rq; goto err_close_rq;
......
...@@ -74,6 +74,72 @@ int mlx5e_create_mkey(struct mlx5_core_dev *mdev, u32 pdn, u32 *mkey) ...@@ -74,6 +74,72 @@ int mlx5e_create_mkey(struct mlx5_core_dev *mdev, u32 pdn, u32 *mkey)
return err; return err;
} }
int mlx5e_create_tis(struct mlx5_core_dev *mdev, void *in, u32 *tisn)
{
void *tisc = MLX5_ADDR_OF(create_tis_in, in, ctx);
MLX5_SET(tisc, tisc, transport_domain, mdev->mlx5e_res.hw_objs.td.tdn);
if (mlx5_lag_is_lacp_owner(mdev))
MLX5_SET(tisc, tisc, strict_lag_tx_port_affinity, 1);
return mlx5_core_create_tis(mdev, in, tisn);
}
void mlx5e_destroy_tis(struct mlx5_core_dev *mdev, u32 tisn)
{
mlx5_core_destroy_tis(mdev, tisn);
}
static void mlx5e_destroy_tises(struct mlx5_core_dev *mdev, u32 tisn[MLX5_MAX_PORTS][MLX5_MAX_NUM_TC])
{
int tc, i;
for (i = 0; i < MLX5_MAX_PORTS; i++)
for (tc = 0; tc < MLX5_MAX_NUM_TC; tc++)
mlx5e_destroy_tis(mdev, tisn[i][tc]);
}
static bool mlx5_lag_should_assign_affinity(struct mlx5_core_dev *mdev)
{
return MLX5_CAP_GEN(mdev, lag_tx_port_affinity) && mlx5e_get_num_lag_ports(mdev) > 1;
}
static int mlx5e_create_tises(struct mlx5_core_dev *mdev, u32 tisn[MLX5_MAX_PORTS][MLX5_MAX_NUM_TC])
{
int tc, i;
int err;
for (i = 0; i < MLX5_MAX_PORTS; i++) {
for (tc = 0; tc < MLX5_MAX_NUM_TC; tc++) {
u32 in[MLX5_ST_SZ_DW(create_tis_in)] = {};
void *tisc;
tisc = MLX5_ADDR_OF(create_tis_in, in, ctx);
MLX5_SET(tisc, tisc, prio, tc << 1);
if (mlx5_lag_should_assign_affinity(mdev))
MLX5_SET(tisc, tisc, lag_tx_port_affinity, i + 1);
err = mlx5e_create_tis(mdev, in, &tisn[i][tc]);
if (err)
goto err_close_tises;
}
}
return 0;
err_close_tises:
for (; i >= 0; i--) {
for (tc--; tc >= 0; tc--)
mlx5e_destroy_tis(mdev, tisn[i][tc]);
tc = MLX5_MAX_NUM_TC;
}
return err;
}
int mlx5e_create_mdev_resources(struct mlx5_core_dev *mdev) int mlx5e_create_mdev_resources(struct mlx5_core_dev *mdev)
{ {
struct mlx5e_hw_objs *res = &mdev->mlx5e_res.hw_objs; struct mlx5e_hw_objs *res = &mdev->mlx5e_res.hw_objs;
...@@ -103,6 +169,11 @@ int mlx5e_create_mdev_resources(struct mlx5_core_dev *mdev) ...@@ -103,6 +169,11 @@ int mlx5e_create_mdev_resources(struct mlx5_core_dev *mdev)
goto err_destroy_mkey; goto err_destroy_mkey;
} }
err = mlx5e_create_tises(mdev, res->tisn);
if (err) {
mlx5_core_err(mdev, "alloc tises failed, %d\n", err);
goto err_destroy_bfreg;
}
INIT_LIST_HEAD(&res->td.tirs_list); INIT_LIST_HEAD(&res->td.tirs_list);
mutex_init(&res->td.list_lock); mutex_init(&res->td.list_lock);
...@@ -115,6 +186,8 @@ int mlx5e_create_mdev_resources(struct mlx5_core_dev *mdev) ...@@ -115,6 +186,8 @@ int mlx5e_create_mdev_resources(struct mlx5_core_dev *mdev)
return 0; return 0;
err_destroy_bfreg:
mlx5_free_bfreg(mdev, &res->bfreg);
err_destroy_mkey: err_destroy_mkey:
mlx5_core_destroy_mkey(mdev, res->mkey); mlx5_core_destroy_mkey(mdev, res->mkey);
err_dealloc_transport_domain: err_dealloc_transport_domain:
...@@ -130,6 +203,7 @@ void mlx5e_destroy_mdev_resources(struct mlx5_core_dev *mdev) ...@@ -130,6 +203,7 @@ void mlx5e_destroy_mdev_resources(struct mlx5_core_dev *mdev)
mlx5_crypto_dek_cleanup(mdev->mlx5e_res.dek_priv); mlx5_crypto_dek_cleanup(mdev->mlx5e_res.dek_priv);
mdev->mlx5e_res.dek_priv = NULL; mdev->mlx5e_res.dek_priv = NULL;
mlx5e_destroy_tises(mdev, res->tisn);
mlx5_free_bfreg(mdev, &res->bfreg); mlx5_free_bfreg(mdev, &res->bfreg);
mlx5_core_destroy_mkey(mdev, res->mkey); mlx5_core_destroy_mkey(mdev, res->mkey);
mlx5_core_dealloc_transport_domain(mdev, res->td.tdn); mlx5_core_dealloc_transport_domain(mdev, res->td.tdn);
......
...@@ -1352,6 +1352,17 @@ void mlx5e_close_rq(struct mlx5e_rq *rq) ...@@ -1352,6 +1352,17 @@ void mlx5e_close_rq(struct mlx5e_rq *rq)
mlx5e_free_rq(rq); mlx5e_free_rq(rq);
} }
u32 mlx5e_profile_get_tisn(struct mlx5_core_dev *mdev,
struct mlx5e_priv *priv,
const struct mlx5e_profile *profile,
u8 lag_port, u8 tc)
{
if (profile->get_tisn)
return profile->get_tisn(mdev, priv, lag_port, tc);
return mdev->mlx5e_res.hw_objs.tisn[lag_port][tc];
}
static void mlx5e_free_xdpsq_db(struct mlx5e_xdpsq *sq) static void mlx5e_free_xdpsq_db(struct mlx5e_xdpsq *sq)
{ {
kvfree(sq->db.xdpi_fifo.xi); kvfree(sq->db.xdpi_fifo.xi);
...@@ -1920,7 +1931,8 @@ int mlx5e_open_xdpsq(struct mlx5e_channel *c, struct mlx5e_params *params, ...@@ -1920,7 +1931,8 @@ int mlx5e_open_xdpsq(struct mlx5e_channel *c, struct mlx5e_params *params,
return err; return err;
csp.tis_lst_sz = 1; csp.tis_lst_sz = 1;
csp.tisn = c->priv->tisn[c->lag_port][0]; /* tc = 0 */ csp.tisn = mlx5e_profile_get_tisn(c->mdev, c->priv, c->priv->profile,
c->lag_port, 0); /* tc = 0 */
csp.cqn = sq->cq.mcq.cqn; csp.cqn = sq->cq.mcq.cqn;
csp.wq_ctrl = &sq->wq_ctrl; csp.wq_ctrl = &sq->wq_ctrl;
csp.min_inline_mode = sq->min_inline_mode; csp.min_inline_mode = sq->min_inline_mode;
...@@ -1982,11 +1994,12 @@ void mlx5e_close_xdpsq(struct mlx5e_xdpsq *sq) ...@@ -1982,11 +1994,12 @@ void mlx5e_close_xdpsq(struct mlx5e_xdpsq *sq)
mlx5e_free_xdpsq(sq); mlx5e_free_xdpsq(sq);
} }
static int mlx5e_alloc_cq_common(struct mlx5e_priv *priv, static int mlx5e_alloc_cq_common(struct mlx5_core_dev *mdev,
struct net_device *netdev,
struct workqueue_struct *workqueue,
struct mlx5e_cq_param *param, struct mlx5e_cq_param *param,
struct mlx5e_cq *cq) struct mlx5e_cq *cq)
{ {
struct mlx5_core_dev *mdev = priv->mdev;
struct mlx5_core_cq *mcq = &cq->mcq; struct mlx5_core_cq *mcq = &cq->mcq;
int err; int err;
u32 i; u32 i;
...@@ -2013,13 +2026,13 @@ static int mlx5e_alloc_cq_common(struct mlx5e_priv *priv, ...@@ -2013,13 +2026,13 @@ static int mlx5e_alloc_cq_common(struct mlx5e_priv *priv,
} }
cq->mdev = mdev; cq->mdev = mdev;
cq->netdev = priv->netdev; cq->netdev = netdev;
cq->priv = priv; cq->workqueue = workqueue;
return 0; return 0;
} }
static int mlx5e_alloc_cq(struct mlx5e_priv *priv, static int mlx5e_alloc_cq(struct mlx5_core_dev *mdev,
struct mlx5e_cq_param *param, struct mlx5e_cq_param *param,
struct mlx5e_create_cq_param *ccp, struct mlx5e_create_cq_param *ccp,
struct mlx5e_cq *cq) struct mlx5e_cq *cq)
...@@ -2030,7 +2043,7 @@ static int mlx5e_alloc_cq(struct mlx5e_priv *priv, ...@@ -2030,7 +2043,7 @@ static int mlx5e_alloc_cq(struct mlx5e_priv *priv,
param->wq.db_numa_node = ccp->node; param->wq.db_numa_node = ccp->node;
param->eq_ix = ccp->ix; param->eq_ix = ccp->ix;
err = mlx5e_alloc_cq_common(priv, param, cq); err = mlx5e_alloc_cq_common(mdev, ccp->netdev, ccp->wq, param, cq);
cq->napi = ccp->napi; cq->napi = ccp->napi;
cq->ch_stats = ccp->ch_stats; cq->ch_stats = ccp->ch_stats;
...@@ -2096,14 +2109,13 @@ static void mlx5e_destroy_cq(struct mlx5e_cq *cq) ...@@ -2096,14 +2109,13 @@ static void mlx5e_destroy_cq(struct mlx5e_cq *cq)
mlx5_core_destroy_cq(cq->mdev, &cq->mcq); mlx5_core_destroy_cq(cq->mdev, &cq->mcq);
} }
int mlx5e_open_cq(struct mlx5e_priv *priv, struct dim_cq_moder moder, int mlx5e_open_cq(struct mlx5_core_dev *mdev, struct dim_cq_moder moder,
struct mlx5e_cq_param *param, struct mlx5e_create_cq_param *ccp, struct mlx5e_cq_param *param, struct mlx5e_create_cq_param *ccp,
struct mlx5e_cq *cq) struct mlx5e_cq *cq)
{ {
struct mlx5_core_dev *mdev = priv->mdev;
int err; int err;
err = mlx5e_alloc_cq(priv, param, ccp, cq); err = mlx5e_alloc_cq(mdev, param, ccp, cq);
if (err) if (err)
return err; return err;
...@@ -2136,7 +2148,7 @@ static int mlx5e_open_tx_cqs(struct mlx5e_channel *c, ...@@ -2136,7 +2148,7 @@ static int mlx5e_open_tx_cqs(struct mlx5e_channel *c,
int tc; int tc;
for (tc = 0; tc < c->num_tc; tc++) { for (tc = 0; tc < c->num_tc; tc++) {
err = mlx5e_open_cq(c->priv, params->tx_cq_moderation, &cparam->txq_sq.cqp, err = mlx5e_open_cq(c->mdev, params->tx_cq_moderation, &cparam->txq_sq.cqp,
ccp, &c->sq[tc].cq); ccp, &c->sq[tc].cq);
if (err) if (err)
goto err_close_tx_cqs; goto err_close_tx_cqs;
...@@ -2204,12 +2216,15 @@ static int mlx5e_open_sqs(struct mlx5e_channel *c, ...@@ -2204,12 +2216,15 @@ static int mlx5e_open_sqs(struct mlx5e_channel *c,
for (tc = 0; tc < mlx5e_get_dcb_num_tc(params); tc++) { for (tc = 0; tc < mlx5e_get_dcb_num_tc(params); tc++) {
int txq_ix = c->ix + tc * params->num_channels; int txq_ix = c->ix + tc * params->num_channels;
u32 qos_queue_group_id; u32 qos_queue_group_id;
u32 tisn;
tisn = mlx5e_profile_get_tisn(c->mdev, c->priv, c->priv->profile,
c->lag_port, tc);
err = mlx5e_txq_get_qos_node_hw_id(params, txq_ix, &qos_queue_group_id); err = mlx5e_txq_get_qos_node_hw_id(params, txq_ix, &qos_queue_group_id);
if (err) if (err)
goto err_close_sqs; goto err_close_sqs;
err = mlx5e_open_txqsq(c, c->priv->tisn[c->lag_port][tc], txq_ix, err = mlx5e_open_txqsq(c, tisn, txq_ix,
params, &cparam->txq_sq, &c->sq[tc], tc, params, &cparam->txq_sq, &c->sq[tc], tc,
qos_queue_group_id, qos_queue_group_id,
&c->priv->channel_stats[c->ix]->sq[tc]); &c->priv->channel_stats[c->ix]->sq[tc]);
...@@ -2337,12 +2352,12 @@ static int mlx5e_open_queues(struct mlx5e_channel *c, ...@@ -2337,12 +2352,12 @@ static int mlx5e_open_queues(struct mlx5e_channel *c,
mlx5e_build_create_cq_param(&ccp, c); mlx5e_build_create_cq_param(&ccp, c);
err = mlx5e_open_cq(c->priv, icocq_moder, &cparam->async_icosq.cqp, &ccp, err = mlx5e_open_cq(c->mdev, icocq_moder, &cparam->async_icosq.cqp, &ccp,
&c->async_icosq.cq); &c->async_icosq.cq);
if (err) if (err)
return err; return err;
err = mlx5e_open_cq(c->priv, icocq_moder, &cparam->icosq.cqp, &ccp, err = mlx5e_open_cq(c->mdev, icocq_moder, &cparam->icosq.cqp, &ccp,
&c->icosq.cq); &c->icosq.cq);
if (err) if (err)
goto err_close_async_icosq_cq; goto err_close_async_icosq_cq;
...@@ -2351,17 +2366,17 @@ static int mlx5e_open_queues(struct mlx5e_channel *c, ...@@ -2351,17 +2366,17 @@ static int mlx5e_open_queues(struct mlx5e_channel *c,
if (err) if (err)
goto err_close_icosq_cq; goto err_close_icosq_cq;
err = mlx5e_open_cq(c->priv, params->tx_cq_moderation, &cparam->xdp_sq.cqp, &ccp, err = mlx5e_open_cq(c->mdev, params->tx_cq_moderation, &cparam->xdp_sq.cqp, &ccp,
&c->xdpsq.cq); &c->xdpsq.cq);
if (err) if (err)
goto err_close_tx_cqs; goto err_close_tx_cqs;
err = mlx5e_open_cq(c->priv, params->rx_cq_moderation, &cparam->rq.cqp, &ccp, err = mlx5e_open_cq(c->mdev, params->rx_cq_moderation, &cparam->rq.cqp, &ccp,
&c->rq.cq); &c->rq.cq);
if (err) if (err)
goto err_close_xdp_tx_cqs; goto err_close_xdp_tx_cqs;
err = c->xdp ? mlx5e_open_cq(c->priv, params->tx_cq_moderation, &cparam->xdp_sq.cqp, err = c->xdp ? mlx5e_open_cq(c->mdev, params->tx_cq_moderation, &cparam->xdp_sq.cqp,
&ccp, &c->rq_xdpsq.cq) : 0; &ccp, &c->rq_xdpsq.cq) : 0;
if (err) if (err)
goto err_close_rx_cq; goto err_close_rx_cq;
...@@ -3308,7 +3323,7 @@ static int mlx5e_alloc_drop_cq(struct mlx5e_priv *priv, ...@@ -3308,7 +3323,7 @@ static int mlx5e_alloc_drop_cq(struct mlx5e_priv *priv,
param->wq.buf_numa_node = dev_to_node(mlx5_core_dma_dev(mdev)); param->wq.buf_numa_node = dev_to_node(mlx5_core_dma_dev(mdev));
param->wq.db_numa_node = dev_to_node(mlx5_core_dma_dev(mdev)); param->wq.db_numa_node = dev_to_node(mlx5_core_dma_dev(mdev));
return mlx5e_alloc_cq_common(priv, param, cq); return mlx5e_alloc_cq_common(priv->mdev, priv->netdev, priv->wq, param, cq);
} }
int mlx5e_open_drop_rq(struct mlx5e_priv *priv, int mlx5e_open_drop_rq(struct mlx5e_priv *priv,
...@@ -3364,75 +3379,6 @@ void mlx5e_close_drop_rq(struct mlx5e_rq *drop_rq) ...@@ -3364,75 +3379,6 @@ void mlx5e_close_drop_rq(struct mlx5e_rq *drop_rq)
mlx5e_free_cq(&drop_rq->cq); mlx5e_free_cq(&drop_rq->cq);
} }
int mlx5e_create_tis(struct mlx5_core_dev *mdev, void *in, u32 *tisn)
{
void *tisc = MLX5_ADDR_OF(create_tis_in, in, ctx);
MLX5_SET(tisc, tisc, transport_domain, mdev->mlx5e_res.hw_objs.td.tdn);
if (MLX5_GET(tisc, tisc, tls_en))
MLX5_SET(tisc, tisc, pd, mdev->mlx5e_res.hw_objs.pdn);
if (mlx5_lag_is_lacp_owner(mdev))
MLX5_SET(tisc, tisc, strict_lag_tx_port_affinity, 1);
return mlx5_core_create_tis(mdev, in, tisn);
}
void mlx5e_destroy_tis(struct mlx5_core_dev *mdev, u32 tisn)
{
mlx5_core_destroy_tis(mdev, tisn);
}
void mlx5e_destroy_tises(struct mlx5e_priv *priv)
{
int tc, i;
for (i = 0; i < mlx5e_get_num_lag_ports(priv->mdev); i++)
for (tc = 0; tc < priv->profile->max_tc; tc++)
mlx5e_destroy_tis(priv->mdev, priv->tisn[i][tc]);
}
static bool mlx5e_lag_should_assign_affinity(struct mlx5_core_dev *mdev)
{
return MLX5_CAP_GEN(mdev, lag_tx_port_affinity) && mlx5e_get_num_lag_ports(mdev) > 1;
}
int mlx5e_create_tises(struct mlx5e_priv *priv)
{
int tc, i;
int err;
for (i = 0; i < mlx5e_get_num_lag_ports(priv->mdev); i++) {
for (tc = 0; tc < priv->profile->max_tc; tc++) {
u32 in[MLX5_ST_SZ_DW(create_tis_in)] = {};
void *tisc;
tisc = MLX5_ADDR_OF(create_tis_in, in, ctx);
MLX5_SET(tisc, tisc, prio, tc << 1);
if (mlx5e_lag_should_assign_affinity(priv->mdev))
MLX5_SET(tisc, tisc, lag_tx_port_affinity, i + 1);
err = mlx5e_create_tis(priv->mdev, in, &priv->tisn[i][tc]);
if (err)
goto err_close_tises;
}
}
return 0;
err_close_tises:
for (; i >= 0; i--) {
for (tc--; tc >= 0; tc--)
mlx5e_destroy_tis(priv->mdev, priv->tisn[i][tc]);
tc = priv->profile->max_tc;
}
return err;
}
static void mlx5e_cleanup_nic_tx(struct mlx5e_priv *priv) static void mlx5e_cleanup_nic_tx(struct mlx5e_priv *priv)
{ {
if (priv->mqprio_rl) { if (priv->mqprio_rl) {
...@@ -3441,7 +3387,6 @@ static void mlx5e_cleanup_nic_tx(struct mlx5e_priv *priv) ...@@ -3441,7 +3387,6 @@ static void mlx5e_cleanup_nic_tx(struct mlx5e_priv *priv)
priv->mqprio_rl = NULL; priv->mqprio_rl = NULL;
} }
mlx5e_accel_cleanup_tx(priv); mlx5e_accel_cleanup_tx(priv);
mlx5e_destroy_tises(priv);
} }
static int mlx5e_modify_channels_vsd(struct mlx5e_channels *chs, bool vsd) static int mlx5e_modify_channels_vsd(struct mlx5e_channels *chs, bool vsd)
...@@ -3543,7 +3488,7 @@ static int mlx5e_setup_tc_mqprio_dcb(struct mlx5e_priv *priv, ...@@ -3543,7 +3488,7 @@ static int mlx5e_setup_tc_mqprio_dcb(struct mlx5e_priv *priv,
mqprio->hw = TC_MQPRIO_HW_OFFLOAD_TCS; mqprio->hw = TC_MQPRIO_HW_OFFLOAD_TCS;
if (tc && tc != MLX5E_MAX_NUM_TC) if (tc && tc != MLX5_MAX_NUM_TC)
return -EINVAL; return -EINVAL;
new_params = priv->channels.params; new_params = priv->channels.params;
...@@ -5506,23 +5451,13 @@ static int mlx5e_init_nic_tx(struct mlx5e_priv *priv) ...@@ -5506,23 +5451,13 @@ static int mlx5e_init_nic_tx(struct mlx5e_priv *priv)
{ {
int err; int err;
err = mlx5e_create_tises(priv);
if (err) {
mlx5_core_warn(priv->mdev, "create tises failed, %d\n", err);
return err;
}
err = mlx5e_accel_init_tx(priv); err = mlx5e_accel_init_tx(priv);
if (err) if (err)
goto err_destroy_tises; return err;
mlx5e_set_mqprio_rl(priv); mlx5e_set_mqprio_rl(priv);
mlx5e_dcbnl_initialize(priv); mlx5e_dcbnl_initialize(priv);
return 0; return 0;
err_destroy_tises:
mlx5e_destroy_tises(priv);
return err;
} }
static void mlx5e_nic_enable(struct mlx5e_priv *priv) static void mlx5e_nic_enable(struct mlx5e_priv *priv)
...@@ -5617,7 +5552,7 @@ static const struct mlx5e_profile mlx5e_nic_profile = { ...@@ -5617,7 +5552,7 @@ static const struct mlx5e_profile mlx5e_nic_profile = {
.update_stats = mlx5e_stats_update_ndo_stats, .update_stats = mlx5e_stats_update_ndo_stats,
.update_carrier = mlx5e_update_carrier, .update_carrier = mlx5e_update_carrier,
.rx_handlers = &mlx5e_rx_handlers_nic, .rx_handlers = &mlx5e_rx_handlers_nic,
.max_tc = MLX5E_MAX_NUM_TC, .max_tc = MLX5_MAX_NUM_TC,
.stats_grps = mlx5e_nic_stats_grps, .stats_grps = mlx5e_nic_stats_grps,
.stats_grps_num = mlx5e_nic_stats_grps_num, .stats_grps_num = mlx5e_nic_stats_grps_num,
.features = BIT(MLX5E_PROFILE_FEATURE_PTP_RX) | .features = BIT(MLX5E_PROFILE_FEATURE_PTP_RX) |
...@@ -6070,7 +6005,7 @@ static int mlx5e_resume(struct auxiliary_device *adev) ...@@ -6070,7 +6005,7 @@ static int mlx5e_resume(struct auxiliary_device *adev)
return 0; return 0;
} }
static int mlx5e_suspend(struct auxiliary_device *adev, pm_message_t state) static int _mlx5e_suspend(struct auxiliary_device *adev)
{ {
struct mlx5e_dev *mlx5e_dev = auxiliary_get_drvdata(adev); struct mlx5e_dev *mlx5e_dev = auxiliary_get_drvdata(adev);
struct mlx5e_priv *priv = mlx5e_dev->priv; struct mlx5e_priv *priv = mlx5e_dev->priv;
...@@ -6088,15 +6023,18 @@ static int mlx5e_suspend(struct auxiliary_device *adev, pm_message_t state) ...@@ -6088,15 +6023,18 @@ static int mlx5e_suspend(struct auxiliary_device *adev, pm_message_t state)
return 0; return 0;
} }
static int mlx5e_probe(struct auxiliary_device *adev, static int mlx5e_suspend(struct auxiliary_device *adev, pm_message_t state)
const struct auxiliary_device_id *id) {
return _mlx5e_suspend(adev);
}
static int _mlx5e_probe(struct auxiliary_device *adev)
{ {
struct mlx5_adev *edev = container_of(adev, struct mlx5_adev, adev); struct mlx5_adev *edev = container_of(adev, struct mlx5_adev, adev);
const struct mlx5e_profile *profile = &mlx5e_nic_profile; const struct mlx5e_profile *profile = &mlx5e_nic_profile;
struct mlx5_core_dev *mdev = edev->mdev; struct mlx5_core_dev *mdev = edev->mdev;
struct mlx5e_dev *mlx5e_dev; struct mlx5e_dev *mlx5e_dev;
struct net_device *netdev; struct net_device *netdev;
pm_message_t state = {};
struct mlx5e_priv *priv; struct mlx5e_priv *priv;
int err; int err;
...@@ -6151,7 +6089,7 @@ static int mlx5e_probe(struct auxiliary_device *adev, ...@@ -6151,7 +6089,7 @@ static int mlx5e_probe(struct auxiliary_device *adev,
return 0; return 0;
err_resume: err_resume:
mlx5e_suspend(adev, state); _mlx5e_suspend(adev);
err_profile_cleanup: err_profile_cleanup:
profile->cleanup(priv); profile->cleanup(priv);
err_destroy_netdev: err_destroy_netdev:
...@@ -6163,16 +6101,21 @@ static int mlx5e_probe(struct auxiliary_device *adev, ...@@ -6163,16 +6101,21 @@ static int mlx5e_probe(struct auxiliary_device *adev,
return err; return err;
} }
static int mlx5e_probe(struct auxiliary_device *adev,
const struct auxiliary_device_id *id)
{
return _mlx5e_probe(adev);
}
static void mlx5e_remove(struct auxiliary_device *adev) static void mlx5e_remove(struct auxiliary_device *adev)
{ {
struct mlx5e_dev *mlx5e_dev = auxiliary_get_drvdata(adev); struct mlx5e_dev *mlx5e_dev = auxiliary_get_drvdata(adev);
struct mlx5e_priv *priv = mlx5e_dev->priv; struct mlx5e_priv *priv = mlx5e_dev->priv;
pm_message_t state = {};
mlx5_core_uplink_netdev_set(priv->mdev, NULL); mlx5_core_uplink_netdev_set(priv->mdev, NULL);
mlx5e_dcbnl_delete_app(priv); mlx5e_dcbnl_delete_app(priv);
unregister_netdev(priv->netdev); unregister_netdev(priv->netdev);
mlx5e_suspend(adev, state); _mlx5e_suspend(adev);
priv->profile->cleanup(priv); priv->profile->cleanup(priv);
mlx5e_destroy_netdev(priv); mlx5e_destroy_netdev(priv);
mlx5e_devlink_port_unregister(mlx5e_dev); mlx5e_devlink_port_unregister(mlx5e_dev);
......
...@@ -1180,12 +1180,6 @@ static int mlx5e_init_rep_tx(struct mlx5e_priv *priv) ...@@ -1180,12 +1180,6 @@ static int mlx5e_init_rep_tx(struct mlx5e_priv *priv)
struct mlx5e_rep_priv *rpriv = priv->ppriv; struct mlx5e_rep_priv *rpriv = priv->ppriv;
int err; int err;
err = mlx5e_create_tises(priv);
if (err) {
mlx5_core_warn(priv->mdev, "create tises failed, %d\n", err);
return err;
}
err = mlx5e_rep_neigh_init(rpriv); err = mlx5e_rep_neigh_init(rpriv);
if (err) if (err)
goto err_neigh_init; goto err_neigh_init;
...@@ -1208,7 +1202,6 @@ static int mlx5e_init_rep_tx(struct mlx5e_priv *priv) ...@@ -1208,7 +1202,6 @@ static int mlx5e_init_rep_tx(struct mlx5e_priv *priv)
err_init_tx: err_init_tx:
mlx5e_rep_neigh_cleanup(rpriv); mlx5e_rep_neigh_cleanup(rpriv);
err_neigh_init: err_neigh_init:
mlx5e_destroy_tises(priv);
return err; return err;
} }
...@@ -1222,7 +1215,6 @@ static void mlx5e_cleanup_rep_tx(struct mlx5e_priv *priv) ...@@ -1222,7 +1215,6 @@ static void mlx5e_cleanup_rep_tx(struct mlx5e_priv *priv)
mlx5e_cleanup_uplink_rep_tx(rpriv); mlx5e_cleanup_uplink_rep_tx(rpriv);
mlx5e_rep_neigh_cleanup(rpriv); mlx5e_rep_neigh_cleanup(rpriv);
mlx5e_destroy_tises(priv);
} }
static void mlx5e_rep_enable(struct mlx5e_priv *priv) static void mlx5e_rep_enable(struct mlx5e_priv *priv)
...@@ -1452,7 +1444,7 @@ static const struct mlx5e_profile mlx5e_uplink_rep_profile = { ...@@ -1452,7 +1444,7 @@ static const struct mlx5e_profile mlx5e_uplink_rep_profile = {
.update_stats = mlx5e_stats_update_ndo_stats, .update_stats = mlx5e_stats_update_ndo_stats,
.update_carrier = mlx5e_update_carrier, .update_carrier = mlx5e_update_carrier,
.rx_handlers = &mlx5e_rx_handlers_rep, .rx_handlers = &mlx5e_rx_handlers_rep,
.max_tc = MLX5E_MAX_NUM_TC, .max_tc = MLX5_MAX_NUM_TC,
.stats_grps = mlx5e_ul_rep_stats_grps, .stats_grps = mlx5e_ul_rep_stats_grps,
.stats_grps_num = mlx5e_ul_rep_stats_grps_num, .stats_grps_num = mlx5e_ul_rep_stats_grps_num,
}; };
......
...@@ -1039,7 +1039,7 @@ int mlx5e_poll_ico_cq(struct mlx5e_cq *cq) ...@@ -1039,7 +1039,7 @@ int mlx5e_poll_ico_cq(struct mlx5e_cq *cq)
(struct mlx5_err_cqe *)cqe); (struct mlx5_err_cqe *)cqe);
mlx5_wq_cyc_wqe_dump(&sq->wq, ci, wi->num_wqebbs); mlx5_wq_cyc_wqe_dump(&sq->wq, ci, wi->num_wqebbs);
if (!test_and_set_bit(MLX5E_SQ_STATE_RECOVERING, &sq->state)) if (!test_and_set_bit(MLX5E_SQ_STATE_RECOVERING, &sq->state))
queue_work(cq->priv->wq, &sq->recover_work); queue_work(cq->workqueue, &sq->recover_work);
break; break;
} }
......
...@@ -861,7 +861,7 @@ bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq, int napi_budget) ...@@ -861,7 +861,7 @@ bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq, int napi_budget)
mlx5e_dump_error_cqe(&sq->cq, sq->sqn, mlx5e_dump_error_cqe(&sq->cq, sq->sqn,
(struct mlx5_err_cqe *)cqe); (struct mlx5_err_cqe *)cqe);
mlx5_wq_cyc_wqe_dump(&sq->wq, ci, wi->num_wqebbs); mlx5_wq_cyc_wqe_dump(&sq->wq, ci, wi->num_wqebbs);
queue_work(cq->priv->wq, &sq->recover_work); queue_work(cq->workqueue, &sq->recover_work);
} }
stats->cqe_err++; stats->cqe_err++;
} }
......
...@@ -1144,3 +1144,37 @@ const struct mlx5_flow_cmds *mlx5_fs_cmd_get_default(enum fs_flow_table_type typ ...@@ -1144,3 +1144,37 @@ const struct mlx5_flow_cmds *mlx5_fs_cmd_get_default(enum fs_flow_table_type typ
return mlx5_fs_cmd_get_stub_cmds(); return mlx5_fs_cmd_get_stub_cmds();
} }
} }
int mlx5_fs_cmd_set_l2table_entry_silent(struct mlx5_core_dev *dev, u8 silent_mode)
{
u32 in[MLX5_ST_SZ_DW(set_l2_table_entry_in)] = {};
if (silent_mode && !MLX5_CAP_GEN(dev, silent_mode))
return -EOPNOTSUPP;
MLX5_SET(set_l2_table_entry_in, in, opcode, MLX5_CMD_OP_SET_L2_TABLE_ENTRY);
MLX5_SET(set_l2_table_entry_in, in, silent_mode_valid, 1);
MLX5_SET(set_l2_table_entry_in, in, silent_mode, silent_mode);
return mlx5_cmd_exec_in(dev, set_l2_table_entry, in);
}
int mlx5_fs_cmd_set_tx_flow_table_root(struct mlx5_core_dev *dev, u32 ft_id, bool disconnect)
{
u32 out[MLX5_ST_SZ_DW(set_flow_table_root_out)] = {};
u32 in[MLX5_ST_SZ_DW(set_flow_table_root_in)] = {};
if (disconnect && MLX5_CAP_FLOWTABLE_NIC_TX(dev, reset_root_to_default))
return -EOPNOTSUPP;
MLX5_SET(set_flow_table_root_in, in, opcode,
MLX5_CMD_OP_SET_FLOW_TABLE_ROOT);
MLX5_SET(set_flow_table_root_in, in, table_type,
FS_FT_NIC_TX);
if (disconnect)
MLX5_SET(set_flow_table_root_in, in, op_mod, 1);
else
MLX5_SET(set_flow_table_root_in, in, table_id, ft_id);
return mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
}
...@@ -122,4 +122,6 @@ int mlx5_cmd_fc_bulk_query(struct mlx5_core_dev *dev, u32 base_id, int bulk_len, ...@@ -122,4 +122,6 @@ int mlx5_cmd_fc_bulk_query(struct mlx5_core_dev *dev, u32 base_id, int bulk_len,
const struct mlx5_flow_cmds *mlx5_fs_cmd_get_default(enum fs_flow_table_type type); const struct mlx5_flow_cmds *mlx5_fs_cmd_get_default(enum fs_flow_table_type type);
const struct mlx5_flow_cmds *mlx5_fs_cmd_get_fw_cmds(void); const struct mlx5_flow_cmds *mlx5_fs_cmd_get_fw_cmds(void);
int mlx5_fs_cmd_set_l2table_entry_silent(struct mlx5_core_dev *dev, u8 silent_mode);
int mlx5_fs_cmd_set_tx_flow_table_root(struct mlx5_core_dev *dev, u32 ft_id, bool disconnect);
#endif #endif
...@@ -339,7 +339,7 @@ static int mlx5i_init_tx(struct mlx5e_priv *priv) ...@@ -339,7 +339,7 @@ static int mlx5i_init_tx(struct mlx5e_priv *priv)
return err; return err;
} }
err = mlx5i_create_tis(priv->mdev, ipriv->qpn, &priv->tisn[0][0]); err = mlx5i_create_tis(priv->mdev, ipriv->qpn, &ipriv->tisn);
if (err) { if (err) {
mlx5_core_warn(priv->mdev, "create tis failed, %d\n", err); mlx5_core_warn(priv->mdev, "create tis failed, %d\n", err);
goto err_destroy_underlay_qp; goto err_destroy_underlay_qp;
...@@ -356,7 +356,7 @@ static void mlx5i_cleanup_tx(struct mlx5e_priv *priv) ...@@ -356,7 +356,7 @@ static void mlx5i_cleanup_tx(struct mlx5e_priv *priv)
{ {
struct mlx5i_priv *ipriv = priv->ppriv; struct mlx5i_priv *ipriv = priv->ppriv;
mlx5e_destroy_tis(priv->mdev, priv->tisn[0][0]); mlx5e_destroy_tis(priv->mdev, ipriv->tisn);
mlx5i_destroy_underlay_qp(priv->mdev, ipriv->qpn); mlx5i_destroy_underlay_qp(priv->mdev, ipriv->qpn);
} }
...@@ -483,6 +483,18 @@ static unsigned int mlx5i_stats_grps_num(struct mlx5e_priv *priv) ...@@ -483,6 +483,18 @@ static unsigned int mlx5i_stats_grps_num(struct mlx5e_priv *priv)
return ARRAY_SIZE(mlx5i_stats_grps); return ARRAY_SIZE(mlx5i_stats_grps);
} }
u32 mlx5i_get_tisn(struct mlx5_core_dev *mdev, struct mlx5e_priv *priv, u8 lag_port, u8 tc)
{
struct mlx5i_priv *ipriv = priv->ppriv;
if (WARN(lag_port || tc,
"IPoIB unexpected non-zero value: lag_port (%u), tc (%u)\n",
lag_port, tc))
return 0;
return ipriv->tisn;
}
static const struct mlx5e_profile mlx5i_nic_profile = { static const struct mlx5e_profile mlx5i_nic_profile = {
.init = mlx5i_init, .init = mlx5i_init,
.cleanup = mlx5i_cleanup, .cleanup = mlx5i_cleanup,
...@@ -499,6 +511,7 @@ static const struct mlx5e_profile mlx5i_nic_profile = { ...@@ -499,6 +511,7 @@ static const struct mlx5e_profile mlx5i_nic_profile = {
.max_tc = MLX5I_MAX_NUM_TC, .max_tc = MLX5I_MAX_NUM_TC,
.stats_grps = mlx5i_stats_grps, .stats_grps = mlx5i_stats_grps,
.stats_grps_num = mlx5i_stats_grps_num, .stats_grps_num = mlx5i_stats_grps_num,
.get_tisn = mlx5i_get_tisn,
}; };
/* mlx5i netdev NDos */ /* mlx5i netdev NDos */
...@@ -829,7 +842,7 @@ int mlx5_rdma_rn_get_params(struct mlx5_core_dev *mdev, ...@@ -829,7 +842,7 @@ int mlx5_rdma_rn_get_params(struct mlx5_core_dev *mdev,
*params = (struct rdma_netdev_alloc_params){ *params = (struct rdma_netdev_alloc_params){
.sizeof_priv = sizeof(struct mlx5i_priv) + .sizeof_priv = sizeof(struct mlx5i_priv) +
sizeof(struct mlx5e_priv), sizeof(struct mlx5e_priv),
.txqs = nch * MLX5E_MAX_NUM_TC, .txqs = nch * MLX5_MAX_NUM_TC,
.rxqs = nch, .rxqs = nch,
.param = mdev, .param = mdev,
.initialize_rdma_netdev = mlx5_rdma_setup_rn, .initialize_rdma_netdev = mlx5_rdma_setup_rn,
......
...@@ -53,6 +53,7 @@ extern const struct mlx5e_rx_handlers mlx5i_rx_handlers; ...@@ -53,6 +53,7 @@ extern const struct mlx5e_rx_handlers mlx5i_rx_handlers;
struct mlx5i_priv { struct mlx5i_priv {
struct rdma_netdev rn; /* keep this first */ struct rdma_netdev rn; /* keep this first */
u32 qpn; u32 qpn;
u32 tisn;
bool sub_interface; bool sub_interface;
u32 num_sub_interfaces; u32 num_sub_interfaces;
u32 qkey; u32 qkey;
...@@ -63,6 +64,7 @@ struct mlx5i_priv { ...@@ -63,6 +64,7 @@ struct mlx5i_priv {
}; };
int mlx5i_create_tis(struct mlx5_core_dev *mdev, u32 underlay_qpn, u32 *tisn); int mlx5i_create_tis(struct mlx5_core_dev *mdev, u32 underlay_qpn, u32 *tisn);
u32 mlx5i_get_tisn(struct mlx5_core_dev *mdev, struct mlx5e_priv *priv, u8 lag_port, u8 tc);
/* Underlay QP create/destroy functions */ /* Underlay QP create/destroy functions */
int mlx5i_create_underlay_qp(struct mlx5e_priv *priv); int mlx5i_create_underlay_qp(struct mlx5e_priv *priv);
......
...@@ -218,7 +218,7 @@ static int mlx5i_pkey_open(struct net_device *netdev) ...@@ -218,7 +218,7 @@ static int mlx5i_pkey_open(struct net_device *netdev)
goto err_unint_underlay_qp; goto err_unint_underlay_qp;
} }
err = mlx5i_create_tis(mdev, ipriv->qpn, &epriv->tisn[0][0]); err = mlx5i_create_tis(mdev, ipriv->qpn, &ipriv->tisn);
if (err) { if (err) {
mlx5_core_warn(mdev, "create child tis failed, %d\n", err); mlx5_core_warn(mdev, "create child tis failed, %d\n", err);
goto err_remove_rx_uderlay_qp; goto err_remove_rx_uderlay_qp;
...@@ -240,7 +240,7 @@ static int mlx5i_pkey_open(struct net_device *netdev) ...@@ -240,7 +240,7 @@ static int mlx5i_pkey_open(struct net_device *netdev)
err_close_channels: err_close_channels:
mlx5e_close_channels(&epriv->channels); mlx5e_close_channels(&epriv->channels);
err_clear_state_opened_flag: err_clear_state_opened_flag:
mlx5e_destroy_tis(mdev, epriv->tisn[0][0]); mlx5e_destroy_tis(mdev, ipriv->tisn);
err_remove_rx_uderlay_qp: err_remove_rx_uderlay_qp:
mlx5_fs_remove_rx_underlay_qpn(mdev, ipriv->qpn); mlx5_fs_remove_rx_underlay_qpn(mdev, ipriv->qpn);
err_unint_underlay_qp: err_unint_underlay_qp:
...@@ -269,7 +269,7 @@ static int mlx5i_pkey_close(struct net_device *netdev) ...@@ -269,7 +269,7 @@ static int mlx5i_pkey_close(struct net_device *netdev)
mlx5i_uninit_underlay_qp(priv); mlx5i_uninit_underlay_qp(priv);
mlx5e_deactivate_priv_channels(priv); mlx5e_deactivate_priv_channels(priv);
mlx5e_close_channels(&priv->channels); mlx5e_close_channels(&priv->channels);
mlx5e_destroy_tis(mdev, priv->tisn[0][0]); mlx5e_destroy_tis(mdev, ipriv->tisn);
unlock: unlock:
mutex_unlock(&priv->state_lock); mutex_unlock(&priv->state_lock);
return 0; return 0;
...@@ -361,6 +361,7 @@ static const struct mlx5e_profile mlx5i_pkey_nic_profile = { ...@@ -361,6 +361,7 @@ static const struct mlx5e_profile mlx5i_pkey_nic_profile = {
.update_stats = NULL, .update_stats = NULL,
.rx_handlers = &mlx5i_rx_handlers, .rx_handlers = &mlx5i_rx_handlers,
.max_tc = MLX5I_MAX_NUM_TC, .max_tc = MLX5I_MAX_NUM_TC,
.get_tisn = mlx5i_get_tisn,
}; };
const struct mlx5e_profile *mlx5i_pkey_get_profile(void) const struct mlx5e_profile *mlx5i_pkey_get_profile(void)
......
...@@ -256,6 +256,13 @@ void mlx5_devcom_unregister_component(struct mlx5_devcom_comp_dev *devcom) ...@@ -256,6 +256,13 @@ void mlx5_devcom_unregister_component(struct mlx5_devcom_comp_dev *devcom)
devcom_free_comp_dev(devcom); devcom_free_comp_dev(devcom);
} }
int mlx5_devcom_comp_get_size(struct mlx5_devcom_comp_dev *devcom)
{
struct mlx5_devcom_comp *comp = devcom->comp;
return kref_read(&comp->ref);
}
int mlx5_devcom_send_event(struct mlx5_devcom_comp_dev *devcom, int mlx5_devcom_send_event(struct mlx5_devcom_comp_dev *devcom,
int event, int rollback_event, int event, int rollback_event,
void *event_data) void *event_data)
......
...@@ -31,6 +31,7 @@ void mlx5_devcom_unregister_component(struct mlx5_devcom_comp_dev *devcom); ...@@ -31,6 +31,7 @@ void mlx5_devcom_unregister_component(struct mlx5_devcom_comp_dev *devcom);
int mlx5_devcom_send_event(struct mlx5_devcom_comp_dev *devcom, int mlx5_devcom_send_event(struct mlx5_devcom_comp_dev *devcom,
int event, int rollback_event, int event, int rollback_event,
void *event_data); void *event_data);
int mlx5_devcom_comp_get_size(struct mlx5_devcom_comp_dev *devcom);
void mlx5_devcom_comp_set_ready(struct mlx5_devcom_comp_dev *devcom, bool ready); void mlx5_devcom_comp_set_ready(struct mlx5_devcom_comp_dev *devcom, bool ready);
bool mlx5_devcom_comp_is_ready(struct mlx5_devcom_comp_dev *devcom); bool mlx5_devcom_comp_is_ready(struct mlx5_devcom_comp_dev *devcom);
......
...@@ -243,6 +243,7 @@ int mlx5_query_mcam_reg(struct mlx5_core_dev *dev, u32 *mcap, u8 feature_group, ...@@ -243,6 +243,7 @@ int mlx5_query_mcam_reg(struct mlx5_core_dev *dev, u32 *mcap, u8 feature_group,
u8 access_reg_group); u8 access_reg_group);
int mlx5_query_qcam_reg(struct mlx5_core_dev *mdev, u32 *qcam, int mlx5_query_qcam_reg(struct mlx5_core_dev *mdev, u32 *qcam,
u8 feature_group, u8 access_reg_group); u8 feature_group, u8 access_reg_group);
int mlx5_query_mpir_reg(struct mlx5_core_dev *dev, u32 *mpir);
void mlx5_lag_add_netdev(struct mlx5_core_dev *dev, struct net_device *netdev); void mlx5_lag_add_netdev(struct mlx5_core_dev *dev, struct net_device *netdev);
void mlx5_lag_remove_netdev(struct mlx5_core_dev *dev, struct net_device *netdev); void mlx5_lag_remove_netdev(struct mlx5_core_dev *dev, struct net_device *netdev);
......
...@@ -1206,3 +1206,13 @@ int mlx5_port_max_linkspeed(struct mlx5_core_dev *mdev, u32 *speed) ...@@ -1206,3 +1206,13 @@ int mlx5_port_max_linkspeed(struct mlx5_core_dev *mdev, u32 *speed)
*speed = max_speed; *speed = max_speed;
return 0; return 0;
} }
int mlx5_query_mpir_reg(struct mlx5_core_dev *dev, u32 *mpir)
{
u32 in[MLX5_ST_SZ_DW(mpir_reg)] = {};
int sz = MLX5_ST_SZ_BYTES(mpir_reg);
MLX5_SET(mpir_reg, in, local_port, 1);
return mlx5_core_access_reg(dev, in, sz, mpir, sz, MLX5_REG_MPIR, 0, 0);
}
...@@ -1170,7 +1170,6 @@ mlx5dr_action_create_mult_dest_tbl(struct mlx5dr_domain *dmn, ...@@ -1170,7 +1170,6 @@ mlx5dr_action_create_mult_dest_tbl(struct mlx5dr_domain *dmn,
bool ignore_flow_level, bool ignore_flow_level,
u32 flow_source) u32 flow_source)
{ {
struct mlx5dr_cmd_flow_destination_hw_info tmp_hw_dest;
struct mlx5dr_cmd_flow_destination_hw_info *hw_dests; struct mlx5dr_cmd_flow_destination_hw_info *hw_dests;
struct mlx5dr_action **ref_actions; struct mlx5dr_action **ref_actions;
struct mlx5dr_action *action; struct mlx5dr_action *action;
...@@ -1249,11 +1248,8 @@ mlx5dr_action_create_mult_dest_tbl(struct mlx5dr_domain *dmn, ...@@ -1249,11 +1248,8 @@ mlx5dr_action_create_mult_dest_tbl(struct mlx5dr_domain *dmn,
* one that done in the TX. * one that done in the TX.
* So, if one of the ft target is wire, put it at the end of the dest list. * So, if one of the ft target is wire, put it at the end of the dest list.
*/ */
if (is_ft_wire && num_dst_ft > 1) { if (is_ft_wire && num_dst_ft > 1)
tmp_hw_dest = hw_dests[last_dest]; swap(hw_dests[last_dest], hw_dests[num_of_dests - 1]);
hw_dests[last_dest] = hw_dests[num_of_dests - 1];
hw_dests[num_of_dests - 1] = tmp_hw_dest;
}
action = dr_action_create_generic(DR_ACTION_TYP_FT); action = dr_action_create_generic(DR_ACTION_TYP_FT);
if (!action) if (!action)
......
...@@ -150,6 +150,7 @@ enum { ...@@ -150,6 +150,7 @@ enum {
MLX5_REG_MTPPSE = 0x9054, MLX5_REG_MTPPSE = 0x9054,
MLX5_REG_MTUTC = 0x9055, MLX5_REG_MTUTC = 0x9055,
MLX5_REG_MPEGC = 0x9056, MLX5_REG_MPEGC = 0x9056,
MLX5_REG_MPIR = 0x9059,
MLX5_REG_MCQS = 0x9060, MLX5_REG_MCQS = 0x9060,
MLX5_REG_MCQI = 0x9061, MLX5_REG_MCQI = 0x9061,
MLX5_REG_MCC = 0x9062, MLX5_REG_MCC = 0x9062,
...@@ -678,6 +679,8 @@ struct mlx5e_resources { ...@@ -678,6 +679,8 @@ struct mlx5e_resources {
struct mlx5_td td; struct mlx5_td td;
u32 mkey; u32 mkey;
struct mlx5_sq_bfreg bfreg; struct mlx5_sq_bfreg bfreg;
#define MLX5_MAX_NUM_TC 8
u32 tisn[MLX5_MAX_PORTS][MLX5_MAX_NUM_TC];
} hw_objs; } hw_objs;
struct net_device *uplink_netdev; struct net_device *uplink_netdev;
struct mutex uplink_netdev_lock; struct mutex uplink_netdev_lock;
......
...@@ -435,7 +435,7 @@ struct mlx5_ifc_flow_table_prop_layout_bits { ...@@ -435,7 +435,7 @@ struct mlx5_ifc_flow_table_prop_layout_bits {
u8 flow_table_modify[0x1]; u8 flow_table_modify[0x1];
u8 reformat[0x1]; u8 reformat[0x1];
u8 decap[0x1]; u8 decap[0x1];
u8 reserved_at_9[0x1]; u8 reset_root_to_default[0x1];
u8 pop_vlan[0x1]; u8 pop_vlan[0x1];
u8 push_vlan[0x1]; u8 push_vlan[0x1];
u8 reserved_at_c[0x1]; u8 reserved_at_c[0x1];
...@@ -1801,7 +1801,8 @@ struct mlx5_ifc_cmd_hca_cap_bits { ...@@ -1801,7 +1801,8 @@ struct mlx5_ifc_cmd_hca_cap_bits {
u8 disable_local_lb_uc[0x1]; u8 disable_local_lb_uc[0x1];
u8 disable_local_lb_mc[0x1]; u8 disable_local_lb_mc[0x1];
u8 log_min_hairpin_wq_data_sz[0x5]; u8 log_min_hairpin_wq_data_sz[0x5];
u8 reserved_at_3e8[0x2]; u8 reserved_at_3e8[0x1];
u8 silent_mode[0x1];
u8 vhca_state[0x1]; u8 vhca_state[0x1];
u8 log_max_vlan_list[0x5]; u8 log_max_vlan_list[0x5];
u8 reserved_at_3f0[0x3]; u8 reserved_at_3f0[0x3];
...@@ -1818,7 +1819,7 @@ struct mlx5_ifc_cmd_hca_cap_bits { ...@@ -1818,7 +1819,7 @@ struct mlx5_ifc_cmd_hca_cap_bits {
u8 reserved_at_460[0x1]; u8 reserved_at_460[0x1];
u8 ats[0x1]; u8 ats[0x1];
u8 reserved_at_462[0x1]; u8 cross_vhca_rqt[0x1];
u8 log_max_uctx[0x5]; u8 log_max_uctx[0x5];
u8 reserved_at_468[0x1]; u8 reserved_at_468[0x1];
u8 crypto[0x1]; u8 crypto[0x1];
...@@ -1943,6 +1944,7 @@ struct mlx5_ifc_cmd_hca_cap_bits { ...@@ -1943,6 +1944,7 @@ struct mlx5_ifc_cmd_hca_cap_bits {
enum { enum {
MLX5_CROSS_VHCA_OBJ_TO_OBJ_SUPPORTED_LOCAL_FLOW_TABLE_TO_REMOTE_FLOW_TABLE_MISS = 0x80000, MLX5_CROSS_VHCA_OBJ_TO_OBJ_SUPPORTED_LOCAL_FLOW_TABLE_TO_REMOTE_FLOW_TABLE_MISS = 0x80000,
MLX5_CROSS_VHCA_OBJ_TO_OBJ_SUPPORTED_LOCAL_FLOW_TABLE_ROOT_TO_REMOTE_FLOW_TABLE = (1ULL << 20),
}; };
enum { enum {
...@@ -1992,7 +1994,11 @@ struct mlx5_ifc_cmd_hca_cap_2_bits { ...@@ -1992,7 +1994,11 @@ struct mlx5_ifc_cmd_hca_cap_2_bits {
u8 reserved_at_260[0x120]; u8 reserved_at_260[0x120];
u8 reserved_at_380[0x10]; u8 reserved_at_380[0x10];
u8 ec_vf_vport_base[0x10]; u8 ec_vf_vport_base[0x10];
u8 reserved_at_3a0[0x460];
u8 reserved_at_3a0[0x10];
u8 max_rqt_vhca_id[0x10];
u8 reserved_at_3c0[0x440];
}; };
enum mlx5_ifc_flow_destination_type { enum mlx5_ifc_flow_destination_type {
...@@ -2151,6 +2157,13 @@ struct mlx5_ifc_rq_num_bits { ...@@ -2151,6 +2157,13 @@ struct mlx5_ifc_rq_num_bits {
u8 rq_num[0x18]; u8 rq_num[0x18];
}; };
struct mlx5_ifc_rq_vhca_bits {
u8 reserved_at_0[0x8];
u8 rq_num[0x18];
u8 reserved_at_20[0x10];
u8 rq_vhca_id[0x10];
};
struct mlx5_ifc_mac_address_layout_bits { struct mlx5_ifc_mac_address_layout_bits {
u8 reserved_at_0[0x10]; u8 reserved_at_0[0x10];
u8 mac_addr_47_32[0x10]; u8 mac_addr_47_32[0x10];
...@@ -3901,7 +3914,10 @@ struct mlx5_ifc_rqtc_bits { ...@@ -3901,7 +3914,10 @@ struct mlx5_ifc_rqtc_bits {
u8 reserved_at_e0[0x6a0]; u8 reserved_at_e0[0x6a0];
struct mlx5_ifc_rq_num_bits rq_num[]; union {
DECLARE_FLEX_ARRAY(struct mlx5_ifc_rq_num_bits, rq_num);
DECLARE_FLEX_ARRAY(struct mlx5_ifc_rq_vhca_bits, rq_vhca);
};
}; };
enum { enum {
...@@ -4744,7 +4760,10 @@ struct mlx5_ifc_set_l2_table_entry_in_bits { ...@@ -4744,7 +4760,10 @@ struct mlx5_ifc_set_l2_table_entry_in_bits {
u8 reserved_at_c0[0x20]; u8 reserved_at_c0[0x20];
u8 reserved_at_e0[0x13]; u8 reserved_at_e0[0x10];
u8 silent_mode_valid[0x1];
u8 silent_mode[0x1];
u8 reserved_at_f2[0x1];
u8 vlan_valid[0x1]; u8 vlan_valid[0x1];
u8 vlan[0xc]; u8 vlan[0xc];
...@@ -10089,6 +10108,20 @@ struct mlx5_ifc_mpegc_reg_bits { ...@@ -10089,6 +10108,20 @@ struct mlx5_ifc_mpegc_reg_bits {
u8 reserved_at_60[0x100]; u8 reserved_at_60[0x100];
}; };
struct mlx5_ifc_mpir_reg_bits {
u8 sdm[0x1];
u8 reserved_at_1[0x1b];
u8 host_buses[0x4];
u8 reserved_at_20[0x20];
u8 local_port[0x8];
u8 reserved_at_28[0x15];
u8 sd_group[0x3];
u8 reserved_at_60[0x20];
};
enum { enum {
MLX5_MTUTC_FREQ_ADJ_UNITS_PPB = 0x0, MLX5_MTUTC_FREQ_ADJ_UNITS_PPB = 0x0,
MLX5_MTUTC_FREQ_ADJ_UNITS_SCALED_PPM = 0x1, MLX5_MTUTC_FREQ_ADJ_UNITS_SCALED_PPM = 0x1,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment