Lines Matching refs:mac_entry
207 struct lan966x_mac_entry *mac_entry; in lan966x_mac_alloc_entry() local
209 mac_entry = kzalloc(sizeof(*mac_entry), GFP_ATOMIC); in lan966x_mac_alloc_entry()
210 if (!mac_entry) in lan966x_mac_alloc_entry()
213 memcpy(mac_entry->mac, mac, ETH_ALEN); in lan966x_mac_alloc_entry()
214 mac_entry->vid = vid; in lan966x_mac_alloc_entry()
215 mac_entry->port_index = port->chip_port; in lan966x_mac_alloc_entry()
216 mac_entry->row = LAN966X_MAC_INVALID_ROW; in lan966x_mac_alloc_entry()
217 mac_entry->lag = port->bond ? true : false; in lan966x_mac_alloc_entry()
218 return mac_entry; in lan966x_mac_alloc_entry()
226 struct lan966x_mac_entry *mac_entry; in lan966x_mac_find_entry() local
228 list_for_each_entry(mac_entry, &lan966x->mac_entries, list) { in lan966x_mac_find_entry()
229 if (mac_entry->vid == vid && in lan966x_mac_find_entry()
230 ether_addr_equal(mac, mac_entry->mac) && in lan966x_mac_find_entry()
231 mac_entry->port_index == port_index) { in lan966x_mac_find_entry()
232 res = mac_entry; in lan966x_mac_find_entry()
276 struct lan966x_mac_entry *mac_entry; in lan966x_mac_add_entry() local
290 mac_entry = lan966x_mac_find_entry(lan966x, addr, vid, port->chip_port); in lan966x_mac_add_entry()
291 if (mac_entry) { in lan966x_mac_add_entry()
296 mac_entry = lan966x_mac_alloc_entry(port, addr, vid); in lan966x_mac_add_entry()
297 if (!mac_entry) { in lan966x_mac_add_entry()
302 list_add_tail(&mac_entry->list, &lan966x->mac_entries); in lan966x_mac_add_entry()
317 struct lan966x_mac_entry *mac_entry, *tmp; in lan966x_mac_del_entry() local
320 list_for_each_entry_safe(mac_entry, tmp, &lan966x->mac_entries, in lan966x_mac_del_entry()
322 if (mac_entry->vid == vid && in lan966x_mac_del_entry()
323 ether_addr_equal(addr, mac_entry->mac)) { in lan966x_mac_del_entry()
324 lan966x_mac_forget_locked(lan966x, mac_entry->mac, in lan966x_mac_del_entry()
325 mac_entry->vid, in lan966x_mac_del_entry()
328 list_del(&mac_entry->list); in lan966x_mac_del_entry()
329 kfree(mac_entry); in lan966x_mac_del_entry()
341 struct lan966x_mac_entry *mac_entry; in lan966x_mac_lag_replace_port_entry() local
344 list_for_each_entry(mac_entry, &lan966x->mac_entries, list) { in lan966x_mac_lag_replace_port_entry()
345 if (mac_entry->port_index == src->chip_port && in lan966x_mac_lag_replace_port_entry()
346 mac_entry->lag) { in lan966x_mac_lag_replace_port_entry()
347 lan966x_mac_forget_locked(lan966x, mac_entry->mac, in lan966x_mac_lag_replace_port_entry()
348 mac_entry->vid, in lan966x_mac_lag_replace_port_entry()
352 mac_entry->mac, mac_entry->vid, in lan966x_mac_lag_replace_port_entry()
354 mac_entry->port_index = dst->chip_port; in lan966x_mac_lag_replace_port_entry()
363 struct lan966x_mac_entry *mac_entry, *tmp; in lan966x_mac_lag_remove_port_entry() local
366 list_for_each_entry_safe(mac_entry, tmp, &lan966x->mac_entries, in lan966x_mac_lag_remove_port_entry()
368 if (mac_entry->port_index == src->chip_port && in lan966x_mac_lag_remove_port_entry()
369 mac_entry->lag) { in lan966x_mac_lag_remove_port_entry()
370 lan966x_mac_forget_locked(lan966x, mac_entry->mac, in lan966x_mac_lag_remove_port_entry()
371 mac_entry->vid, in lan966x_mac_lag_remove_port_entry()
374 list_del(&mac_entry->list); in lan966x_mac_lag_remove_port_entry()
375 kfree(mac_entry); in lan966x_mac_lag_remove_port_entry()
383 struct lan966x_mac_entry *mac_entry, *tmp; in lan966x_mac_purge_entries() local
386 list_for_each_entry_safe(mac_entry, tmp, &lan966x->mac_entries, in lan966x_mac_purge_entries()
388 lan966x_mac_forget_locked(lan966x, mac_entry->mac, in lan966x_mac_purge_entries()
389 mac_entry->vid, ENTRYTYPE_LOCKED); in lan966x_mac_purge_entries()
391 list_del(&mac_entry->list); in lan966x_mac_purge_entries()
392 kfree(mac_entry); in lan966x_mac_purge_entries()
423 struct lan966x_mac_entry *mac_entry, *tmp; in lan966x_mac_irq_process() local
434 list_for_each_entry_safe(mac_entry, tmp, &lan966x->mac_entries, list) { in lan966x_mac_irq_process()
437 if (mac_entry->row != row) in lan966x_mac_irq_process()
456 if (mac_entry->vid == vid && in lan966x_mac_irq_process()
457 ether_addr_equal(mac_entry->mac, mac) && in lan966x_mac_irq_process()
458 mac_entry->port_index == dest_idx) { in lan966x_mac_irq_process()
466 list_del(&mac_entry->list); in lan966x_mac_irq_process()
470 list_add_tail(&mac_entry->list, &mac_deleted_entries); in lan966x_mac_irq_process()
475 list_for_each_entry_safe(mac_entry, tmp, &mac_deleted_entries, list) { in lan966x_mac_irq_process()
479 port = lan966x->ports[mac_entry->port_index]; in lan966x_mac_irq_process()
481 mac_entry->mac, mac_entry->vid, in lan966x_mac_irq_process()
483 list_del(&mac_entry->list); in lan966x_mac_irq_process()
484 kfree(mac_entry); in lan966x_mac_irq_process()
508 mac_entry = lan966x_mac_find_entry(lan966x, mac, vid, dest_idx); in lan966x_mac_irq_process()
509 if (mac_entry) { in lan966x_mac_irq_process()
515 mac_entry = lan966x_mac_alloc_entry(port, mac, vid); in lan966x_mac_irq_process()
516 if (!mac_entry) { in lan966x_mac_irq_process()
521 mac_entry->row = row; in lan966x_mac_irq_process()
522 list_add_tail(&mac_entry->list, &lan966x->mac_entries); in lan966x_mac_irq_process()