From: Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Faisal Latif <faisal.latif-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH/libnes] Fix build against upstream libibverbs
Date: Thu, 5 May 2011 13:35:56 -0700 [thread overview]
Message-ID: <1304627756-13446-1-git-send-email-roland@kernel.org> (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.
Signed-off-by: Roland Dreier <roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org>
---
configure.in | 2 ++
src/nes_uverbs.c | 16 +++++++++++++++-
2 files changed, 17 insertions(+), 1 deletion(-)
Index: libnes-1.1.1/configure.in
===================================================================
--- libnes-1.1.1.orig/configure.in 2011-05-05 12:10:43.810368012 -0700
+++ libnes-1.1.1/configure.in 2011-05-05 12:11:13.990515182 -0700
@@ -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)
Index: libnes-1.1.1/src/nes_uverbs.c
===================================================================
--- libnes-1.1.1.orig/src/nes_uverbs.c 2011-05-05 12:11:20.280547877 -0700
+++ libnes-1.1.1/src/nes_uverbs.c 2011-05-05 12:12:59.411140500 -0700
@@ -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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2011-05-05 20:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-05 20:35 Roland Dreier [this message]
[not found] ` <1304627756-13446-1-git-send-email-roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2011-05-05 22:15 ` [PATCH/libnes] Fix build against upstream libibverbs Latif, Faisal
[not found] ` <2EFBCAEF10980645BBCFB605689E08E904DACB9183-uLM7Qlg6MbdZtRGVdHMbwrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2011-05-06 6:05 ` Roland Dreier
[not found] ` <BANLkTi=mN+sKnxHmriO3gt8E+PvQX8i9oQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-05-06 15:11 ` Latif, Faisal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1304627756-13446-1-git-send-email-roland@kernel.org \
--to=roland-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=faisal.latif-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox