smc_llc.h 1.2 KB

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