MLX5_SET(create_mkey_in, in, pg_access, attr->pg_access);
MLX5_SET(mkc, mkc, lw, 0x1);
MLX5_SET(mkc, mkc, lr, 0x1);
+ if (attr->set_remote_rw) {
+ MLX5_SET(mkc, mkc, rw, 0x1);
+ MLX5_SET(mkc, mkc, rr, 0x1);
+ }
MLX5_SET(mkc, mkc, qpn, 0xffffff);
MLX5_SET(mkc, mkc, pd, attr->pd);
MLX5_SET(mkc, mkc, mkey_7_0, attr->umem_id & 0xFF);
MLX5_SET(mkc, mkc, relaxed_ordering_read, attr->relaxed_ordering_read);
MLX5_SET64(mkc, mkc, start_addr, attr->addr);
MLX5_SET64(mkc, mkc, len, attr->size);
+ MLX5_SET(mkc, mkc, crypto_en, attr->crypto_en);
+ if (attr->crypto_en) {
+ MLX5_SET(mkc, mkc, bsf_en, attr->crypto_en);
+ MLX5_SET(mkc, mkc, bsf_octword_size, 4);
+ }
mkey->obj = mlx5_glue->devx_obj_create(ctx, in, in_size_dw * 4, out,
sizeof(out));
if (!mkey->obj) {
u8 relaxed_ordering_read[0x1];
u8 reserved_at_1da[0x1];
u8 log_page_size[0x5];
- u8 reserved_at_1e0[0x20];
+ u8 reserved_at_1e0[0x3];
+ u8 crypto_en[0x2];
+ u8 reserved_at_1e5[0x1b];
+};
+
+/* Range of values for MKEY context crypto_en field. */
+enum {
+ MLX5_MKEY_CRYPTO_DISABLED = 0x0,
+ MLX5_MKEY_CRYPTO_ENABLED = 0x1,
};
struct mlx5_ifc_create_mkey_out_bits {