Commit 6e0ddb65 authored by David S. Miller's avatar David S. Miller

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 0ba83aa0 c0d7eccb
...@@ -400,6 +400,7 @@ static int felix_init_structs(struct felix *felix, int num_phys_ports) ...@@ -400,6 +400,7 @@ static int felix_init_structs(struct felix *felix, int num_phys_ports)
ocelot->stats_layout = felix->info->stats_layout; ocelot->stats_layout = felix->info->stats_layout;
ocelot->num_stats = felix->info->num_stats; ocelot->num_stats = felix->info->num_stats;
ocelot->shared_queue_sz = felix->info->shared_queue_sz; ocelot->shared_queue_sz = felix->info->shared_queue_sz;
ocelot->num_mact_rows = felix->info->num_mact_rows;
ocelot->vcap_is2_keys = felix->info->vcap_is2_keys; ocelot->vcap_is2_keys = felix->info->vcap_is2_keys;
ocelot->vcap_is2_actions= felix->info->vcap_is2_actions; ocelot->vcap_is2_actions= felix->info->vcap_is2_actions;
ocelot->vcap = felix->info->vcap; ocelot->vcap = felix->info->vcap;
......
...@@ -15,6 +15,7 @@ struct felix_info { ...@@ -15,6 +15,7 @@ struct felix_info {
const u32 *const *map; const u32 *const *map;
const struct ocelot_ops *ops; const struct ocelot_ops *ops;
int shared_queue_sz; int shared_queue_sz;
int num_mact_rows;
const struct ocelot_stat_layout *stats_layout; const struct ocelot_stat_layout *stats_layout;
unsigned int num_stats; unsigned int num_stats;
int num_ports; int num_ports;
......
...@@ -1220,6 +1220,7 @@ struct felix_info felix_info_vsc9959 = { ...@@ -1220,6 +1220,7 @@ struct felix_info felix_info_vsc9959 = {
.vcap_is2_actions = vsc9959_vcap_is2_actions, .vcap_is2_actions = vsc9959_vcap_is2_actions,
.vcap = vsc9959_vcap_props, .vcap = vsc9959_vcap_props,
.shared_queue_sz = 128 * 1024, .shared_queue_sz = 128 * 1024,
.num_mact_rows = 2048,
.num_ports = 6, .num_ports = 6,
.switch_pci_bar = 4, .switch_pci_bar = 4,
.imdio_pci_bar = 0, .imdio_pci_bar = 0,
......
...@@ -1031,10 +1031,8 @@ int ocelot_fdb_dump(struct ocelot *ocelot, int port, ...@@ -1031,10 +1031,8 @@ int ocelot_fdb_dump(struct ocelot *ocelot, int port,
{ {
int i, j; int i, j;
/* Loop through all the mac tables entries. There are 1024 rows of 4 /* Loop through all the mac tables entries. */
* entries. for (i = 0; i < ocelot->num_mact_rows; i++) {
*/
for (i = 0; i < 1024; i++) {
for (j = 0; j < 4; j++) { for (j = 0; j < 4; j++) {
struct ocelot_mact_entry entry; struct ocelot_mact_entry entry;
bool is_static; bool is_static;
...@@ -1453,8 +1451,15 @@ static void ocelot_port_attr_stp_state_set(struct ocelot *ocelot, int port, ...@@ -1453,8 +1451,15 @@ static void ocelot_port_attr_stp_state_set(struct ocelot *ocelot, int port,
void ocelot_set_ageing_time(struct ocelot *ocelot, unsigned int msecs) void ocelot_set_ageing_time(struct ocelot *ocelot, unsigned int msecs)
{ {
ocelot_write(ocelot, ANA_AUTOAGE_AGE_PERIOD(msecs / 2), unsigned int age_period = ANA_AUTOAGE_AGE_PERIOD(msecs / 2000);
ANA_AUTOAGE);
/* Setting AGE_PERIOD to zero effectively disables automatic aging,
* which is clearly not what our intention is. So avoid that.
*/
if (!age_period)
age_period = 1;
ocelot_rmw(ocelot, age_period, ANA_AUTOAGE_AGE_PERIOD_M, ANA_AUTOAGE);
} }
EXPORT_SYMBOL(ocelot_set_ageing_time); EXPORT_SYMBOL(ocelot_set_ageing_time);
......
...@@ -431,6 +431,7 @@ int ocelot_chip_init(struct ocelot *ocelot, const struct ocelot_ops *ops) ...@@ -431,6 +431,7 @@ int ocelot_chip_init(struct ocelot *ocelot, const struct ocelot_ops *ops)
ocelot->stats_layout = ocelot_stats_layout; ocelot->stats_layout = ocelot_stats_layout;
ocelot->num_stats = ARRAY_SIZE(ocelot_stats_layout); ocelot->num_stats = ARRAY_SIZE(ocelot_stats_layout);
ocelot->shared_queue_sz = 224 * 1024; ocelot->shared_queue_sz = 224 * 1024;
ocelot->num_mact_rows = 1024;
ocelot->ops = ops; ocelot->ops = ops;
ret = ocelot_regfields_init(ocelot, ocelot_regfields); ret = ocelot_regfields_init(ocelot, ocelot_regfields);
......
...@@ -502,6 +502,7 @@ struct ocelot { ...@@ -502,6 +502,7 @@ struct ocelot {
unsigned int num_stats; unsigned int num_stats;
int shared_queue_sz; int shared_queue_sz;
int num_mact_rows;
struct net_device *hw_bridge_dev; struct net_device *hw_bridge_dev;
u16 bridge_mask; u16 bridge_mask;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment