Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ixl/ixlvc.c
Show First 20 Lines • Show All 356 Lines • ▼ Show 20 Lines | ixlv_configure_queues(struct ixlv_sc *sc) | ||||
struct ixl_vsi *vsi = &sc->vsi; | struct ixl_vsi *vsi = &sc->vsi; | ||||
struct ixl_queue *que = vsi->queues; | struct ixl_queue *que = vsi->queues; | ||||
struct tx_ring *txr; | struct tx_ring *txr; | ||||
struct rx_ring *rxr; | struct rx_ring *rxr; | ||||
int len, pairs; | int len, pairs; | ||||
struct i40e_virtchnl_vsi_queue_config_info *vqci; | struct i40e_virtchnl_vsi_queue_config_info *vqci; | ||||
struct i40e_virtchnl_queue_pair_info *vqpi; | struct i40e_virtchnl_queue_pair_info *vqpi; | ||||
pairs = vsi->num_queues; | pairs = vsi->num_queues; | ||||
len = sizeof(struct i40e_virtchnl_vsi_queue_config_info) + | len = sizeof(struct i40e_virtchnl_vsi_queue_config_info) + | ||||
(sizeof(struct i40e_virtchnl_queue_pair_info) * pairs); | (sizeof(struct i40e_virtchnl_queue_pair_info) * pairs); | ||||
vqci = malloc(len, M_DEVBUF, M_NOWAIT | M_ZERO); | vqci = malloc(len, M_DEVBUF, M_NOWAIT | M_ZERO); | ||||
if (!vqci) { | if (!vqci) { | ||||
device_printf(dev, "%s: unable to allocate memory\n", __func__); | device_printf(dev, "%s: unable to allocate memory\n", __func__); | ||||
ixl_vc_schedule_retry(&sc->vc_mgr); | ixl_vc_schedule_retry(&sc->vc_mgr); | ||||
return; | return; | ||||
▲ Show 20 Lines • Show All 411 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
struct ixl_vsi *vsi; | struct ixl_vsi *vsi; | ||||
uint64_t tx_discards; | uint64_t tx_discards; | ||||
int i; | int i; | ||||
vsi = &sc->vsi; | vsi = &sc->vsi; | ||||
tx_discards = es->tx_discards; | tx_discards = es->tx_discards; | ||||
for (i = 0; i < sc->vsi.num_queues; i++) | for (i = 0; i < vsi->num_queues; i++) | ||||
tx_discards += sc->vsi.queues[i].txr.br->br_drops; | tx_discards += sc->vsi.queues[i].txr.br->br_drops; | ||||
/* Update ifnet stats */ | /* Update ifnet stats */ | ||||
IXL_SET_IPACKETS(vsi, es->rx_unicast + | IXL_SET_IPACKETS(vsi, es->rx_unicast + | ||||
es->rx_multicast + | es->rx_multicast + | ||||
es->rx_broadcast); | es->rx_broadcast); | ||||
IXL_SET_OPACKETS(vsi, es->tx_unicast + | IXL_SET_OPACKETS(vsi, es->tx_unicast + | ||||
es->tx_multicast + | es->tx_multicast + | ||||
es->tx_broadcast); | es->tx_broadcast); | ||||
IXL_SET_IBYTES(vsi, es->rx_bytes); | IXL_SET_IBYTES(vsi, es->rx_bytes); | ||||
IXL_SET_OBYTES(vsi, es->tx_bytes); | IXL_SET_OBYTES(vsi, es->tx_bytes); | ||||
IXL_SET_IMCASTS(vsi, es->rx_multicast); | IXL_SET_IMCASTS(vsi, es->rx_multicast); | ||||
IXL_SET_OMCASTS(vsi, es->tx_multicast); | IXL_SET_OMCASTS(vsi, es->tx_multicast); | ||||
IXL_SET_OERRORS(vsi, es->tx_errors); | IXL_SET_OERRORS(vsi, es->tx_errors); | ||||
IXL_SET_IQDROPS(vsi, es->rx_discards); | IXL_SET_IQDROPS(vsi, es->rx_discards); | ||||
IXL_SET_OQDROPS(vsi, tx_discards); | IXL_SET_OQDROPS(vsi, tx_discards); | ||||
IXL_SET_NOPROTO(vsi, es->rx_unknown_protocol); | IXL_SET_NOPROTO(vsi, es->rx_unknown_protocol); | ||||
IXL_SET_COLLISIONS(vsi, 0); | IXL_SET_COLLISIONS(vsi, 0); | ||||
sc->vsi.eth_stats = *es; | vsi->eth_stats = *es; | ||||
} | } | ||||
/* | /* | ||||
** ixlv_vc_completion | ** ixlv_vc_completion | ||||
** | ** | ||||
** Asynchronous completion function for admin queue messages. Rather than busy | ** Asynchronous completion function for admin queue messages. Rather than busy | ||||
** wait, we fire off our requests and assume that no errors will be returned. | ** wait, we fire off our requests and assume that no errors will be returned. | ||||
** This function handles the reply messages. | ** This function handles the reply messages. | ||||
▲ Show 20 Lines • Show All 295 Lines • Show Last 20 Lines |