Skip to content

Commit 6e0ddb6

Browse files
committed
Merge branch 'FDB-fixes-for-Felix-and-Ocelot-switches'
Vladimir Oltean says: ==================== FDB fixes for Felix and Ocelot switches This series fixes the following problems: - Dynamically learnt addresses never expiring (neither for Ocelot nor for Felix) - Half of the FDB not visible in 'bridge fdb show' (for Felix only) ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 0ba83aa + c0d7ecc commit 6e0ddb6

File tree

6 files changed

+16
-6
lines changed

6 files changed

+16
-6
lines changed

drivers/net/dsa/ocelot/felix.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ static int felix_init_structs(struct felix *felix, int num_phys_ports)
400400
ocelot->stats_layout = felix->info->stats_layout;
401401
ocelot->num_stats = felix->info->num_stats;
402402
ocelot->shared_queue_sz = felix->info->shared_queue_sz;
403+
ocelot->num_mact_rows = felix->info->num_mact_rows;
403404
ocelot->vcap_is2_keys = felix->info->vcap_is2_keys;
404405
ocelot->vcap_is2_actions= felix->info->vcap_is2_actions;
405406
ocelot->vcap = felix->info->vcap;

drivers/net/dsa/ocelot/felix.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ struct felix_info {
1515
const u32 *const *map;
1616
const struct ocelot_ops *ops;
1717
int shared_queue_sz;
18+
int num_mact_rows;
1819
const struct ocelot_stat_layout *stats_layout;
1920
unsigned int num_stats;
2021
int num_ports;

drivers/net/dsa/ocelot/felix_vsc9959.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,6 +1220,7 @@ struct felix_info felix_info_vsc9959 = {
12201220
.vcap_is2_actions = vsc9959_vcap_is2_actions,
12211221
.vcap = vsc9959_vcap_props,
12221222
.shared_queue_sz = 128 * 1024,
1223+
.num_mact_rows = 2048,
12231224
.num_ports = 6,
12241225
.switch_pci_bar = 4,
12251226
.imdio_pci_bar = 0,

drivers/net/ethernet/mscc/ocelot.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,10 +1031,8 @@ int ocelot_fdb_dump(struct ocelot *ocelot, int port,
10311031
{
10321032
int i, j;
10331033

1034-
/* Loop through all the mac tables entries. There are 1024 rows of 4
1035-
* entries.
1036-
*/
1037-
for (i = 0; i < 1024; i++) {
1034+
/* Loop through all the mac tables entries. */
1035+
for (i = 0; i < ocelot->num_mact_rows; i++) {
10381036
for (j = 0; j < 4; j++) {
10391037
struct ocelot_mact_entry entry;
10401038
bool is_static;
@@ -1453,8 +1451,15 @@ static void ocelot_port_attr_stp_state_set(struct ocelot *ocelot, int port,
14531451

14541452
void ocelot_set_ageing_time(struct ocelot *ocelot, unsigned int msecs)
14551453
{
1456-
ocelot_write(ocelot, ANA_AUTOAGE_AGE_PERIOD(msecs / 2),
1457-
ANA_AUTOAGE);
1454+
unsigned int age_period = ANA_AUTOAGE_AGE_PERIOD(msecs / 2000);
1455+
1456+
/* Setting AGE_PERIOD to zero effectively disables automatic aging,
1457+
* which is clearly not what our intention is. So avoid that.
1458+
*/
1459+
if (!age_period)
1460+
age_period = 1;
1461+
1462+
ocelot_rmw(ocelot, age_period, ANA_AUTOAGE_AGE_PERIOD_M, ANA_AUTOAGE);
14581463
}
14591464
EXPORT_SYMBOL(ocelot_set_ageing_time);
14601465

drivers/net/ethernet/mscc/ocelot_regs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ int ocelot_chip_init(struct ocelot *ocelot, const struct ocelot_ops *ops)
431431
ocelot->stats_layout = ocelot_stats_layout;
432432
ocelot->num_stats = ARRAY_SIZE(ocelot_stats_layout);
433433
ocelot->shared_queue_sz = 224 * 1024;
434+
ocelot->num_mact_rows = 1024;
434435
ocelot->ops = ops;
435436

436437
ret = ocelot_regfields_init(ocelot, ocelot_regfields);

include/soc/mscc/ocelot.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@ struct ocelot {
502502
unsigned int num_stats;
503503

504504
int shared_queue_sz;
505+
int num_mact_rows;
505506

506507
struct net_device *hw_bridge_dev;
507508
u16 bridge_mask;

0 commit comments

Comments
 (0)