drivers/net/ethernet/wangxun/txgbe/txgbe_fdir.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/wangxun/txgbe/txgbe_fdir.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/wangxun/txgbe/txgbe_fdir.c- Extension
.c- Size
- 20005 bytes
- Lines
- 649
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/string.hlinux/types.hlinux/pci.h../libwx/wx_type.h../libwx/wx_lib.h../libwx/wx_hw.htxgbe_type.htxgbe_fdir.h
Detected Declarations
function txgbe_atr_compute_sig_hashfunction txgbe_atr_compute_perfect_hashfunction txgbe_fdir_check_cmd_completefunction txgbe_fdir_add_signature_filterfunction txgbe_atrfunction txgbe_fdir_set_input_maskfunction txgbe_fdir_write_perfect_filterfunction txgbe_fdir_erase_perfect_filterfunction txgbe_fdir_enablefunction txgbe_init_fdir_signaturefunction txgbe_init_fdir_perfectfunction txgbe_fdir_filter_restorefunction hlist_for_each_entry_safefunction txgbe_configure_fdirfunction txgbe_fdir_filter_exitfunction hlist_for_each_entry_safe
Annotated Snippet
if (filter->action == TXGBE_RDB_FDIR_DROP_QUEUE) {
queue = TXGBE_RDB_FDIR_DROP_QUEUE;
} else {
u32 ring = ethtool_get_flow_spec_ring(filter->action);
if (ring >= wx->num_rx_queues) {
wx_err(wx, "FDIR restore failed, ring:%u\n",
ring);
continue;
}
/* Map the ring onto the absolute queue index */
queue = wx->rx_ring[ring]->reg_idx;
}
ret = txgbe_fdir_write_perfect_filter(wx,
&filter->filter,
filter->sw_idx,
queue);
if (ret)
wx_err(wx, "FDIR restore failed, index:%u\n",
filter->sw_idx);
}
unlock:
spin_unlock(&txgbe->fdir_perfect_lock);
}
void txgbe_configure_fdir(struct wx *wx)
{
wx_disable_sec_rx_path(wx);
if (test_bit(WX_FLAG_FDIR_HASH, wx->flags)) {
txgbe_init_fdir_signature(wx);
} else if (test_bit(WX_FLAG_FDIR_PERFECT, wx->flags)) {
txgbe_init_fdir_perfect(wx);
txgbe_fdir_filter_restore(wx);
}
wx_enable_sec_rx_path(wx);
}
void txgbe_fdir_filter_exit(struct wx *wx)
{
struct txgbe_fdir_filter *filter;
struct txgbe *txgbe = wx->priv;
struct hlist_node *node;
spin_lock(&txgbe->fdir_perfect_lock);
hlist_for_each_entry_safe(filter, node,
&txgbe->fdir_filter_list, fdir_node) {
hlist_del(&filter->fdir_node);
kfree(filter);
}
txgbe->fdir_filter_count = 0;
spin_unlock(&txgbe->fdir_perfect_lock);
}
Annotation
- Immediate include surface: `linux/string.h`, `linux/types.h`, `linux/pci.h`, `../libwx/wx_type.h`, `../libwx/wx_lib.h`, `../libwx/wx_hw.h`, `txgbe_type.h`, `txgbe_fdir.h`.
- Detected declarations: `function txgbe_atr_compute_sig_hash`, `function txgbe_atr_compute_perfect_hash`, `function txgbe_fdir_check_cmd_complete`, `function txgbe_fdir_add_signature_filter`, `function txgbe_atr`, `function txgbe_fdir_set_input_mask`, `function txgbe_fdir_write_perfect_filter`, `function txgbe_fdir_erase_perfect_filter`, `function txgbe_fdir_enable`, `function txgbe_init_fdir_signature`.
- 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.
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.