smc_rx.h 715 B

12345678910111213141516171819202122232425262728293031
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Shared Memory Communications over RDMA (SMC-R) and RoCE
  4. *
  5. * Manage RMBE
  6. *
  7. * Copyright IBM Corp. 2016
  8. *
  9. * Author(s): Ursula Braun <ubraun@linux.vnet.ibm.com>
  10. */
  11. #ifndef SMC_RX_H
  12. #define SMC_RX_H
  13. #include <linux/socket.h>
  14. #include <linux/types.h>
  15. #include "smc.h"
  16. void smc_rx_init(struct smc_sock *smc);
  17. int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg,
  18. struct pipe_inode_info *pipe, size_t len, int flags);
  19. int smc_rx_wait(struct smc_sock *smc, long *timeo,
  20. int (*fcrit)(struct smc_connection *conn));
  21. static inline int smc_rx_data_available(struct smc_connection *conn)
  22. {
  23. return atomic_read(&conn->bytes_to_rcv);
  24. }
  25. #endif /* SMC_RX_H */