Changeset View
Changeset View
Standalone View
Standalone View
head/sys/net/iflib.c
| Show First 20 Lines • Show All 2,181 Lines • ▼ Show 20 Lines | iflib_fl_setup(iflib_fl_t fl) | ||||
| /* Now replenish the mbufs */ | /* Now replenish the mbufs */ | ||||
| MPASS(fl->ifl_credits == 0); | MPASS(fl->ifl_credits == 0); | ||||
| /* | /* | ||||
| * XXX don't set the max_frame_size to larger | * XXX don't set the max_frame_size to larger | ||||
| * than the hardware can handle | * than the hardware can handle | ||||
| */ | */ | ||||
| if (sctx->isc_max_frame_size <= 2048) | if (sctx->isc_max_frame_size <= 2048) | ||||
| fl->ifl_buf_size = MCLBYTES; | fl->ifl_buf_size = MCLBYTES; | ||||
| #ifndef CONTIGMALLOC_WORKS | |||||
| else | else | ||||
| fl->ifl_buf_size = MJUMPAGESIZE; | fl->ifl_buf_size = MJUMPAGESIZE; | ||||
| #else | |||||
| else if (sctx->isc_max_frame_size <= 4096) | |||||
| fl->ifl_buf_size = MJUMPAGESIZE; | |||||
| else if (sctx->isc_max_frame_size <= 9216) | |||||
| fl->ifl_buf_size = MJUM9BYTES; | |||||
| else | |||||
| fl->ifl_buf_size = MJUM16BYTES; | |||||
| #endif | |||||
| if (fl->ifl_buf_size > ctx->ifc_max_fl_buf_size) | if (fl->ifl_buf_size > ctx->ifc_max_fl_buf_size) | ||||
| ctx->ifc_max_fl_buf_size = fl->ifl_buf_size; | ctx->ifc_max_fl_buf_size = fl->ifl_buf_size; | ||||
| fl->ifl_cltype = m_gettype(fl->ifl_buf_size); | fl->ifl_cltype = m_gettype(fl->ifl_buf_size); | ||||
| fl->ifl_zone = m_getzone(fl->ifl_buf_size); | fl->ifl_zone = m_getzone(fl->ifl_buf_size); | ||||
| /* avoid pre-allocating zillions of clusters to an idle card | /* avoid pre-allocating zillions of clusters to an idle card | ||||
| * potentially speeding up attach | * potentially speeding up attach | ||||
| ▲ Show 20 Lines • Show All 4,343 Lines • Show Last 20 Lines | |||||