Lines 176-182
Link Here
|
176 |
|
176 |
|
177 |
static VNET_DEFINE(vifi_t, numvifs); |
177 |
static VNET_DEFINE(vifi_t, numvifs); |
178 |
#define V_numvifs VNET(numvifs) |
178 |
#define V_numvifs VNET(numvifs) |
179 |
static VNET_DEFINE(struct vif, viftable[MAXVIFS]); |
179 |
static VNET_DEFINE(struct vif *, viftable); |
180 |
#define V_viftable VNET(viftable) |
180 |
#define V_viftable VNET(viftable) |
181 |
SYSCTL_VNET_OPAQUE(_net_inet_ip, OID_AUTO, viftable, CTLFLAG_RD, |
181 |
SYSCTL_VNET_OPAQUE(_net_inet_ip, OID_AUTO, viftable, CTLFLAG_RD, |
182 |
&VNET_NAME(viftable), sizeof(V_viftable), "S,vif[MAXVIFS]", |
182 |
&VNET_NAME(viftable), sizeof(V_viftable), "S,vif[MAXVIFS]", |
Lines 207-213
Link Here
|
207 |
* expiration time. Periodically, the entries are analysed and processed. |
207 |
* expiration time. Periodically, the entries are analysed and processed. |
208 |
*/ |
208 |
*/ |
209 |
#define BW_METER_BUCKETS 1024 |
209 |
#define BW_METER_BUCKETS 1024 |
210 |
static VNET_DEFINE(struct bw_meter*, bw_meter_timers[BW_METER_BUCKETS]); |
210 |
static VNET_DEFINE(struct bw_meter **, bw_meter_timers); |
211 |
#define V_bw_meter_timers VNET(bw_meter_timers) |
211 |
#define V_bw_meter_timers VNET(bw_meter_timers) |
212 |
static VNET_DEFINE(struct callout, bw_meter_ch); |
212 |
static VNET_DEFINE(struct callout, bw_meter_ch); |
213 |
#define V_bw_meter_ch VNET(bw_meter_ch) |
213 |
#define V_bw_meter_ch VNET(bw_meter_ch) |
Lines 217-223
Link Here
|
217 |
* Pending upcalls are stored in a vector which is flushed when |
217 |
* Pending upcalls are stored in a vector which is flushed when |
218 |
* full, or periodically |
218 |
* full, or periodically |
219 |
*/ |
219 |
*/ |
220 |
static VNET_DEFINE(struct bw_upcall, bw_upcalls[BW_UPCALLS_MAX]); |
220 |
static VNET_DEFINE(struct bw_upcall *, bw_upcalls); |
221 |
#define V_bw_upcalls VNET(bw_upcalls) |
221 |
#define V_bw_upcalls VNET(bw_upcalls) |
222 |
static VNET_DEFINE(u_int, bw_upcalls_n); /* # of pending upcalls */ |
222 |
static VNET_DEFINE(u_int, bw_upcalls_n); /* # of pending upcalls */ |
223 |
#define V_bw_upcalls_n VNET(bw_upcalls_n) |
223 |
#define V_bw_upcalls_n VNET(bw_upcalls_n) |
Lines 2805-2812
Link Here
|
2805 |
vnet_mroute_init(const void *unused __unused) |
2805 |
vnet_mroute_init(const void *unused __unused) |
2806 |
{ |
2806 |
{ |
2807 |
|
2807 |
|
2808 |
MALLOC(V_nexpire, u_char *, mfchashsize, M_MRTABLE, M_WAITOK|M_ZERO); |
2808 |
MALLOC(V_nexpire, u_char *, sizeof(*V_nexpire) * mfchashsize, |
2809 |
bzero(V_bw_meter_timers, sizeof(V_bw_meter_timers)); |
2809 |
M_MRTABLE, M_WAITOK|M_ZERO); |
|
|
2810 |
MALLOC(V_viftable, struct vif *, sizeof(*V_viftable) * MAXVIFS, |
2811 |
M_MRTABLE, M_WAITOK|M_ZERO); |
2812 |
MALLOC(V_bw_meter_timers, struct bw_meter **, |
2813 |
sizeof(*V_bw_meter_timers) * BW_METER_BUCKETS, |
2814 |
M_MRTABLE, M_WAITOK|M_ZERO); |
2815 |
MALLOC(V_bw_upcalls, struct bw_upcall *, |
2816 |
sizeof(*V_bw_upcalls) * BW_UPCALLS_MAX, |
2817 |
M_MRTABLE, M_WAITOK|M_ZERO); |
2810 |
callout_init(&V_expire_upcalls_ch, CALLOUT_MPSAFE); |
2818 |
callout_init(&V_expire_upcalls_ch, CALLOUT_MPSAFE); |
2811 |
callout_init(&V_bw_upcalls_ch, CALLOUT_MPSAFE); |
2819 |
callout_init(&V_bw_upcalls_ch, CALLOUT_MPSAFE); |
2812 |
callout_init(&V_bw_meter_ch, CALLOUT_MPSAFE); |
2820 |
callout_init(&V_bw_meter_ch, CALLOUT_MPSAFE); |
Lines 2820-2825
Link Here
|
2820 |
{ |
2828 |
{ |
2821 |
|
2829 |
|
2822 |
FREE(V_nexpire, M_MRTABLE); |
2830 |
FREE(V_nexpire, M_MRTABLE); |
|
|
2831 |
FREE(V_viftable, M_MRTABLE); |
2832 |
FREE(V_bw_meter_timers, M_MRTABLE); |
2833 |
FREE(V_bw_upcalls, M_MRTABLE); |
2823 |
V_nexpire = NULL; |
2834 |
V_nexpire = NULL; |
2824 |
} |
2835 |
} |
2825 |
|
2836 |
|