version 1.1.2.19, 2013/06/26 16:22:12
|
version 1.1.2.20, 2013/06/26 16:34:28
|
Line 231 chkZCbuf(struct bpf_zbuf_header *bzh)
|
Line 231 chkZCbuf(struct bpf_zbuf_header *bzh)
|
return (bzh->bzh_user_gen != atomic_load_acq_int(&bzh->bzh_kernel_gen)); |
return (bzh->bzh_user_gen != atomic_load_acq_int(&bzh->bzh_kernel_gen)); |
} |
} |
|
|
static inline ssize_t | static ssize_t |
nextZCbuf(int eth, struct bpf_zbuf * __restrict zbuf, void * __restrict buf, size_t buflen) |
nextZCbuf(int eth, struct bpf_zbuf * __restrict zbuf, void * __restrict buf, size_t buflen) |
{ |
{ |
ssize_t rlen = 0; |
ssize_t rlen = 0; |
Line 254 nextZCbuf(int eth, struct bpf_zbuf * __restrict zbuf,
|
Line 254 nextZCbuf(int eth, struct bpf_zbuf * __restrict zbuf,
|
pos += rlen; |
pos += rlen; |
} |
} |
|
|
if (!pos) | if (!pos) { |
ioctl(eth, BIOCROTZBUF, &bz); | if ((rlen = ioctl(eth, BIOCROTZBUF, &bz)) == -1) |
| LOGERR; |
| } else |
| rlen = pos; |
return rlen; |
return rlen; |
} |
} |
#endif |
#endif |
Line 285 io_etherRecv(int eth, void * __restrict buf, size_t bu
|
Line 288 io_etherRecv(int eth, void * __restrict buf, size_t bu
|
LOGERR; |
LOGERR; |
} else { |
} else { |
#ifdef __FreeBSD__ |
#ifdef __FreeBSD__ |
do { | rlen = nextZCbuf(eth, (struct bpf_zbuf*) zcbuf, buf, buflen); |
| if (!rlen) |
rlen = nextZCbuf(eth, (struct bpf_zbuf*) zcbuf, buf, buflen); |
rlen = nextZCbuf(eth, (struct bpf_zbuf*) zcbuf, buf, buflen); |
if (!rlen) |
|
continue; |
|
} while (0); |
|
#else |
#else |
rlen = -1; |
rlen = -1; |
io_SetErr(ENOTSUP, "bpf zero copy buffer mode is not supported"); |
io_SetErr(ENOTSUP, "bpf zero copy buffer mode is not supported"); |