smc_llc.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Shared Memory Communications over RDMA (SMC-R) and RoCE
  3. *
  4. * Definitions for LLC (link layer control) message handling
  5. *
  6. * Copyright IBM Corp. 2016
  7. *
  8. * Author(s): Klaus Wacker <Klaus.Wacker@de.ibm.com>
  9. * Ursula Braun <ubraun@linux.vnet.ibm.com>
  10. */
  11. #ifndef SMC_LLC_H
  12. #define SMC_LLC_H
  13. #include "smc_wr.h"
  14. #define SMC_LLC_FLAG_RESP 0x80
  15. #define SMC_LLC_WAIT_FIRST_TIME (5 * HZ)
  16. enum smc_llc_reqresp {
  17. SMC_LLC_REQ,
  18. SMC_LLC_RESP
  19. };
  20. enum smc_llc_msg_type {
  21. SMC_LLC_CONFIRM_LINK = 0x01,
  22. };
  23. #define SMC_LLC_DATA_LEN 40
  24. struct smc_llc_hdr {
  25. struct smc_wr_rx_hdr common;
  26. u8 length; /* 44 */
  27. u8 reserved;
  28. u8 flags;
  29. };
  30. struct smc_llc_msg_confirm_link { /* type 0x01 */
  31. struct smc_llc_hdr hd;
  32. u8 sender_mac[ETH_ALEN];
  33. u8 sender_gid[SMC_GID_SIZE];
  34. u8 sender_qp_num[3];
  35. u8 link_num;
  36. u8 link_uid[SMC_LGR_ID_SIZE];
  37. u8 max_links;
  38. u8 reserved[9];
  39. };
  40. union smc_llc_msg {
  41. struct smc_llc_msg_confirm_link confirm_link;
  42. struct {
  43. struct smc_llc_hdr hdr;
  44. u8 data[SMC_LLC_DATA_LEN];
  45. } raw;
  46. };
  47. /* transmit */
  48. int smc_llc_send_confirm_link(struct smc_link *lnk, u8 mac[], union ib_gid *gid,
  49. enum smc_llc_reqresp reqresp);
  50. int smc_llc_init(void) __init;
  51. #endif /* SMC_LLC_H */