aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_cbq.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-19 23:29:13 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:26:28 -0400
commit27a884dc3cb63b93c2b3b643f5b31eed5f8a4d26 (patch)
tree5a267e40f9b94014be38dad5de0a52b6628834e0 /net/sched/sch_cbq.c
parentbe8bd86321fa7f06359d866ef61fb4d2f3e9dce9 (diff)
[SK_BUFF]: Convert skb->tail to sk_buff_data_t
So that it is also an offset from skb->head, reduces its size from 8 to 4 bytes on 64bit architectures, allowing us to combine the 4 bytes hole left by the layer headers conversion, reducing struct sk_buff size to 256 bytes, i.e. 4 64byte cachelines, and since the sk_buff slab cache is SLAB_HWCACHE_ALIGN... :-) Many calculations that previously required that skb->{transport,network, mac}_header be first converted to a pointer now can be done directly, being meaningful as offsets or pointers. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_cbq.c')
-rw-r--r--net/sched/sch_cbq.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index d83414d828d8..be98a01253e9 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -1465,7 +1465,7 @@ static int cbq_init(struct Qdisc *sch, struct rtattr *opt)
1465 1465
1466static __inline__ int cbq_dump_rate(struct sk_buff *skb, struct cbq_class *cl) 1466static __inline__ int cbq_dump_rate(struct sk_buff *skb, struct cbq_class *cl)
1467{ 1467{
1468 unsigned char *b = skb->tail; 1468 unsigned char *b = skb_tail_pointer(skb);
1469 1469
1470 RTA_PUT(skb, TCA_CBQ_RATE, sizeof(cl->R_tab->rate), &cl->R_tab->rate); 1470 RTA_PUT(skb, TCA_CBQ_RATE, sizeof(cl->R_tab->rate), &cl->R_tab->rate);
1471 return skb->len; 1471 return skb->len;
@@ -1477,7 +1477,7 @@ rtattr_failure:
1477 1477
1478static __inline__ int cbq_dump_lss(struct sk_buff *skb, struct cbq_class *cl) 1478static __inline__ int cbq_dump_lss(struct sk_buff *skb, struct cbq_class *cl)
1479{ 1479{
1480 unsigned char *b = skb->tail; 1480 unsigned char *b = skb_tail_pointer(skb);
1481 struct tc_cbq_lssopt opt; 1481 struct tc_cbq_lssopt opt;
1482 1482
1483 opt.flags = 0; 1483 opt.flags = 0;
@@ -1502,7 +1502,7 @@ rtattr_failure:
1502 1502
1503static __inline__ int cbq_dump_wrr(struct sk_buff *skb, struct cbq_class *cl) 1503static __inline__ int cbq_dump_wrr(struct sk_buff *skb, struct cbq_class *cl)
1504{ 1504{
1505 unsigned char *b = skb->tail; 1505 unsigned char *b = skb_tail_pointer(skb);
1506 struct tc_cbq_wrropt opt; 1506 struct tc_cbq_wrropt opt;
1507 1507
1508 opt.flags = 0; 1508 opt.flags = 0;
@@ -1520,7 +1520,7 @@ rtattr_failure:
1520 1520
1521static __inline__ int cbq_dump_ovl(struct sk_buff *skb, struct cbq_class *cl) 1521static __inline__ int cbq_dump_ovl(struct sk_buff *skb, struct cbq_class *cl)
1522{ 1522{
1523 unsigned char *b = skb->tail; 1523 unsigned char *b = skb_tail_pointer(skb);
1524 struct tc_cbq_ovl opt; 1524 struct tc_cbq_ovl opt;
1525 1525
1526 opt.strategy = cl->ovl_strategy; 1526 opt.strategy = cl->ovl_strategy;
@@ -1537,7 +1537,7 @@ rtattr_failure:
1537 1537
1538static __inline__ int cbq_dump_fopt(struct sk_buff *skb, struct cbq_class *cl) 1538static __inline__ int cbq_dump_fopt(struct sk_buff *skb, struct cbq_class *cl)
1539{ 1539{
1540 unsigned char *b = skb->tail; 1540 unsigned char *b = skb_tail_pointer(skb);
1541 struct tc_cbq_fopt opt; 1541 struct tc_cbq_fopt opt;
1542 1542
1543 if (cl->split || cl->defmap) { 1543 if (cl->split || cl->defmap) {
@@ -1556,7 +1556,7 @@ rtattr_failure:
1556#ifdef CONFIG_NET_CLS_POLICE 1556#ifdef CONFIG_NET_CLS_POLICE
1557static __inline__ int cbq_dump_police(struct sk_buff *skb, struct cbq_class *cl) 1557static __inline__ int cbq_dump_police(struct sk_buff *skb, struct cbq_class *cl)
1558{ 1558{
1559 unsigned char *b = skb->tail; 1559 unsigned char *b = skb_tail_pointer(skb);
1560 struct tc_cbq_police opt; 1560 struct tc_cbq_police opt;
1561 1561
1562 if (cl->police) { 1562 if (cl->police) {
@@ -1590,14 +1590,14 @@ static int cbq_dump_attr(struct sk_buff *skb, struct cbq_class *cl)
1590static int cbq_dump(struct Qdisc *sch, struct sk_buff *skb) 1590static int cbq_dump(struct Qdisc *sch, struct sk_buff *skb)
1591{ 1591{
1592 struct cbq_sched_data *q = qdisc_priv(sch); 1592 struct cbq_sched_data *q = qdisc_priv(sch);
1593 unsigned char *b = skb->tail; 1593 unsigned char *b = skb_tail_pointer(skb);
1594 struct rtattr *rta; 1594 struct rtattr *rta;
1595 1595
1596 rta = (struct rtattr*)b; 1596 rta = (struct rtattr*)b;
1597 RTA_PUT(skb, TCA_OPTIONS, 0, NULL); 1597 RTA_PUT(skb, TCA_OPTIONS, 0, NULL);
1598 if (cbq_dump_attr(skb, &q->link) < 0) 1598 if (cbq_dump_attr(skb, &q->link) < 0)
1599 goto rtattr_failure; 1599 goto rtattr_failure;
1600 rta->rta_len = skb->tail - b; 1600 rta->rta_len = skb_tail_pointer(skb) - b;
1601 return skb->len; 1601 return skb->len;
1602 1602
1603rtattr_failure: 1603rtattr_failure:
@@ -1619,7 +1619,7 @@ cbq_dump_class(struct Qdisc *sch, unsigned long arg,
1619 struct sk_buff *skb, struct tcmsg *tcm) 1619 struct sk_buff *skb, struct tcmsg *tcm)
1620{ 1620{
1621 struct cbq_class *cl = (struct cbq_class*)arg; 1621 struct cbq_class *cl = (struct cbq_class*)arg;
1622 unsigned char *b = skb->tail; 1622 unsigned char *b = skb_tail_pointer(skb);
1623 struct rtattr *rta; 1623 struct rtattr *rta;
1624 1624
1625 if (cl->tparent) 1625 if (cl->tparent)
@@ -1633,7 +1633,7 @@ cbq_dump_class(struct Qdisc *sch, unsigned long arg,
1633 RTA_PUT(skb, TCA_OPTIONS, 0, NULL); 1633 RTA_PUT(skb, TCA_OPTIONS, 0, NULL);
1634 if (cbq_dump_attr(skb, cl) < 0) 1634 if (cbq_dump_attr(skb, cl) < 0)
1635 goto rtattr_failure; 1635 goto rtattr_failure;
1636 rta->rta_len = skb->tail - b; 1636 rta->rta_len = skb_tail_pointer(skb) - b;
1637 return skb->len; 1637 return skb->len;
1638 1638
1639rtattr_failure: 1639rtattr_failure: