Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109276
b: refs/heads/master
c: df69471
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Aug 27, 2008
1 parent 8ec3830 commit 966d89d
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 17393dd67c06c3912ff47b31268b648929715336
refs/heads/master: df69471290cbec7714f6d1fabd14f4e41219cee1
12 changes: 10 additions & 2 deletions trunk/include/net/sch_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,19 +217,27 @@ static inline spinlock_t *qdisc_root_lock(struct Qdisc *qdisc)
return qdisc_lock(root);
}

static inline spinlock_t *qdisc_root_sleeping_lock(struct Qdisc *qdisc)
{
struct Qdisc *root = qdisc_root_sleeping(qdisc);

ASSERT_RTNL();
return qdisc_lock(root);
}

static inline struct net_device *qdisc_dev(struct Qdisc *qdisc)
{
return qdisc->dev_queue->dev;
}

static inline void sch_tree_lock(struct Qdisc *q)
{
spin_lock_bh(qdisc_root_lock(q));
spin_lock_bh(qdisc_root_sleeping_lock(q));
}

static inline void sch_tree_unlock(struct Qdisc *q)
{
spin_unlock_bh(qdisc_root_lock(q));
spin_unlock_bh(qdisc_root_sleeping_lock(q));
}

#define tcf_tree_lock(tp) sch_tree_lock((tp)->q)
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -3121,9 +3121,9 @@ static struct ctl_table empty[1];
static struct ctl_table ipv4_skeleton[] =
{
{ .procname = "route", .ctl_name = NET_IPV4_ROUTE,
.child = ipv4_route_table},
.mode = 0555, .child = ipv4_route_table},
{ .procname = "neigh", .ctl_name = NET_IPV4_NEIGH,
.child = empty},
.mode = 0555, .child = empty},
{ }
};

Expand Down
6 changes: 4 additions & 2 deletions trunk/net/ipv4/tcp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,8 @@ static unsigned tcp_syn_options(struct sock *sk, struct sk_buff *skb,
}
if (likely(sysctl_tcp_window_scaling)) {
opts->ws = tp->rx_opt.rcv_wscale;
size += TCPOLEN_WSCALE_ALIGNED;
if(likely(opts->ws))
size += TCPOLEN_WSCALE_ALIGNED;
}
if (likely(sysctl_tcp_sack)) {
opts->options |= OPTION_SACK_ADVERTISE;
Expand Down Expand Up @@ -509,7 +510,8 @@ static unsigned tcp_synack_options(struct sock *sk,

if (likely(ireq->wscale_ok)) {
opts->ws = ireq->rcv_wscale;
size += TCPOLEN_WSCALE_ALIGNED;
if(likely(opts->ws))
size += TCPOLEN_WSCALE_ALIGNED;
}
if (likely(doing_ts)) {
opts->options |= OPTION_TS;
Expand Down
18 changes: 13 additions & 5 deletions trunk/net/sched/sch_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ static struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue,
struct Qdisc *oqdisc = dev_queue->qdisc_sleeping;
spinlock_t *root_lock;

root_lock = qdisc_root_lock(oqdisc);
root_lock = qdisc_lock(oqdisc);
spin_lock_bh(root_lock);

/* Prune old scheduler */
Expand All @@ -635,7 +635,7 @@ static struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue,
if (qdisc == NULL)
qdisc = &noop_qdisc;
dev_queue->qdisc_sleeping = qdisc;
dev_queue->qdisc = &noop_qdisc;
rcu_assign_pointer(dev_queue->qdisc, &noop_qdisc);

spin_unlock_bh(root_lock);

Expand Down Expand Up @@ -830,9 +830,16 @@ qdisc_create(struct net_device *dev, struct netdev_queue *dev_queue,
sch->stab = stab;
}
if (tca[TCA_RATE]) {
spinlock_t *root_lock;

if ((sch->parent != TC_H_ROOT) &&
!(sch->flags & TCQ_F_INGRESS))
root_lock = qdisc_root_sleeping_lock(sch);
else
root_lock = qdisc_lock(sch);

err = gen_new_estimator(&sch->bstats, &sch->rate_est,
qdisc_root_lock(sch),
tca[TCA_RATE]);
root_lock, tca[TCA_RATE]);
if (err) {
/*
* Any broken qdiscs that would require
Expand Down Expand Up @@ -884,7 +891,8 @@ static int qdisc_change(struct Qdisc *sch, struct nlattr **tca)

if (tca[TCA_RATE])
gen_replace_estimator(&sch->bstats, &sch->rate_est,
qdisc_root_lock(sch), tca[TCA_RATE]);
qdisc_root_sleeping_lock(sch),
tca[TCA_RATE]);
return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/net/sched/sch_cbq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1839,7 +1839,7 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **t

if (tca[TCA_RATE])
gen_replace_estimator(&cl->bstats, &cl->rate_est,
qdisc_root_lock(sch),
qdisc_root_sleeping_lock(sch),
tca[TCA_RATE]);
return 0;
}
Expand Down Expand Up @@ -1930,7 +1930,7 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **t

if (tca[TCA_RATE])
gen_new_estimator(&cl->bstats, &cl->rate_est,
qdisc_root_lock(sch), tca[TCA_RATE]);
qdisc_root_sleeping_lock(sch), tca[TCA_RATE]);

*arg = (unsigned long)cl;
return 0;
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/sched/sch_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ static void dev_deactivate_queue(struct net_device *dev,
if (!(qdisc->flags & TCQ_F_BUILTIN))
set_bit(__QDISC_STATE_DEACTIVATED, &qdisc->state);

dev_queue->qdisc = qdisc_default;
rcu_assign_pointer(dev_queue->qdisc, qdisc_default);
qdisc_reset(qdisc);

spin_unlock_bh(qdisc_lock(qdisc));
Expand Down Expand Up @@ -709,7 +709,7 @@ static void shutdown_scheduler_queue(struct net_device *dev,
struct Qdisc *qdisc_default = _qdisc_default;

if (qdisc) {
dev_queue->qdisc = qdisc_default;
rcu_assign_pointer(dev_queue->qdisc, qdisc_default);
dev_queue->qdisc_sleeping = qdisc_default;

qdisc_destroy(qdisc);
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/sched/sch_hfsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid,

if (tca[TCA_RATE])
gen_replace_estimator(&cl->bstats, &cl->rate_est,
qdisc_root_lock(sch),
qdisc_root_sleeping_lock(sch),
tca[TCA_RATE]);
return 0;
}
Expand Down Expand Up @@ -1104,7 +1104,7 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid,

if (tca[TCA_RATE])
gen_new_estimator(&cl->bstats, &cl->rate_est,
qdisc_root_lock(sch), tca[TCA_RATE]);
qdisc_root_sleeping_lock(sch), tca[TCA_RATE]);
*arg = (unsigned long)cl;
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/sched/sch_htb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
goto failure;

gen_new_estimator(&cl->bstats, &cl->rate_est,
qdisc_root_lock(sch),
qdisc_root_sleeping_lock(sch),
tca[TCA_RATE] ? : &est.nla);
cl->refcnt = 1;
cl->children = 0;
Expand Down Expand Up @@ -1427,7 +1427,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
} else {
if (tca[TCA_RATE])
gen_replace_estimator(&cl->bstats, &cl->rate_est,
qdisc_root_lock(sch),
qdisc_root_sleeping_lock(sch),
tca[TCA_RATE]);
sch_tree_lock(sch);
}
Expand Down

0 comments on commit 966d89d

Please sign in to comment.