Lines Matching refs:pgid_entry
41 struct lan966x_pgid_entry *pgid_entry, *tmp; in lan966x_mdb_purge_pgid_entries() local
43 list_for_each_entry_safe(pgid_entry, tmp, &lan966x->pgid_entries, list) { in lan966x_mdb_purge_pgid_entries()
44 list_del(&pgid_entry->list); in lan966x_mdb_purge_pgid_entries()
45 kfree(pgid_entry); in lan966x_mdb_purge_pgid_entries()
185 struct lan966x_pgid_entry *pgid_entry; in lan966x_pgid_entry_add() local
187 pgid_entry = kzalloc(sizeof(*pgid_entry), GFP_KERNEL); in lan966x_pgid_entry_add()
188 if (!pgid_entry) in lan966x_pgid_entry_add()
191 pgid_entry->ports = ports; in lan966x_pgid_entry_add()
192 pgid_entry->index = index; in lan966x_pgid_entry_add()
193 refcount_set(&pgid_entry->refcount, 1); in lan966x_pgid_entry_add()
195 list_add_tail(&pgid_entry->list, &lan966x->pgid_entries); in lan966x_pgid_entry_add()
197 return pgid_entry; in lan966x_pgid_entry_add()
204 struct lan966x_pgid_entry *pgid_entry; in lan966x_pgid_entry_get() local
210 list_for_each_entry(pgid_entry, &lan966x->pgid_entries, list) { in lan966x_pgid_entry_get()
211 if (pgid_entry->ports == mdb_entry->ports) { in lan966x_pgid_entry_get()
212 refcount_inc(&pgid_entry->refcount); in lan966x_pgid_entry_get()
213 return pgid_entry; in lan966x_pgid_entry_get()
223 list_for_each_entry(pgid_entry, &lan966x->pgid_entries, list) { in lan966x_pgid_entry_get()
224 if (pgid_entry->index == index) { in lan966x_pgid_entry_get()
239 struct lan966x_pgid_entry *pgid_entry) in lan966x_pgid_entry_del() argument
241 if (!refcount_dec_and_test(&pgid_entry->refcount)) in lan966x_pgid_entry_del()
244 list_del(&pgid_entry->list); in lan966x_pgid_entry_del()
245 kfree(pgid_entry); in lan966x_pgid_entry_del()
254 struct lan966x_pgid_entry *pgid_entry; in lan966x_mdb_l2_add() local
276 pgid_entry = lan966x_pgid_entry_get(lan966x, mdb_entry); in lan966x_mdb_l2_add()
277 if (IS_ERR(pgid_entry)) { in lan966x_mdb_l2_add()
280 return PTR_ERR(pgid_entry); in lan966x_mdb_l2_add()
282 mdb_entry->pgid = pgid_entry; in lan966x_mdb_l2_add()
291 lan966x, ANA_PGID(pgid_entry->index)); in lan966x_mdb_l2_add()
293 return lan966x_mac_learn(lan966x, pgid_entry->index, mdb_entry->mac, in lan966x_mdb_l2_add()
303 struct lan966x_pgid_entry *pgid_entry; in lan966x_mdb_l2_del() local
338 pgid_entry = lan966x_pgid_entry_get(lan966x, mdb_entry); in lan966x_mdb_l2_del()
339 if (IS_ERR(pgid_entry)) { in lan966x_mdb_l2_del()
342 return PTR_ERR(pgid_entry); in lan966x_mdb_l2_del()
344 mdb_entry->pgid = pgid_entry; in lan966x_mdb_l2_del()
348 lan966x, ANA_PGID(pgid_entry->index)); in lan966x_mdb_l2_del()
350 return lan966x_mac_learn(lan966x, pgid_entry->index, mdb_entry->mac, in lan966x_mdb_l2_del()
413 struct lan966x_pgid_entry *pgid_entry; in lan966x_mdb_l2_cpu_copy() local
422 pgid_entry = lan966x_pgid_entry_get(lan966x, mdb_entry); in lan966x_mdb_l2_cpu_copy()
423 if (IS_ERR(pgid_entry)) in lan966x_mdb_l2_cpu_copy()
426 mdb_entry->pgid = pgid_entry; in lan966x_mdb_l2_cpu_copy()
430 lan966x, ANA_PGID(pgid_entry->index)); in lan966x_mdb_l2_cpu_copy()
432 lan966x_mac_learn(lan966x, pgid_entry->index, mdb_entry->mac, in lan966x_mdb_l2_cpu_copy()
468 struct lan966x_pgid_entry *pgid_entry; in lan966x_mdb_l2_cpu_remove() local
477 pgid_entry = lan966x_pgid_entry_get(lan966x, mdb_entry); in lan966x_mdb_l2_cpu_remove()
478 if (IS_ERR(pgid_entry)) in lan966x_mdb_l2_cpu_remove()
481 mdb_entry->pgid = pgid_entry; in lan966x_mdb_l2_cpu_remove()
485 lan966x, ANA_PGID(pgid_entry->index)); in lan966x_mdb_l2_cpu_remove()
487 lan966x_mac_learn(lan966x, pgid_entry->index, mdb_entry->mac, in lan966x_mdb_l2_cpu_remove()