if (unlikely(READ_ONCE(vnic_sdma->state) != HFI1_VNIC_SDMA_Q_ACTIVE)) goto tx_err;
if (unlikely(!sde || !sdma_running(sde))) goto tx_err;
tx = kmem_cache_alloc(dd->vnic.txreq_cache, GFP_ATOMIC); if (unlikely(!tx)) {
ret = -ENOMEM; goto tx_err;
}
tx->sdma = vnic_sdma;
tx->skb = skb;
hfi1_vnic_update_pad(tx->pad, plen);
tx->plen = plen;
ret = build_vnic_tx_desc(sde, tx, pbc); if (unlikely(ret)) goto free_desc;
ret = sdma_send_txreq(sde, iowait_get_ib_work(&vnic_sdma->wait),
&tx->txreq, vnic_sdma->pkts_sent); /* When -ECOMM, sdma callback will be called with ABORT status */ if (unlikely(ret && unlikely(ret != -ECOMM))) goto free_desc;
/* * hfi1_vnic_sdma_sleep - vnic sdma sleep function * * This function gets called from sdma_send_txreq() when there are not enough * sdma descriptors available to send the packet. It adds Tx queue's wait * structure to sdma engine's dmawait list to be woken up when descriptors * become available.
*/ staticint hfi1_vnic_sdma_sleep(struct sdma_engine *sde, struct iowait_work *wait, struct sdma_txreq *txreq,
uint seq, bool pkts_sent)
{ struct hfi1_vnic_sdma *vnic_sdma =
container_of(wait->iow, struct hfi1_vnic_sdma, wait);
write_seqlock(&sde->waitlock); if (sdma_progress(sde, seq, txreq)) {
write_sequnlock(&sde->waitlock); return -EAGAIN;
}
/* * hfi1_vnic_sdma_wakeup - vnic sdma wakeup function * * This function gets called when SDMA descriptors becomes available and Tx * queue's wait structure was previously added to sdma engine's dmawait list. * It notifies the upper driver about Tx queue wakeup.
*/ staticvoid hfi1_vnic_sdma_wakeup(struct iowait *wait, int reason)
{ struct hfi1_vnic_sdma *vnic_sdma =
container_of(wait, struct hfi1_vnic_sdma, wait); struct hfi1_vnic_vport_info *vinfo = vnic_sdma->vinfo;
vnic_sdma->state = HFI1_VNIC_SDMA_Q_ACTIVE; if (__netif_subqueue_stopped(vinfo->netdev, vnic_sdma->q_idx))
netif_wake_subqueue(vinfo->netdev, vnic_sdma->q_idx);
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.