Skip to content

Commit ceea48e

Browse files
wkzdavem330
authored andcommitted
net: dsa: mv88e6xxx: Limit histogram counters to ingress traffic
Chips in this family only have one set of histogram counters, which can be used to count ingressing and/or egressing traffic. mv88e6xxx has, up until this point, kept the hardware default of counting both directions. In the mean time, standard counter group support has been added to ethtool. Via that interface, drivers may report ingress-only and egress-only histograms separately - but not combined. In order for mv88e6xxx to maximize amount of diagnostic information that can be exported via standard interfaces, we opt to limit the histogram counters to ingress traffic only. Which will allow us to export them via the standard "rmon" group in an upcoming commit. The reason for choosing ingress-only over egress-only, is to be compatible with RFC2819 (RMON MIB). Reviewed-by: Florian Fainelli <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Signed-off-by: Tobias Waldekranz <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0e047ce commit ceea48e

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

drivers/net/dsa/mv88e6xxx/chip.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ static size_t mv88e6095_stats_get_stat(struct mv88e6xxx_chip *chip, int port,
12211221
return 0;
12221222

12231223
*data = _mv88e6xxx_get_ethtool_stat(chip, stat, port, 0,
1224-
MV88E6XXX_G1_STATS_OP_HIST_RX_TX);
1224+
MV88E6XXX_G1_STATS_OP_HIST_RX);
12251225
return 1;
12261226
}
12271227

@@ -1233,7 +1233,7 @@ static size_t mv88e6250_stats_get_stat(struct mv88e6xxx_chip *chip, int port,
12331233
return 0;
12341234

12351235
*data = _mv88e6xxx_get_ethtool_stat(chip, stat, port, 0,
1236-
MV88E6XXX_G1_STATS_OP_HIST_RX_TX);
1236+
MV88E6XXX_G1_STATS_OP_HIST_RX);
12371237
return 1;
12381238
}
12391239

@@ -1246,7 +1246,7 @@ static size_t mv88e6320_stats_get_stat(struct mv88e6xxx_chip *chip, int port,
12461246

12471247
*data = _mv88e6xxx_get_ethtool_stat(chip, stat, port,
12481248
MV88E6XXX_G1_STATS_OP_BANK_1_BIT_9,
1249-
MV88E6XXX_G1_STATS_OP_HIST_RX_TX);
1249+
MV88E6XXX_G1_STATS_OP_HIST_RX);
12501250
return 1;
12511251
}
12521252

drivers/net/dsa/mv88e6xxx/global1.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,7 @@ int mv88e6390_g1_rmu_disable(struct mv88e6xxx_chip *chip)
462462
int mv88e6390_g1_stats_set_histogram(struct mv88e6xxx_chip *chip)
463463
{
464464
return mv88e6xxx_g1_ctl2_mask(chip, MV88E6390_G1_CTL2_HIST_MODE_MASK,
465-
MV88E6390_G1_CTL2_HIST_MODE_RX |
466-
MV88E6390_G1_CTL2_HIST_MODE_TX);
465+
MV88E6390_G1_CTL2_HIST_MODE_RX);
467466
}
468467

469468
int mv88e6xxx_g1_set_device_number(struct mv88e6xxx_chip *chip, int index)
@@ -491,7 +490,7 @@ int mv88e6095_g1_stats_set_histogram(struct mv88e6xxx_chip *chip)
491490
if (err)
492491
return err;
493492

494-
val |= MV88E6XXX_G1_STATS_OP_HIST_RX_TX;
493+
val |= MV88E6XXX_G1_STATS_OP_HIST_RX;
495494

496495
err = mv88e6xxx_g1_write(chip, MV88E6XXX_G1_STATS_OP, val);
497496

@@ -506,7 +505,7 @@ int mv88e6xxx_g1_stats_snapshot(struct mv88e6xxx_chip *chip, int port)
506505
err = mv88e6xxx_g1_write(chip, MV88E6XXX_G1_STATS_OP,
507506
MV88E6XXX_G1_STATS_OP_BUSY |
508507
MV88E6XXX_G1_STATS_OP_CAPTURE_PORT |
509-
MV88E6XXX_G1_STATS_OP_HIST_RX_TX | port);
508+
MV88E6XXX_G1_STATS_OP_HIST_RX | port);
510509
if (err)
511510
return err;
512511

0 commit comments

Comments
 (0)