summaryrefslogtreecommitdiffstats
path: root/sys/net/netmap_user.h
diff options
context:
space:
mode:
authornp <np@FreeBSD.org>2014-08-21 19:42:03 +0000
committernp <np@FreeBSD.org>2014-08-21 19:42:03 +0000
commitc11c6b79511d6994540355e671cd715fba04af23 (patch)
tree90fe0cc61ebe3bf65b7031199842654bb0ef5d24 /sys/net/netmap_user.h
parentc4304b5b4af4fba2337dabfc4d6f9cb8e651ff82 (diff)
downloadFreeBSD-src-c11c6b79511d6994540355e671cd715fba04af23.zip
FreeBSD-src-c11c6b79511d6994540355e671cd715fba04af23.tar.gz
Update a couple of header files that were missed in r270252. This is a
direct commit to stable/10. Submitted by: luigi
Diffstat (limited to 'sys/net/netmap_user.h')
-rw-r--r--sys/net/netmap_user.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/net/netmap_user.h b/sys/net/netmap_user.h
index 9e0ab43..5faf671 100644
--- a/sys/net/netmap_user.h
+++ b/sys/net/netmap_user.h
@@ -149,21 +149,21 @@ nm_ring_space(struct netmap_ring *ring)
#define ND(_fmt, ...) do {} while(0)
#define D(_fmt, ...) \
do { \
- struct timeval t0; \
- gettimeofday(&t0, NULL); \
+ struct timeval _t0; \
+ gettimeofday(&_t0, NULL); \
fprintf(stderr, "%03d.%06d %s [%d] " _fmt "\n", \
- (int)(t0.tv_sec % 1000), (int)t0.tv_usec, \
+ (int)(_t0.tv_sec % 1000), (int)_t0.tv_usec, \
__FUNCTION__, __LINE__, ##__VA_ARGS__); \
} while (0)
/* Rate limited version of "D", lps indicates how many per second */
#define RD(lps, format, ...) \
do { \
- static int t0, __cnt; \
+ static int __t0, __cnt; \
struct timeval __xxts; \
gettimeofday(&__xxts, NULL); \
- if (t0 != __xxts.tv_sec) { \
- t0 = __xxts.tv_sec; \
+ if (__t0 != __xxts.tv_sec) { \
+ __t0 = __xxts.tv_sec; \
__cnt = 0; \
} \
if (__cnt++ < lps) { \
@@ -495,23 +495,23 @@ nm_open(const char *ifname, const struct nmreq *req,
(char *)d->mem + d->memsize;
}
- if (nr_flags == NR_REG_SW) { /* host stack */
+ if (d->req.nr_flags == NR_REG_SW) { /* host stack */
d->first_tx_ring = d->last_tx_ring = d->req.nr_tx_rings;
d->first_rx_ring = d->last_rx_ring = d->req.nr_rx_rings;
- } else if (nr_flags == NR_REG_ALL_NIC) { /* only nic */
+ } else if (d->req.nr_flags == NR_REG_ALL_NIC) { /* only nic */
d->first_tx_ring = 0;
d->first_rx_ring = 0;
d->last_tx_ring = d->req.nr_tx_rings - 1;
d->last_rx_ring = d->req.nr_rx_rings - 1;
- } else if (nr_flags == NR_REG_NIC_SW) {
+ } else if (d->req.nr_flags == NR_REG_NIC_SW) {
d->first_tx_ring = 0;
d->first_rx_ring = 0;
d->last_tx_ring = d->req.nr_tx_rings;
d->last_rx_ring = d->req.nr_rx_rings;
- } else if (nr_flags == NR_REG_ONE_NIC) {
+ } else if (d->req.nr_flags == NR_REG_ONE_NIC) {
/* XXX check validity */
d->first_tx_ring = d->last_tx_ring =
- d->first_rx_ring = d->last_rx_ring = nr_ringid;
+ d->first_rx_ring = d->last_rx_ring = d->req.nr_ringid & NETMAP_RING_MASK;
} else { /* pipes */
d->first_tx_ring = d->last_tx_ring = 0;
d->first_rx_ring = d->last_rx_ring = 0;
OpenPOWER on IntegriCloud