Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Mar 2007 15:53:11 GMT
From:      "Christian S.J. Peron" <csjp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 115764 for review
Message-ID:  <200703121553.l2CFrBsF027016@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=115764

Change 115764 by csjp@csjp_rnd01 on 2007/03/12 15:52:15

	Remove debug printfs

Affected files ...

.. //depot/projects/zcopybpf/src/sys/net/bpf_zerocopy.c#20 edit

Differences ...

==== //depot/projects/zcopybpf/src/sys/net/bpf_zerocopy.c#20 (text+ko) ====

@@ -96,7 +96,6 @@
 zbuf_page_free(vm_page_t pp)
 {
 
-	// printf("  zbuf_page_free(%p)\n", (void *)pp);
 	vm_page_lock_queues();
 	vm_page_unwire(pp, 0);
 	if (pp->wire_count == 0 && pp->object == NULL)
@@ -113,7 +112,6 @@
 	vm_page_t pp;
 
 	pp = sf_buf_page(sf);
-	// printf("zbuf_sfbuf_free(sf: %p pp: %p)\n", sf, (void *)pp);
 	sf_buf_free(sf);
 	zbuf_page_free(pp);
 }
@@ -128,7 +126,6 @@
 {
 	int i;
 
-	// printf("zbuf_free(%p)\n", zb);
 	for (i = 0; i < zb->zb_numpages; i++) {
 		if (zb->zb_pages[i] != NULL)
 			zbuf_sfbuf_free(zb->zb_pages[i]);
@@ -148,7 +145,6 @@
 	struct sf_buf *sf;
 	vm_page_t pp;
 
-	// printf("  zbuf_sfbuf_get(%p)\n", (void *)uaddr);
 	if (vm_fault_quick((caddr_t) uaddr, VM_PROT_READ | VM_PROT_WRITE)
 	    < 0)
 		return (NULL);
@@ -183,31 +179,19 @@
 	struct vm_map *map;
 	int error, i;
 
-	// printf("zbuf_setup(td: %p pid: %d uaddr: %p len: %d)\n", td,
-	//     td->td_proc->p_pid, (void *)uaddr, len);
-
 	*zbp = NULL;
 
 	/* User address must be page-aligned. */
-	if (uaddr & PAGE_MASK) {
-		// printf("zbuf_setup: uaddr not page-aligned (%p)\n",
-		//     (void *)uaddr);
+	if (uaddr & PAGE_MASK)
 		return (EINVAL);
-	}
 
 	/* Length must be an integer number of full pages. */
-	if (len & PAGE_MASK) {
-		// printf("zbuf_setup: len not a multiple of page size (%d)\n",
-		//     len);
+	if (len & PAGE_MASK)
 		return (EINVAL);
-	}
 
 	/* Length must not exceed per-buffer resource limit. */
-	if ((len / PAGE_SIZE) > BPF_MAX_PAGES) {
-		// printf("zbuf_setup: len %d greater than max %d\n", len,
-		//     BPF_MAX_PAGES * PAGE_SIZE);
+	if ((len / PAGE_SIZE) > BPF_MAX_PAGES)
 		return (EINVAL);
-	}
 
 	error = 0;
 	zb = malloc(sizeof(*zb), M_BPF, M_ZERO | M_WAITOK);
@@ -252,8 +236,6 @@
 	    ("bpf_zerocopy_append_bytes: not in zbuf mode"));
 	KASSERT(buf != NULL, ("bpf_zerocopy_append_bytes: NULL buf"));
 
-	// printf("bpf_zerocopy_append_bytes(d: %p, buf: %p, offset: %d, src "
-	//     "%p, len: %d)\n", d, buf, offset, src, len);
 
 	src_bytes = (u_char *)src;
 	zb = (struct zbuf *)buf;
@@ -305,9 +287,6 @@
 	    ("bpf_zerocopy_append_mbuf not in zbuf mode"));
 	KASSERT(buf != NULL, ("bpf_zerocopy_append_mbuf: NULL buf"));
 
-	// printf("bpf_zerocopy_append_mbuf(d: %p, buf: %p, offset: %d, src "
-	//     "%p, len: %d)\n", d, buf, offset, src, len);
-
 	m = (struct mbuf *)src;
 	zb = (struct zbuf *)buf;
 
@@ -411,8 +390,6 @@
 	KASSERT(d->bd_bufmode == BPF_BUFMODE_ZBUF,
 	    ("bpf_zerocopy_free: not in zbuf mode"));
 
-	// printf("bpf_zerocopy_free(%p)\n", d);
-
 	zb = (struct zbuf *)d->bd_sbuf;
 	if (zb != NULL)
 		zbuf_free(zb);
@@ -437,9 +414,6 @@
 	KASSERT(d->bd_bufmode == BPF_BUFMODE_ZBUF,
 	    ("bpf_zerocopy_uiomove: not in zbuf mode"));
 
-	// printf("bpf_zerocopy_uiomove(d: %p, buf: %p, len: %d, uio: %p)\n", d,
-	//     buf, len, uio);
-
 	return (EOPNOTSUPP);
 }
 
@@ -459,20 +433,13 @@
 	KASSERT(d->bd_bufmode == BPF_BUFMODE_ZBUF,
 	    ("bpf_zerocopy_ioctl_ackzbuf: not in zbuf mode"));
 
-	// printf("bpf_zerocopy_ioctl_ackzbuf(td: %p, pid: %d, d: %p, "
-	//     "bz.bz_bufa: %p, bz.bz_buflen: %d)\n", td, td->td_proc->p_pid,
-	//     d, bz->bz_bufa, bz->bz_buflen);
-
 	BPFD_LOCK(d);
 	if (d->bd_hbuf == NULL) {
-		// printf("ackzbuf rejected: no hbuf\n");
 		BPFD_UNLOCK(d);
 		return (EINVAL);
 	}
 	zb = (struct zbuf *)d->bd_hbuf;
 	if (bz->bz_bufa != (void *)zb->zb_uaddr) {
-		// printf("ackzbuf rejected: bufa %p not uaddr %p\n",
-		//     bz->bz_bufa, (void *)zb->zb_uaddr);
 		BPFD_UNLOCK(d);
 		return (EINVAL);
 	}
@@ -533,9 +500,6 @@
 	KASSERT(d->bd_bufmode == BPF_BUFMODE_ZBUF,
 	    ("bpf_zerocopy_ioctl_getzmax: not in zbuf mode"));
 
-	// printf("bpf_zerocopy_ioctl_getzmax(td: %p, pid: %d, d: %p)\n", td,
-	//     td->td_proc->p_pid, d);
-
 	*i = BPF_MAX_PAGES * PAGE_SIZE;
 	return (0);
 }
@@ -555,9 +519,6 @@
 	KASSERT(d->bd_bufmode == BPF_BUFMODE_ZBUF,
 	    ("bpf_zerocopy_ioctl_getznext: not in zbuf mode"));
 
-	// printf("bpf_zerocopy_ioctl_getznext(td: %p, pid: %d, d: %p)\n", td,
-	//     td->td_proc->p_pid, d);
-
 	/*
 	 * If in immediate mode, there's no holder buffer, but there is
 	 * stored packet data, rotate so that the stored buffer is now the
@@ -608,9 +569,6 @@
 	KASSERT(d->bd_bufmode == BPF_BUFMODE_ZBUF,
 	    ("bpf_zerocopy_ioctl_setzbuf: not in zbuf mode"));
 
-	// printf("bpf_zerocopy_ioctl_setzbuf(td: %p, pid: %d, d: %p)\n", td,
-	//     td->td_proc->p_pid, d);
-
 	/*
 	 * Must set both buffers.  Cannot clear them.
 	 */



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