@@ -285,47 +285,6 @@ int t3a_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr,
return ret;
}
-/*
- * XXX: This is going to be moved to firmware.
- * Missing pdid/qpid check for now.
- */
-static inline int iwch_sgl2pbl_map(struct iwch_device *rhp,
- struct ibv_sge *sg_list, uint32_t num_sgle,
- uint32_t *pbl_addr, uint8_t *page_size)
-{
- int i;
- struct iwch_mr *mhp;
- uint32_t offset;
- for (i = 0; i < num_sgle; i++) {
- mhp = rhp->mmid2ptr[t3_mmid(sg_list[i].lkey)];
- if (!mhp) {
- PDBG("%s %d\n", __FUNCTION__, __LINE__);
- return -1;
- }
- if (sg_list[i].addr < mhp->va_fbo) {
- PDBG("%s %d\n", __FUNCTION__, __LINE__);
- return -1;
- }
- if (sg_list[i].addr + ((uint64_t) sg_list[i].length) <
- sg_list[i].addr) {
- PDBG("%s %d\n", __FUNCTION__, __LINE__);
- return -1;
- }
- if (sg_list[i].addr + ((uint64_t) sg_list[i].length) >
- mhp->va_fbo + ((uint64_t) mhp->len)) {
- PDBG("%s %d\n", __FUNCTION__, __LINE__);
- return -1;
- }
- offset = sg_list[i].addr - mhp->va_fbo;
- offset += ((uint32_t) mhp->va_fbo) %
- (1UL << (12 + mhp->page_size));
- pbl_addr[i] = mhp->pbl_addr +
- (offset >> (12 + mhp->page_size));
- page_size[i] = mhp->page_size;
- }
- return 0;
-}
-
static inline int iwch_build_rdma_recv(struct iwch_device *rhp,
union t3_wr *wqe,
struct ibv_recv_wr *wr)
@@ -100,7 +100,6 @@ int open_test_device(void)
void test_register(void)
{
- int rc = 0;
int agent_id;
long method_mask[16 / sizeof(long)];
uint32_t class_oui = 0x001405; /* OPENIB_OUI */
@@ -215,6 +215,7 @@ int nes_udereg_mr(struct ibv_mr *mr)
return 0;
}
+#if HAVE_DECL_IBV_QPT_RAW_ETH
static
int nes_ima_ureplace_cq(struct ibv_cq *cq,
int mcrqf,
@@ -296,6 +297,7 @@ int nes_ima_ureplace_cq(struct ibv_cq *cq,
err:
return ret;
}
+#endif
/**
* nes_ucreate_cq
@@ -425,7 +427,6 @@ int nes_ima_upoll_cq(struct ibv_cq *cq, int num_entries, struct ibv_wc *entry)
int cqe_count = 0;
uint32_t head;
uint32_t cq_size;
- uint16_t qp_size;
volatile struct nes_hw_nic_cqe *cqe = 0;
volatile struct nes_hw_nic_cqe *cqes;
@@ -487,7 +488,6 @@ int nes_ima_upoll_cq(struct ibv_cq *cq, int num_entries, struct ibv_wc *entry)
entry->src_qp = nesuqp->qp_id;
if (cqe_misc & NES_NIC_CQE_SQ) {
entry->opcode = IBV_WC_SEND;
- qp_size = nesuqp->sq_size;
entry->wr_id =
nesuqp->send_wr_id[nesuqp->sq_tail];
@@ -557,7 +557,6 @@ int nes_upoll_cq(struct ibv_cq *cq, int num_entries, struct ibv_wc *entry)
uint32_t wqe_index;
uint32_t wq_tail = 0;
struct nes_hw_cqe cqe;
- uint32_t tmp;
uint64_t u64temp;
int move_cq_head = 1;
uint32_t err_code;
@@ -679,7 +678,6 @@ nes_upoll_cq_update:
nesvctx = to_nes_uctx(cq->context);
nesvctx->nesupd->udoorbell->cqe_alloc = cpu_to_le32(nesucq->cq_id |
(nesucq->polled_completions << 16));
- tmp = nesvctx->nesupd->udoorbell->cqe_alloc;
nesucq->polled_completions = 0;
}
} else {
@@ -699,7 +697,6 @@ nes_upoll_cq_update:
nesvctx = to_nes_uctx(cq->context);
nesvctx->nesupd->udoorbell->cqe_alloc = cpu_to_le32(nesucq->cq_id |
(nesucq->polled_completions << 16));
- tmp = nesvctx->nesupd->udoorbell->cqe_alloc;
nesucq->polled_completions = 0;
}
nesucq->head = head;
@@ -1140,7 +1137,6 @@ struct ibv_qp *nes_ucreate_qp(struct ibv_pd *pd, struct ibv_qp_init_attr *attr)
struct nes_uqp *nesuqp;
int sqdepth, rqdepth;
int status = 1;
- int i = 0;
/* fprintf(stderr, PFX "%s\n", __FUNCTION__); */
@@ -1211,6 +1207,8 @@ struct ibv_qp *nes_ucreate_qp(struct ibv_pd *pd, struct ibv_qp_init_attr *attr)
#if HAVE_DECL_IBV_QPT_RAW_ETH
if (attr->qp_type == IBV_QPT_RAW_ETH) {
+ int i = 0;
+
nesuqp->nes_ud_sksq_fd = open("/dev/infiniband/nes_ud_sksq",
O_RDWR);
if (nesuqp->nes_ud_sksq_fd <= 0)
@@ -1327,7 +1325,6 @@ int nes_udestroy_qp(struct ibv_qp *qp)
{
struct nes_uqp *nesuqp = to_nes_uqp(qp);
int ret = 0;
- int i = 0;
// fprintf(stderr, PFX "%s addr&mr= %p \n", __FUNCTION__, &nesuqp->mr );
@@ -1353,6 +1350,8 @@ int nes_udestroy_qp(struct ibv_qp *qp)
#if HAVE_DECL_IBV_QPT_RAW_ETH
if (qp->qp_type == IBV_QPT_RAW_ETH) {
+ int i = 0;
+
if (nesuqp->pend_rx_wr) {
for (i = 0; i < NES_UD_RX_BATCH_SZ; i++)
if (nesuqp->pend_rx_wr[i].sg_list) {
@@ -1381,6 +1380,7 @@ int nes_udestroy_qp(struct ibv_qp *qp)
return 0;
}
+#if HAVE_DECL_IBV_QPT_RAW_ETH
static inline
int nes_ima_upost_send(struct ibv_qp *ib_qp, struct ibv_send_wr *ib_wr,
struct ibv_send_wr **bad_wr)
@@ -1457,6 +1457,7 @@ int nes_ima_upost_send(struct ibv_qp *ib_qp, struct ibv_send_wr *ib_wr,
out:
return ret;
}
+#endif
/**
* nes_upost_send
@@ -1653,6 +1654,7 @@ int nes_upost_send(struct ibv_qp *ib_qp, struct ibv_send_wr *ib_wr,
return err;
}
+#if HAVE_DECL_IBV_QPT_RAW_ETH
static inline
int nes_ima_upost_recv(struct ibv_qp *ib_qp, struct ibv_recv_wr *ib_wr,
struct ibv_recv_wr **bad_wr)
@@ -1727,6 +1729,7 @@ int nes_ima_upost_recv(struct ibv_qp *ib_qp, struct ibv_recv_wr *ib_wr,
out:
return ret;
}
+#endif
/**
* nes_upost_recv
@@ -945,10 +945,11 @@ static inline void *ocrdma_hwq_head(struct ocrdma_qp_hwq_info *q)
return q->va + (q->head * q->entry_size);
}
-static inline void *ocrdma_wq_tail(struct ocrdma_qp_hwq_info *q)
+/*static inline void *ocrdma_wq_tail(struct ocrdma_qp_hwq_info *q)
{
return q->va + (q->tail * q->entry_size);
}
+*/
static inline void *ocrdma_hwq_head_from_idx(struct ocrdma_qp_hwq_info *q,
uint32_t idx)
@@ -128,13 +128,6 @@ static inline int __list_empty(struct work_list *list)
return list->list.next == &list->list;
}
-static inline int list_empty(struct work_list *work_list)
-{
- pthread_mutex_lock(&work_list->lock);
- return work_list->list.next == &work_list->list;
- pthread_mutex_unlock(&work_list->lock);
-}
-
static inline struct list_head *__list_remove_head(struct work_list *work_list)
{
struct list_head *list_item;
@@ -144,15 +137,6 @@ static inline struct list_head *__list_remove_head(struct work_list *work_list)
return list_item;
}
-static inline struct list_head *list_remove_head(struct work_list *work_list)
-{
- struct list_head *list_item;
- pthread_mutex_lock(&work_list->lock);
- list_item = __list_remove_head(work_list);
- pthread_mutex_unlock(&work_list->lock);
- return list_item;
-}
-
static inline void list_add_tail(struct work_list *work_list, struct list_head *req)
{
int empty;
Mostly just delete cruft. nes has a number of unused related to HAVE_DECL_IBV_QPT_RAW_ETH, perhaps this code should be deleted entirely because whatever QPT_RAW_ETH is, it is not part of this repository. Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> --- libcxgb3/src/qp.c | 41 -------------------------------------- libibumad/tests/umad_reg2_compat.c | 1 - libnes/src/nes_uverbs.c | 17 +++++++++------- libocrdma/src/ocrdma_verbs.c | 3 ++- librdmacm/examples/cmtime.c | 16 --------------- 5 files changed, 12 insertions(+), 66 deletions(-)