diff mbox

[net-2.6,1/3] net: dcb: match dcb_app protocol field with 802.1Qaz spec

Message ID 20110131220048.29758.22379.stgit@jf-dev1-dcblab
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

John Fastabend Jan. 31, 2011, 10 p.m. UTC
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(-)


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller Feb. 1, 2011, 4:41 a.m. UTC | #1
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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
John Fastabend Feb. 5, 2011, 7:39 p.m. UTC | #2
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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;
 };