net/sched: get rid of qdisc->padded
kmalloc() of sufficiently big portion of memory is cache-aligned in regular conditions. If some debugging options are used, there is no reason qdisc structures would need 64-byte alignment if most other kernel structures are not aligned. This get rid of QDISC_ALIGN and QDISC_ALIGNTO. Addition of privdata field will help implementing the reverse of qdisc_priv() and documents where the private data is. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Allen Pais <allen.lkml@gmail.com> Acked-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:

committed by
Jakub Kicinski

parent
036dfd8322
commit
846e463a70
@@ -19,12 +19,9 @@ struct qdisc_walker {
|
||||
int (*fn)(struct Qdisc *, unsigned long cl, struct qdisc_walker *);
|
||||
};
|
||||
|
||||
#define QDISC_ALIGNTO 64
|
||||
#define QDISC_ALIGN(len) (((len) + QDISC_ALIGNTO-1) & ~(QDISC_ALIGNTO-1))
|
||||
|
||||
static inline void *qdisc_priv(struct Qdisc *q)
|
||||
{
|
||||
return (char *) q + QDISC_ALIGN(sizeof(struct Qdisc));
|
||||
return &q->privdata;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user