Commit 7ec79270 authored by John Fastabend's avatar John Fastabend Committed by David S. Miller

net: dcb: application priority is per net_device

The app_data priority may not be the same for all net devices.
In order for stacks with application notifiers to identify the
specific net device dcb_app_type should be passed in the ptr.

This allows handlers to use dev_get_by_name() to pin priority
to net devices.
Signed-off-by: default avatarJohn Fastabend <john.r.fastabend@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8a870178
...@@ -1613,6 +1613,10 @@ EXPORT_SYMBOL(dcb_getapp); ...@@ -1613,6 +1613,10 @@ EXPORT_SYMBOL(dcb_getapp);
u8 dcb_setapp(struct net_device *dev, struct dcb_app *new) u8 dcb_setapp(struct net_device *dev, struct dcb_app *new)
{ {
struct dcb_app_type *itr; struct dcb_app_type *itr;
struct dcb_app_type event;
memcpy(&event.name, dev->name, sizeof(event.name));
memcpy(&event.app, new, sizeof(event.app));
spin_lock(&dcb_lock); spin_lock(&dcb_lock);
/* Search for existing match and replace */ /* Search for existing match and replace */
...@@ -1644,7 +1648,7 @@ u8 dcb_setapp(struct net_device *dev, struct dcb_app *new) ...@@ -1644,7 +1648,7 @@ u8 dcb_setapp(struct net_device *dev, struct dcb_app *new)
} }
out: out:
spin_unlock(&dcb_lock); spin_unlock(&dcb_lock);
call_dcbevent_notifiers(DCB_APP_EVENT, new); call_dcbevent_notifiers(DCB_APP_EVENT, &event);
return 0; return 0;
} }
EXPORT_SYMBOL(dcb_setapp); EXPORT_SYMBOL(dcb_setapp);
......
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