From: "David S. Miller" <davem@redhat.com>
To: Daniel Fraga <fraga@abusar.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: OOPS: 2.6.8.1 QoS and routing conflict (bug)
Date: Sun, 15 Aug 2004 23:45:28 -0700 [thread overview]
Message-ID: <20040815234528.66eba1c4.davem@redhat.com> (raw)
In-Reply-To: <XFMail.20040816033530.fraga@abusar.org>
Fix already posted, included below for your convenience:
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2004/08/15 19:33:16-07:00 kaber@trash.net
# [PKT_SCHED]: cacheline-align qdisc data in qdisc_create()
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
# Signed-off-by: David S. Miller <davem@redhat.com>
#
# net/sched/sch_api.c
# 2004/08/15 19:32:59-07:00 kaber@trash.net +13 -8
# [PKT_SCHED]: cacheline-align qdisc data in qdisc_create()
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
# Signed-off-by: David S. Miller <davem@redhat.com>
#
diff -Nru a/net/sched/sch_api.c b/net/sched/sch_api.c
--- a/net/sched/sch_api.c 2004-08-15 23:32:37 -07:00
+++ b/net/sched/sch_api.c 2004-08-15 23:32:37 -07:00
@@ -389,7 +389,8 @@
{
int err;
struct rtattr *kind = tca[TCA_KIND-1];
- struct Qdisc *sch = NULL;
+ void *p = NULL;
+ struct Qdisc *sch;
struct Qdisc_ops *ops;
int size;
@@ -407,12 +408,18 @@
if (ops == NULL)
goto err_out;
- size = sizeof(*sch) + ops->priv_size;
+ /* ensure that the Qdisc and the private data are 32-byte aligned */
+ size = ((sizeof(*sch) + QDISC_ALIGN_CONST) & ~QDISC_ALIGN_CONST);
+ size += ops->priv_size + QDISC_ALIGN_CONST;
- sch = kmalloc(size, GFP_KERNEL);
+ p = kmalloc(size, GFP_KERNEL);
err = -ENOBUFS;
- if (!sch)
+ if (!p)
goto err_out;
+ memset(p, 0, size);
+ sch = (struct Qdisc *)(((unsigned long)p + QDISC_ALIGN_CONST)
+ & ~QDISC_ALIGN_CONST);
+ sch->padded = (char *)sch - (char *)p;
/* Grrr... Resolve race condition with module unload */
@@ -420,8 +427,6 @@
if (ops != qdisc_lookup_ops(kind))
goto err_out;
- memset(sch, 0, size);
-
INIT_LIST_HEAD(&sch->list);
skb_queue_head_init(&sch->q);
@@ -470,8 +475,8 @@
err_out:
*errp = err;
- if (sch)
- kfree(sch);
+ if (p)
+ kfree(p);
return NULL;
}
prev parent reply other threads:[~2004-08-16 6:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-16 6:35 OOPS: 2.6.8.1 QoS and routing conflict (bug) Daniel Fraga
2004-08-16 6:45 ` David S. Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040815234528.66eba1c4.davem@redhat.com \
--to=davem@redhat.com \
--cc=fraga@abusar.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.