include/net/tc_act/tc_pedit.h
Source file repositories/reference/linux-study-clean/include/net/tc_act/tc_pedit.h
File Facts
- System
- Linux kernel
- Corpus path
include/net/tc_act/tc_pedit.h- Extension
.h- Size
- 2361 bytes
- Lines
- 120
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- 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
net/act_api.hlinux/tc_act/tc_pedit.hlinux/types.h
Detected Declarations
struct tcf_pedit_key_exstruct tcf_pedit_parmsstruct tcf_peditfunction is_tcf_peditfunction tcf_pedit_nkeysfunction tcf_pedit_htypefunction tcf_pedit_cmdfunction tcf_pedit_maskfunction tcf_pedit_valfunction tcf_pedit_offset
Annotated Snippet
struct tcf_pedit_key_ex {
enum pedit_header_type htype;
enum pedit_cmd cmd;
};
struct tcf_pedit_parms {
struct tc_pedit_key *tcfp_keys;
struct tcf_pedit_key_ex *tcfp_keys_ex;
int action;
unsigned char tcfp_nkeys;
unsigned char tcfp_flags;
struct rcu_head rcu;
};
struct tcf_pedit {
struct tc_action common;
struct tcf_pedit_parms __rcu *parms;
};
#define to_pedit(a) ((struct tcf_pedit *)a)
#define to_pedit_parms(a) (rcu_dereference(to_pedit(a)->parms))
static inline bool is_tcf_pedit(const struct tc_action *a)
{
#ifdef CONFIG_NET_CLS_ACT
if (a->ops && a->ops->id == TCA_ID_PEDIT)
return true;
#endif
return false;
}
static inline int tcf_pedit_nkeys(const struct tc_action *a)
{
struct tcf_pedit_parms *parms;
int nkeys;
rcu_read_lock();
parms = to_pedit_parms(a);
nkeys = parms->tcfp_nkeys;
rcu_read_unlock();
return nkeys;
}
static inline u32 tcf_pedit_htype(const struct tc_action *a, int index)
{
u32 htype = TCA_PEDIT_KEY_EX_HDR_TYPE_NETWORK;
struct tcf_pedit_parms *parms;
rcu_read_lock();
parms = to_pedit_parms(a);
if (parms->tcfp_keys_ex)
htype = parms->tcfp_keys_ex[index].htype;
rcu_read_unlock();
return htype;
}
static inline u32 tcf_pedit_cmd(const struct tc_action *a, int index)
{
struct tcf_pedit_parms *parms;
u32 cmd = __PEDIT_CMD_MAX;
rcu_read_lock();
parms = to_pedit_parms(a);
if (parms->tcfp_keys_ex)
cmd = parms->tcfp_keys_ex[index].cmd;
rcu_read_unlock();
return cmd;
}
static inline u32 tcf_pedit_mask(const struct tc_action *a, int index)
{
struct tcf_pedit_parms *parms;
u32 mask;
rcu_read_lock();
parms = to_pedit_parms(a);
mask = parms->tcfp_keys[index].mask;
rcu_read_unlock();
return mask;
}
static inline u32 tcf_pedit_val(const struct tc_action *a, int index)
{
struct tcf_pedit_parms *parms;
u32 val;
Annotation
- Immediate include surface: `net/act_api.h`, `linux/tc_act/tc_pedit.h`, `linux/types.h`.
- Detected declarations: `struct tcf_pedit_key_ex`, `struct tcf_pedit_parms`, `struct tcf_pedit`, `function is_tcf_pedit`, `function tcf_pedit_nkeys`, `function tcf_pedit_htype`, `function tcf_pedit_cmd`, `function tcf_pedit_mask`, `function tcf_pedit_val`, `function tcf_pedit_offset`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- 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.