Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/netmap/if_ixl_netmap.h
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
ixl_netmap_attach(struct ixl_vsi *vsi) | ixl_netmap_attach(struct ixl_vsi *vsi) | ||||
{ | { | ||||
struct netmap_adapter na; | struct netmap_adapter na; | ||||
bzero(&na, sizeof(na)); | bzero(&na, sizeof(na)); | ||||
na.ifp = vsi->ifp; | na.ifp = vsi->ifp; | ||||
na.na_flags = NAF_BDG_MAYSLEEP; | na.na_flags = NAF_BDG_MAYSLEEP; | ||||
// XXX check that queues is set. | na.num_tx_desc = vsi->num_tx_desc; | ||||
nm_prinf("queues is %p", vsi->queues); | na.num_rx_desc = vsi->num_rx_desc; | ||||
if (vsi->queues) { | |||||
na.num_tx_desc = vsi->queues[0].num_desc; | |||||
na.num_rx_desc = vsi->queues[0].num_desc; | |||||
} | |||||
na.nm_txsync = ixl_netmap_txsync; | na.nm_txsync = ixl_netmap_txsync; | ||||
na.nm_rxsync = ixl_netmap_rxsync; | na.nm_rxsync = ixl_netmap_rxsync; | ||||
na.nm_register = ixl_netmap_reg; | na.nm_register = ixl_netmap_reg; | ||||
na.num_tx_rings = na.num_rx_rings = vsi->num_queues; | na.num_tx_rings = na.num_rx_rings = vsi->num_queues; | ||||
netmap_attach(&na); | netmap_attach(&na); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | |||||
/* (re)start the tx unit up to slot nic_i (excluded) */ | /* (re)start the tx unit up to slot nic_i (excluded) */ | ||||
wr32(vsi->hw, txr->tail, nic_i); | wr32(vsi->hw, txr->tail, nic_i); | ||||
} | } | ||||
/* | /* | ||||
* Second part: reclaim buffers for completed transmissions. | * Second part: reclaim buffers for completed transmissions. | ||||
*/ | */ | ||||
nic_i = LE32_TO_CPU(*(volatile __le32 *)&txr->base[que->num_desc]); | nic_i = LE32_TO_CPU(*(volatile __le32 *)&txr->base[que->num_tx_desc]); | ||||
if (nic_i != txr->next_to_clean) { | if (nic_i != txr->next_to_clean) { | ||||
/* some tx completed, increment avail */ | /* some tx completed, increment avail */ | ||||
txr->next_to_clean = nic_i; | txr->next_to_clean = nic_i; | ||||
kring->nr_hwtail = nm_prev(netmap_idx_n2k(kring, nic_i), lim); | kring->nr_hwtail = nm_prev(netmap_idx_n2k(kring, nic_i), lim); | ||||
} | } | ||||
return 0; | return 0; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |