8 #include <linux/slab.h>
12 #define RDS_FMR_SIZE 256
13 #define RDS_FMR_POOL_SIZE 8192
15 #define RDS_IB_MAX_SGE 8
16 #define RDS_IB_RECV_SGE 2
18 #define RDS_IB_DEFAULT_RECV_WR 1024
19 #define RDS_IB_DEFAULT_SEND_WR 256
21 #define RDS_IB_DEFAULT_RETRY_COUNT 2
23 #define RDS_IB_SUPPORTED_PROTOCOLS 0x00000003
25 #define RDS_IB_RECYCLE_BATCH_COUNT 32
130 #ifdef KERNEL_HAS_ATOMIC64
160 #define IB_GET_SEND_CREDITS(v) ((v) & 0xffff)
161 #define IB_GET_POST_CREDITS(v) ((v) >> 16)
162 #define IB_SET_SEND_CREDITS(v) ((v) & 0xffff)
163 #define IB_SET_POST_CREDITS(v) ((v) << 16)
189 #define ibdev_to_node(ibdev) dev_to_node(ibdev->dma_device)
190 #define rdsibdev_to_node(rdsibdev) ibdev_to_node(rdsibdev->dev)
193 #define IB_ACK_IN_FLIGHT 0
194 #define IB_ACK_REQUESTED 1
197 #define RDS_IB_ACK_WR_ID (~(u64) 0)
237 static inline void rds_ib_dma_sync_sg_for_cpu(
struct ib_device *
dev,
243 ib_dma_sync_single_for_cpu(dev,
244 ib_sg_dma_address(dev, &sg[i]),
245 ib_sg_dma_len(dev, &sg[i]),
249 #define ib_dma_sync_sg_for_cpu rds_ib_dma_sync_sg_for_cpu
251 static inline void rds_ib_dma_sync_sg_for_device(
struct ib_device *
dev,
257 ib_dma_sync_single_for_device(dev,
258 ib_sg_dma_address(dev, &sg[i]),
259 ib_sg_dma_len(dev, &sg[i]),
263 #define ib_dma_sync_sg_for_device rds_ib_dma_sync_sg_for_device
294 #define rds_ib_conn_error(conn, fmt...) \
295 __rds_ib_conn_error(conn, KERN_WARNING "RDS/IB: " fmt)
346 unsigned int hdr_off,
unsigned int sg,
unsigned int off);
354 u32 *adv_credits,
int need_posted,
int max_posted);
359 #define rds_ib_stats_inc(member) rds_stats_inc_which(rds_ib_stats, member)