usnic_abi.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
  3. *
  4. * This program is free software; you may redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; version 2 of the License.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  9. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  10. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  11. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  12. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  13. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  14. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  15. * SOFTWARE.
  16. *
  17. */
  18. #ifndef USNIC_ABI_H
  19. #define USNIC_ABI_H
  20. /* ABI between userspace and kernel */
  21. #define USNIC_UVERBS_ABI_VERSION 4
  22. #define USNIC_QP_GRP_MAX_WQS 8
  23. #define USNIC_QP_GRP_MAX_RQS 8
  24. #define USNIC_QP_GRP_MAX_CQS 16
  25. enum usnic_transport_type {
  26. USNIC_TRANSPORT_UNKNOWN = 0,
  27. USNIC_TRANSPORT_ROCE_CUSTOM = 1,
  28. USNIC_TRANSPORT_IPV4_UDP = 2,
  29. USNIC_TRANSPORT_MAX = 3,
  30. };
  31. struct usnic_transport_spec {
  32. enum usnic_transport_type trans_type;
  33. union {
  34. struct {
  35. uint16_t port_num;
  36. } usnic_roce;
  37. struct {
  38. uint32_t sock_fd;
  39. } udp;
  40. };
  41. };
  42. struct usnic_ib_create_qp_cmd {
  43. struct usnic_transport_spec spec;
  44. };
  45. /*TODO: Future - usnic_modify_qp needs to pass in generic filters */
  46. struct usnic_ib_create_qp_resp {
  47. u32 vfid;
  48. u32 qp_grp_id;
  49. u64 bar_bus_addr;
  50. u32 bar_len;
  51. /*
  52. * WQ, RQ, CQ are explicity specified bc exposing a generic resources inteface
  53. * expands the scope of ABI to many files.
  54. */
  55. u32 wq_cnt;
  56. u32 rq_cnt;
  57. u32 cq_cnt;
  58. u32 wq_idx[USNIC_QP_GRP_MAX_WQS];
  59. u32 rq_idx[USNIC_QP_GRP_MAX_RQS];
  60. u32 cq_idx[USNIC_QP_GRP_MAX_CQS];
  61. u32 transport;
  62. u32 reserved[9];
  63. };
  64. #endif /* USNIC_ABI_H */