Commit 4394fbcb authored by Yevhen Orlov's avatar Yevhen Orlov Committed by David S. Miller

net: marvell: prestera: handle fib notifications

For now we support only TRAP or DROP, so we can offload only "local" or
"blackhole" routes.
Nexthop routes is TRAP for now. Will be implemented soon.
Co-developed-by: default avatarTaras Chornyi <tchornyi@marvell.com>
Signed-off-by: default avatarTaras Chornyi <tchornyi@marvell.com>
Co-developed-by: default avatarOleksandr Mazur <oleksandr.mazur@plvision.eu>
Signed-off-by: default avatarOleksandr Mazur <oleksandr.mazur@plvision.eu>
Signed-off-by: default avatarYevhen Orlov <yevhen.orlov@plvision.eu>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 16de3db1
...@@ -282,8 +282,10 @@ struct prestera_router { ...@@ -282,8 +282,10 @@ struct prestera_router {
struct list_head vr_list; struct list_head vr_list;
struct list_head rif_entry_list; struct list_head rif_entry_list;
struct rhashtable fib_ht; struct rhashtable fib_ht;
struct rhashtable kern_fib_cache_ht;
struct notifier_block inetaddr_nb; struct notifier_block inetaddr_nb;
struct notifier_block inetaddr_valid_nb; struct notifier_block inetaddr_valid_nb;
struct notifier_block fib_nb;
}; };
struct prestera_rxtx_params { struct prestera_rxtx_params {
...@@ -326,6 +328,8 @@ int prestera_port_cfg_mac_write(struct prestera_port *port, ...@@ -326,6 +328,8 @@ int prestera_port_cfg_mac_write(struct prestera_port *port,
struct prestera_port *prestera_port_dev_lower_find(struct net_device *dev); struct prestera_port *prestera_port_dev_lower_find(struct net_device *dev);
void prestera_queue_work(struct work_struct *work);
int prestera_port_pvid_set(struct prestera_port *port, u16 vid); int prestera_port_pvid_set(struct prestera_port *port, u16 vid);
bool prestera_netdev_check(const struct net_device *dev); bool prestera_netdev_check(const struct net_device *dev);
......
...@@ -28,6 +28,12 @@ ...@@ -28,6 +28,12 @@
#define PRESTERA_MAC_ADDR_NUM_MAX 255 #define PRESTERA_MAC_ADDR_NUM_MAX 255
static struct workqueue_struct *prestera_wq; static struct workqueue_struct *prestera_wq;
static struct workqueue_struct *prestera_owq;
void prestera_queue_work(struct work_struct *work)
{
queue_work(prestera_owq, work);
}
int prestera_port_pvid_set(struct prestera_port *port, u16 vid) int prestera_port_pvid_set(struct prestera_port *port, u16 vid)
{ {
...@@ -1024,12 +1030,17 @@ static int __init prestera_module_init(void) ...@@ -1024,12 +1030,17 @@ static int __init prestera_module_init(void)
if (!prestera_wq) if (!prestera_wq)
return -ENOMEM; return -ENOMEM;
prestera_owq = alloc_ordered_workqueue("prestera_ordered", 0);
if (!prestera_owq)
return -ENOMEM;
return 0; return 0;
} }
static void __exit prestera_module_exit(void) static void __exit prestera_module_exit(void)
{ {
destroy_workqueue(prestera_wq); destroy_workqueue(prestera_wq);
destroy_workqueue(prestera_owq);
} }
module_init(prestera_module_init); module_init(prestera_module_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment