isert_proto.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* From iscsi_iser.h */
  2. struct iser_hdr {
  3. u8 flags;
  4. u8 rsvd[3];
  5. __be32 write_stag; /* write rkey */
  6. __be64 write_va;
  7. __be32 read_stag; /* read rkey */
  8. __be64 read_va;
  9. } __packed;
  10. /*Constant PDU lengths calculations */
  11. #define ISER_HEADERS_LEN (sizeof(struct iser_hdr) + sizeof(struct iscsi_hdr))
  12. #define ISER_RECV_DATA_SEG_LEN 8192
  13. #define ISER_RX_PAYLOAD_SIZE (ISER_HEADERS_LEN + ISER_RECV_DATA_SEG_LEN)
  14. #define ISER_RX_LOGIN_SIZE (ISER_HEADERS_LEN + ISCSI_DEF_MAX_RECV_SEG_LEN)
  15. /* QP settings */
  16. /* Maximal bounds on received asynchronous PDUs */
  17. #define ISERT_MAX_TX_MISC_PDUS 4 /* NOOP_IN(2) , ASYNC_EVENT(2) */
  18. #define ISERT_MAX_RX_MISC_PDUS 6 /* NOOP_OUT(2), TEXT(1), *
  19. * SCSI_TMFUNC(2), LOGOUT(1) */
  20. #define ISCSI_DEF_XMIT_CMDS_MAX 128 /* from libiscsi.h, must be power of 2 */
  21. #define ISERT_QP_MAX_RECV_DTOS (ISCSI_DEF_XMIT_CMDS_MAX)
  22. #define ISERT_MIN_POSTED_RX (ISCSI_DEF_XMIT_CMDS_MAX >> 2)
  23. #define ISERT_INFLIGHT_DATAOUTS 8
  24. #define ISERT_QP_MAX_REQ_DTOS (ISCSI_DEF_XMIT_CMDS_MAX * \
  25. (1 + ISERT_INFLIGHT_DATAOUTS) + \
  26. ISERT_MAX_TX_MISC_PDUS + \
  27. ISERT_MAX_RX_MISC_PDUS)
  28. #define ISER_RX_PAD_SIZE (ISER_RECV_DATA_SEG_LEN + 4096 - \
  29. (ISER_RX_PAYLOAD_SIZE + sizeof(u64) + sizeof(struct ib_sge)))
  30. #define ISER_VER 0x10
  31. #define ISER_WSV 0x08
  32. #define ISER_RSV 0x04
  33. #define ISCSI_CTRL 0x10
  34. #define ISER_HELLO 0x20
  35. #define ISER_HELLORPLY 0x30