From: Christoph Paasch Commit 66af4fe37119 ("net/mlx5: Remove unused functions") removed get_cqe_l3_hdr_type. Let's bring it back. Also, define CQE_L3_HDR_TYPE_* to identify IPv6 and IPv4 packets. Signed-off-by: Christoph Paasch --- include/linux/mlx5/device.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h index 6822cfa5f4ad31ef6fb61be2dcfae3ac9a46d659..a0098df1b82bf746bf0132d547440b9dab22e57f 100644 --- a/include/linux/mlx5/device.h +++ b/include/linux/mlx5/device.h @@ -926,11 +926,16 @@ static inline u8 get_cqe_lro_tcppsh(struct mlx5_cqe64 *cqe) return (cqe->lro.tcppsh_abort_dupack >> 6) & 1; } -static inline u8 get_cqe_l4_hdr_type(struct mlx5_cqe64 *cqe) +static inline u8 get_cqe_l4_hdr_type(const struct mlx5_cqe64 *cqe) { return (cqe->l4_l3_hdr_type >> 4) & 0x7; } +static inline u8 get_cqe_l3_hdr_type(const struct mlx5_cqe64 *cqe) +{ + return (cqe->l4_l3_hdr_type >> 2) & 0x3; +} + static inline bool cqe_is_tunneled(struct mlx5_cqe64 *cqe) { return cqe->tls_outer_l3_tunneled & 0x1; @@ -1011,6 +1016,11 @@ enum { CQE_L4_HDR_TYPE_TCP_ACK_AND_DATA = 0x4, }; +enum { + CQE_L3_HDR_TYPE_IPV6 = 0x1, + CQE_L3_HDR_TYPE_IPV4 = 0x2, +}; + enum { CQE_RSS_HTYPE_IP = GENMASK(3, 2), /* cqe->rss_hash_type[3:2] - IP destination selected for hash -- 2.49.0