diff options
author | hselasky <hselasky@FreeBSD.org> | 2015-12-07 11:04:50 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2015-12-07 11:04:50 +0000 |
commit | 7d81938ea5fd00b2f9bd8e622f7f96b26bb05f3a (patch) | |
tree | bf531933eff45bbca8a3be7ec36cf66463cbfa3b /sys/dev/mlx5/mlx5_en/mlx5_en_main.c | |
parent | bc220e2f51c1cc1eda36aa8c4cd56cbcd6afcc9d (diff) | |
download | FreeBSD-src-7d81938ea5fd00b2f9bd8e622f7f96b26bb05f3a.zip FreeBSD-src-7d81938ea5fd00b2f9bd8e622f7f96b26bb05f3a.tar.gz |
Add support for setting the TX moderation mode via a sysctl entry. TX
completion events can be moderated in the same way like RX completion
events. Expose this functionality by a sysctl variable.
MFC after: 1 week
Sponsored by: Mellanox Technologies
Differential Revision: https://reviews.freebsd.org/D4409
Diffstat (limited to 'sys/dev/mlx5/mlx5_en/mlx5_en_main.c')
-rw-r--r-- | sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index 4e92eb6..71a708e 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -1324,13 +1324,25 @@ static int mlx5e_open_tx_cqs(struct mlx5e_channel *c, struct mlx5e_channel_param *cparam) { + u8 tx_moderation_mode; int err; int tc; + switch (c->priv->params.tx_cq_moderation_mode) { + case 0: + tx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; + break; + default: + if (MLX5_CAP_GEN(c->priv->mdev, cq_period_start_from_cqe)) + tx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_CQE; + else + tx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; + break; + } for (tc = 0; tc < c->num_tc; tc++) { /* open completion queue */ err = mlx5e_open_cq(c, &cparam->tx_cq, &c->sq[tc].cq, - &mlx5e_tx_cq_comp, MLX5_CQ_PERIOD_MODE_START_FROM_EQE); + &mlx5e_tx_cq_comp, tx_moderation_mode); if (err) goto err_close_tx_cqs; } |