aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mlx5/device.h
diff options
context:
space:
mode:
authorTariq Toukan <tariqt@mellanox.com>2018-12-04 18:03:01 -0800
committerSaeed Mahameed <saeedm@mellanox.com>2018-12-09 18:16:16 -0800
commit6254adeb1f6943a66cbed892a5f683400b9db194 (patch)
tree39258dbbb716e31c52223c97d104f8d04929a243 /include/linux/mlx5/device.h
parentnet/mlx5: When fetching CQEs return CQE instead of void pointer (diff)
downloadlinux-dev-6254adeb1f6943a66cbed892a5f683400b9db194.tar.xz
linux-dev-6254adeb1f6943a66cbed892a5f683400b9db194.zip
net/mlx5: Use helper to get CQE opcode
Introduce and use a helper that extracts the opcode from a CQE (completion queue entry) structure. Signed-off-by: Tariq Toukan <tariqt@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to '')
-rw-r--r--include/linux/mlx5/device.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h
index f7c8bebfe472..c66867c8fc2f 100644
--- a/include/linux/mlx5/device.h
+++ b/include/linux/mlx5/device.h
@@ -781,6 +781,11 @@ static inline u8 mlx5_get_cqe_format(struct mlx5_cqe64 *cqe)
return (cqe->op_own >> 2) & 0x3;
}
+static inline u8 get_cqe_opcode(struct mlx5_cqe64 *cqe)
+{
+ return cqe->op_own >> 4;
+}
+
static inline u8 get_cqe_lro_tcppsh(struct mlx5_cqe64 *cqe)
{
return (cqe->lro_tcppsh_abort_dupack >> 6) & 1;