drivers/net/ethernet/cavium/liquidio/lio_core.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/cavium/liquidio/lio_core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/cavium/liquidio/lio_core.c- Extension
.c- Size
- 48901 bytes
- Lines
- 1829
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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
linux/pci.hlinux/if_vlan.hliquidio_common.hocteon_droq.hocteon_iq.hresponse_manager.hocteon_device.hocteon_nic.hocteon_main.hocteon_network.h
Detected Declarations
function lio_delete_glistsfunction lio_setup_glistsfunction liquidio_set_featurefunction octeon_report_tx_completion_to_bqlfunction octeon_update_tx_completion_countersfunction octeon_report_sent_bytes_to_bqlfunction liquidio_link_ctrl_cmd_completionfunction octeon_pf_changed_vf_macaddrfunction octeon_schedule_rxq_oom_workfunction octnet_poll_check_rxq_oom_statusfunction setup_rx_oom_poll_fnfunction cleanup_rx_oom_poll_fnfunction lio_update_txq_statusfunction octeon_setup_droqfunction liquidio_push_packetfunction napi_schedule_wrapperfunction liquidio_napi_drv_callbackfunction liquidio_napi_pollfunction liquidio_setup_io_queuesfunction liquidio_schedule_msix_droq_pkt_handlerfunction liquidio_msix_intr_handlerfunction liquidio_schedule_droq_pkt_handlersfunction liquidio_legacy_intr_handlerfunction octeon_setup_interruptfunction liquidio_change_mtufunction lio_wait_for_clean_oqfunction octnet_nic_stats_callbackfunction lio_fetch_vf_statsfunction lio_fetch_statsfunction liquidio_set_speedfunction liquidio_get_speedfunction liquidio_set_fecfunction liquidio_get_fecexport lio_delete_glistsexport lio_setup_glistsexport liquidio_set_featureexport liquidio_link_ctrl_cmd_completionexport setup_rx_oom_poll_fnexport cleanup_rx_oom_poll_fnexport liquidio_setup_io_queuesexport octeon_setup_interruptexport liquidio_change_mtuexport lio_wait_for_clean_oqexport lio_fetch_statsexport liquidio_get_speedexport liquidio_get_fec
Annotated Snippet
if (!lio->glists_virt_base[i]) {
lio_delete_glists(lio);
return -ENOMEM;
}
for (j = 0; j < lio->tx_qsize; j++) {
g = kzalloc_node(sizeof(*g), GFP_KERNEL,
numa_node);
if (!g)
g = kzalloc_obj(*g);
if (!g)
break;
g->sg = lio->glists_virt_base[i] +
(j * lio->glist_entry_size);
g->sg_dma_ptr = lio->glists_dma_base[i] +
(j * lio->glist_entry_size);
list_add_tail(&g->list, &lio->glist[i]);
}
if (j != lio->tx_qsize) {
lio_delete_glists(lio);
return -ENOMEM;
}
}
return 0;
}
EXPORT_SYMBOL_GPL(lio_setup_glists);
int liquidio_set_feature(struct net_device *netdev, int cmd, u16 param1)
{
struct lio *lio = GET_LIO(netdev);
struct octeon_device *oct = lio->oct_dev;
struct octnic_ctrl_pkt nctrl;
int ret = 0;
memset(&nctrl, 0, sizeof(struct octnic_ctrl_pkt));
nctrl.ncmd.u64 = 0;
nctrl.ncmd.s.cmd = cmd;
nctrl.ncmd.s.param1 = param1;
nctrl.iq_no = lio->linfo.txpciq[0].s.q_no;
nctrl.netpndev = (u64)netdev;
nctrl.cb_fn = liquidio_link_ctrl_cmd_completion;
ret = octnet_send_nic_ctrl_pkt(lio->oct_dev, &nctrl);
if (ret) {
dev_err(&oct->pci_dev->dev, "Feature change failed in core (ret: 0x%x)\n",
ret);
if (ret > 0)
ret = -EIO;
}
return ret;
}
EXPORT_SYMBOL_GPL(liquidio_set_feature);
void octeon_report_tx_completion_to_bql(void *txq, unsigned int pkts_compl,
unsigned int bytes_compl)
{
struct netdev_queue *netdev_queue = txq;
netdev_tx_completed_queue(netdev_queue, pkts_compl, bytes_compl);
}
void octeon_update_tx_completion_counters(void *buf, int reqtype,
unsigned int *pkts_compl,
unsigned int *bytes_compl)
{
struct octnet_buf_free_info *finfo;
struct sk_buff *skb = NULL;
struct octeon_soft_command *sc;
switch (reqtype) {
case REQTYPE_NORESP_NET:
case REQTYPE_NORESP_NET_SG:
finfo = buf;
skb = finfo->skb;
break;
case REQTYPE_RESP_NET_SG:
case REQTYPE_RESP_NET:
sc = buf;
skb = sc->callback_arg;
break;
default:
return;
Annotation
- Immediate include surface: `linux/pci.h`, `linux/if_vlan.h`, `liquidio_common.h`, `octeon_droq.h`, `octeon_iq.h`, `response_manager.h`, `octeon_device.h`, `octeon_nic.h`.
- Detected declarations: `function lio_delete_glists`, `function lio_setup_glists`, `function liquidio_set_feature`, `function octeon_report_tx_completion_to_bql`, `function octeon_update_tx_completion_counters`, `function octeon_report_sent_bytes_to_bql`, `function liquidio_link_ctrl_cmd_completion`, `function octeon_pf_changed_vf_macaddr`, `function octeon_schedule_rxq_oom_work`, `function octnet_poll_check_rxq_oom_status`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.