Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/netmap/netmap_bdg.c
Show First 20 Lines • Show All 384 Lines • ▼ Show 20 Lines | |||||
* (*na != NULL && return == 0). | * (*na != NULL && return == 0). | ||||
*/ | */ | ||||
int | int | ||||
netmap_get_bdg_na(struct nmreq_header *hdr, struct netmap_adapter **na, | netmap_get_bdg_na(struct nmreq_header *hdr, struct netmap_adapter **na, | ||||
struct netmap_mem_d *nmd, int create, struct netmap_bdg_ops *ops) | struct netmap_mem_d *nmd, int create, struct netmap_bdg_ops *ops) | ||||
{ | { | ||||
char *nr_name = hdr->nr_name; | char *nr_name = hdr->nr_name; | ||||
const char *ifname; | const char *ifname; | ||||
struct ifnet *ifp = NULL; | if_t ifp = NULL; | ||||
int error = 0; | int error = 0; | ||||
struct netmap_vp_adapter *vpna, *hostna = NULL; | struct netmap_vp_adapter *vpna, *hostna = NULL; | ||||
struct nm_bridge *b; | struct nm_bridge *b; | ||||
uint32_t i, j; | uint32_t i, j; | ||||
uint32_t cand = NM_BDG_NOPORT, cand2 = NM_BDG_NOPORT; | uint32_t cand = NM_BDG_NOPORT, cand2 = NM_BDG_NOPORT; | ||||
int needed; | int needed; | ||||
*na = NULL; /* default return value */ | *na = NULL; /* default return value */ | ||||
▲ Show 20 Lines • Show All 1,370 Lines • ▼ Show 20 Lines | if (hwna->na_flags & NAF_HOST_RINGS) { | ||||
hostna->na_flags = NAF_BUSY; /* prevent NIOCREGIF */ | hostna->na_flags = NAF_BUSY; /* prevent NIOCREGIF */ | ||||
hostna->rx_buf_maxsize = hwna->rx_buf_maxsize; | hostna->rx_buf_maxsize = hwna->rx_buf_maxsize; | ||||
/* bwrap_config() will determine the number of host rings */ | /* bwrap_config() will determine the number of host rings */ | ||||
} | } | ||||
if (hwna->na_flags & NAF_MOREFRAG) | if (hwna->na_flags & NAF_MOREFRAG) | ||||
na->na_flags |= NAF_MOREFRAG; | na->na_flags |= NAF_MOREFRAG; | ||||
nm_prdis("%s<->%s txr %d txd %d rxr %d rxd %d", | nm_prdis("%s<->%s txr %d txd %d rxr %d rxd %d", | ||||
na->name, ifp->if_xname, | na->name, if_name(ifp), | ||||
na->num_tx_rings, na->num_tx_desc, | na->num_tx_rings, na->num_tx_desc, | ||||
na->num_rx_rings, na->num_rx_desc); | na->num_rx_rings, na->num_rx_desc); | ||||
error = netmap_attach_common(na); | error = netmap_attach_common(na); | ||||
if (error) { | if (error) { | ||||
goto err_put; | goto err_put; | ||||
} | } | ||||
hwna->na_flags |= NAF_BUSY; | hwna->na_flags |= NAF_BUSY; | ||||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |