View | Details | Raw Unified | Return to bug 206583 | Differences between
and this patch

Collapse All | Expand All

(-)sys/netinet/ip_mroute.c (-5 / +16 lines)
Lines 177-183 Link Here
177
177
178
static VNET_DEFINE(vifi_t, numvifs);
178
static VNET_DEFINE(vifi_t, numvifs);
179
#define	V_numvifs		VNET(numvifs)
179
#define	V_numvifs		VNET(numvifs)
180
static VNET_DEFINE(struct vif, viftable[MAXVIFS]);
180
static VNET_DEFINE(struct vif *, viftable);
181
#define	V_viftable		VNET(viftable)
181
#define	V_viftable		VNET(viftable)
182
SYSCTL_OPAQUE(_net_inet_ip, OID_AUTO, viftable, CTLFLAG_VNET | CTLFLAG_RD,
182
SYSCTL_OPAQUE(_net_inet_ip, OID_AUTO, viftable, CTLFLAG_VNET | CTLFLAG_RD,
183
    &VNET_NAME(viftable), sizeof(V_viftable), "S,vif[MAXVIFS]",
183
    &VNET_NAME(viftable), sizeof(V_viftable), "S,vif[MAXVIFS]",
Lines 208-214 Link Here
208
 * expiration time. Periodically, the entries are analysed and processed.
208
 * expiration time. Periodically, the entries are analysed and processed.
209
 */
209
 */
210
#define	BW_METER_BUCKETS	1024
210
#define	BW_METER_BUCKETS	1024
211
static VNET_DEFINE(struct bw_meter*, bw_meter_timers[BW_METER_BUCKETS]);
211
static VNET_DEFINE(struct bw_meter **, bw_meter_timers);
212
#define	V_bw_meter_timers	VNET(bw_meter_timers)
212
#define	V_bw_meter_timers	VNET(bw_meter_timers)
213
static VNET_DEFINE(struct callout, bw_meter_ch);
213
static VNET_DEFINE(struct callout, bw_meter_ch);
214
#define	V_bw_meter_ch		VNET(bw_meter_ch)
214
#define	V_bw_meter_ch		VNET(bw_meter_ch)
Lines 218-224 Link Here
218
 * Pending upcalls are stored in a vector which is flushed when
218
 * Pending upcalls are stored in a vector which is flushed when
219
 * full, or periodically
219
 * full, or periodically
220
 */
220
 */
221
static VNET_DEFINE(struct bw_upcall, bw_upcalls[BW_UPCALLS_MAX]);
221
static VNET_DEFINE(struct bw_upcall *, bw_upcalls);
222
#define	V_bw_upcalls		VNET(bw_upcalls)
222
#define	V_bw_upcalls		VNET(bw_upcalls)
223
static VNET_DEFINE(u_int, bw_upcalls_n); /* # of pending upcalls */
223
static VNET_DEFINE(u_int, bw_upcalls_n); /* # of pending upcalls */
224
#define	V_bw_upcalls_n    	VNET(bw_upcalls_n)
224
#define	V_bw_upcalls_n    	VNET(bw_upcalls_n)
Lines 2815-2822 Link Here
2815
vnet_mroute_init(const void *unused __unused)
2815
vnet_mroute_init(const void *unused __unused)
2816
{
2816
{
2817
2817
2818
	MALLOC(V_nexpire, u_char *, mfchashsize, M_MRTABLE, M_WAITOK|M_ZERO);
2818
	MALLOC(V_nexpire, u_char *, sizeof(*V_nexpire) * mfchashsize,
2819
	bzero(V_bw_meter_timers, sizeof(V_bw_meter_timers));
2819
	    M_MRTABLE, M_WAITOK|M_ZERO);
2820
	MALLOC(V_viftable, struct vif *, sizeof(*V_viftable) * MAXVIFS,
2821
	    M_MRTABLE, M_WAITOK|M_ZERO);
2822
	MALLOC(V_bw_meter_timers, struct bw_meter **,
2823
	    sizeof(*V_bw_meter_timers) * BW_METER_BUCKETS,
2824
	    M_MRTABLE, M_WAITOK|M_ZERO);
2825
	MALLOC(V_bw_upcalls, struct bw_upcall *,
2826
	    sizeof(*V_bw_upcalls) * BW_UPCALLS_MAX,
2827
	    M_MRTABLE, M_WAITOK|M_ZERO);
2820
	callout_init(&V_expire_upcalls_ch, 1);
2828
	callout_init(&V_expire_upcalls_ch, 1);
2821
	callout_init(&V_bw_upcalls_ch, 1);
2829
	callout_init(&V_bw_upcalls_ch, 1);
2822
	callout_init(&V_bw_meter_ch, 1);
2830
	callout_init(&V_bw_meter_ch, 1);
Lines 2830-2835 Link Here
2830
{
2838
{
2831
2839
2832
	FREE(V_nexpire, M_MRTABLE);
2840
	FREE(V_nexpire, M_MRTABLE);
2841
	FREE(V_viftable, M_MRTABLE);
2842
	FREE(V_bw_meter_timers, M_MRTABLE);
2843
	FREE(V_bw_upcalls, M_MRTABLE);
2833
	V_nexpire = NULL;
2844
	V_nexpire = NULL;
2834
}
2845
}
2835
2846

Return to bug 206583