drivers/s390/net/qeth_ethtool.c
Source file repositories/reference/linux-study-clean/drivers/s390/net/qeth_ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/net/qeth_ethtool.c- Extension
.c- Size
- 13289 bytes
- Lines
- 465
- Domain
- Driver Families
- Bucket
- drivers/s390
- 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
linux/ethtool.hqeth_core.h
Detected Declarations
struct qeth_statsfunction qeth_add_stat_datafunction qeth_add_stat_stringsfunction qeth_get_sset_countfunction qeth_get_ethtool_statsfunction __qeth_set_coalescefunction qeth_set_coalescefunction qeth_get_ringparamfunction qeth_get_stringsfunction qeth_get_drvinfofunction qeth_get_channelsfunction qeth_set_channelsfunction qeth_get_ts_infofunction qeth_get_tunablefunction qeth_set_tunablefunction qeth_get_per_queue_coalescefunction qeth_set_per_queue_coalescefunction qeth_set_ethtool_link_modesfunction qeth_get_link_ksettings
Annotated Snippet
struct qeth_stats {
char name[ETH_GSTRING_LEN];
unsigned int offset;
};
static const struct qeth_stats txq_stats[] = {
QETH_TXQ_STAT("IO buffers", bufs),
QETH_TXQ_STAT("IO buffer elements", buf_elements),
QETH_TXQ_STAT("packed IO buffers", bufs_pack),
QETH_TXQ_STAT("skbs", tx_packets),
QETH_TXQ_STAT("packed skbs", skbs_pack),
QETH_TXQ_STAT("SG skbs", skbs_sg),
QETH_TXQ_STAT("HW csum skbs", skbs_csum),
QETH_TXQ_STAT("TSO skbs", skbs_tso),
QETH_TXQ_STAT("linearized skbs", skbs_linearized),
QETH_TXQ_STAT("linearized+error skbs", skbs_linearized_fail),
QETH_TXQ_STAT("TSO bytes", tso_bytes),
QETH_TXQ_STAT("Packing mode switches", packing_mode_switch),
QETH_TXQ_STAT("Queue stopped", stopped),
QETH_TXQ_STAT("Doorbell", doorbell),
QETH_TXQ_STAT("IRQ for frames", coal_frames),
QETH_TXQ_STAT("Completion IRQ", completion_irq),
QETH_TXQ_STAT("Completion yield", completion_yield),
QETH_TXQ_STAT("Completion timer", completion_timer),
};
static const struct qeth_stats card_stats[] = {
QETH_CARD_STAT("rx0 IO buffers", rx_bufs),
QETH_CARD_STAT("rx0 HW csum skbs", rx_skb_csum),
QETH_CARD_STAT("rx0 SG skbs", rx_sg_skbs),
QETH_CARD_STAT("rx0 SG page frags", rx_sg_frags),
QETH_CARD_STAT("rx0 SG page allocs", rx_sg_alloc_page),
QETH_CARD_STAT("rx0 dropped, no memory", rx_dropped_nomem),
QETH_CARD_STAT("rx0 dropped, bad format", rx_dropped_notsupp),
QETH_CARD_STAT("rx0 dropped, runt", rx_dropped_runt),
};
#define TXQ_STATS_LEN ARRAY_SIZE(txq_stats)
#define CARD_STATS_LEN ARRAY_SIZE(card_stats)
static void qeth_add_stat_data(u64 **dst, void *src,
const struct qeth_stats stats[],
unsigned int size)
{
unsigned int i;
char *stat;
for (i = 0; i < size; i++) {
stat = (char *)src + stats[i].offset;
**dst = *(u64 *)stat;
(*dst)++;
}
}
static void qeth_add_stat_strings(u8 **data, const char *prefix,
const struct qeth_stats stats[],
unsigned int size)
{
unsigned int i;
for (i = 0; i < size; i++)
ethtool_sprintf(data, "%s%s", prefix, stats[i].name);
}
static int qeth_get_sset_count(struct net_device *dev, int stringset)
{
struct qeth_card *card = dev->ml_priv;
switch (stringset) {
case ETH_SS_STATS:
return CARD_STATS_LEN +
card->qdio.no_out_queues * TXQ_STATS_LEN;
default:
return -EINVAL;
}
}
static void qeth_get_ethtool_stats(struct net_device *dev,
struct ethtool_stats *stats, u64 *data)
{
struct qeth_card *card = dev->ml_priv;
unsigned int i;
qeth_add_stat_data(&data, &card->stats, card_stats, CARD_STATS_LEN);
for (i = 0; i < card->qdio.no_out_queues; i++)
qeth_add_stat_data(&data, &card->qdio.out_qs[i]->stats,
txq_stats, TXQ_STATS_LEN);
}
static void __qeth_set_coalesce(struct net_device *dev,
Annotation
- Immediate include surface: `linux/ethtool.h`, `qeth_core.h`.
- Detected declarations: `struct qeth_stats`, `function qeth_add_stat_data`, `function qeth_add_stat_strings`, `function qeth_get_sset_count`, `function qeth_get_ethtool_stats`, `function __qeth_set_coalesce`, `function qeth_set_coalesce`, `function qeth_get_ringparam`, `function qeth_get_strings`, `function qeth_get_drvinfo`.
- Atlas domain: Driver Families / drivers/s390.
- 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.