net/ethtool/strset.c
Source file repositories/reference/linux-study-clean/net/ethtool/strset.c
File Facts
- System
- Linux kernel
- Corpus path
net/ethtool/strset.c- Extension
.c- Size
- 12719 bytes
- Lines
- 503
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/ethtool.hlinux/phy.hcommon.hnetlink.h
Detected Declarations
struct strset_infostruct strset_req_infostruct strset_reply_datafunction strset_includefunction strset_get_idfunction strset_parse_requestfunction strset_cleanup_datafunction strset_prepare_setfunction strset_prepare_datafunction strset_set_sizefunction strset_reply_sizefunction strset_fill_stringfunction strset_fill_setfunction strset_fill_reply
Annotated Snippet
struct strset_info {
bool per_dev;
bool free_strings;
unsigned int count;
const char (*strings)[ETH_GSTRING_LEN];
};
static const struct strset_info info_template[] = {
[ETH_SS_TEST] = {
.per_dev = true,
},
[ETH_SS_STATS] = {
.per_dev = true,
},
[ETH_SS_PRIV_FLAGS] = {
.per_dev = true,
},
[ETH_SS_FEATURES] = {
.per_dev = false,
.count = ARRAY_SIZE(netdev_features_strings),
.strings = netdev_features_strings,
},
[ETH_SS_RSS_HASH_FUNCS] = {
.per_dev = false,
.count = ARRAY_SIZE(rss_hash_func_strings),
.strings = rss_hash_func_strings,
},
[ETH_SS_TUNABLES] = {
.per_dev = false,
.count = ARRAY_SIZE(tunable_strings),
.strings = tunable_strings,
},
[ETH_SS_PHY_STATS] = {
.per_dev = true,
},
[ETH_SS_PHY_TUNABLES] = {
.per_dev = false,
.count = ARRAY_SIZE(phy_tunable_strings),
.strings = phy_tunable_strings,
},
[ETH_SS_LINK_MODES] = {
.per_dev = false,
.count = __ETHTOOL_LINK_MODE_MASK_NBITS,
.strings = link_mode_names,
},
[ETH_SS_MSG_CLASSES] = {
.per_dev = false,
.count = NETIF_MSG_CLASS_COUNT,
.strings = netif_msg_class_names,
},
[ETH_SS_WOL_MODES] = {
.per_dev = false,
.count = WOL_MODE_COUNT,
.strings = wol_mode_names,
},
[ETH_SS_SOF_TIMESTAMPING] = {
.per_dev = false,
.count = __SOF_TIMESTAMPING_CNT,
.strings = sof_timestamping_names,
},
[ETH_SS_TS_TX_TYPES] = {
.per_dev = false,
.count = __HWTSTAMP_TX_CNT,
.strings = ts_tx_type_names,
},
[ETH_SS_TS_RX_FILTERS] = {
.per_dev = false,
.count = __HWTSTAMP_FILTER_CNT,
.strings = ts_rx_filter_names,
},
[ETH_SS_TS_FLAGS] = {
.per_dev = false,
.count = __HWTSTAMP_FLAG_CNT,
.strings = ts_flags_names,
},
[ETH_SS_UDP_TUNNEL_TYPES] = {
.per_dev = false,
.count = __ETHTOOL_UDP_TUNNEL_TYPE_CNT,
.strings = udp_tunnel_type_names,
},
[ETH_SS_STATS_STD] = {
.per_dev = false,
.count = __ETHTOOL_STATS_CNT,
.strings = stats_std_names,
},
[ETH_SS_STATS_ETH_PHY] = {
.per_dev = false,
.count = __ETHTOOL_A_STATS_ETH_PHY_CNT,
.strings = stats_eth_phy_names,
},
Annotation
- Immediate include surface: `linux/ethtool.h`, `linux/phy.h`, `common.h`, `netlink.h`.
- Detected declarations: `struct strset_info`, `struct strset_req_info`, `struct strset_reply_data`, `function strset_include`, `function strset_get_id`, `function strset_parse_request`, `function strset_cleanup_data`, `function strset_prepare_set`, `function strset_prepare_data`, `function strset_set_size`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- 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.