* [net-2.6 PATCH 1/3] net: dcb: match dcb_app protocol field with 802.1Qaz spec
@ 2011-01-31 22:00 John Fastabend
2011-01-31 22:00 ` [net-2.6 PATCH 2/3] net: dcb: use _safe() version of list iterators John Fastabend
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: John Fastabend @ 2011-01-31 22:00 UTC (permalink / raw)
To: davem; +Cc: john.r.fastabend, netdev
The dcb_app protocol field is a __u32 however the 802.1Qaz
specification defines it as a 16 bit field. This patch brings
the structure inline with the spec making it a __u16.
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
---
include/linux/dcbnl.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h
index 68cd248..bdc7ef4 100644
--- a/include/linux/dcbnl.h
+++ b/include/linux/dcbnl.h
@@ -101,7 +101,7 @@ struct ieee_pfc {
*/
struct dcb_app {
__u8 selector;
- __u32 protocol;
+ __u16 protocol;
__u8 priority;
};
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [net-2.6 PATCH 2/3] net: dcb: use _safe() version of list iterators
2011-01-31 22:00 [net-2.6 PATCH 1/3] net: dcb: match dcb_app protocol field with 802.1Qaz spec John Fastabend
@ 2011-01-31 22:00 ` John Fastabend
2011-02-01 4:42 ` David Miller
2011-01-31 22:00 ` [net-2.6 PATCH 3/3] net: dcb: application priority is per net_device John Fastabend
2011-02-01 4:41 ` [net-2.6 PATCH 1/3] net: dcb: match dcb_app protocol field with 802.1Qaz spec David Miller
2 siblings, 1 reply; 9+ messages in thread
From: John Fastabend @ 2011-01-31 22:00 UTC (permalink / raw)
To: davem; +Cc: john.r.fastabend, netdev
Use _safe() version of list iterator macros in dcb_setapp().
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
---
net/dcb/dcbnl.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index 6b03f56..e3399d6 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -1605,18 +1605,18 @@ u8 dcb_getapp(struct net_device *dev, struct dcb_app *app)
EXPORT_SYMBOL(dcb_getapp);
/**
- * ixgbe_dcbnl_setapp - add dcb application data to app list
+ * dcbnl_setapp - add dcb application data to app list
*
* Priority 0 is the default priority this removes applications
* from the app list if the priority is set to zero.
*/
u8 dcb_setapp(struct net_device *dev, struct dcb_app *new)
{
- struct dcb_app_type *itr;
+ struct dcb_app_type *itr, *tmp;
spin_lock(&dcb_lock);
/* Search for existing match and replace */
- list_for_each_entry(itr, &dcb_app_list, list) {
+ list_for_each_entry_safe(itr, tmp, &dcb_app_list, list) {
if (itr->app.selector == new->selector &&
itr->app.protocol == new->protocol &&
(strncmp(itr->name, dev->name, IFNAMSIZ) == 0)) {
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [net-2.6 PATCH 3/3] net: dcb: application priority is per net_device
2011-01-31 22:00 [net-2.6 PATCH 1/3] net: dcb: match dcb_app protocol field with 802.1Qaz spec John Fastabend
2011-01-31 22:00 ` [net-2.6 PATCH 2/3] net: dcb: use _safe() version of list iterators John Fastabend
@ 2011-01-31 22:00 ` John Fastabend
2011-02-01 4:43 ` David Miller
2011-02-13 19:03 ` David Miller
2011-02-01 4:41 ` [net-2.6 PATCH 1/3] net: dcb: match dcb_app protocol field with 802.1Qaz spec David Miller
2 siblings, 2 replies; 9+ messages in thread
From: John Fastabend @ 2011-01-31 22:00 UTC (permalink / raw)
To: davem; +Cc: john.r.fastabend, netdev
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: John Fastabend <john.r.fastabend@intel.com>
---
net/dcb/dcbnl.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index e3399d6..249bcec 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -1613,6 +1613,10 @@ EXPORT_SYMBOL(dcb_getapp);
u8 dcb_setapp(struct net_device *dev, struct dcb_app *new)
{
struct dcb_app_type *itr, *tmp;
+ struct dcb_app_type event;
+
+ memcpy(&event.name, dev->name, sizeof(event.name));
+ memcpy(&event.app, new, sizeof(event.app));
spin_lock(&dcb_lock);
/* Search for existing match and replace */
@@ -1644,7 +1648,7 @@ u8 dcb_setapp(struct net_device *dev, struct dcb_app *new)
}
out:
spin_unlock(&dcb_lock);
- call_dcbevent_notifiers(DCB_APP_EVENT, new);
+ call_dcbevent_notifiers(DCB_APP_EVENT, &event);
return 0;
}
EXPORT_SYMBOL(dcb_setapp);
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [net-2.6 PATCH 1/3] net: dcb: match dcb_app protocol field with 802.1Qaz spec
2011-01-31 22:00 [net-2.6 PATCH 1/3] net: dcb: match dcb_app protocol field with 802.1Qaz spec John Fastabend
2011-01-31 22:00 ` [net-2.6 PATCH 2/3] net: dcb: use _safe() version of list iterators John Fastabend
2011-01-31 22:00 ` [net-2.6 PATCH 3/3] net: dcb: application priority is per net_device John Fastabend
@ 2011-02-01 4:41 ` David Miller
2011-02-05 19:39 ` John Fastabend
2 siblings, 1 reply; 9+ messages in thread
From: David Miller @ 2011-02-01 4:41 UTC (permalink / raw)
To: john.r.fastabend; +Cc: netdev
From: John Fastabend <john.r.fastabend@intel.com>
Date: Mon, 31 Jan 2011 14:00:49 -0800
> The dcb_app protocol field is a __u32 however the 802.1Qaz
> specification defines it as a 16 bit field. This patch brings
> the structure inline with the spec making it a __u16.
>
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
...
> @@ -101,7 +101,7 @@ struct ieee_pfc {
> */
> struct dcb_app {
> __u8 selector;
> - __u32 protocol;
> + __u16 protocol;
> __u8 priority;
> };
>
If we're going to do this, please fix this wasteful structure
layout. Put the "protocol" either first, or last, so that the
structure size is 4 bytes, rather than something like 8.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [net-2.6 PATCH 2/3] net: dcb: use _safe() version of list iterators
2011-01-31 22:00 ` [net-2.6 PATCH 2/3] net: dcb: use _safe() version of list iterators John Fastabend
@ 2011-02-01 4:42 ` David Miller
2011-02-05 19:40 ` John Fastabend
0 siblings, 1 reply; 9+ messages in thread
From: David Miller @ 2011-02-01 4:42 UTC (permalink / raw)
To: john.r.fastabend; +Cc: netdev
From: John Fastabend <john.r.fastabend@intel.com>
Date: Mon, 31 Jan 2011 14:00:54 -0800
> Use _safe() version of list iterator macros in dcb_setapp().
>
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Why? It's unnecessary overhead, since we always branch to "out", and
therefore out of the list traversal loop, any time we list_del()
something on the list.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [net-2.6 PATCH 3/3] net: dcb: application priority is per net_device
2011-01-31 22:00 ` [net-2.6 PATCH 3/3] net: dcb: application priority is per net_device John Fastabend
@ 2011-02-01 4:43 ` David Miller
2011-02-13 19:03 ` David Miller
1 sibling, 0 replies; 9+ messages in thread
From: David Miller @ 2011-02-01 4:43 UTC (permalink / raw)
To: john.r.fastabend; +Cc: netdev
From: John Fastabend <john.r.fastabend@intel.com>
Date: Mon, 31 Jan 2011 14:00:59 -0800
> 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: John Fastabend <john.r.fastabend@intel.com>
Given your track record with the previous two patches (ie. they
need work or are nonsense) I want someone who understands this
dcbnl stuff to review this third patch before I'm willing to
apply it.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [net-2.6 PATCH 1/3] net: dcb: match dcb_app protocol field with 802.1Qaz spec
2011-02-01 4:41 ` [net-2.6 PATCH 1/3] net: dcb: match dcb_app protocol field with 802.1Qaz spec David Miller
@ 2011-02-05 19:39 ` John Fastabend
0 siblings, 0 replies; 9+ messages in thread
From: John Fastabend @ 2011-02-05 19:39 UTC (permalink / raw)
To: David Miller; +Cc: netdev
On 1/31/2011 8:41 PM, David Miller wrote:
> From: John Fastabend <john.r.fastabend@intel.com>
> Date: Mon, 31 Jan 2011 14:00:49 -0800
>
>> The dcb_app protocol field is a __u32 however the 802.1Qaz
>> specification defines it as a 16 bit field. This patch brings
>> the structure inline with the spec making it a __u16.
>>
>> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
> ...
>> @@ -101,7 +101,7 @@ struct ieee_pfc {
>> */
>> struct dcb_app {
>> __u8 selector;
>> - __u32 protocol;
>> + __u16 protocol;
>> __u8 priority;
>> };
>>
>
> If we're going to do this, please fix this wasteful structure
> layout. Put the "protocol" either first, or last, so that the
> structure size is 4 bytes, rather than something like 8.
OK I will fix this. Thanks
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [net-2.6 PATCH 2/3] net: dcb: use _safe() version of list iterators
2011-02-01 4:42 ` David Miller
@ 2011-02-05 19:40 ` John Fastabend
0 siblings, 0 replies; 9+ messages in thread
From: John Fastabend @ 2011-02-05 19:40 UTC (permalink / raw)
To: David Miller; +Cc: netdev
On 1/31/2011 8:42 PM, David Miller wrote:
> From: John Fastabend <john.r.fastabend@intel.com>
> Date: Mon, 31 Jan 2011 14:00:54 -0800
>
>> Use _safe() version of list iterator macros in dcb_setapp().
>>
>> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
>
> Why? It's unnecessary overhead, since we always branch to "out", and
> therefore out of the list traversal loop, any time we list_del()
> something on the list.
Of course you are right there is no reason for this. Thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [net-2.6 PATCH 3/3] net: dcb: application priority is per net_device
2011-01-31 22:00 ` [net-2.6 PATCH 3/3] net: dcb: application priority is per net_device John Fastabend
2011-02-01 4:43 ` David Miller
@ 2011-02-13 19:03 ` David Miller
1 sibling, 0 replies; 9+ messages in thread
From: David Miller @ 2011-02-13 19:03 UTC (permalink / raw)
To: john.r.fastabend; +Cc: netdev
From: John Fastabend <john.r.fastabend@intel.com>
Date: Mon, 31 Jan 2011 14:00:59 -0800
> 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: John Fastabend <john.r.fastabend@intel.com>
Applied.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2011-02-13 19:02 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-31 22:00 [net-2.6 PATCH 1/3] net: dcb: match dcb_app protocol field with 802.1Qaz spec John Fastabend
2011-01-31 22:00 ` [net-2.6 PATCH 2/3] net: dcb: use _safe() version of list iterators John Fastabend
2011-02-01 4:42 ` David Miller
2011-02-05 19:40 ` John Fastabend
2011-01-31 22:00 ` [net-2.6 PATCH 3/3] net: dcb: application priority is per net_device John Fastabend
2011-02-01 4:43 ` David Miller
2011-02-13 19:03 ` David Miller
2011-02-01 4:41 ` [net-2.6 PATCH 1/3] net: dcb: match dcb_app protocol field with 802.1Qaz spec David Miller
2011-02-05 19:39 ` John Fastabend
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.