// mutex_lock(&priv->reg_mutex);
// idx = find_first_zero_bit(priv->octet_cntr_use_bm, MAX_COUNTERS);
-// if (idx >= priv->n_counters) {
+// if (idx >= priv->r->n_counters) {
// mutex_unlock(&priv->reg_mutex);
// return -1;
// }
* a 0-bit means the counter is already allocated (for octets)
*/
idx = find_first_bit(priv->packet_cntr_use_bm, MAX_COUNTERS * 2);
- if (idx >= priv->n_counters * 2) {
+ if (idx >= priv->r->n_counters * 2) {
j = find_first_zero_bit(priv->octet_cntr_use_bm, MAX_COUNTERS);
- if (j >= priv->n_counters) {
+ if (j >= priv->r->n_counters) {
mutex_unlock(&priv->reg_mutex);
return -1;
}
priv->l2_bucket_size = 4;
priv->n_mst = 64;
priv->n_pie_blocks = 12;
- priv->n_counters = 128;
break;
case RTL8390_FAMILY_ID:
priv->ds->ops = &rtldsa_83xx_switch_ops;
priv->l2_bucket_size = 4;
priv->n_mst = 256;
priv->n_pie_blocks = 18;
- priv->n_counters = 1024;
break;
case RTL9300_FAMILY_ID:
priv->ds->ops = &rtldsa_93xx_switch_ops;
priv->l2_bucket_size = 8;
priv->n_mst = 64;
priv->n_pie_blocks = 16;
- priv->n_counters = 2048;
break;
case RTL9310_FAMILY_ID:
priv->ds->ops = &rtldsa_93xx_switch_ops;
priv->l2_bucket_size = 8;
priv->n_mst = 128;
priv->n_pie_blocks = 16;
- priv->n_counters = 2048;
break;
}
.isr_port_link_sts_chg = RTL838X_ISR_PORT_LINK_STS_CHG,
.imr_port_link_sts_chg = RTL838X_IMR_PORT_LINK_STS_CHG,
.imr_glb = RTL838X_IMR_GLB,
+ .n_counters = 128,
.port_ignore = 0x1f,
.vlan_tables_read = rtl838x_vlan_tables_read,
.vlan_set_tagged = rtl838x_vlan_set_tagged,
int isr_port_link_sts_chg;
int imr_port_link_sts_chg;
int imr_glb;
+ int n_counters;
u8 port_ignore;
void (*vlan_tables_read)(u32 vlan, struct rtl838x_vlan_info *info);
void (*vlan_set_tagged)(u32 vlan, struct rtl838x_vlan_info *info);
int n_pie_blocks;
struct rhashtable tc_ht;
unsigned long pie_use_bm[MAX_PIE_ENTRIES >> 5];
- int n_counters;
unsigned long octet_cntr_use_bm[MAX_COUNTERS >> 5];
unsigned long packet_cntr_use_bm[MAX_COUNTERS >> 4];
struct rhltable routes;
.isr_port_link_sts_chg = RTL839X_ISR_PORT_LINK_STS_CHG,
.imr_port_link_sts_chg = RTL839X_IMR_PORT_LINK_STS_CHG,
.imr_glb = RTL839X_IMR_GLB,
+ .n_counters = 1024,
.port_ignore = 0x3f,
.vlan_tables_read = rtl839x_vlan_tables_read,
.vlan_set_tagged = rtl839x_vlan_set_tagged,
.isr_port_link_sts_chg = RTL930X_ISR_PORT_LINK_STS_CHG,
.imr_port_link_sts_chg = RTL930X_IMR_PORT_LINK_STS_CHG,
.imr_glb = RTL930X_IMR_GLB,
+ .n_counters = 2048,
.port_ignore = 0x3f,
.vlan_tables_read = rtl930x_vlan_tables_read,
.vlan_set_tagged = rtl930x_vlan_set_tagged,
.isr_port_link_sts_chg = RTL931X_ISR_PORT_LINK_STS_CHG,
.imr_port_link_sts_chg = RTL931X_IMR_PORT_LINK_STS_CHG,
/* imr_glb does not exist on RTL931X */
+ .n_counters = 2048,
.port_ignore = 0x3f,
.vlan_tables_read = rtl931x_vlan_tables_read,
.vlan_set_tagged = rtl931x_vlan_set_tagged,