drivers/net/ethernet/intel/idpf/idpf_txrx.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/idpf/idpf_txrx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/idpf/idpf_txrx.c- Extension
.c- Size
- 126631 bytes
- Lines
- 4737
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
idpf.hidpf_ptp.hidpf_virtchnl.hxdp.hxsk.h
Detected Declarations
function idpf_features_checkfunction idpf_tx_timeoutfunction idpf_tx_buf_cleanfunction idpf_tx_buf_rel_allfunction idpf_tx_desc_relfunction idpf_compl_desc_relfunction idpf_tx_desc_rel_allfunction idpf_tx_buf_alloc_allfunction idpf_tx_desc_allocfunction idpf_compl_desc_allocfunction idpf_tx_desc_alloc_allfunction idpf_rx_page_relfunction idpf_rx_hdr_buf_rel_allfunction idpf_rx_buf_rel_bufqfunction idpf_rx_buf_rel_allfunction idpf_rx_desc_relfunction idpf_rx_desc_rel_bufqfunction idpf_rx_desc_rel_allfunction idpf_rx_buf_hw_updatefunction idpf_rx_hdr_buf_alloc_allfunction idpf_post_buf_refillfunction idpf_rx_post_buf_descfunction idpf_rx_post_init_bufsfunction idpf_rx_buf_alloc_singleqfunction idpf_rx_bufs_init_singleqfunction idpf_rx_buf_alloc_allfunction idpf_rx_bufs_initfunction idpf_rx_bufs_init_allfunction idpf_rx_desc_allocfunction idpf_bufq_desc_allocfunction idpf_rx_desc_alloc_allfunction idpf_init_queue_setfunction idpf_clean_queue_setfunction idpf_qvec_ena_irqfunction vectorfunction idpf_qp_enablefunction idpf_qp_disablefunction idpf_qp_switchfunction idpf_txq_group_relfunction idpf_rxq_sw_queue_relfunction idpf_rxq_group_relfunction idpf_vport_queue_grp_rel_allfunction idpf_vport_queues_relfunction idpf_vport_init_fast_path_txqsfunction idpf_vport_init_num_qsfunction idpf_vport_calc_num_q_descfunction idpf_vport_calc_total_qsfunction idpf_vport_calc_num_q_groups
Annotated Snippet
if (err) {
pci_err(vport->adapter->pdev,
"Allocation for Tx Queue %u failed\n",
i);
goto err_out;
}
}
if (!idpf_is_queue_model_split(rsrc->txq_model))
continue;
/* Setup completion queues */
err = idpf_compl_desc_alloc(vport, rsrc->txq_grps[i].complq);
if (err) {
pci_err(vport->adapter->pdev,
"Allocation for Tx Completion Queue %u failed\n",
i);
goto err_out;
}
}
err_out:
if (err)
idpf_tx_desc_rel_all(rsrc);
return err;
}
/**
* idpf_rx_page_rel - Release an rx buffer page
* @rx_buf: the buffer to free
*/
static void idpf_rx_page_rel(struct libeth_fqe *rx_buf)
{
if (unlikely(!rx_buf->netmem))
return;
libeth_rx_recycle_slow(rx_buf->netmem);
rx_buf->netmem = 0;
rx_buf->offset = 0;
}
/**
* idpf_rx_hdr_buf_rel_all - Release header buffer memory
* @bufq: queue to use
*/
static void idpf_rx_hdr_buf_rel_all(struct idpf_buf_queue *bufq)
{
struct libeth_fq fq = {
.fqes = bufq->hdr_buf,
.pp = bufq->hdr_pp,
};
for (u32 i = 0; i < bufq->desc_count; i++)
idpf_rx_page_rel(&bufq->hdr_buf[i]);
libeth_rx_fq_destroy(&fq);
bufq->hdr_buf = NULL;
bufq->hdr_pp = NULL;
}
/**
* idpf_rx_buf_rel_bufq - Free all Rx buffer resources for a buffer queue
* @bufq: queue to be cleaned
*/
static void idpf_rx_buf_rel_bufq(struct idpf_buf_queue *bufq)
{
struct libeth_fq fq = {
.fqes = bufq->buf,
.pp = bufq->pp,
};
/* queue already cleared, nothing to do */
if (!bufq->buf)
return;
if (idpf_queue_has(XSK, bufq)) {
idpf_xskfq_rel(bufq);
return;
}
/* Free all the bufs allocated and given to hw on Rx queue */
for (u32 i = 0; i < bufq->desc_count; i++)
idpf_rx_page_rel(&bufq->buf[i]);
if (idpf_queue_has(HSPLIT_EN, bufq))
idpf_rx_hdr_buf_rel_all(bufq);
libeth_rx_fq_destroy(&fq);
Annotation
- Immediate include surface: `idpf.h`, `idpf_ptp.h`, `idpf_virtchnl.h`, `xdp.h`, `xsk.h`.
- Detected declarations: `function idpf_features_check`, `function idpf_tx_timeout`, `function idpf_tx_buf_clean`, `function idpf_tx_buf_rel_all`, `function idpf_tx_desc_rel`, `function idpf_compl_desc_rel`, `function idpf_tx_desc_rel_all`, `function idpf_tx_buf_alloc_all`, `function idpf_tx_desc_alloc`, `function idpf_compl_desc_alloc`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.