diff mbox

net_sched: long word align struct qdisc_skb_cb data

Message ID 1298480707.3301.386.camel@edumazet-laptop
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Eric Dumazet Feb. 23, 2011, 5:05 p.m. UTC
Le mercredi 23 février 2011 à 17:24 +0100, Patrick McHardy a écrit :
> Am 23.02.2011 16:14, schrieb Eric Dumazet:
> > diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
> > index 16626a0..f40d32e 100644
> > --- a/include/net/sch_generic.h
> > +++ b/include/net/sch_generic.h
> > @@ -218,6 +218,7 @@ struct tcf_proto {
> >  
> >  struct qdisc_skb_cb {
> >  	unsigned int		pkt_len;
> > +	unsigned int		sfb_classid;
> >  	char			data[];
> >  };
> 
> This could be moved into a SFB specific cb, similar to what netem
> does.

Hmm... well... I want to be sure no other sch will destroy my values.

netem seems buggy then.

Probably following patch is needed ?

Thanks

[PATCH] net_sched: long word align struct qdisc_skb_cb data

netem_skb_cb() does :

return (struct netem_skb_cb *)qdisc_skb_cb(skb)->data;

Unfortunatly struct qdisc_skb_cb data is not long word aligned, so
access to psched_time_t time_to_send uses a non aligned access.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
 include/net/sch_generic.h |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)



--
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

stephen hemminger Feb. 23, 2011, 5:30 p.m. UTC | #1
On Wed, 23 Feb 2011 18:05:07 +0100
Eric Dumazet <eric.dumazet@gmail.com> wrote:

> Le mercredi 23 février 2011 à 17:24 +0100, Patrick McHardy a écrit :
> > Am 23.02.2011 16:14, schrieb Eric Dumazet:
> > > diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
> > > index 16626a0..f40d32e 100644
> > > --- a/include/net/sch_generic.h
> > > +++ b/include/net/sch_generic.h
> > > @@ -218,6 +218,7 @@ struct tcf_proto {
> > >  
> > >  struct qdisc_skb_cb {
> > >  	unsigned int		pkt_len;
> > > +	unsigned int		sfb_classid;
> > >  	char			data[];
> > >  };
> > 
> > This could be moved into a SFB specific cb, similar to what netem
> > does.
> 
> Hmm... well... I want to be sure no other sch will destroy my values.
> 
> netem seems buggy then.
> 
> Probably following patch is needed ?

Yes, it was long word aligned when netem was written but
we seem to have bit creep.
David Miller Feb. 23, 2011, 10:17 p.m. UTC | #2
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Wed, 23 Feb 2011 09:30:01 -0800

> On Wed, 23 Feb 2011 18:05:07 +0100
> Eric Dumazet <eric.dumazet@gmail.com> wrote:
> 
>> Le mercredi 23 février 2011 à 17:24 +0100, Patrick McHardy a écrit :
>> > Am 23.02.2011 16:14, schrieb Eric Dumazet:
>> > > diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
>> > > index 16626a0..f40d32e 100644
>> > > --- a/include/net/sch_generic.h
>> > > +++ b/include/net/sch_generic.h
>> > > @@ -218,6 +218,7 @@ struct tcf_proto {
>> > >  
>> > >  struct qdisc_skb_cb {
>> > >  	unsigned int		pkt_len;
>> > > +	unsigned int		sfb_classid;
>> > >  	char			data[];
>> > >  };
>> > 
>> > This could be moved into a SFB specific cb, similar to what netem
>> > does.
>> 
>> Hmm... well... I want to be sure no other sch will destroy my values.
>> 
>> netem seems buggy then.
>> 
>> Probably following patch is needed ?
> 
> Yes, it was long word aligned when netem was written but
> we seem to have bit creep.

Applied to net-2.6, 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/net/sch_generic.h b/include/net/sch_generic.h
index 16626a0..dbdf2b5 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -218,7 +218,7 @@  struct tcf_proto {
 
 struct qdisc_skb_cb {
 	unsigned int		pkt_len;
-	char			data[];
+	long			data[];
 };
 
 static inline int qdisc_qlen(struct Qdisc *q)