Re: [PATCH net-next 2/2] net: cadence: macb: Report standard stats

From: Andrew Lunn
Date: Fri Feb 14 2025 - 18:14:54 EST


> +static const struct ethtool_rmon_hist_range gem_rmon_ranges[] = {
> + { 64, 64 },
> + { 65, 127 },
> + { 128, 255 },
> + { 256, 511 },
> + { 512, 1023 },
> + { 1024, 1518 },
> + { 1519, 16384 },
> + { },
> +};

static const struct ethtool_rmon_hist_range a5psw_rmon_ranges[] = {
{ 0, 64 },
{ 65, 127 },
{ 128, 255 },
{ 256, 511 },
{ 512, 1023 },
{ 1024, 1518 },
{ 1519, A5PSW_MAX_MTU },
{}
};

static const struct ethtool_rmon_hist_range axienet_rmon_ranges[] = {
{ 64, 64 },
{ 65, 127 },
{ 128, 255 },
{ 256, 511 },
{ 512, 1023 },
{ 1024, 1518 },
{ 1519, 16384 },
{ },
};

static const struct ethtool_rmon_hist_range bcmasp_rmon_ranges[] = {
{ 0, 64},
{ 65, 127},
{ 128, 255},
{ 256, 511},
{ 512, 1023},
{ 1024, 1518},
{ 1519, 1522},
{}
};

static const struct ethtool_rmon_hist_range mlxsw_rmon_ranges[] = {
{ 0, 64 },
{ 65, 127 },
{ 128, 255 },
{ 256, 511 },
{ 512, 1023 },
{ 1024, 1518 },
{ 1519, 2047 },
{ 2048, 4095 },
{ 4096, 8191 },
{ 8192, 10239 },
{}
};

static const struct ethtool_rmon_hist_range mlx5e_rmon_ranges[] = {
{ 0, 64 },
{ 65, 127 },
{ 128, 255 },
{ 256, 511 },
{ 512, 1023 },
{ 1024, 1518 },
{ 1519, 2047 },
{ 2048, 4095 },
{ 4096, 8191 },
{ 8192, 10239 },
{}
};

Could we maybe have one central table which drivers share? I assume
IETF defined these bands as part or RMON?

Andrew