Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Feb 2007 02:51:45 GMT
From:      "Christian S.J. Peron" <csjp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 114148 for review
Message-ID:  <200702070251.l172pjJA045309@repoman.freebsd.org>

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

Change 114148 by csjp@csjp_rnd01 on 2007/02/07 02:50:51

	Make sure we are checking for the presence of BPF zerocopy rather
	then just assuming we are using it.

Affected files ...

.. //depot/projects/zcopybpf/src/sys/net/bpf.c#13 edit

Differences ...

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

@@ -310,6 +310,19 @@
 }
 
 static int
+bpf_ioctl_rotate(struct thread *td, struct bpf_d *d, struct bpf_zbuf *bz)
+{
+
+	if (d->bd_bufmode != BPF_BUFMODE_ZBUF)
+		return (EOPNOTSUPP);
+#ifdef BPF_ZEROCOPY
+	return (bpf_zerocopy_ioctl_rotate(td, d, bz));
+#else
+	panic("bpf_ioctl_rotate");
+#endif
+}
+
+static int
 bpf_ioctl_getznext(struct thread *td, struct bpf_d *d, struct bpf_zbuf *bz)
 {
 
@@ -1285,8 +1298,7 @@
 		return (bpf_ioctl_setzbuf(td, d, (struct bpf_zbuf *)addr));
 
 	case BIOCROTZBUF:
-		return (bpf_zerocopy_ioctl_rotate(td, d, (struct bpf_zbuf *)
-		    addr));
+		return (bpf_ioctl_rotate(td, d, (struct bpf_zbuf *) addr));
 	}
 	return (error);
 }



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