PERFORCE change 131321 for review

Kip Macy kmacy at FreeBSD.org
Thu Dec 20 11:20:56 PST 2007


http://perforce.freebsd.org/chv.cgi?CH=131321

Change 131321 by kmacy at kmacy:entropy:iwarp on 2007/12/20 19:20:04

	compile fixes for problems created by last integrate

Affected files ...

.. //depot/projects/iwarp/sys/contrib/rdma/ib_user_verbs.h#3 edit
.. //depot/projects/iwarp/sys/contrib/rdma/ib_verbs.h#6 edit
.. //depot/projects/iwarp/sys/contrib/rdma/types.h#1 add
.. //depot/projects/iwarp/sys/dev/cxgb/cxgb_osdep.h#6 edit
.. //depot/projects/iwarp/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cxio_dbg.c#2 edit
.. //depot/projects/iwarp/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cxio_hal.h#4 edit
.. //depot/projects/iwarp/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cxio_wr.h#2 edit
.. //depot/projects/iwarp/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_iwch.c#3 edit
.. //depot/projects/iwarp/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_iwch_cm.c#4 edit
.. //depot/projects/iwarp/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_iwch_user.h#2 edit
.. //depot/projects/iwarp/sys/modules/cxgb/Makefile#4 edit
.. //depot/projects/iwarp/sys/modules/cxgb/tom/Makefile#3 edit
.. //depot/projects/iwarp/sys/sys/linux_compat.h#9 edit
.. //depot/projects/iwarp/sys/sys/linux_pci.h#3 edit

Differences ...

==== //depot/projects/iwarp/sys/contrib/rdma/ib_user_verbs.h#3 (text+ko) ====

@@ -38,6 +38,8 @@
 #ifndef IB_USER_VERBS_H
 #define IB_USER_VERBS_H
 
+#include <contrib/rdma/types.h>
+
 
 /*
  * Increment this value if any changes that break userspace ABI

==== //depot/projects/iwarp/sys/contrib/rdma/ib_verbs.h#6 (text+ko) ====

@@ -42,6 +42,7 @@
 #if !defined(IB_VERBS_H)
 #define IB_VERBS_H
 
+#include <contrib/rdma/types.h>
 #include <sys/linux_atomic.h>
 #include <sys/linux_compat.h>
 #include <sys/linux_pci.h>

==== //depot/projects/iwarp/sys/dev/cxgb/cxgb_osdep.h#6 (text+ko) ====

@@ -355,10 +355,11 @@
 #define simple_strtoul strtoul
 
 
-typedef uint8_t u8;
-typedef uint16_t u16;
-typedef uint32_t u32;
-typedef uint64_t u64;
+#ifndef LINUX_TYPES_DEFINED
+typedef uint8_t 	u8;
+typedef uint16_t 	u16;
+typedef uint32_t 	u32;
+typedef uint64_t 	u64;
  
 typedef uint8_t		__u8;
 typedef uint16_t	__u16;
@@ -367,6 +368,7 @@
 typedef uint16_t	__be16;
 typedef uint32_t	__be32;
 typedef uint64_t	__be64;
+#endif
 
 
 #if BYTE_ORDER == BIG_ENDIAN

==== //depot/projects/iwarp/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cxio_dbg.c#2 (text+ko) ====

@@ -88,7 +88,7 @@
 #include <dev/cxgb/ulp/iw_cxgb/iw_cxgb_iwch_user.h>
 #endif
 
-void cxio_dump_tpt(struct cxio_rdev *rdev, u32 stag)
+void cxio_dump_tpt(struct cxio_rdev *rdev, uint32_t stag)
 {
 	struct ch_mem_range *m;
 	u64 *data;
@@ -107,7 +107,7 @@
 	rc = rdev->t3cdev_p->ctl(rdev->t3cdev_p, RDMA_GET_MEM, m);
 	if (rc) {
 		PDBG("%s toectl returned error %d\n", __FUNCTION__, rc);
-		kfree(m);
+		free(m, M_DEVBUF);
 		return;
 	}
 
@@ -118,10 +118,10 @@
 		data++;
 		m->addr += 8;
 	}
-	kfree(m);
+	free(m, M_DEVBUF);
 }
 
-void cxio_dump_pbl(struct cxio_rdev *rdev, u32 pbl_addr, uint len, u8 shift)
+void cxio_dump_pbl(struct cxio_rdev *rdev, uint32_t pbl_addr, uint32_t len, u8 shift)
 {
 	struct ch_mem_range *m;
 	u64 *data;
@@ -145,7 +145,7 @@
 	rc = rdev->t3cdev_p->ctl(rdev->t3cdev_p, RDMA_GET_MEM, m);
 	if (rc) {
 		PDBG("%s toectl returned error %d\n", __FUNCTION__, rc);
-		kfree(m);
+		free(m, M_DEVBUF);
 		return;
 	}
 
@@ -156,13 +156,13 @@
 		data++;
 		m->addr += 8;
 	}
-	kfree(m);
+	free(m, M_DEVBUF);
 }
 
 void cxio_dump_wqe(union t3_wr *wqe)
 {
-	__be64 *data = (__be64 *)wqe;
-	uint size = (uint)(be64_to_cpu(*data) & 0xff);
+	uint64_t *data = (uint64_t *)wqe;
+	uint32_t size = (uint32_t)(be64_to_cpu(*data) & 0xff);
 
 	if (size == 0)
 		size = 8;
@@ -176,7 +176,7 @@
 
 void cxio_dump_wce(struct t3_cqe *wce)
 {
-	__be64 *data = (__be64 *)wce;
+	uint64_t *data = (uint64_t *)wce;
 	int size = sizeof(*wce);
 
 	while (size > 0) {
@@ -187,7 +187,7 @@
 	}
 }
 
-void cxio_dump_rqt(struct cxio_rdev *rdev, u32 hwtid, int nents)
+void cxio_dump_rqt(struct cxio_rdev *rdev, uint32_t hwtid, int nents)
 {
 	struct ch_mem_range *m;
 	int size = nents * 64;
@@ -206,7 +206,7 @@
 	rc = rdev->t3cdev_p->ctl(rdev->t3cdev_p, RDMA_GET_MEM, m);
 	if (rc) {
 		PDBG("%s toectl returned error %d\n", __FUNCTION__, rc);
-		kfree(m);
+		free(m, M_DEVBUF);
 		return;
 	}
 
@@ -217,14 +217,14 @@
 		data++;
 		m->addr += 8;
 	}
-	kfree(m);
+	free(m, M_DEVBUF);
 }
 
-void cxio_dump_tcb(struct cxio_rdev *rdev, u32 hwtid)
+void cxio_dump_tcb(struct cxio_rdev *rdev, uint32_t hwtid)
 {
 	struct ch_mem_range *m;
 	int size = TCB_SIZE;
-	u32 *data;
+	uint32_t *data;
 	int rc;
 
 	m = kmalloc(sizeof(*m) + size, M_NOWAIT);
@@ -239,13 +239,13 @@
 	rc = rdev->t3cdev_p->ctl(rdev->t3cdev_p, RDMA_GET_MEM, m);
 	if (rc) {
 		PDBG("%s toectl returned error %d\n", __FUNCTION__, rc);
-		kfree(m);
+		free(m, M_DEVBUF);
 		return;
 	}
 
-	data = (u32 *)m->buf;
+	data = (uint32_t *)m->buf;
 	while (size > 0) {
-		printk("%2u: %08x %08x %08x %08x %08x %08x %08x %08x\n",
+		printf("%2u: %08x %08x %08x %08x %08x %08x %08x %08x\n",
 			m->addr,
 			*(data+2), *(data+3), *(data),*(data+1),
 			*(data+6), *(data+7), *(data+4), *(data+5));
@@ -253,6 +253,6 @@
 		data += 8;
 		m->addr += 32;
 	}
-	kfree(m);
+	free(m, M_DEVBUF);
 }
 #endif

==== //depot/projects/iwarp/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cxio_hal.h#4 (text+ko) ====

@@ -152,7 +152,7 @@
 
 #ifdef DEBUG
 void cxio_dump_tpt(struct cxio_rdev *rev, u32 stag);
-void cxio_dump_pbl(struct cxio_rdev *rev, u32 pbl_addr, uint len, u8 shift);
+void cxio_dump_pbl(struct cxio_rdev *rev, u32 pbl_addr, uint32_t len, u8 shift);
 void cxio_dump_wqe(union t3_wr *wqe);
 void cxio_dump_wce(struct t3_cqe *wce);
 void cxio_dump_rqt(struct cxio_rdev *rdev, u32 hwtid, int nents);

==== //depot/projects/iwarp/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cxio_wr.h#2 (text+ko) ====

@@ -554,10 +554,10 @@
 						 /* mismatch) */
 
 struct t3_swsq {
-	__u64			wr_id;
+	uint64_t		wr_id;
 	struct t3_cqe		cqe;
-	__u32			sq_wptr;
-	__be32			read_len;
+	uint32_t		sq_wptr;
+	uint32_t		read_len;
 	int			opcode;
 	int			complete;
 	int			signaled;

==== //depot/projects/iwarp/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_iwch.c#3 (text+ko) ====

@@ -55,7 +55,6 @@
 
 #include <netinet/in.h>
 
-#include <sys/linux_compat.h>
 #include <contrib/rdma/ib_verbs.h>
 
 

==== //depot/projects/iwarp/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_iwch_cm.c#4 (text+ko) ====

@@ -1356,6 +1356,7 @@
 	struct rtentry *dst;
 	struct l2t_entry *l2t;
 	struct iff_mac tim;
+	struct sockaddr_in sin;
 
 	PDBG("%s parent ep %p tid %u\n", __FUNCTION__, parent_ep, hwtid);
 
@@ -1394,7 +1395,10 @@
 		goto reject;
 	}
 	printf("%s ifname |%s|\n", __FUNCTION__, dst->rt_ifp->if_xname);
-	l2t = t3_l2t_get(tdev, dst, dst->rt_ifp);
+	sin.sin_len = sizeof(struct sockaddr_in);
+	sin.sin_family = AF_INET;
+	sin.sin_addr.s_addr = req->peer_ip;
+	l2t = t3_l2t_get(tdev, dst, dst->rt_ifp, (struct sockaddr *)&sin);
 	if (l2t == NULL) {
 		printf("%s - failed to allocate l2t entry!\n", __FUNCTION__);
 		RTFREE(dst);
@@ -1871,7 +1875,8 @@
 	struct iwch_dev *h = to_iwch_dev(cm_id->device);
 	struct iwch_ep *ep;
 	struct rtentry *rt;
-
+	struct sockaddr_in sin;
+	
 	ep = alloc_ep(sizeof(*ep), M_NOWAIT);
 	if (!ep) {
 		printf("%s - cannot alloc ep.\n", __FUNCTION__);
@@ -1918,8 +1923,11 @@
 	ep->dst = rt;
 
 	/* get a l2t entry */
+	sin.sin_len = sizeof(struct sockaddr_in);
+	sin.sin_family = AF_INET;
+	sin.sin_addr.s_addr = cm_id->remote_addr.sin_addr.s_addr;
 	ep->l2t = t3_l2t_get(ep->com.tdev, ep->dst,
-			     ep->dst->rt_ifp);
+	    ep->dst->rt_ifp, (struct sockaddr *)&sin);
 	if (!ep->l2t) {
 		printf("%s - cannot alloc l2e.\n", __FUNCTION__);
 		err = ENOMEM;

==== //depot/projects/iwarp/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_iwch_user.h#2 (text+ko) ====

@@ -38,29 +38,29 @@
  * Make sure that all structs defined in this file remain laid out so
  * that they pack the same way on 32-bit and 64-bit architectures (to
  * avoid incompatibility between 32-bit userspace and 64-bit kernels).
- * In particular do not use pointer types -- pass pointers in __u64
+ * In particular do not use pointer types -- pass pointers in uint64_t
  * instead.
  */
 struct iwch_create_cq_req {
-	__u64 user_rptr_addr;
+	uint64_t user_rptr_addr;
 };
 
 struct iwch_create_cq_resp {
-	__u64 key;
-	__u32 cqid;
-	__u32 size_log2;
+	uint64_t key;
+	uint32_t cqid;
+	uint32_t size_log2;
 };
 
 struct iwch_create_qp_resp {
-	__u64 key;
-	__u64 db_key;
-	__u32 qpid;
-	__u32 size_log2;
-	__u32 sq_size_log2;
-	__u32 rq_size_log2;
+	uint64_t key;
+	uint64_t db_key;
+	uint32_t qpid;
+	uint32_t size_log2;
+	uint32_t sq_size_log2;
+	uint32_t rq_size_log2;
 };
 
 struct iwch_reg_user_mr_resp {
-	__u32 pbl_addr;
+	uint32_t pbl_addr;
 };
 #endif

==== //depot/projects/iwarp/sys/modules/cxgb/Makefile#4 (text+ko) ====

@@ -2,6 +2,6 @@
 SUBDIR= cxgb
 SUBDIR+= toecore
 SUBDIR+= tom
-#SUBDIR+= iw_cxgb
+SUBDIR+= iw_cxgb
 
 .include <bsd.subdir.mk>

==== //depot/projects/iwarp/sys/modules/cxgb/tom/Makefile#3 (text+ko) ====

@@ -6,7 +6,8 @@
 KMOD=	tom
 SRCS=   cxgb_tom.c cxgb_cpl_io.c cxgb_listen.c cxgb_tom_sysctl.c cxgb_cpl_socket.c
 #SRCS+=  cxgb_tcp_subr.c cxgb_tcp_usrreq.c
-SRCS+=	opt_compat.h opt_inet.h opt_inet6.h opt_ipsec.h opt_mac.h opt_tcpdebug.h opt_ddb.h
+SRCS+=	opt_compat.h opt_inet.h opt_inet6.h opt_ipsec.h opt_mac.h 
+SRCS+=	opt_tcpdebug.h opt_ddb.h opt_sched.h
 SRCS+=	device_if.h bus_if.h pci_if.h
 
 #CFLAGS+= -DDEBUG_PRINT -DDEBUG

==== //depot/projects/iwarp/sys/sys/linux_compat.h#9 (text+ko) ====

@@ -5,26 +5,6 @@
 #include <sys/bus_dma.h>
 #include <sys/mbuf.h>
 
-typedef uint8_t u8;
-typedef uint16_t u16;
-typedef uint32_t u32;
-typedef uint64_t u64;
-
-typedef uint8_t __u8;
-typedef uint16_t __u16;
-typedef uint32_t __u32;
-typedef uint64_t __u64;
-
-typedef int8_t __s8;
-typedef int16_t __s16;
-typedef int32_t __s32;
-typedef int64_t __s64;
-
-typedef uint8_t __be8;
-typedef uint16_t __be16;
-typedef uint32_t __be32;
-typedef uint64_t __be64;
-
 #define __attribute_const__
 #define rw_semaphore rwlock
 #define __user

==== //depot/projects/iwarp/sys/sys/linux_pci.h#3 (text+ko) ====

@@ -187,28 +187,28 @@
 #define PCI_DMA_BIDIRECTIONAL 0
 
 static inline int pci_read_config_dword (struct pci_dev *dev,
-					 int where, u32 *val)
+					 int where, uint32_t *val)
 {
 	*val=pci_read_config(dev->d, where, 4);
 	return(0);
 }
 
 static inline int pci_read_config_word (struct pci_dev *dev,
-					int where, u16 *val)
+					int where, uint16_t *val)
 {
 	*val=pci_read_config(dev->d, where, 2);
 	return(0);
 }
 
 static inline int pci_write_config_dword (struct pci_dev *dev,
-					  int where, u32 val)
+					  int where, uint32_t val)
 {
 	pci_write_config(dev->d, where,val, 4);
 	return(0);
 }
 
 static inline int pci_write_config_word (struct pci_dev *dev,
-					  int where, u32 val)
+					  int where, uint32_t val)
 {
 	pci_write_config(dev->d, where,val, 2);
 	return(0);


More information about the p4-projects mailing list