[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200902251336.36461.remi.denis-courmont@nokia.com>
Date: Wed, 25 Feb 2009 13:36:36 +0200
From: "Rémi Denis-Courmont"
<remi.denis-courmont@...ia.com>
To: ext David Miller <davem@...emloft.net>
Cc: "andy.grover@...cle.com" <andy.grover@...cle.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH 23/26] RDS: Add AF and PF #defines for RDS sockets
On Wednesday 25 February 2009 09:26:48 ext David Miller, you wrote:
> From: Andy Grover <andy.grover@...cle.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
--
Rémi Denis-Courmont
Maemo Software, Nokia Devices R&D
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists