diff mbox

[net-next-2.6] if_link: Add PORT_REQUEST_MAX

Message ID 20110309203431.21853.21864.stgit@savbu-pc100.cisco.com
State Rejected, archived
Delegated to: David Miller
Headers show

Commit Message

Roopa Prabhu March 9, 2011, 8:34 p.m. UTC
From: Roopa Prabhu <roprabhu@cisco.com>

This patch adds __PORT_REQUEST_MAX to port request enumeration. And defines
PORT_REQUEST_MAX.

Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
---
 include/linux/if_link.h |    3 +++
 1 files changed, 3 insertions(+), 0 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 March 9, 2011, 8:49 p.m. UTC | #1
From: Roopa Prabhu <roprabhu@cisco.com>
Date: Wed, 09 Mar 2011 12:34:31 -0800

> From: Roopa Prabhu <roprabhu@cisco.com>
> 
> This patch adds __PORT_REQUEST_MAX to port request enumeration. And defines
> PORT_REQUEST_MAX.
> 
> Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
> Signed-off-by: David Wang <dwang2@cisco.com>
> Signed-off-by: Christian Benvenuti <benve@cisco.com>

Why?

If some new request types get added, this max value will increase and
we don't want that to happen for things exposed to userspace.

Userspace should really not depend upon how many requests there are.
--
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
Roopa Prabhu March 10, 2011, 2:16 a.m. UTC | #2
On 3/9/11 12:49 PM, "David Miller" <davem@davemloft.net> wrote:

> From: Roopa Prabhu <roprabhu@cisco.com>
> Date: Wed, 09 Mar 2011 12:34:31 -0800
> 
>> From: Roopa Prabhu <roprabhu@cisco.com>
>> 
>> This patch adds __PORT_REQUEST_MAX to port request enumeration. And defines
>> PORT_REQUEST_MAX.
>> 
>> Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
>> Signed-off-by: David Wang <dwang2@cisco.com>
>> Signed-off-by: Christian Benvenuti <benve@cisco.com>
> 
> Why?
> 
> If some new request types get added, this max value will increase and
> we don't want that to happen for things exposed to userspace.
> 
> Userspace should really not depend upon how many requests there are.

O ok. Did not know the reason why its was not there. Point taken. Pls
ignore. 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/if_link.h b/include/linux/if_link.h
index f4a2e6b..b37cc09 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -353,8 +353,11 @@  enum {
 	PORT_REQUEST_PREASSOCIATE_RR,
 	PORT_REQUEST_ASSOCIATE,
 	PORT_REQUEST_DISASSOCIATE,
+	__PORT_REQUEST_MAX,
 };
 
+#define PORT_REQUEST_MAX (__PORT_REQUEST_MAX - 1)
+
 enum {
 	PORT_VDP_RESPONSE_SUCCESS = 0,
 	PORT_VDP_RESPONSE_INVALID_FORMAT,