drivers/net/ethernet/intel/ice/ice_fltr.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/ice/ice_fltr.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/ice/ice_fltr.c- Extension
.c- Size
- 12915 bytes
- Lines
- 482
- 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.
- 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
ice.hice_fltr.h
Detected Declarations
function ice_fltr_free_listfunction list_for_each_entry_safefunction ice_fltr_add_entry_to_listfunction modefunction modefunction ice_fltr_clear_vsi_promiscfunction ice_fltr_set_vsi_promiscfunction ice_fltr_add_mac_listfunction ice_fltr_remove_mac_listfunction ice_fltr_add_vlan_listfunction ice_fltr_remove_vlan_listfunction ice_fltr_add_eth_listfunction ice_fltr_remove_eth_listfunction ice_fltr_remove_allfunction ice_fltr_add_mac_to_listfunction ice_fltr_add_vlan_to_listfunction ice_fltr_add_eth_to_listfunction ice_fltr_prepare_macfunction ice_fltr_prepare_mac_and_broadcastfunction ice_fltr_add_mac_to_listfunction ice_fltr_prepare_vlanfunction ice_fltr_prepare_ethfunction ice_fltr_add_macfunction ice_fltr_add_mac_and_broadcastfunction ice_fltr_remove_macfunction ice_fltr_add_vlanfunction ice_fltr_remove_vlanfunction ice_fltr_add_ethfunction ice_fltr_remove_eth
Annotated Snippet
ice_fltr_add_mac_to_list(vsi, &tmp_list, broadcast, action)) {
ice_fltr_free_list(ice_pf_to_dev(vsi->back), &tmp_list);
return -ENOMEM;
}
result = mac_action(vsi, &tmp_list);
ice_fltr_free_list(ice_pf_to_dev(vsi->back), &tmp_list);
return result;
}
/**
* ice_fltr_prepare_vlan - add or remove VLAN filter
* @vsi: pointer to VSI struct
* @vlan: VLAN filter details
* @vlan_action: pointer to add or remove VLAN function
*/
static int
ice_fltr_prepare_vlan(struct ice_vsi *vsi, struct ice_vlan *vlan,
int (*vlan_action)(struct ice_vsi *, struct list_head *))
{
LIST_HEAD(tmp_list);
int result;
if (ice_fltr_add_vlan_to_list(vsi, &tmp_list, vlan))
return -ENOMEM;
result = vlan_action(vsi, &tmp_list);
ice_fltr_free_list(ice_pf_to_dev(vsi->back), &tmp_list);
return result;
}
/**
* ice_fltr_prepare_eth - add or remove ethertype filter
* @vsi: pointer to VSI struct
* @ethertype: ethertype of packet to be filtered
* @flag: direction of packet, Tx or Rx
* @action: action to be performed on filter match
* @eth_action: pointer to add or remove ethertype function
*/
static int
ice_fltr_prepare_eth(struct ice_vsi *vsi, u16 ethertype, u16 flag,
enum ice_sw_fwd_act_type action,
int (*eth_action)(struct ice_vsi *, struct list_head *))
{
LIST_HEAD(tmp_list);
int result;
if (ice_fltr_add_eth_to_list(vsi, &tmp_list, ethertype, flag, action))
return -ENOMEM;
result = eth_action(vsi, &tmp_list);
ice_fltr_free_list(ice_pf_to_dev(vsi->back), &tmp_list);
return result;
}
/**
* ice_fltr_add_mac - add single MAC filter
* @vsi: pointer to VSI struct
* @mac: MAC to add
* @action: action to be performed on filter match
*/
int ice_fltr_add_mac(struct ice_vsi *vsi, const u8 *mac,
enum ice_sw_fwd_act_type action)
{
return ice_fltr_prepare_mac(vsi, mac, action, ice_fltr_add_mac_list);
}
/**
* ice_fltr_add_mac_and_broadcast - add single MAC and broadcast
* @vsi: pointer to VSI struct
* @mac: MAC to add
* @action: action to be performed on filter match
*/
int
ice_fltr_add_mac_and_broadcast(struct ice_vsi *vsi, const u8 *mac,
enum ice_sw_fwd_act_type action)
{
return ice_fltr_prepare_mac_and_broadcast(vsi, mac, action,
ice_fltr_add_mac_list);
}
/**
* ice_fltr_remove_mac - remove MAC filter
* @vsi: pointer to VSI struct
* @mac: filter MAC to remove
* @action: action to remove
*/
int ice_fltr_remove_mac(struct ice_vsi *vsi, const u8 *mac,
enum ice_sw_fwd_act_type action)
{
Annotation
- Immediate include surface: `ice.h`, `ice_fltr.h`.
- Detected declarations: `function ice_fltr_free_list`, `function list_for_each_entry_safe`, `function ice_fltr_add_entry_to_list`, `function mode`, `function mode`, `function ice_fltr_clear_vsi_promisc`, `function ice_fltr_set_vsi_promisc`, `function ice_fltr_add_mac_list`, `function ice_fltr_remove_mac_list`, `function ice_fltr_add_vlan_list`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.