Version 2 adds the recommended tlv attributes to the ets struct this will
be needed for offloaded LLDP engines. Host controlled LLDP agents will most
likely not use these fields.
Also Shmulik Ravid caught an error with a spin_lock on kmalloc failure.
---
John Fastabend (3):
net_dcb: add application notifiers
dcbnl: add appliction tlv handlers
dcbnl: add support for ieee8021Qaz attributes
include/linux/dcbnl.h | 108 ++++++++++++++++++++
include/net/dcbevent.h | 31 ++++++
include/net/dcbnl.h | 20 ++++
net/dcb/Makefile | 2
net/dcb/dcbevent.c | 40 +++++++
net/dcb/dcbnl.c | 260 +++++++++++++++++++++++++++++++++++++++++++++++-
6 files changed, 453 insertions(+), 8 deletions(-)
create mode 100644 include/net/dcbevent.h
create mode 100644 net/dcb/dcbevent.c
--
Signature
--
The IEEE8021Qaz is the IEEE standard version of CEE. The standard has had enough significant changes from the CEE version that many of the CEE attributes have no meaning in the new spec or do not easily map to IEEE standards. Rather then attempt to create a complicated mapping between CEE and IEEE standards this patch adds a nested IEEE attribute to the list of DCB attributes. The policy is, [DCB_ATTR_IFNAME] [DCB_ATTR_STATE] ... [DCB_ATTR_IEEE] [DCB_ATTR_IEEE_ETS] [DCB_ATTR_IEEE_PFC] [DCB_ATTR_IEEE_APP_TABLE] [DCB_ATTR_IEEE_APP] ... The following dcbnl_rtnl_ops routines were added to handle the IEEE standard, int (*ieee_getets) (struct net_device *, struct ieee_ets *); int (*ieee_setets) (struct net_device *, struct ieee_ets *); int (*ieee_getpfc) (struct net_device *, struct ieee_pfc *); int (*ieee_setpfc) (struct net_device *, struct ieee_pfc *); int (*ieee_getapp) (struct net_device *, struct dcb_app *); int (*ieee_setapp) (struct net_device *, struct dcb_app *); Signed-off-by: John Fastabend <john.r.fastabend@intel.com> --- include/linux/dcbnl.h | 106 ++++++++++++++++++++++++++++++++++++++++ include/net/dcbnl.h | 11 ++++ net/dcb/dcbnl.c | 131 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 248 insertions(+), 0 deletions(-) diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h index 8723491..287b561 100644 --- a/include/linux/dcbnl.h +++ b/include/linux/dcbnl.h @@ -22,6 +22,87 @@ #include <linux/types.h> +/* IEEE 802.1Qaz std supported values */ +#define IEEE_8021QAZ_MAX_TCS 8 + +/* This structure contains the IEEE 802.1Qaz ETS managed object + * + * @willing: willing bit in ETS configuratin TLV + * @ets_cap: indicates supported capacity of ets feature + * @cbs: credit based shaper ets algorithm supported + * @tc_tx_bw: tc tx bandwidth indexed by traffic class + * @tc_rx_bw: tc rx bandwidth indexed by traffic class + * @tc_tsa: TSA Assignment table, indexed by traffic class + ...
DCBx applications priorities can be changed dynamically. If
application stacks are expected to keep the skb priority
consistent with the dcbx priority the stack will need to
be notified when these changes occur.
This patch adds application notifiers for the stack to register
with.
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
---
include/net/dcbevent.h | 31 +++++++++++++++++++++++++++++++
net/dcb/Makefile | 2 +-
net/dcb/dcbevent.c | 40 ++++++++++++++++++++++++++++++++++++++++
net/dcb/dcbnl.c | 2 ++
4 files changed, 74 insertions(+), 1 deletions(-)
create mode 100644 include/net/dcbevent.h
create mode 100644 net/dcb/dcbevent.c
diff --git a/include/net/dcbevent.h b/include/net/dcbevent.h
new file mode 100644
index 0000000..bc1e7ef
--- /dev/null
+++ b/include/net/dcbevent.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ *
+ * Author: John Fastabend <john.r.fastabend@intel.com>
+ */
+
+#ifndef _DCB_EVENT_H
+#define _DCB_EVENT_H
+
+enum dcbevent_notif_type {
+ DCB_APP_EVENT = 1,
+};
+
+extern int register_dcbevent_notifier(struct notifier_block *nb);
+extern int unregister_dcbevent_notifier(struct notifier_block *nb);
+extern int call_dcbevent_notifiers(unsigned long val, void *v);
+
+#endif
diff --git a/net/dcb/Makefile ...This patch adds application tlv handlers. Networking stacks
may use the application priority to set the skb priority of
their stack using the negoatiated dcbx priority.
This patch provides the dcb_{get|set}app() routines for the
stack to query these parameters. Notice lower layer drivers
can use the dcbnl_ops routines if additional handling is
needed. Perhaps in the firmware case for example
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Shmulik Ravid <shmulikr@broadcom.com>
---
include/linux/dcbnl.h | 4 +
include/net/dcbnl.h | 9 +++
net/dcb/dcbnl.c | 133 +++++++++++++++++++++++++++++++++++++++++++++----
3 files changed, 135 insertions(+), 11 deletions(-)
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h
index 287b561..775bdb4 100644
--- a/include/linux/dcbnl.h
+++ b/include/linux/dcbnl.h
@@ -82,7 +82,9 @@ struct ieee_pfc {
__u64 indications[IEEE_8021QAZ_MAX_TCS];
};
-/* This structure contains the IEEE 802.1Qaz APP managed object
+/* This structure contains the IEEE 802.1Qaz APP managed object. This
+ * object is also used for the CEE std as well. There is no difference
+ * between the objects.
*
* @selector: protocol identifier type
* @protocol: protocol of type indicated
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h
index e2d841e..ab7d623 100644
--- a/include/net/dcbnl.h
+++ b/include/net/dcbnl.h
@@ -22,6 +22,15 @@
#include <linux/dcbnl.h>
+struct dcb_app_type {
+ char name[IFNAMSIZ];
+ struct dcb_app app;
+ struct list_head list;
+};
+
+u8 dcb_setapp(struct net_device *, struct dcb_app *);
+u8 dcb_getapp(struct net_device *, struct dcb_app *);
+
/*
* Ops struct for the netlink callbacks. Used by DCB-enabled drivers through
* the netdevice struct.
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index 2ff9084..cfd731f 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -179,6 +179,9 @@ static const struct nla_policy dcbnl_ieee_app[DCB_ATTR_IEEE_APP_MAX + ...From: John Fastabend <john.r.fastabend@intel.com> BTW, even though I replied "applied" to v1 of these patches I made sure to actully apply v2 :-) --
