Skip to contentSkip to conversation

Fix build against upstream libibverbs

PATCH/libnes Roland Dreier 2 participants 4 messages May 5, 2011 – May 6, 2011 3 messages not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

Upstream libibverbs has not merged support for IBV_QPT_RAW_ETH yet. Add a test for the identifier to the configure script, and add #ifdefs to compile raw Ethernet QP support only if libibverbs supports it.

---
 configure.in     |    2 ++
 src/nes_uverbs.c |   16 +++++++++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)
configure.in +2 -0
Index: libnes-1.1.1/configure.in
===================================================================
@@ -38,6 +38,8 @@
 AC_C_CONST
 AC_CHECK_SIZEOF(long)
 
+AC_CHECK_DECLS([IBV_QPT_RAW_ETH])
+
 dnl Checks for library functions
 AC_CHECK_FUNCS(ibv_read_sysfs_file ibv_register_driver)
 
src/nes_uverbs.c +15 -1
Index: libnes-1.1.1/src/nes_uverbs.c
===================================================================
@@ -1125,12 +1125,16 @@
 	int i = 0;
 
 	/* fprintf(stderr, PFX "%s\n", __FUNCTION__); */
+
+#if HAVE_DECL_IBV_QPT_RAW_ETH
 	if (attr->qp_type == IBV_QPT_RAW_ETH) {
 		attr->cap.max_send_sge = NES_UD_MAX_SG_LIST_SZ;
 		attr->cap.max_recv_sge = NES_UD_MAX_SG_LIST_SZ;
 		nes_debug(NES_DBG_UD, "%s(%d) patching max_sge for UD\n",
 				__func__, __LINE__);
 	}
+#endif
+
 	/* Sanity check QP size before proceeding */
 	sqdepth = nes_qp_get_qdepth(attr->cap.max_send_wr, attr->cap.max_send_sge);
 	if (!sqdepth) {
@@ -1186,6 +1190,7 @@
 	nesuqp->nes_drv_opt = resp.nes_drv_opt;
 	nesuqp->ibv_qp.qp_num = resp.qp_id;
 
+#if HAVE_DECL_IBV_QPT_RAW_ETH
 	if (attr->qp_type == IBV_QPT_RAW_ETH) {
 		nesuqp->nes_ud_sksq_fd = open("/dev/infiniband/nes_ud_sksq",
 						O_RDWR);
@@ -1233,6 +1238,8 @@
 		memset(&nesuqp->send_wr_id[0], 0, sizeof(uint64_t) * 512);
 		memset(&nesuqp->recv_wr_id[0], 0, sizeof(uint64_t) * 512);
 	}
+#endif
+
 	return &nesuqp->ibv_qp;
 }
 
@@ -1324,6 +1331,8 @@
 	}
 
 	pthread_spin_destroy(&nesuqp->lock);
+
+#if HAVE_DECL_IBV_QPT_RAW_ETH
 	if (qp->qp_type == IBV_QPT_RAW_ETH) {
 		if (nesuqp->pend_rx_wr) {
 			for (i = 0; i < NES_UD_RX_BATCH_SZ; i++)
@@ -1340,6 +1349,8 @@
 		nesuqp->sksq_shared_ctxt = 0;
 		close(nesuqp->nes_ud_sksq_fd);
 	}
+#endif
+
 	/* Clean any pending completions from the cq(s) */
 	if (nesuqp->send_cq)
 		nes_clean_cq(nesuqp, nesuqp->send_cq);
@@ -1447,8 +1458,10 @@
 	uint32_t total_payload_length = 0;
 	int sge_index;
 
+#if HAVE_DECL_IBV_QPT_RAW_ETH
 	if (ib_qp->qp_type == IBV_QPT_RAW_ETH)
 		return nes_ima_upost_send(ib_qp, ib_wr, bad_wr);
+#endif
 
 	pthread_spin_lock(&nesuqp->lock);
 
@@ -1715,9 +1728,10 @@
 	uint32_t total_payload_length;
 	int sge_index;
 
-
+#if HAVE_DECL_IBV_QPT_RAW_ETH
 	if (ib_qp->qp_type == IBV_QPT_RAW_ETH)
 		return nes_ima_upost_recv(ib_qp, ib_wr, bad_wr);
+#endif
 
 	if (unlikely(ib_wr->num_sge > 4)) {
 		*bad_wr = ib_wr;

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1304627756-13446-1-git-send-email-roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

Acked-by
#2 lore raw

Roland Dreier wrote

Quoted 6 lines

Upstream libibverbs has not merged support for IBV_QPT_RAW_ETH yet. Add a test for the identifier to the configure script, and add #ifdefs to compile raw Ethernet QP support only if libibverbs supports it.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 2EFBCAEF10980645BBCFB605689E08E904DACB9183-uLM7Qlg6MbdZtRGVdHMbwrfspsVTdybXVpNB7YpNyf8@public.gmane.org

#4 lore raw
Quoted 1 line · Faisal

Thanks... does this mean you're going to merge it? (I'm assuming that

git://git.openfabrics.org/~flatif/libnes.git

is the upstream tree for libnes, and that you are the owner -- if someone else is handling libnes, let me know and I will send the patch on to them)

Thanks,
Roland
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): BANLkTi=mN+sKnxHmriO3gt8E+PvQX8i9oQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#6 lore raw
Quoted 14 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Roland Dreier
Sent: Friday, May 06, 2011 1:06 AM
To: Latif, Faisal
Cc: [email protected]
Subject: Re: [PATCH/libnes] Fix build against upstream libibverbs

Quoted 1 line · Faisal
Quoted 8 lines

Thanks... does this mean you're going to merge it? (I'm assuming that

git://git.openfabrics.org/~flatif/libnes.git

is the upstream tree for libnes, and that you are the owner -- if someone
else is handling libnes, let me know and I will send the patch on to them)

I will apply the patch.

Quoted 2 lines

Thanks,
Roland

Thanks
Faisal

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html