mana-abi.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) */
  2. /*
  3. * Copyright (c) 2022, Microsoft Corporation. All rights reserved.
  4. */
  5. #ifndef MANA_ABI_USER_H
  6. #define MANA_ABI_USER_H
  7. #include <linux/types.h>
  8. #include <rdma/ib_user_ioctl_verbs.h>
  9. /*
  10. * Increment this value if any changes that break userspace ABI
  11. * compatibility are made.
  12. */
  13. #define MANA_IB_UVERBS_ABI_VERSION 1
  14. enum mana_ib_create_cq_flags {
  15. /* Reserved for backward compatibility. Legacy
  16. * kernel versions use it to create CQs in RNIC
  17. */
  18. MANA_IB_CREATE_RNIC_CQ = 1 << 0,
  19. };
  20. struct mana_ib_create_cq {
  21. __aligned_u64 buf_addr;
  22. __u16 flags;
  23. __u16 reserved0;
  24. __u32 reserved1;
  25. };
  26. struct mana_ib_create_cq_resp {
  27. __u32 cqid;
  28. __u32 reserved;
  29. };
  30. struct mana_ib_create_qp {
  31. __aligned_u64 sq_buf_addr;
  32. __u32 sq_buf_size;
  33. __u32 port;
  34. };
  35. struct mana_ib_create_qp_resp {
  36. __u32 sqid;
  37. __u32 cqid;
  38. __u32 tx_vp_offset;
  39. __u32 reserved;
  40. };
  41. struct mana_ib_create_rc_qp {
  42. __aligned_u64 queue_buf[4];
  43. __u32 queue_size[4];
  44. };
  45. struct mana_ib_create_rc_qp_resp {
  46. __u32 queue_id[4];
  47. };
  48. struct mana_ib_create_wq {
  49. __aligned_u64 wq_buf_addr;
  50. __u32 wq_buf_size;
  51. __u32 reserved;
  52. };
  53. /* RX Hash function flags */
  54. enum mana_ib_rx_hash_function_flags {
  55. MANA_IB_RX_HASH_FUNC_TOEPLITZ = 1 << 0,
  56. };
  57. struct mana_ib_create_qp_rss {
  58. __aligned_u64 rx_hash_fields_mask;
  59. __u8 rx_hash_function;
  60. __u8 reserved[7];
  61. __u32 rx_hash_key_len;
  62. __u8 rx_hash_key[40];
  63. __u32 port;
  64. };
  65. struct rss_resp_entry {
  66. __u32 cqid;
  67. __u32 wqid;
  68. };
  69. struct mana_ib_create_qp_rss_resp {
  70. __aligned_u64 num_entries;
  71. struct rss_resp_entry entries[64];
  72. };
  73. #endif