diff options
author | Eric Dumazet <edumazet@google.com> | 2015-02-05 05:30:40 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-02-05 06:15:45 (GMT) |
commit | 06eb395fa9856b5a87cf7d80baee2a0ed3cdb9d7 (patch) | |
tree | b17f7ee51599f992622f924d6a39fcc8e06292f5 /include/uapi | |
parent | f2683b743f2334ef49a5361bf596dd1fbd2c9be4 (diff) | |
download | linux-06eb395fa9856b5a87cf7d80baee2a0ed3cdb9d7.tar.xz |
pkt_sched: fq: better control of DDOS traffic
FQ has a fast path for skb attached to a socket, as it does not
have to compute a flow hash. But for other packets, FQ being non
stochastic means that hosts exposed to random Internet traffic
can allocate million of flows structure (104 bytes each) pretty
easily. Not only host can OOM, but lookup in RB trees can take
too much cpu and memory resources.
This patch adds a new attribute, orphan_mask, that is adding
possibility of having a stochastic hash for orphaned skb.
Its default value is 1024 slots, to mimic SFQ behavior.
Note: This does not apply to locally generated TCP traffic,
and no locally generated traffic will share a flow structure
with another perfect or stochastic flow.
This patch also handles the specific case of SYNACK messages:
They are attached to the listener socket, and therefore all map
to a single hash bucket. If listener have set SO_MAX_PACING_RATE,
hoping to have new accepted socket inherit this rate, SYNACK
might be paced and even dropped.
This is very similar to an internal patch Google have used more
than one year.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi')
-rw-r--r-- | include/uapi/linux/pkt_sched.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h index d62316b..534b847 100644 --- a/include/uapi/linux/pkt_sched.h +++ b/include/uapi/linux/pkt_sched.h @@ -774,6 +774,8 @@ enum { TCA_FQ_FLOW_REFILL_DELAY, /* flow credit refill delay in usec */ + TCA_FQ_ORPHAN_MASK, /* mask applied to orphaned skb hashes */ + __TCA_FQ_MAX }; |