Commit 6bd0e1cb authored by John Fastabend's avatar John Fastabend Committed by David S. Miller

dcb: add DCBX mode to event notifier attributes

Add DCBX mode to event notifiers so listeners can learn
currently enabled mode.
Signed-off-by: default avatarJohn Fastabend <john.r.fastabend@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e290ed81
...@@ -26,6 +26,7 @@ struct dcb_app_type { ...@@ -26,6 +26,7 @@ struct dcb_app_type {
int ifindex; int ifindex;
struct dcb_app app; struct dcb_app app;
struct list_head list; struct list_head list;
u8 dcbx;
}; };
int dcb_setapp(struct net_device *, struct dcb_app *); int dcb_setapp(struct net_device *, struct dcb_app *);
......
...@@ -2075,6 +2075,8 @@ int dcb_setapp(struct net_device *dev, struct dcb_app *new) ...@@ -2075,6 +2075,8 @@ int dcb_setapp(struct net_device *dev, struct dcb_app *new)
event.ifindex = dev->ifindex; event.ifindex = dev->ifindex;
memcpy(&event.app, new, sizeof(event.app)); memcpy(&event.app, new, sizeof(event.app));
if (dev->dcbnl_ops->getdcbx)
event.dcbx = dev->dcbnl_ops->getdcbx(dev);
spin_lock(&dcb_lock); spin_lock(&dcb_lock);
/* Search for existing match and replace */ /* Search for existing match and replace */
...@@ -2152,6 +2154,8 @@ int dcb_ieee_setapp(struct net_device *dev, struct dcb_app *new) ...@@ -2152,6 +2154,8 @@ int dcb_ieee_setapp(struct net_device *dev, struct dcb_app *new)
event.ifindex = dev->ifindex; event.ifindex = dev->ifindex;
memcpy(&event.app, new, sizeof(event.app)); memcpy(&event.app, new, sizeof(event.app));
if (dev->dcbnl_ops->getdcbx)
event.dcbx = dev->dcbnl_ops->getdcbx(dev);
spin_lock(&dcb_lock); spin_lock(&dcb_lock);
/* Search for existing match and abort if found */ /* Search for existing match and abort if found */
...@@ -2196,6 +2200,8 @@ int dcb_ieee_delapp(struct net_device *dev, struct dcb_app *del) ...@@ -2196,6 +2200,8 @@ int dcb_ieee_delapp(struct net_device *dev, struct dcb_app *del)
event.ifindex = dev->ifindex; event.ifindex = dev->ifindex;
memcpy(&event.app, del, sizeof(event.app)); memcpy(&event.app, del, sizeof(event.app));
if (dev->dcbnl_ops->getdcbx)
event.dcbx = dev->dcbnl_ops->getdcbx(dev);
spin_lock(&dcb_lock); spin_lock(&dcb_lock);
/* Search for existing match and remove it. */ /* Search for existing match and remove it. */
......
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