diff options
author | hselasky <hselasky@FreeBSD.org> | 2016-05-20 06:54:58 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2016-05-20 06:54:58 +0000 |
commit | 64d010d53317655ede6d212985d499e1b7c7f583 (patch) | |
tree | 5b13ba2b91ef24aa9fc4103002682befe2d95de1 /sys/dev/mlx5/mlx5_en/en.h | |
parent | ad10425ff7c11b0f9841a9ff53859ca0d7800109 (diff) | |
download | FreeBSD-src-64d010d53317655ede6d212985d499e1b7c7f583.zip FreeBSD-src-64d010d53317655ede6d212985d499e1b7c7f583.tar.gz |
Implement TX completion event interleaving.
This patch implements a sysctl which allows setting a factor, N, for
how many work queue elements can be generated before requiring a
completion event. When a completion event happens the code simulates N
completion events instead of only one. When draining a transmit queue,
N-1 NOPs are transmitted at most, to force generation of the final
completion event. Further a timer is running every HZ ticks to flush
any remaining data off the transmit queue when the tx_completion_fact
> 1.
The goal of this feature is to reduce the PCI bandwidth needed when
transmitting data.
Sponsored by: Mellanox Technologies
Tested by: Netflix
MFC after: 1 week
Diffstat (limited to 'sys/dev/mlx5/mlx5_en/en.h')
-rw-r--r-- | sys/dev/mlx5/mlx5_en/en.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/dev/mlx5/mlx5_en/en.h b/sys/dev/mlx5/mlx5_en/en.h index 12a6922..693259d 100644 --- a/sys/dev/mlx5/mlx5_en/en.h +++ b/sys/dev/mlx5/mlx5_en/en.h @@ -391,6 +391,8 @@ struct mlx5e_params { m(+1, u64 tx_coalesce_usecs, "tx_coalesce_usecs", "Limit in usec for joining tx packets") \ m(+1, u64 tx_coalesce_pkts, "tx_coalesce_pkts", "Maximum number of tx packets to join") \ m(+1, u64 tx_coalesce_mode, "tx_coalesce_mode", "0: EQE mode 1: CQE mode") \ + m(+1, u64 tx_completion_fact, "tx_completion_fact", "1..MAX: Completion event ratio") \ + m(+1, u64 tx_completion_fact_max, "tx_completion_fact_max", "Maximum completion event ratio") \ m(+1, u64 hw_lro, "hw_lro", "set to enable hw_lro") \ m(+1, u64 cqe_zipping, "cqe_zipping", "0 : CQE zipping disabled") @@ -496,6 +498,13 @@ struct mlx5e_sq { /* dirtied @xmit */ u16 pc __aligned(MLX5E_CACHELINE_SIZE); u16 bf_offset; + u16 cev_counter; /* completion event counter */ + u16 cev_factor; /* completion event factor */ + u32 cev_next_state; /* next completion event state */ +#define MLX5E_CEV_STATE_INITIAL 0 /* timer not started */ +#define MLX5E_CEV_STATE_SEND_NOPS 1 /* send NOPs */ +#define MLX5E_CEV_STATE_HOLD_NOPS 2 /* don't send NOPs yet */ + struct callout cev_callout; struct mlx5e_sq_stats stats; struct mlx5e_cq cq; @@ -787,6 +796,7 @@ void mlx5e_create_stats(struct sysctl_ctx_list *, struct sysctl_oid_list *, const char *, const char **, unsigned, u64 *); void mlx5e_send_nop(struct mlx5e_sq *, u32, bool); +void mlx5e_sq_cev_timeout(void *); int mlx5e_refresh_channel_params(struct mlx5e_priv *); #endif /* _MLX5_EN_H_ */ |