Lines Matching refs:ofdpa
173 struct ofdpa { struct
194 struct ofdpa *ofdpa; argument
741 ofdpa_flow_tbl_find(const struct ofdpa *ofdpa, in ofdpa_flow_tbl_find() argument
747 hash_for_each_possible(ofdpa->flow_tbl, found, in ofdpa_flow_tbl_find()
759 struct ofdpa *ofdpa = ofdpa_port->ofdpa; in ofdpa_flow_tbl_add() local
766 spin_lock_irqsave(&ofdpa->flow_tbl_lock, lock_flags); in ofdpa_flow_tbl_add()
768 found = ofdpa_flow_tbl_find(ofdpa, match); in ofdpa_flow_tbl_add()
778 found->cookie = ofdpa->flow_tbl_next_cookie++; in ofdpa_flow_tbl_add()
782 hash_add(ofdpa->flow_tbl, &found->entry, found->key_crc32); in ofdpa_flow_tbl_add()
783 spin_unlock_irqrestore(&ofdpa->flow_tbl_lock, lock_flags); in ofdpa_flow_tbl_add()
794 struct ofdpa *ofdpa = ofdpa_port->ofdpa; in ofdpa_flow_tbl_del() local
802 spin_lock_irqsave(&ofdpa->flow_tbl_lock, lock_flags); in ofdpa_flow_tbl_del()
804 found = ofdpa_flow_tbl_find(ofdpa, match); in ofdpa_flow_tbl_del()
811 spin_unlock_irqrestore(&ofdpa->flow_tbl_lock, lock_flags); in ofdpa_flow_tbl_del()
1048 ofdpa_group_tbl_find(const struct ofdpa *ofdpa, in ofdpa_group_tbl_find() argument
1053 hash_for_each_possible(ofdpa->group_tbl, found, in ofdpa_group_tbl_find()
1078 struct ofdpa *ofdpa = ofdpa_port->ofdpa; in ofdpa_group_tbl_add() local
1082 spin_lock_irqsave(&ofdpa->group_tbl_lock, lock_flags); in ofdpa_group_tbl_add()
1084 found = ofdpa_group_tbl_find(ofdpa, match); in ofdpa_group_tbl_add()
1096 hash_add(ofdpa->group_tbl, &found->entry, found->group_id); in ofdpa_group_tbl_add()
1098 spin_unlock_irqrestore(&ofdpa->group_tbl_lock, lock_flags); in ofdpa_group_tbl_add()
1109 struct ofdpa *ofdpa = ofdpa_port->ofdpa; in ofdpa_group_tbl_del() local
1114 spin_lock_irqsave(&ofdpa->group_tbl_lock, lock_flags); in ofdpa_group_tbl_del()
1116 found = ofdpa_group_tbl_find(ofdpa, match); in ofdpa_group_tbl_del()
1123 spin_unlock_irqrestore(&ofdpa->group_tbl_lock, lock_flags); in ofdpa_group_tbl_del()
1219 ofdpa_neigh_tbl_find(const struct ofdpa *ofdpa, __be32 ip_addr) in ofdpa_neigh_tbl_find() argument
1223 hash_for_each_possible(ofdpa->neigh_tbl, found, in ofdpa_neigh_tbl_find()
1231 static void ofdpa_neigh_add(struct ofdpa *ofdpa, in ofdpa_neigh_add() argument
1234 entry->index = ofdpa->neigh_tbl_next_index++; in ofdpa_neigh_add()
1236 hash_add(ofdpa->neigh_tbl, &entry->entry, in ofdpa_neigh_add()
1262 struct ofdpa *ofdpa = ofdpa_port->ofdpa; in ofdpa_port_ipv4_neigh() local
1280 spin_lock_irqsave(&ofdpa->neigh_tbl_lock, lock_flags); in ofdpa_port_ipv4_neigh()
1282 found = ofdpa_neigh_tbl_find(ofdpa, ip_addr); in ofdpa_port_ipv4_neigh()
1293 ofdpa_neigh_add(ofdpa, entry); in ofdpa_port_ipv4_neigh()
1304 spin_unlock_irqrestore(&ofdpa->neigh_tbl_lock, lock_flags); in ofdpa_port_ipv4_neigh()
1379 struct ofdpa *ofdpa = ofdpa_port->ofdpa; in ofdpa_port_ipv4_nh() local
1393 spin_lock_irqsave(&ofdpa->neigh_tbl_lock, lock_flags); in ofdpa_port_ipv4_nh()
1395 found = ofdpa_neigh_tbl_find(ofdpa, ip_addr); in ofdpa_port_ipv4_nh()
1404 ofdpa_neigh_add(ofdpa, entry); in ofdpa_port_ipv4_nh()
1418 spin_unlock_irqrestore(&ofdpa->neigh_tbl_lock, lock_flags); in ofdpa_port_ipv4_nh()
1434 static struct ofdpa_port *ofdpa_port_get(const struct ofdpa *ofdpa, in ofdpa_port_get() argument
1439 rocker_port = ofdpa->rocker->ports[port_index]; in ofdpa_port_get()
1447 const struct ofdpa *ofdpa = ofdpa_port->ofdpa; in ofdpa_port_vlan_flood_group() local
1448 unsigned int port_count = ofdpa->rocker->port_count; in ofdpa_port_vlan_flood_group()
1465 p = ofdpa_port_get(ofdpa, i); in ofdpa_port_vlan_flood_group()
1493 const struct ofdpa *ofdpa = ofdpa_port->ofdpa; in ofdpa_port_vlan_l2_groups() local
1494 unsigned int port_count = ofdpa->rocker->port_count; in ofdpa_port_vlan_l2_groups()
1524 p = ofdpa_port_get(ofdpa, i); in ofdpa_port_vlan_l2_groups()
1885 ofdpa_fdb_tbl_find(const struct ofdpa *ofdpa, in ofdpa_fdb_tbl_find() argument
1890 hash_for_each_possible(ofdpa->fdb_tbl, found, entry, match->key_crc32) in ofdpa_fdb_tbl_find()
1901 struct ofdpa *ofdpa = ofdpa_port->ofdpa; in ofdpa_port_fdb() local
1918 spin_lock_irqsave(&ofdpa->fdb_tbl_lock, lock_flags); in ofdpa_port_fdb()
1920 found = ofdpa_fdb_tbl_find(ofdpa, fdb); in ofdpa_port_fdb()
1929 hash_add(ofdpa->fdb_tbl, &fdb->entry, in ofdpa_port_fdb()
1933 spin_unlock_irqrestore(&ofdpa->fdb_tbl_lock, lock_flags); in ofdpa_port_fdb()
1949 struct ofdpa *ofdpa = ofdpa_port->ofdpa; in ofdpa_port_fdb_flush() local
1962 spin_lock_irqsave(&ofdpa->fdb_tbl_lock, lock_flags); in ofdpa_port_fdb_flush()
1964 hash_for_each_safe(ofdpa->fdb_tbl, bkt, tmp, found, entry) { in ofdpa_port_fdb_flush()
1978 spin_unlock_irqrestore(&ofdpa->fdb_tbl_lock, lock_flags); in ofdpa_port_fdb_flush()
1985 struct ofdpa *ofdpa = from_timer(ofdpa, t, fdb_cleanup_timer); in ofdpa_fdb_cleanup() local
1989 unsigned long next_timer = jiffies + ofdpa->ageing_time; in ofdpa_fdb_cleanup()
1996 spin_lock_irqsave(&ofdpa->fdb_tbl_lock, lock_flags); in ofdpa_fdb_cleanup()
1998 hash_for_each_safe(ofdpa->fdb_tbl, bkt, tmp, entry, entry) { in ofdpa_fdb_cleanup()
2013 spin_unlock_irqrestore(&ofdpa->fdb_tbl_lock, lock_flags); in ofdpa_fdb_cleanup()
2015 mod_timer(&ofdpa->fdb_cleanup_timer, round_jiffies_up(next_timer)); in ofdpa_fdb_cleanup()
2213 ofdpa_internal_vlan_tbl_find(const struct ofdpa *ofdpa, int ifindex) in ofdpa_internal_vlan_tbl_find() argument
2217 hash_for_each_possible(ofdpa->internal_vlan_tbl, found, in ofdpa_internal_vlan_tbl_find()
2229 struct ofdpa *ofdpa = ofdpa_port->ofdpa; in ofdpa_port_internal_vlan_id_get() local
2241 spin_lock_irqsave(&ofdpa->internal_vlan_tbl_lock, lock_flags); in ofdpa_port_internal_vlan_id_get()
2243 found = ofdpa_internal_vlan_tbl_find(ofdpa, ifindex); in ofdpa_port_internal_vlan_id_get()
2250 hash_add(ofdpa->internal_vlan_tbl, &found->entry, found->ifindex); in ofdpa_port_internal_vlan_id_get()
2253 if (test_and_set_bit(i, ofdpa->internal_vlan_bitmap)) in ofdpa_port_internal_vlan_id_get()
2263 spin_unlock_irqrestore(&ofdpa->internal_vlan_tbl_lock, lock_flags); in ofdpa_port_internal_vlan_id_get()
2317 struct ofdpa *ofdpa = ofdpa_port->ofdpa; in ofdpa_port_internal_vlan_id_put() local
2322 spin_lock_irqsave(&ofdpa->internal_vlan_tbl_lock, lock_flags); in ofdpa_port_internal_vlan_id_put()
2324 found = ofdpa_internal_vlan_tbl_find(ofdpa, ifindex); in ofdpa_port_internal_vlan_id_put()
2334 clear_bit(bit, ofdpa->internal_vlan_bitmap); in ofdpa_port_internal_vlan_id_put()
2340 spin_unlock_irqrestore(&ofdpa->internal_vlan_tbl_lock, lock_flags); in ofdpa_port_internal_vlan_id_put()
2349 struct ofdpa *ofdpa = rocker->wpriv; in ofdpa_init() local
2351 ofdpa->rocker = rocker; in ofdpa_init()
2353 hash_init(ofdpa->flow_tbl); in ofdpa_init()
2354 spin_lock_init(&ofdpa->flow_tbl_lock); in ofdpa_init()
2356 hash_init(ofdpa->group_tbl); in ofdpa_init()
2357 spin_lock_init(&ofdpa->group_tbl_lock); in ofdpa_init()
2359 hash_init(ofdpa->fdb_tbl); in ofdpa_init()
2360 spin_lock_init(&ofdpa->fdb_tbl_lock); in ofdpa_init()
2362 hash_init(ofdpa->internal_vlan_tbl); in ofdpa_init()
2363 spin_lock_init(&ofdpa->internal_vlan_tbl_lock); in ofdpa_init()
2365 hash_init(ofdpa->neigh_tbl); in ofdpa_init()
2366 spin_lock_init(&ofdpa->neigh_tbl_lock); in ofdpa_init()
2368 timer_setup(&ofdpa->fdb_cleanup_timer, ofdpa_fdb_cleanup, 0); in ofdpa_init()
2369 mod_timer(&ofdpa->fdb_cleanup_timer, jiffies); in ofdpa_init()
2371 ofdpa->ageing_time = BR_DEFAULT_AGEING_TIME; in ofdpa_init()
2378 struct ofdpa *ofdpa = rocker->wpriv; in ofdpa_fini() local
2389 del_timer_sync(&ofdpa->fdb_cleanup_timer); in ofdpa_fini()
2392 spin_lock_irqsave(&ofdpa->flow_tbl_lock, flags); in ofdpa_fini()
2393 hash_for_each_safe(ofdpa->flow_tbl, bkt, tmp, flow_entry, entry) in ofdpa_fini()
2395 spin_unlock_irqrestore(&ofdpa->flow_tbl_lock, flags); in ofdpa_fini()
2397 spin_lock_irqsave(&ofdpa->group_tbl_lock, flags); in ofdpa_fini()
2398 hash_for_each_safe(ofdpa->group_tbl, bkt, tmp, group_entry, entry) in ofdpa_fini()
2400 spin_unlock_irqrestore(&ofdpa->group_tbl_lock, flags); in ofdpa_fini()
2402 spin_lock_irqsave(&ofdpa->fdb_tbl_lock, flags); in ofdpa_fini()
2403 hash_for_each_safe(ofdpa->fdb_tbl, bkt, tmp, fdb_entry, entry) in ofdpa_fini()
2405 spin_unlock_irqrestore(&ofdpa->fdb_tbl_lock, flags); in ofdpa_fini()
2407 spin_lock_irqsave(&ofdpa->internal_vlan_tbl_lock, flags); in ofdpa_fini()
2408 hash_for_each_safe(ofdpa->internal_vlan_tbl, bkt, in ofdpa_fini()
2411 spin_unlock_irqrestore(&ofdpa->internal_vlan_tbl_lock, flags); in ofdpa_fini()
2413 spin_lock_irqsave(&ofdpa->neigh_tbl_lock, flags); in ofdpa_fini()
2414 hash_for_each_safe(ofdpa->neigh_tbl, bkt, tmp, neigh_entry, entry) in ofdpa_fini()
2416 spin_unlock_irqrestore(&ofdpa->neigh_tbl_lock, flags); in ofdpa_fini()
2423 ofdpa_port->ofdpa = rocker_port->rocker->wpriv; in ofdpa_port_pre_init()
2523 struct ofdpa *ofdpa = ofdpa_port->ofdpa; in ofdpa_port_attr_bridge_ageing_time_set() local
2526 if (ofdpa_port->ageing_time < ofdpa->ageing_time) in ofdpa_port_attr_bridge_ageing_time_set()
2527 ofdpa->ageing_time = ofdpa_port->ageing_time; in ofdpa_port_attr_bridge_ageing_time_set()
2528 mod_timer(&ofdpa_port->ofdpa->fdb_cleanup_timer, jiffies); in ofdpa_port_attr_bridge_ageing_time_set()
2724 struct ofdpa *ofdpa = rocker->wpriv; in ofdpa_fib4_add() local
2729 if (ofdpa->fib_aborted) in ofdpa_fib4_add()
2747 struct ofdpa *ofdpa = rocker->wpriv; in ofdpa_fib4_del() local
2751 if (ofdpa->fib_aborted) in ofdpa_fib4_del()
2765 struct ofdpa *ofdpa = rocker->wpriv; in ofdpa_fib4_abort() local
2772 if (ofdpa->fib_aborted) in ofdpa_fib4_abort()
2775 spin_lock_irqsave(&ofdpa->flow_tbl_lock, flags); in ofdpa_fib4_abort()
2776 hash_for_each_safe(ofdpa->flow_tbl, bkt, tmp, flow_entry, entry) { in ofdpa_fib4_abort()
2791 spin_unlock_irqrestore(&ofdpa->flow_tbl_lock, flags); in ofdpa_fib4_abort()
2792 ofdpa->fib_aborted = true; in ofdpa_fib4_abort()
2797 .priv_size = sizeof(struct ofdpa),