mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 00:21:17 +00:00
net: dsa: Add support for learning FDB through notification
Add support for learning FDB through notification. The driver defers the hardware update via ordered work queue. In case of a successful FDB add a notification is sent back to bridge. In case of hw FDB del failure the static FDB will be deleted from the bridge, thus, the interface is moved to down state in order to indicate inconsistent situation. Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
2acf4e6a89
commit
c9eb3e0f87
3 changed files with 139 additions and 2 deletions
|
@ -282,10 +282,22 @@ static struct packet_type dsa_pack_type __read_mostly = {
|
|||
.func = dsa_switch_rcv,
|
||||
};
|
||||
|
||||
static struct workqueue_struct *dsa_owq;
|
||||
|
||||
bool dsa_schedule_work(struct work_struct *work)
|
||||
{
|
||||
return queue_work(dsa_owq, work);
|
||||
}
|
||||
|
||||
static int __init dsa_init_module(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
dsa_owq = alloc_ordered_workqueue("dsa_ordered",
|
||||
WQ_MEM_RECLAIM);
|
||||
if (!dsa_owq)
|
||||
return -ENOMEM;
|
||||
|
||||
rc = dsa_slave_register_notifier();
|
||||
if (rc)
|
||||
return rc;
|
||||
|
@ -305,6 +317,7 @@ static void __exit dsa_cleanup_module(void)
|
|||
dsa_slave_unregister_notifier();
|
||||
dev_remove_pack(&dsa_pack_type);
|
||||
dsa_legacy_unregister();
|
||||
destroy_workqueue(dsa_owq);
|
||||
}
|
||||
module_exit(dsa_cleanup_module);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue