aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/fq_impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/fq_impl.h')
-rw-r--r--include/net/fq_impl.h30
1 files changed, 19 insertions, 11 deletions
diff --git a/include/net/fq_impl.h b/include/net/fq_impl.h
index 02eab7c51adb..163f3ed0f05a 100644
--- a/include/net/fq_impl.h
+++ b/include/net/fq_impl.h
@@ -120,6 +120,24 @@ static struct fq_flow *fq_flow_classify(struct fq *fq,
120 return flow; 120 return flow;
121} 121}
122 122
123static void fq_recalc_backlog(struct fq *fq,
124 struct fq_tin *tin,
125 struct fq_flow *flow)
126{
127 struct fq_flow *i;
128
129 if (list_empty(&flow->backlogchain))
130 list_add_tail(&flow->backlogchain, &fq->backlogs);
131
132 i = flow;
133 list_for_each_entry_continue_reverse(i, &fq->backlogs,
134 backlogchain)
135 if (i->backlog > flow->backlog)
136 break;
137
138 list_move(&flow->backlogchain, &i->backlogchain);
139}
140
123static void fq_tin_enqueue(struct fq *fq, 141static void fq_tin_enqueue(struct fq *fq,
124 struct fq_tin *tin, 142 struct fq_tin *tin,
125 struct sk_buff *skb, 143 struct sk_buff *skb,
@@ -127,7 +145,6 @@ static void fq_tin_enqueue(struct fq *fq,
127 fq_flow_get_default_t get_default_func) 145 fq_flow_get_default_t get_default_func)
128{ 146{
129 struct fq_flow *flow; 147 struct fq_flow *flow;
130 struct fq_flow *i;
131 148
132 lockdep_assert_held(&fq->lock); 149 lockdep_assert_held(&fq->lock);
133 150
@@ -139,16 +156,7 @@ static void fq_tin_enqueue(struct fq *fq,
139 tin->backlog_packets++; 156 tin->backlog_packets++;
140 fq->backlog++; 157 fq->backlog++;
141 158
142 if (list_empty(&flow->backlogchain)) 159 fq_recalc_backlog(fq, tin, flow);
143 list_add_tail(&flow->backlogchain, &fq->backlogs);
144
145 i = flow;
146 list_for_each_entry_continue_reverse(i, &fq->backlogs,
147 backlogchain)
148 if (i->backlog > flow->backlog)
149 break;
150
151 list_move(&flow->backlogchain, &i->backlogchain);
152 160
153 if (list_empty(&flow->flowchain)) { 161 if (list_empty(&flow->flowchain)) {
154 flow->deficit = fq->quantum; 162 flow->deficit = fq->quantum;