Skip to content

Commit

Permalink
net/mlx5: Better return types for CQE API
Browse files Browse the repository at this point in the history
Reduce sizes of return types.
Use bool for binary indication.

Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
  • Loading branch information
Tariq Toukan authored and Saeed Mahameed committed Jul 18, 2018
1 parent d34c6ef commit e2abdcf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/linux/mlx5/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ enum {

#define MLX5_MINI_CQE_ARRAY_SIZE 8

static inline int mlx5_get_cqe_format(struct mlx5_cqe64 *cqe)
static inline u8 mlx5_get_cqe_format(struct mlx5_cqe64 *cqe)
{
return (cqe->op_own >> 2) & 0x3;
}
Expand All @@ -770,14 +770,14 @@ static inline u8 get_cqe_l3_hdr_type(struct mlx5_cqe64 *cqe)
return (cqe->l4_l3_hdr_type >> 2) & 0x3;
}

static inline u8 cqe_is_tunneled(struct mlx5_cqe64 *cqe)
static inline bool cqe_is_tunneled(struct mlx5_cqe64 *cqe)
{
return cqe->outer_l3_tunneled & 0x1;
}

static inline int cqe_has_vlan(struct mlx5_cqe64 *cqe)
static inline bool cqe_has_vlan(struct mlx5_cqe64 *cqe)
{
return !!(cqe->l4_l3_hdr_type & 0x1);
return cqe->l4_l3_hdr_type & 0x1;
}

static inline u64 get_cqe_ts(struct mlx5_cqe64 *cqe)
Expand Down

0 comments on commit e2abdcf

Please sign in to comment.