drivers/net/ethernet/rocker/rocker_ofdpa.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/rocker/rocker_ofdpa.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/rocker/rocker_ofdpa.c- Extension
.c- Size
- 76141 bytes
- Lines
- 2807
- 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.
- 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/kernel.hlinux/types.hlinux/spinlock.hlinux/hashtable.hlinux/crc32.hlinux/netdevice.hlinux/inetdevice.hlinux/if_vlan.hlinux/if_bridge.hnet/neighbour.hnet/switchdev.hnet/ip_fib.hnet/nexthop.hnet/arp.hrocker.hrocker_tlv.h
Detected Declarations
struct ofdpa_flow_tbl_keystruct ofdpa_flow_tbl_entrystruct ofdpa_group_tbl_entrystruct ofdpa_fdb_tbl_entrystruct ofdpa_fdb_tbl_keystruct ofdpa_internal_vlan_tbl_entrystruct ofdpa_neigh_tbl_entrystruct ofdpastruct ofdpa_portstruct ofdpa_fdb_learn_workfunction ofdpa_vlan_id_is_internalfunction ofdpa_port_vid_to_vlanfunction ofdpa_port_vlan_to_vidfunction ofdpa_port_is_slavefunction ofdpa_port_is_bridgedfunction ofdpa_port_is_ovsedfunction ofdpa_flags_nowaitfunction ofdpa_cmd_flow_tbl_add_ig_portfunction ofdpa_cmd_flow_tbl_add_vlanfunction ofdpa_cmd_flow_tbl_add_term_macfunction ofdpa_cmd_flow_tbl_add_ucast_routingfunction ofdpa_cmd_flow_tbl_add_bridgefunction ofdpa_cmd_flow_tbl_add_aclfunction ofdpa_cmd_flow_tbl_addfunction ofdpa_cmd_flow_tbl_delfunction ofdpa_cmd_group_tbl_add_l2_interfacefunction ofdpa_cmd_group_tbl_add_l2_rewritefunction ofdpa_cmd_group_tbl_add_group_idsfunction ofdpa_cmd_group_tbl_add_l3_unicastfunction ofdpa_cmd_group_tbl_addfunction ofdpa_cmd_group_tbl_delfunction ofdpa_flow_tbl_findfunction hash_for_each_possiblefunction ofdpa_flow_tbl_addfunction ofdpa_flow_tbl_delfunction ofdpa_flow_tbl_dofunction ofdpa_flow_tbl_ig_portfunction ofdpa_flow_tbl_vlanfunction ofdpa_flow_tbl_term_macfunction ofdpa_flow_tbl_bridgefunction ofdpa_flow_tbl_ucast4_routingfunction ofdpa_flow_tbl_aclfunction ofdpa_group_tbl_findfunction hash_for_each_possiblefunction ofdpa_group_tbl_addfunction ofdpa_group_tbl_delfunction ofdpa_group_tbl_dofunction ofdpa_group_l2_interface
Annotated Snippet
struct ofdpa_flow_tbl_key {
u32 priority;
enum rocker_of_dpa_table_id tbl_id;
union {
struct {
u32 in_pport;
u32 in_pport_mask;
enum rocker_of_dpa_table_id goto_tbl;
} ig_port;
struct {
u32 in_pport;
__be16 vlan_id;
__be16 vlan_id_mask;
enum rocker_of_dpa_table_id goto_tbl;
bool untagged;
__be16 new_vlan_id;
} vlan;
struct {
u32 in_pport;
u32 in_pport_mask;
__be16 eth_type;
u8 eth_dst[ETH_ALEN];
u8 eth_dst_mask[ETH_ALEN];
__be16 vlan_id;
__be16 vlan_id_mask;
enum rocker_of_dpa_table_id goto_tbl;
bool copy_to_cpu;
} term_mac;
struct {
__be16 eth_type;
__be32 dst4;
__be32 dst4_mask;
enum rocker_of_dpa_table_id goto_tbl;
u32 group_id;
} ucast_routing;
struct {
u8 eth_dst[ETH_ALEN];
u8 eth_dst_mask[ETH_ALEN];
int has_eth_dst;
int has_eth_dst_mask;
__be16 vlan_id;
u32 tunnel_id;
enum rocker_of_dpa_table_id goto_tbl;
u32 group_id;
bool copy_to_cpu;
} bridge;
struct {
u32 in_pport;
u32 in_pport_mask;
u8 eth_src[ETH_ALEN];
u8 eth_src_mask[ETH_ALEN];
u8 eth_dst[ETH_ALEN];
u8 eth_dst_mask[ETH_ALEN];
__be16 eth_type;
__be16 vlan_id;
__be16 vlan_id_mask;
u8 ip_proto;
u8 ip_proto_mask;
u8 ip_tos;
u8 ip_tos_mask;
u32 group_id;
} acl;
};
};
struct ofdpa_flow_tbl_entry {
struct hlist_node entry;
u32 cmd;
u64 cookie;
struct ofdpa_flow_tbl_key key;
size_t key_len;
u32 key_crc32; /* key */
struct fib_info *fi;
};
struct ofdpa_group_tbl_entry {
struct hlist_node entry;
u32 cmd;
u32 group_id; /* key */
u16 group_count;
union {
struct {
u8 pop_vlan;
} l2_interface;
struct {
u8 eth_src[ETH_ALEN];
u8 eth_dst[ETH_ALEN];
__be16 vlan_id;
u32 group_id;
} l2_rewrite;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/types.h`, `linux/spinlock.h`, `linux/hashtable.h`, `linux/crc32.h`, `linux/netdevice.h`, `linux/inetdevice.h`, `linux/if_vlan.h`.
- Detected declarations: `struct ofdpa_flow_tbl_key`, `struct ofdpa_flow_tbl_entry`, `struct ofdpa_group_tbl_entry`, `struct ofdpa_fdb_tbl_entry`, `struct ofdpa_fdb_tbl_key`, `struct ofdpa_internal_vlan_tbl_entry`, `struct ofdpa_neigh_tbl_entry`, `struct ofdpa`, `struct ofdpa_port`, `struct ofdpa_fdb_learn_work`.
- 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.