include/linux/dsa/ocelot.h
Source file repositories/reference/linux-study-clean/include/linux/dsa/ocelot.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/dsa/ocelot.h- Extension
.h- Size
- 12878 bytes
- Lines
- 325
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- 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/if_bridge.hlinux/if_vlan.hlinux/kthread.hlinux/packing.hlinux/skbuff.hnet/dsa.h
Detected Declarations
struct ocelot_skb_cbstruct felix_deferred_xmit_workstruct ocelot_8021q_tagger_datafunction ocelot_8021q_tagger_datafunction ocelot_xfh_get_rew_valfunction ocelot_xfh_get_lenfunction ocelot_xfh_get_src_portfunction ocelot_xfh_get_qos_classfunction ocelot_xfh_get_tag_typefunction ocelot_xfh_get_vlan_tcifunction ocelot_ifh_set_bypassfunction ocelot_ifh_set_rew_opfunction ocelot_ifh_set_destfunction ocelot_ifh_set_qos_classfunction seville_ifh_set_destfunction ocelot_ifh_set_srcfunction ocelot_ifh_set_tag_typefunction ocelot_ifh_set_vlan_tcifunction ocelot_ptp_rew_opfunction ports
Annotated Snippet
struct ocelot_skb_cb {
struct sk_buff *clone;
unsigned int ptp_class; /* valid only for clones */
unsigned long ptp_tx_time; /* valid only for clones */
u32 tstamp_lo;
u8 ptp_cmd;
u8 ts_id;
};
#define OCELOT_SKB_CB(skb) \
((struct ocelot_skb_cb *)((skb)->cb))
#define IFH_TAG_TYPE_C 0
#define IFH_TAG_TYPE_S 1
#define IFH_REW_OP_NOOP 0x0
#define IFH_REW_OP_DSCP 0x1
#define IFH_REW_OP_ONE_STEP_PTP 0x2
#define IFH_REW_OP_TWO_STEP_PTP 0x3
#define IFH_REW_OP_ORIGIN_PTP 0x5
#define OCELOT_TAG_LEN 16
#define OCELOT_SHORT_PREFIX_LEN 4
#define OCELOT_LONG_PREFIX_LEN 16
#define OCELOT_TOTAL_TAG_LEN (OCELOT_SHORT_PREFIX_LEN + OCELOT_TAG_LEN)
/* The CPU injection header and the CPU extraction header can have 3 types of
* prefixes: long, short and no prefix. The format of the header itself is the
* same in all 3 cases.
*
* Extraction with long prefix:
*
* +-------------------+-------------------+------+------+------------+-------+
* | ff:ff:ff:ff:ff:ff | fe:ff:ff:ff:ff:ff | 8880 | 000a | extraction | frame |
* | | | | | header | |
* +-------------------+-------------------+------+------+------------+-------+
* 48 bits 48 bits 16 bits 16 bits 128 bits
*
* Extraction with short prefix:
*
* +------+------+------------+-------+
* | 8880 | 000a | extraction | frame |
* | | | header | |
* +------+------+------------+-------+
* 16 bits 16 bits 128 bits
*
* Extraction with no prefix:
*
* +------------+-------+
* | extraction | frame |
* | header | |
* +------------+-------+
* 128 bits
*
*
* Injection with long prefix:
*
* +-------------------+-------------------+------+------+------------+-------+
* | any dmac | any smac | 8880 | 000a | injection | frame |
* | | | | | header | |
* +-------------------+-------------------+------+------+------------+-------+
* 48 bits 48 bits 16 bits 16 bits 128 bits
*
* Injection with short prefix:
*
* +------+------+------------+-------+
* | 8880 | 000a | injection | frame |
* | | | header | |
* +------+------+------------+-------+
* 16 bits 16 bits 128 bits
*
* Injection with no prefix:
*
* +------------+-------+
* | injection | frame |
* | header | |
* +------------+-------+
* 128 bits
*
* The injection header looks like this (network byte order, bit 127
* is part of lowest address byte in memory, bit 0 is part of highest
* address byte):
*
* +------+------+------+------+------+------+------+------+
* 127:120 |BYPASS| MASQ | MASQ_PORT |REW_OP|REW_OP|
* +------+------+------+------+------+------+------+------+
* 119:112 | REW_OP |
* +------+------+------+------+------+------+------+------+
* 111:104 | REW_VAL |
* +------+------+------+------+------+------+------+------+
Annotation
- Immediate include surface: `linux/if_bridge.h`, `linux/if_vlan.h`, `linux/kthread.h`, `linux/packing.h`, `linux/skbuff.h`, `net/dsa.h`.
- Detected declarations: `struct ocelot_skb_cb`, `struct felix_deferred_xmit_work`, `struct ocelot_8021q_tagger_data`, `function ocelot_8021q_tagger_data`, `function ocelot_xfh_get_rew_val`, `function ocelot_xfh_get_len`, `function ocelot_xfh_get_src_port`, `function ocelot_xfh_get_qos_class`, `function ocelot_xfh_get_tag_type`, `function ocelot_xfh_get_vlan_tci`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.