Skip to content

Commit 90caf67

Browse files
edumazetdavem330
authored andcommitted
net_sched: sch_fq: remove dead code dealing with retransmits
With the earliest departure time model, we no longer plan special casing TCP retransmits. We therefore remove dead code (since most compilers understood skb_is_retransmit() was false) Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c092dd5 commit 90caf67

File tree

1 file changed

+5
-53
lines changed

1 file changed

+5
-53
lines changed

net/sched/sch_fq.c

Lines changed: 5 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ struct fq_sched_data {
106106

107107
u64 stat_gc_flows;
108108
u64 stat_internal_packets;
109-
u64 stat_tcp_retrans;
110109
u64 stat_throttled;
111110
u64 stat_flows_plimit;
112111
u64 stat_pkts_too_long;
@@ -327,62 +326,17 @@ static struct sk_buff *fq_dequeue_head(struct Qdisc *sch, struct fq_flow *flow)
327326
return skb;
328327
}
329328

330-
/* We might add in the future detection of retransmits
331-
* For the time being, just return false
332-
*/
333-
static bool skb_is_retransmit(struct sk_buff *skb)
334-
{
335-
return false;
336-
}
337-
338-
/* add skb to flow queue
339-
* flow queue is a linked list, kind of FIFO, except for TCP retransmits
340-
* We special case tcp retransmits to be transmitted before other packets.
341-
* We rely on fact that TCP retransmits are unlikely, so we do not waste
342-
* a separate queue or a pointer.
343-
* head-> [retrans pkt 1]
344-
* [retrans pkt 2]
345-
* [ normal pkt 1]
346-
* [ normal pkt 2]
347-
* [ normal pkt 3]
348-
* tail-> [ normal pkt 4]
349-
*/
350329
static void flow_queue_add(struct fq_flow *flow, struct sk_buff *skb)
351330
{
352-
struct sk_buff *prev, *head = flow->head;
331+
struct sk_buff *head = flow->head;
353332

354333
skb->next = NULL;
355-
if (!head) {
334+
if (!head)
356335
flow->head = skb;
357-
flow->tail = skb;
358-
return;
359-
}
360-
if (likely(!skb_is_retransmit(skb))) {
336+
else
361337
flow->tail->next = skb;
362-
flow->tail = skb;
363-
return;
364-
}
365338

366-
/* This skb is a tcp retransmit,
367-
* find the last retrans packet in the queue
368-
*/
369-
prev = NULL;
370-
while (skb_is_retransmit(head)) {
371-
prev = head;
372-
head = head->next;
373-
if (!head)
374-
break;
375-
}
376-
if (!prev) { /* no rtx packet in queue, become the new head */
377-
skb->next = flow->head;
378-
flow->head = skb;
379-
} else {
380-
if (prev == flow->tail)
381-
flow->tail = skb;
382-
else
383-
skb->next = prev->next;
384-
prev->next = skb;
385-
}
339+
flow->tail = skb;
386340
}
387341

388342
static int fq_enqueue(struct sk_buff *skb, struct Qdisc *sch,
@@ -401,8 +355,6 @@ static int fq_enqueue(struct sk_buff *skb, struct Qdisc *sch,
401355
}
402356

403357
f->qlen++;
404-
if (skb_is_retransmit(skb))
405-
q->stat_tcp_retrans++;
406358
qdisc_qstats_backlog_inc(sch, skb);
407359
if (fq_flow_is_detached(f)) {
408360
struct sock *sk = skb->sk;
@@ -874,7 +826,7 @@ static int fq_dump_stats(struct Qdisc *sch, struct gnet_dump *d)
874826

875827
st.gc_flows = q->stat_gc_flows;
876828
st.highprio_packets = q->stat_internal_packets;
877-
st.tcp_retrans = q->stat_tcp_retrans;
829+
st.tcp_retrans = 0;
878830
st.throttled = q->stat_throttled;
879831
st.flows_plimit = q->stat_flows_plimit;
880832
st.pkts_too_long = q->stat_pkts_too_long;

0 commit comments

Comments
 (0)