net/mlx4_core: Add support for RoCE v2 entropy

In RoCE v2 we need to choose a source UDP port, we do so by using
entropy over the source and dest QPNs.

Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
Moni Shoua
2016-01-14 17:50:37 +02:00
committed by Doug Ledford
parent fca8300629
commit 3f723f42d9
2 changed files with 38 additions and 1 deletions

View File

@@ -204,7 +204,8 @@ struct mlx4_qp_context {
u32 reserved1;
__be32 next_send_psn;
__be32 cqn_send;
u32 reserved2[2];
__be16 roce_entropy;
__be16 reserved2[3];
__be32 last_acked_psn;
__be32 ssn;
__be32 params2;
@@ -487,4 +488,14 @@ static inline struct mlx4_qp *__mlx4_qp_lookup(struct mlx4_dev *dev, u32 qpn)
void mlx4_qp_remove(struct mlx4_dev *dev, struct mlx4_qp *qp);
static inline u16 folded_qp(u32 q)
{
u16 res;
res = ((q & 0xff) ^ ((q & 0xff0000) >> 16)) | (q & 0xff00);
return res;
}
u16 mlx4_qp_roce_entropy(struct mlx4_dev *dev, u32 qpn);
#endif /* MLX4_QP_H */