X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lnet%2Fklnds%2Fo2iblnd%2Fo2iblnd.h;h=fd6f97cf46c257dc32c75fc390bdefa4116956bf;hp=ddee13d46cd6587338095c047d81264444644e81;hb=bbc2cf593b83f5f1822889ef5c910906aadbe735;hpb=51965d73a7ab75bc0f11c7c180d35a68f5571670 diff --git a/lnet/klnds/o2iblnd/o2iblnd.h b/lnet/klnds/o2iblnd/o2iblnd.h index ddee13d..fd6f97c 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.h +++ b/lnet/klnds/o2iblnd/o2iblnd.h @@ -43,7 +43,6 @@ #endif -#include #include #include #include @@ -65,9 +64,6 @@ #include #include #include -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32) -#include -#endif #include #include @@ -162,8 +158,7 @@ extern struct kib_tunables kiblnd_tunables; #define IBLND_RECV_WRS(c) IBLND_RX_MSGS(c) /* 2 = LNet msg + Transfer chain */ -#define IBLND_CQ_ENTRIES(c) \ - (IBLND_RECV_WRS(c) + 2 * c->ibc_queue_depth) +#define IBLND_CQ_ENTRIES(c) (IBLND_RECV_WRS(c) + kiblnd_send_wrs(c)) struct kib_hca_dev; @@ -565,7 +560,7 @@ struct kib_rx { /* receive message */ /* message buffer (I/O addr) */ __u64 rx_msgaddr; /* for dma_unmap_single() */ - DECLARE_PCI_UNMAP_ADDR(rx_msgunmap); + DEFINE_DMA_UNMAP_ADDR(rx_msgunmap); /* receive work item... */ struct ib_recv_wr rx_wrq; /* ...and its memory */ @@ -605,7 +600,7 @@ struct kib_tx { /* transmit message */ /* message buffer (I/O addr) */ __u64 tx_msgaddr; /* for dma_unmap_single() */ - DECLARE_PCI_UNMAP_ADDR(tx_msgunmap); + DEFINE_DMA_UNMAP_ADDR(tx_msgunmap); /** sge for tx_msgaddr */ struct ib_sge tx_msgsge; /* # send work items */ @@ -696,6 +691,8 @@ struct kib_conn { struct list_head ibc_tx_queue_rsrvd; /* active tx awaiting completion */ struct list_head ibc_active_txs; + /* zombie tx awaiting done */ + struct list_head ibc_zombie_txs; /* serialise */ spinlock_t ibc_lock; /* the rx descs */ @@ -777,6 +774,26 @@ extern void kiblnd_hdev_destroy(struct kib_hca_dev *hdev); int kiblnd_msg_queue_size(int version, struct lnet_ni *ni); +static inline int +kiblnd_concurrent_sends(int version, struct lnet_ni *ni) +{ + struct lnet_ioctl_config_o2iblnd_tunables *tunables; + int concurrent_sends; + + tunables = &ni->ni_lnd_tunables.lnd_tun_u.lnd_o2ib; + concurrent_sends = tunables->lnd_concurrent_sends; + + if (version == IBLND_MSG_VERSION_1) { + if (concurrent_sends > IBLND_MSG_QUEUE_SIZE_V1 * 2) + return IBLND_MSG_QUEUE_SIZE_V1 * 2; + + if (concurrent_sends < IBLND_MSG_QUEUE_SIZE_V1 / 2) + return IBLND_MSG_QUEUE_SIZE_V1 / 2; + } + + return concurrent_sends; +} + static inline void kiblnd_hdev_addref_locked(struct kib_hca_dev *hdev) { @@ -1105,6 +1122,12 @@ static inline void kiblnd_dma_unmap_sg(struct ib_device *dev, ib_dma_unmap_sg(dev, sg, nents, direction); } +#ifndef HAVE_IB_SG_DMA_ADDRESS +#include +#define ib_sg_dma_address(dev, sg) sg_dma_address((dev), (sg)) +#define ib_sg_dma_len(dev, sg) sg_dma_len((dev), (sg)) +#endif + static inline __u64 kiblnd_sg_dma_address(struct ib_device *dev, struct scatterlist *sg) { @@ -1124,6 +1147,7 @@ static inline unsigned int kiblnd_sg_dma_len(struct ib_device *dev, #define KIBLND_CONN_PARAM(e) ((e)->param.conn.private_data) #define KIBLND_CONN_PARAM_LEN(e) ((e)->param.conn.private_data_len) +void kiblnd_abort_txs(struct kib_conn *conn, struct list_head *txs); void kiblnd_map_rx_descs(struct kib_conn *conn); void kiblnd_unmap_rx_descs(struct kib_conn *conn); void kiblnd_pool_free_node(struct kib_pool *pool, struct list_head *node);