aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMoni Shoua <monis@mellanox.com>2016-01-14 17:50:37 +0200
committerDoug Ledford <dledford@redhat.com>2016-01-19 15:35:00 -0500
commit3f723f42d9d625bb9ecfe923d19d1d42da775797 (patch)
treeebf0ef5781105d6188a5e897b8910bb0cc10aee9 /include
parentnet/mlx4_core: Add support for configuring RoCE v2 UDP port (diff)
downloadlinux-dev-3f723f42d9d625bb9ecfe923d19d1d42da775797.tar.xz
linux-dev-3f723f42d9d625bb9ecfe923d19d1d42da775797.zip
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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mlx4/qp.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index fe052e234906..cdf110d3f260 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -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 */