Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Nov 2012 22:02:29 +0100
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Xin LI <delphij@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r242842 - in head/sys: conf modules/mthca
Message-ID:  <509EC0E5.6040109@FreeBSD.org>
In-Reply-To: <201211100032.qAA0Wlvw090497@svn.freebsd.org>
References:  <201211100032.qAA0Wlvw090497@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------030108040104080601000702
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 2012-11-10 01:32, Xin LI wrote:
> Author: delphij
> Date: Sat Nov 10 00:32:47 2012
> New Revision: 242842
> URL: http://svnweb.freebsd.org/changeset/base/242842
>
> Log:
>    Attempt toward a buildable universe by silenting a few warnings for OFED.
...
> -OFEDNOERR=	-Wno-cast-qual -Wno-pointer-arith -fms-extensions
> +OFEDNOERR=	-Wno-cast-qual -Wno-pointer-arith -fms-extensions -Wno-switch -Wno-sometimes-uninitialized -Wno-conversion -Wno-initializer-overrides

A few of these warnings point to real bugs, e.g. the uninitialized
packet_length variable in ib_ud_header_init(), and the incorrect value
passed to rdma_notify() in sdp_rx_comp_work().  The others are not that
severe, but very easy to fix, as you can see from the attached diff.

If anything, I hope the maintainer(s) will check with upstream whether
these bugs are already fixed?  Meanwhile, I see no reason why we could
not do a local fix.

--------------030108040104080601000702
Content-Type: text/x-diff;
 name="fix-ofed-warn-1.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="fix-ofed-warn-1.diff"

Index: sys/conf/kern.pre.mk
===================================================================
--- sys/conf/kern.pre.mk	(revision 242861)
+++ sys/conf/kern.pre.mk	(working copy)
@@ -156,7 +156,7 @@ NORMAL_LINT=	${LINT} ${LINTFLAGS} ${CFLAGS:M-[DIU]
 # Infiniband C flags.  Correct include paths and omit errors that linux
 # does not honor.
 OFEDINCLUDES=	-I$S/ofed/include/
-OFEDNOERR=	-Wno-cast-qual -Wno-pointer-arith -fms-extensions -Wno-switch -Wno-sometimes-uninitialized -Wno-conversion -Wno-initializer-overrides
+OFEDNOERR=	-Wno-cast-qual -Wno-pointer-arith -fms-extensions
 OFEDCFLAGS=	${CFLAGS:N-I*} ${OFEDINCLUDES} ${CFLAGS:M-I*} ${OFEDNOERR}
 OFED_C_NOIMP=	${CC} -c -o ${.TARGET} ${OFEDCFLAGS} ${WERROR} ${PROF}
 OFED_C=		${OFED_C_NOIMP} ${.IMPSRC}
Index: sys/modules/mthca/Makefile
===================================================================
--- sys/modules/mthca/Makefile	(revision 242861)
+++ sys/modules/mthca/Makefile	(working copy)
@@ -28,4 +28,4 @@ opt_inet6.h:
 
 .include <bsd.kmod.mk>
 
-CFLAGS+= -Wno-cast-qual -Wno-pointer-arith -fms-extensions  -Wno-switch -Wno-sometimes-uninitialized -Wno-conversion -Wno-initializer-overrides
+CFLAGS+= -Wno-cast-qual -Wno-pointer-arith -fms-extensions
Index: sys/ofed/drivers/infiniband/core/cma.c
===================================================================
--- sys/ofed/drivers/infiniband/core/cma.c	(revision 242861)
+++ sys/ofed/drivers/infiniband/core/cma.c	(working copy)
@@ -1312,7 +1312,7 @@ static int cma_iw_handler(struct iw_cm_id *iw_id,
 		*sin = iw_event->local_addr;
 		sin = (struct sockaddr_in *) &id_priv->id.route.addr.dst_addr;
 		*sin = iw_event->remote_addr;
-		switch (iw_event->status) {
+		switch ((int)iw_event->status) {
 		case 0:
 			event.event = RDMA_CM_EVENT_ESTABLISHED;
 			break;
Index: sys/ofed/drivers/infiniband/core/ud_header.c
===================================================================
--- sys/ofed/drivers/infiniband/core/ud_header.c	(revision 242861)
+++ sys/ofed/drivers/infiniband/core/ud_header.c	(working copy)
@@ -230,7 +230,7 @@ void ib_ud_header_init(int     		    payload_bytes
 		       int		    immediate_present,
 		       struct ib_ud_header *header)
 {
-	u16 packet_length;
+	u16 packet_length = 0;
 
 	memset(header, 0, sizeof *header);
 
Index: sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c
===================================================================
--- sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c	(revision 242861)
+++ sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c	(working copy)
@@ -590,7 +590,7 @@ sdp_rx_comp_work(struct work_struct *work)
 	if (unlikely(!ssk->poll_cq)) {
 		struct rdma_cm_id *id = ssk->id;
 		if (id && id->qp)
-			rdma_notify(id, RDMA_CM_EVENT_ESTABLISHED);
+			rdma_notify(id, IB_EVENT_COMM_EST);
 		goto out;
 	}
 
Index: sys/ofed/include/linux/pci.h
===================================================================
--- sys/ofed/include/linux/pci.h	(revision 242861)
+++ sys/ofed/include/linux/pci.h	(working copy)
@@ -73,10 +73,12 @@ struct pci_device_id {
 #define	PCI_DEVICE_ID_MELLANOX_SINAI		0x6274
 
 
-#define PCI_VDEVICE(vendor, device)					\
-	    PCI_VENDOR_ID_##vendor, (device), PCI_ANY_ID, PCI_ANY_ID, 0, 0
-#define	PCI_DEVICE(vendor, device)					\
-	    (vendor), (device), PCI_ANY_ID, PCI_ANY_ID, 0, 0
+#define PCI_VDEVICE(_vendor, _device)					\
+	    .vendor = PCI_VENDOR_ID_##_vendor, .device = (_device),	\
+	    .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID
+#define	PCI_DEVICE(_vendor, _device)					\
+	    .vendor = (_vendor), .device = (_device),			\
+	    .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID
 
 #define	to_pci_dev(n)	container_of(n, struct pci_dev, dev)
 

--------------030108040104080601000702--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?509EC0E5.6040109>