smc_llc.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. #define SMC_LLC_WAIT_TIME (2 * HZ)
  18. enum smc_llc_reqresp {
  19. SMC_LLC_REQ,
  20. SMC_LLC_RESP
  21. };
  22. enum smc_llc_msg_type {
  23. SMC_LLC_CONFIRM_LINK = 0x01,
  24. SMC_LLC_ADD_LINK = 0x02,
  25. SMC_LLC_DELETE_LINK = 0x04,
  26. SMC_LLC_CONFIRM_RKEY = 0x06,
  27. SMC_LLC_TEST_LINK = 0x07,
  28. SMC_LLC_CONFIRM_RKEY_CONT = 0x08,
  29. SMC_LLC_DELETE_RKEY = 0x09,
  30. };
  31. /* transmit */
  32. int smc_llc_send_confirm_link(struct smc_link *lnk,
  33. enum smc_llc_reqresp reqresp);
  34. int smc_llc_send_add_link(struct smc_link *link, u8 mac[], u8 gid[],
  35. enum smc_llc_reqresp reqresp);
  36. int smc_llc_send_delete_link(struct smc_link *link,
  37. enum smc_llc_reqresp reqresp, bool orderly);
  38. int smc_llc_link_init(struct smc_link *link);
  39. void smc_llc_link_active(struct smc_link *link, int testlink_time);
  40. void smc_llc_link_deleting(struct smc_link *link);
  41. void smc_llc_link_inactive(struct smc_link *link);
  42. void smc_llc_link_clear(struct smc_link *link);
  43. int smc_llc_do_confirm_rkey(struct smc_link *link,
  44. struct smc_buf_desc *rmb_desc);
  45. int smc_llc_init(void) __init;
  46. #endif /* SMC_LLC_H */