#include <linux/atomic.h>
#include <linux/hashtable.h>
#include <linux/wait.h>
#include <rdma/ib_verbs.h>
#include <asm/div64.h>
#include "smc.h"
#include "smc_wr.h"
#define SMC_WR_MAX_POLL_CQE …
#define SMC_WR_RX_HASH_BITS …
static DEFINE_HASHTABLE(smc_wr_rx_hash, SMC_WR_RX_HASH_BITS);
static DEFINE_SPINLOCK(smc_wr_rx_hash_lock);
struct smc_wr_tx_pend { … };
static inline bool smc_wr_is_tx_pend(struct smc_link *link)
{ … }
void smc_wr_tx_wait_no_pending_sends(struct smc_link *link)
{ … }
static inline int smc_wr_tx_find_pending_index(struct smc_link *link, u64 wr_id)
{ … }
static inline void smc_wr_tx_process_cqe(struct ib_wc *wc)
{ … }
static void smc_wr_tx_tasklet_fn(struct tasklet_struct *t)
{ … }
void smc_wr_tx_cq_handler(struct ib_cq *ib_cq, void *cq_context)
{ … }
static inline int smc_wr_tx_get_free_slot_index(struct smc_link *link, u32 *idx)
{ … }
int smc_wr_tx_get_free_slot(struct smc_link *link,
smc_wr_tx_handler handler,
struct smc_wr_buf **wr_buf,
struct smc_rdma_wr **wr_rdma_buf,
struct smc_wr_tx_pend_priv **wr_pend_priv)
{ … }
int smc_wr_tx_get_v2_slot(struct smc_link *link,
smc_wr_tx_handler handler,
struct smc_wr_v2_buf **wr_buf,
struct smc_wr_tx_pend_priv **wr_pend_priv)
{ … }
int smc_wr_tx_put_slot(struct smc_link *link,
struct smc_wr_tx_pend_priv *wr_pend_priv)
{ … }
int smc_wr_tx_send(struct smc_link *link, struct smc_wr_tx_pend_priv *priv)
{ … }
int smc_wr_tx_v2_send(struct smc_link *link, struct smc_wr_tx_pend_priv *priv,
int len)
{ … }
int smc_wr_tx_send_wait(struct smc_link *link, struct smc_wr_tx_pend_priv *priv,
unsigned long timeout)
{ … }
int smc_wr_reg_send(struct smc_link *link, struct ib_mr *mr)
{ … }
int smc_wr_rx_register_handler(struct smc_wr_rx_handler *handler)
{ … }
static inline void smc_wr_rx_demultiplex(struct ib_wc *wc)
{ … }
static inline void smc_wr_rx_process_cqes(struct ib_wc wc[], int num)
{ … }
static void smc_wr_rx_tasklet_fn(struct tasklet_struct *t)
{ … }
void smc_wr_rx_cq_handler(struct ib_cq *ib_cq, void *cq_context)
{ … }
int smc_wr_rx_post_init(struct smc_link *link)
{ … }
void smc_wr_remember_qp_attr(struct smc_link *lnk)
{ … }
static void smc_wr_init_sge(struct smc_link *lnk)
{ … }
void smc_wr_free_link(struct smc_link *lnk)
{ … }
void smc_wr_free_lgr_mem(struct smc_link_group *lgr)
{ … }
void smc_wr_free_link_mem(struct smc_link *lnk)
{ … }
int smc_wr_alloc_lgr_mem(struct smc_link_group *lgr)
{ … }
int smc_wr_alloc_link_mem(struct smc_link *link)
{ … }
void smc_wr_remove_dev(struct smc_ib_device *smcibdev)
{ … }
void smc_wr_add_dev(struct smc_ib_device *smcibdev)
{ … }
static void smcr_wr_tx_refs_free(struct percpu_ref *ref)
{ … }
static void smcr_wr_reg_refs_free(struct percpu_ref *ref)
{ … }
int smc_wr_create_link(struct smc_link *lnk)
{ … }