* [PATCH] remove unused netlink NL_EMULATE_DEV code
@ 2005-03-18 23:36 Chris Wright
2005-03-19 0:09 ` Max Krasnyansky
0 siblings, 1 reply; 7+ messages in thread
From: Chris Wright @ 2005-03-18 23:36 UTC (permalink / raw)
To: davem; +Cc: netdev
Now that netlink_attach() has been removed, the NL_EMULATE_DEV handler
functions can't ever be set. So let's rip them out too, because what's
left behind can't be used at all.
Signed-off-by: Chris Wright <chrisw@osdl.org>
net/netlink/af_netlink.c | 24 +-----------------------
1 files changed, 1 insertion(+), 23 deletions(-)
===== net/netlink/af_netlink.c 1.71 vs edited =====
--- 1.71/net/netlink/af_netlink.c 2005-03-14 21:27:59 -08:00
+++ edited/net/netlink/af_netlink.c 2005-03-18 11:57:32 -08:00
@@ -55,10 +55,6 @@
#define Nprintk(a...)
-#if defined(CONFIG_NETLINK_DEV) || defined(CONFIG_NETLINK_DEV_MODULE)
-#define NL_EMULATE_DEV
-#endif
-
struct netlink_sock {
/* struct sock has to be the first member of netlink_sock */
struct sock sk;
@@ -67,7 +63,6 @@ struct netlink_sock {
u32 dst_pid;
unsigned int dst_groups;
unsigned long state;
- int (*handler)(int unit, struct sk_buff *skb);
wait_queue_head_t wait;
struct netlink_callback *cb;
spinlock_t cb_lock;
@@ -593,10 +588,6 @@ int netlink_attachskb(struct sock *sk, s
nlk = nlk_sk(sk);
-#ifdef NL_EMULATE_DEV
- if (nlk->handler)
- return 0;
-#endif
if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf ||
test_bit(0, &nlk->state)) {
DECLARE_WAITQUEUE(wait, current);
@@ -636,14 +627,6 @@ int netlink_sendskb(struct sock *sk, str
int len = skb->len;
nlk = nlk_sk(sk);
-#ifdef NL_EMULATE_DEV
- if (nlk->handler) {
- skb_orphan(skb);
- len = nlk->handler(protocol, skb);
- sock_put(sk);
- return len;
- }
-#endif
skb_queue_tail(&sk->sk_receive_queue, skb);
sk->sk_data_ready(sk, len);
@@ -708,12 +691,7 @@ retry:
static __inline__ int netlink_broadcast_deliver(struct sock *sk, struct sk_buff *skb)
{
struct netlink_sock *nlk = nlk_sk(sk);
-#ifdef NL_EMULATE_DEV
- if (nlk->handler) {
- nlk->handler(sk->sk_protocol, skb);
- return 0;
- } else
-#endif
+
if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf &&
!test_bit(0, &nlk->state)) {
skb_set_owner_r(skb, sk);
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] remove unused netlink NL_EMULATE_DEV code
2005-03-18 23:36 [PATCH] remove unused netlink NL_EMULATE_DEV code Chris Wright
@ 2005-03-19 0:09 ` Max Krasnyansky
2005-03-19 1:02 ` Chris Wright
0 siblings, 1 reply; 7+ messages in thread
From: Max Krasnyansky @ 2005-03-19 0:09 UTC (permalink / raw)
To: Chris Wright; +Cc: davem, netdev
Hi Chris,
Why don't you kill Ethertap completely while you're at it. Ethertap needs "Netlink device emulation"
stuff. And this whole thing has been marked OBSOLETE for more than two years now.
Most projects seem to have switched to TUN/TAP long time ago.
Max
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] remove unused netlink NL_EMULATE_DEV code
2005-03-19 0:09 ` Max Krasnyansky
@ 2005-03-19 1:02 ` Chris Wright
2005-03-19 1:48 ` jamal
0 siblings, 1 reply; 7+ messages in thread
From: Chris Wright @ 2005-03-19 1:02 UTC (permalink / raw)
To: Max Krasnyansky; +Cc: Chris Wright, davem, netdev
* Max Krasnyansky (maxk@qualcomm.com) wrote:
> Why don't you kill Ethertap completely while you're at it. Ethertap needs
> "Netlink device emulation"
> stuff. And this whole thing has been marked OBSOLETE for more than two
> years now.
> Most projects seem to have switched to TUN/TAP long time ago.
I'd prefer that too. What about the netlink_dev implementation itself?
Should it be marked obsolete?
thanks,
-chris
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] remove unused netlink NL_EMULATE_DEV code
2005-03-19 1:02 ` Chris Wright
@ 2005-03-19 1:48 ` jamal
2005-03-21 18:26 ` Max Krasnyansky
0 siblings, 1 reply; 7+ messages in thread
From: jamal @ 2005-03-19 1:48 UTC (permalink / raw)
To: Chris Wright; +Cc: Max Krasnyansky, David S. Miller, netdev
1
On Fri, 2005-03-18 at 20:02, Chris Wright wrote:
> I'd prefer that too. What about the netlink_dev implementation itself?
> Should it be marked obsolete?
>
It should die - pieces of it have already been slowly disapearing.
cheers,
jamal
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] remove unused netlink NL_EMULATE_DEV code
2005-03-19 1:48 ` jamal
@ 2005-03-21 18:26 ` Max Krasnyansky
2005-03-23 3:22 ` David S. Miller
0 siblings, 1 reply; 7+ messages in thread
From: Max Krasnyansky @ 2005-03-21 18:26 UTC (permalink / raw)
To: hadi; +Cc: Chris Wright, David S. Miller, netdev
jamal wrote:
> 1
> On Fri, 2005-03-18 at 20:02, Chris Wright wrote:
>
>
>>I'd prefer that too. What about the netlink_dev implementation itself?
>>Should it be marked obsolete?
>>
>
> It should die - pieces of it have already been slowly disapearing.
Totally agree. Even for Ethertap it was easy to use Netlink sockets directly.
Max
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] remove unused netlink NL_EMULATE_DEV code
2005-03-21 18:26 ` Max Krasnyansky
@ 2005-03-23 3:22 ` David S. Miller
0 siblings, 0 replies; 7+ messages in thread
From: David S. Miller @ 2005-03-23 3:22 UTC (permalink / raw)
To: Max Krasnyansky; +Cc: hadi, chrisw, netdev
On Mon, 21 Mar 2005 10:26:11 -0800
Max Krasnyansky <maxk@qualcomm.com> wrote:
> jamal wrote:
> > 1
> > On Fri, 2005-03-18 at 20:02, Chris Wright wrote:
> >
> >
> >>I'd prefer that too. What about the netlink_dev implementation itself?
> >>Should it be marked obsolete?
> >>
> >
> > It should die - pieces of it have already been slowly disapearing.
>
> Totally agree. Even for Ethertap it was easy to use Netlink sockets directly.
I've applied Chris's original patch, then killed ethertap and
netlink_dev from my tree.
It's very telling that CONFIG_ETHERTAP was still marked EXPERIMENTAL
:-)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] remove unused netlink NL_EMULATE_DEV code
@ 2005-02-12 3:55 Chris Wright
0 siblings, 0 replies; 7+ messages in thread
From: Chris Wright @ 2005-02-12 3:55 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
NL_EMULATE_DEV handler functions can't ever be set, so let's rip them
out too. I realize the other half (netlink_attach()) just came out in
2.6.11-rc1, but what's left behind can't be used at all.
Signed-off-by: Chris Wright <chrisw@osdl.org>
af_netlink.c | 24 +-----------------------
1 files changed, 1 insertion(+), 23 deletions(-)
===== net/netlink/af_netlink.c 1.69 vs edited =====
--- 1.69/net/netlink/af_netlink.c 2005-01-21 12:25:32 -08:00
+++ edited/net/netlink/af_netlink.c 2005-02-11 19:47:08 -08:00
@@ -55,10 +55,6 @@
#define Nprintk(a...)
-#if defined(CONFIG_NETLINK_DEV) || defined(CONFIG_NETLINK_DEV_MODULE)
-#define NL_EMULATE_DEV
-#endif
-
struct netlink_opt
{
u32 pid;
@@ -66,7 +62,6 @@ struct netlink_opt
u32 dst_pid;
unsigned int dst_groups;
unsigned long state;
- int (*handler)(int unit, struct sk_buff *skb);
wait_queue_head_t wait;
struct netlink_callback *cb;
spinlock_t cb_lock;
@@ -596,10 +591,6 @@ int netlink_attachskb(struct sock *sk, s
nlk = nlk_sk(sk);
-#ifdef NL_EMULATE_DEV
- if (nlk->handler)
- return 0;
-#endif
if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf ||
test_bit(0, &nlk->state)) {
DECLARE_WAITQUEUE(wait, current);
@@ -639,14 +630,6 @@ int netlink_sendskb(struct sock *sk, str
int len = skb->len;
nlk = nlk_sk(sk);
-#ifdef NL_EMULATE_DEV
- if (nlk->handler) {
- skb_orphan(skb);
- len = nlk->handler(protocol, skb);
- sock_put(sk);
- return len;
- }
-#endif
skb_queue_tail(&sk->sk_receive_queue, skb);
sk->sk_data_ready(sk, len);
@@ -711,12 +694,7 @@ retry:
static __inline__ int netlink_broadcast_deliver(struct sock *sk, struct sk_buff *skb)
{
struct netlink_opt *nlk = nlk_sk(sk);
-#ifdef NL_EMULATE_DEV
- if (nlk->handler) {
- nlk->handler(sk->sk_protocol, skb);
- return 0;
- } else
-#endif
+
if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf &&
!test_bit(0, &nlk->state)) {
skb_set_owner_r(skb, sk);
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2005-03-23 3:22 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-18 23:36 [PATCH] remove unused netlink NL_EMULATE_DEV code Chris Wright
2005-03-19 0:09 ` Max Krasnyansky
2005-03-19 1:02 ` Chris Wright
2005-03-19 1:48 ` jamal
2005-03-21 18:26 ` Max Krasnyansky
2005-03-23 3:22 ` David S. Miller
-- strict thread matches above, loose matches on Subject: below --
2005-02-12 3:55 Chris Wright
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).