drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c- Extension
.c- Size
- 15368 bytes
- Lines
- 627
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
lan966x_main.hvcap_api.hvcap_api_client.hvcap_tc.h
Detected Declarations
function lan966x_tc_is_known_etypefunction lan966x_tc_flower_handler_control_usagefunction lan966x_tc_flower_handler_basic_usagefunction lan966x_tc_flower_handler_cvlan_usagefunction lan966x_tc_flower_handler_vlan_usagefunction lan966x_tc_flower_use_dissectorsfunction lan966x_tc_flower_action_checkfunction flow_action_for_eachfunction lan966x_tc_set_actionsetfunction lan966x_tc_add_rule_link_targetfunction lan966x_tc_add_rule_linkfunction lan966x_tc_add_rule_counterfunction lan966x_tc_flower_addfunction flow_action_for_eachfunction lan966x_tc_flower_delfunction lan966x_tc_flower_statsfunction lan966x_tc_flower
Annotated Snippet
switch (etype) {
case ETH_P_ALL:
case ETH_P_ARP:
case ETH_P_IP:
case ETH_P_IPV6:
return true;
}
break;
case VCAP_TYPE_IS2:
switch (etype) {
case ETH_P_ALL:
case ETH_P_ARP:
case ETH_P_IP:
case ETH_P_IPV6:
case ETH_P_SNAP:
case ETH_P_802_2:
return true;
}
break;
case VCAP_TYPE_ES0:
return true;
default:
NL_SET_ERR_MSG_MOD(st->fco->common.extack,
"VCAP type not supported");
return false;
}
return false;
}
static int
lan966x_tc_flower_handler_control_usage(struct vcap_tc_flower_parse_usage *st)
{
struct netlink_ext_ack *extack = st->fco->common.extack;
struct flow_match_control match;
int err = 0;
flow_rule_match_control(st->frule, &match);
if (match.mask->flags & FLOW_DIS_IS_FRAGMENT) {
if (match.key->flags & FLOW_DIS_IS_FRAGMENT)
err = vcap_rule_add_key_bit(st->vrule,
VCAP_KF_L3_FRAGMENT,
VCAP_BIT_1);
else
err = vcap_rule_add_key_bit(st->vrule,
VCAP_KF_L3_FRAGMENT,
VCAP_BIT_0);
if (err)
goto bad_frag_out;
}
if (match.mask->flags & FLOW_DIS_FIRST_FRAG) {
if (match.key->flags & FLOW_DIS_FIRST_FRAG)
err = vcap_rule_add_key_bit(st->vrule,
VCAP_KF_L3_FRAG_OFS_GT0,
VCAP_BIT_0);
else
err = vcap_rule_add_key_bit(st->vrule,
VCAP_KF_L3_FRAG_OFS_GT0,
VCAP_BIT_1);
if (err)
goto bad_frag_out;
}
if (!flow_rule_is_supp_control_flags(FLOW_DIS_IS_FRAGMENT |
FLOW_DIS_FIRST_FRAG,
match.mask->flags, extack))
return -EOPNOTSUPP;
st->used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL);
return err;
bad_frag_out:
NL_SET_ERR_MSG_MOD(extack, "ip_frag parse error");
return err;
}
static int
lan966x_tc_flower_handler_basic_usage(struct vcap_tc_flower_parse_usage *st)
{
struct flow_match_basic match;
int err = 0;
flow_rule_match_basic(st->frule, &match);
if (match.mask->n_proto) {
st->l3_proto = be16_to_cpu(match.key->n_proto);
if (!lan966x_tc_is_known_etype(st, st->l3_proto)) {
err = vcap_rule_add_key_u32(st->vrule, VCAP_KF_ETYPE,
st->l3_proto, ~0);
Annotation
- Immediate include surface: `lan966x_main.h`, `vcap_api.h`, `vcap_api_client.h`, `vcap_tc.h`.
- Detected declarations: `function lan966x_tc_is_known_etype`, `function lan966x_tc_flower_handler_control_usage`, `function lan966x_tc_flower_handler_basic_usage`, `function lan966x_tc_flower_handler_cvlan_usage`, `function lan966x_tc_flower_handler_vlan_usage`, `function lan966x_tc_flower_use_dissectors`, `function lan966x_tc_flower_action_check`, `function flow_action_for_each`, `function lan966x_tc_set_actionset`, `function lan966x_tc_add_rule_link_target`.
- 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.