diff mbox

[23/26] RDS: Add AF and PF #defines for RDS sockets

Message ID 1235525443-9007-24-git-send-email-andy.grover@oracle.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Andy Grover Feb. 25, 2009, 1:30 a.m. UTC
RDS is a reliable datagram protocol used for IPC on Oracle
database clusters. This adds address and protocol family numbers
for it.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
 include/linux/socket.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

Comments

David Miller Feb. 25, 2009, 7:26 a.m. UTC | #1
From: Andy Grover <andy.grover@oracle.com>
Date: Tue, 24 Feb 2009 17:30:40 -0800

> @@ -191,7 +191,8 @@ struct ucred {
>  #define AF_RXRPC	33	/* RxRPC sockets 		*/
>  #define AF_ISDN		34	/* mISDN sockets 		*/
>  #define AF_PHONET	35	/* Phonet sockets		*/
> -#define AF_MAX		36	/* For now.. */
> +#define AF_RDS		36	/* RDS sockets 			*/
> +#define AF_MAX		37	/* For now.. */
>  
>  /* Protocol families, same as address families. */
>  #define PF_UNSPEC	AF_UNSPEC

Pick an unused number, you don't have to increment AF_MAX
to allocate a value.

And I don't want to hear any whining about how you've
used this value of 36 internally for a long time or
anything like that.
--
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
Rémi Denis-Courmont Feb. 25, 2009, 11:36 a.m. UTC | #2
On Wednesday 25 February 2009 09:26:48 ext David Miller, you wrote:
> From: Andy Grover <andy.grover@oracle.com>
> Date: Tue, 24 Feb 2009 17:30:40 -0800
>
> > @@ -191,7 +191,8 @@ struct ucred {
> >  #define AF_RXRPC     33      /* RxRPC sockets                */
> >  #define AF_ISDN              34      /* mISDN sockets                */
> >  #define AF_PHONET    35      /* Phonet sockets               */
> > -#define AF_MAX               36      /* For now.. */
> > +#define AF_RDS               36      /* RDS sockets                  */
> > +#define AF_MAX               37      /* For now.. */
> >
> >  /* Protocol families, same as address families. */
> >  #define PF_UNSPEC    AF_UNSPEC
>
> Pick an unused number, you don't have to increment AF_MAX
> to allocate a value.

But that patch is also allocating a PF value and net/socket.c has:
        if (ops->family >= NPROTO) {
                printk(KERN_CRIT "protocol %d >= NPROTO(%d)\n", ops->family,
                       NPROTO);
                return -ENOBUFS;
        }

...while include/linux/net.h has:
#define NPROTO              AF_MAX

Also, the lock dependency checks can cope with AF_MAX, but not AF_MAX+1. I 
have gone through that myself... I can testify it's annoying when the latest 
socket family of the kernel version of the day failed to declare its lock 
classes. Then that family "works" but the one you're trying triggers obnoxious 
locking warnings that are not your own fault.

> And I don't want to hear any whining about how you've
> used this value of 36 internally for a long time or
> anything like that.

So I guess you don't want to hear how AF_PHONET overloaded AF_ECONET before we 
published it :) But anyway, Econet had those cool properties that we did not 
use it, and that it had a private pointer in net_device (although Phonet does 
not need a private device pointer anymore) :P
David Miller Feb. 25, 2009, 11:58 a.m. UTC | #3
From: "Rémi Denis-Courmont" <remi.denis-courmont@nokia.com>
Date: Wed, 25 Feb 2009 13:36:36 +0200

> On Wednesday 25 February 2009 09:26:48 ext David Miller, you wrote:
> > From: Andy Grover <andy.grover@oracle.com>
> > Date: Tue, 24 Feb 2009 17:30:40 -0800
> >
> > > @@ -191,7 +191,8 @@ struct ucred {
> > >  #define AF_RXRPC     33      /* RxRPC sockets                */
> > >  #define AF_ISDN              34      /* mISDN sockets                */
> > >  #define AF_PHONET    35      /* Phonet sockets               */
> > > -#define AF_MAX               36      /* For now.. */
> > > +#define AF_RDS               36      /* RDS sockets                  */
> > > +#define AF_MAX               37      /* For now.. */
> > >
> > >  /* Protocol families, same as address families. */
> > >  #define PF_UNSPEC    AF_UNSPEC
> >
> > Pick an unused number, you don't have to increment AF_MAX
> > to allocate a value.
> 
> But that patch is also allocating a PF value and net/socket.c has:

I'm saying to use a lower number, like 21, 27, 28, etc.

--
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
Andrew Grover Feb. 25, 2009, 6:45 p.m. UTC | #4
On Wed, Feb 25, 2009 at 3:58 AM, David Miller <davem@davemloft.net> wrote:
> I'm saying to use a lower number, like 21, 27, 28, etc.

No prob, will do.

Regards -- Andy
--
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/socket.h b/include/linux/socket.h
index 20fc4bb..3cdc041 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -191,7 +191,8 @@  struct ucred {
 #define AF_RXRPC	33	/* RxRPC sockets 		*/
 #define AF_ISDN		34	/* mISDN sockets 		*/
 #define AF_PHONET	35	/* Phonet sockets		*/
-#define AF_MAX		36	/* For now.. */
+#define AF_RDS		36	/* RDS sockets 			*/
+#define AF_MAX		37	/* For now.. */
 
 /* Protocol families, same as address families. */
 #define PF_UNSPEC	AF_UNSPEC
@@ -229,6 +230,7 @@  struct ucred {
 #define PF_RXRPC	AF_RXRPC
 #define PF_ISDN		AF_ISDN
 #define PF_PHONET	AF_PHONET
+#define PF_RDS		AF_RDS
 #define PF_MAX		AF_MAX
 
 /* Maximum queue length specifiable by listen.  */
@@ -298,6 +300,7 @@  struct ucred {
 #define SOL_PPPOL2TP	273
 #define SOL_BLUETOOTH	274
 #define SOL_PNPIPE	275
+#define SOL_RDS		276
 
 /* IPX options */
 #define IPX_TYPE	1