summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/pkt_sched.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2015-02-04 21:30:40 -0800
committerDavid S. Miller <davem@davemloft.net>2015-02-04 22:15:45 -0800
commit06eb395fa9856b5a87cf7d80baee2a0ed3cdb9d7 (patch)
treeb17f7ee51599f992622f924d6a39fcc8e06292f5 /include/uapi/linux/pkt_sched.h
parentf2683b743f2334ef49a5361bf596dd1fbd2c9be4 (diff)
downloadtalos-obmc-linux-06eb395fa9856b5a87cf7d80baee2a0ed3cdb9d7.tar.gz
talos-obmc-linux-06eb395fa9856b5a87cf7d80baee2a0ed3cdb9d7.zip
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/linux/pkt_sched.h')
-rw-r--r--include/uapi/linux/pkt_sched.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
index d62316baae94..534b84710745 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
};
OpenPOWER on IntegriCloud