* [PATCH] Convert pppoe to new style protocol
@ 2003-06-17 22:04 Andi Kleen
2003-06-17 22:07 ` David S. Miller
0 siblings, 1 reply; 8+ messages in thread
From: Andi Kleen @ 2003-06-17 22:04 UTC (permalink / raw)
To: netdev; +Cc: mostrows, paulus
Convert pppoe to a new style protocol, otherwise it is unusable
on SMP compiled kernels because of the printk in deliver*old_ones.
It works fine here, but only tested on a UP box.
I checked with paulus and he confirmed that ppp_input is safe
to be called with the new softirq semantics. The PPP path also
appears to work with shared skbs (never modify skb data,
not 100% audited however) but not with non linear skbs.
The pppoe code itself is safe because it never uses timers
or does anything complicated.
If someone knows a place in ppp_input that modifies the data
area then please contain now so that a skb_copy can be added.
-Andi
diff -u linux-2.5.72-work/drivers/net/pppoe.c-o linux-2.5.72-work/drivers/net/pppoe.c
--- linux-2.5.72-work/drivers/net/pppoe.c-o 2003-06-14 23:42:51.000000000 +0200
+++ linux-2.5.72-work/drivers/net/pppoe.c 2003-06-17 23:15:11.000000000 +0200
@@ -348,6 +348,9 @@
struct pppox_opt *po = pppox_sk(sk);
struct pppox_opt *relay_po = NULL;
+ if (skb_is_nonlinear(skb) && skb_linearize(skb, GFP_ATOMIC))
+ goto abort_kfree;
+
if (sk->sk_state & PPPOX_BOUND) {
skb_pull(skb, sizeof(struct pppoe_hdr));
ppp_input(&po->chan, skb);
@@ -463,11 +466,13 @@
struct packet_type pppoes_ptype = {
.type = __constant_htons(ETH_P_PPP_SES),
.func = pppoe_rcv,
+ .data = (void*) 1,
};
struct packet_type pppoed_ptype = {
.type = __constant_htons(ETH_P_PPP_DISC),
.func = pppoe_disc_rcv,
+ .data = (void*) 1,
};
/***********************************************************************
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Convert pppoe to new style protocol
2003-06-17 22:04 [PATCH] Convert pppoe to new style protocol Andi Kleen
@ 2003-06-17 22:07 ` David S. Miller
2003-06-18 8:01 ` Andi Kleen
0 siblings, 1 reply; 8+ messages in thread
From: David S. Miller @ 2003-06-17 22:07 UTC (permalink / raw)
To: ak; +Cc: netdev, mostrows, paulus
From: Andi Kleen <ak@muc.de>
Date: Wed, 18 Jun 2003 00:04:20 +0200
Convert pppoe to a new style protocol, otherwise it is unusable
on SMP compiled kernels because of the printk in deliver*old_ones.
It works fine here, but only tested on a UP box.
Please don't add new skb_linearize() users, I'm trying
to make that only local to net/core/dev.c
Otherwise I'm fine with your patch.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Convert pppoe to new style protocol
2003-06-17 22:07 ` David S. Miller
@ 2003-06-18 8:01 ` Andi Kleen
2003-06-18 12:21 ` Werner Almesberger
2003-06-18 17:15 ` David S. Miller
0 siblings, 2 replies; 8+ messages in thread
From: Andi Kleen @ 2003-06-18 8:01 UTC (permalink / raw)
To: David S. Miller; +Cc: ak, netdev, mostrows, paulus
On Tue, Jun 17, 2003 at 03:07:51PM -0700, David S. Miller wrote:
> From: Andi Kleen <ak@muc.de>
> Date: Wed, 18 Jun 2003 00:04:20 +0200
>
> Convert pppoe to a new style protocol, otherwise it is unusable
> on SMP compiled kernels because of the printk in deliver*old_ones.
> It works fine here, but only tested on a UP box.
>
> Please don't add new skb_linearize() users, I'm trying
> to make that only local to net/core/dev.c
Then offer a flag or something for protocols that also doesn't trigger
printks ?
>
> Otherwise I'm fine with your patch.
How else should it be done?
I'm not going through the whole PPP layer now to audit it for non linear
skb cleanliness...
-Andi
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Convert pppoe to new style protocol
2003-06-18 8:01 ` Andi Kleen
@ 2003-06-18 12:21 ` Werner Almesberger
2003-06-18 12:51 ` Andi Kleen
2003-06-18 23:36 ` David S. Miller
2003-06-18 17:15 ` David S. Miller
1 sibling, 2 replies; 8+ messages in thread
From: Werner Almesberger @ 2003-06-18 12:21 UTC (permalink / raw)
To: David S. Miller; +Cc: ak, netdev, mostrows, paulus
On Tue, Jun 17, 2003 at 03:07:51PM -0700, David S. Miller wrote:
> Please don't add new skb_linearize() users, I'm trying
> to make that only local to net/core/dev.c
I know you find documentation unmanly, but maybe ...
- Werner
--- skbuff.h.orig Wed Jun 18 09:13:57 2003
+++ skbuff.h Wed Jun 18 09:15:05 2003
@@ -1126,6 +1126,9 @@
*
* If there is no free memory -ENOMEM is returned, otherwise zero
* is returned and the old skb data released.
+ *
+ * DO NOT USE THIS IN NEW CODE ! skb_linearize will be for internal
+ * use by net/core/dev.c only.
*/
int skb_linearize(struct sk_buff *skb, int gfp);
--
_________________________________________________________________________
/ Werner Almesberger, Buenos Aires, Argentina wa@almesberger.net /
/_http://www.almesberger.net/____________________________________________/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Convert pppoe to new style protocol
2003-06-18 12:21 ` Werner Almesberger
@ 2003-06-18 12:51 ` Andi Kleen
2003-06-18 17:21 ` David S. Miller
2003-06-18 23:36 ` David S. Miller
1 sibling, 1 reply; 8+ messages in thread
From: Andi Kleen @ 2003-06-18 12:51 UTC (permalink / raw)
To: Werner Almesberger; +Cc: David S. Miller, ak, netdev, mostrows, paulus
On Wed, Jun 18, 2003 at 09:21:26AM -0300, Werner Almesberger wrote:
> On Tue, Jun 17, 2003 at 03:07:51PM -0700, David S. Miller wrote:
> > Please don't add new skb_linearize() users, I'm trying
> > to make that only local to net/core/dev.c
>
> I know you find documentation unmanly, but maybe ...
But what is the replacement? For moving over whole subsystems to
non linear skbs it's a bit late in the release...
And the "legacy protocol" setting cannot be used anymore because
it triggers a printk for every packet on a SMP kernel.
-Andi
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Convert pppoe to new style protocol
2003-06-18 8:01 ` Andi Kleen
2003-06-18 12:21 ` Werner Almesberger
@ 2003-06-18 17:15 ` David S. Miller
1 sibling, 0 replies; 8+ messages in thread
From: David S. Miller @ 2003-06-18 17:15 UTC (permalink / raw)
To: ak; +Cc: ak, netdev, mostrows, paulus
From: Andi Kleen <ak@suse.de>
Date: Wed, 18 Jun 2003 10:01:18 +0200
I'm not going through the whole PPP layer now to audit it for non
linear skb cleanliness...
Then you're not making it a compatible protocol.
And the printk will remain until someone fixes it.
If I could get Rusty to fixup _ALL_ of netfilter, I can get
you to fix just _ONE_ thing.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Convert pppoe to new style protocol
2003-06-18 12:51 ` Andi Kleen
@ 2003-06-18 17:21 ` David S. Miller
0 siblings, 0 replies; 8+ messages in thread
From: David S. Miller @ 2003-06-18 17:21 UTC (permalink / raw)
To: ak; +Cc: wa, ak, netdev, mostrows, paulus
From: Andi Kleen <ak@colin2.muc.de>
Date: 18 Jun 2003 14:51:59 +0200,Wed, 18 Jun 2003 14:51:59 +0200
On Wed, Jun 18, 2003 at 09:21:26AM -0300, Werner Almesberger wrote:
> I know you find documentation unmanly, but maybe ...
But what is the replacement? For moving over whole subsystems to
non linear skbs it's a bit late in the release...
We did it for all of netfilter just the other week, networking
development still continues, it's not too late.
Stop looking for excuses and just do the work Andi.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Convert pppoe to new style protocol
2003-06-18 12:21 ` Werner Almesberger
2003-06-18 12:51 ` Andi Kleen
@ 2003-06-18 23:36 ` David S. Miller
1 sibling, 0 replies; 8+ messages in thread
From: David S. Miller @ 2003-06-18 23:36 UTC (permalink / raw)
To: wa; +Cc: ak, netdev, mostrows, paulus
From: Werner Almesberger <wa@almesberger.net>
Date: Wed, 18 Jun 2003 09:21:26 -0300
+ *
+ * DO NOT USE THIS IN NEW CODE ! skb_linearize will be for internal
+ * use by net/core/dev.c only.
*/
int skb_linearize(struct sk_buff *skb, int gfp);
I have a better idea, I just added the __deprecated tag
to this function declaration :-)
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2003-06-18 23:36 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-17 22:04 [PATCH] Convert pppoe to new style protocol Andi Kleen
2003-06-17 22:07 ` David S. Miller
2003-06-18 8:01 ` Andi Kleen
2003-06-18 12:21 ` Werner Almesberger
2003-06-18 12:51 ` Andi Kleen
2003-06-18 17:21 ` David S. Miller
2003-06-18 23:36 ` David S. Miller
2003-06-18 17:15 ` David S. Miller
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).