Changes in 4.9.200 regulator: ti-abb: Fix timeout in ti_abb_wait_txdone/ti_abb_clear_all_txdone regulator: pfuze100-regulator: Variable "val" in pfuze100_regulator_probe() could be uninitialized ASoC: wm_adsp: Don't generate kcontrols without READ flags ASoc: rockchip: i2s: Fix RPM imbalance ARM: dts: logicpd-torpedo-som: Remove twl_keypad pinctrl: ns2: Fix off by one bugs in ns2_pinmux_enable() ARM: mm: fix alignment handler faults under memory pressure scsi: scsi_dh_alua: handle RTPG sense code correctly during state transitions scsi: sni_53c710: fix compilation error scsi: fix kconfig dependency warning related to 53C700_LE_ON_BE ARM: dts: imx7s: Correct GPT's ipg clock source perf kmem: Fix memory leak in compact_gfp_flags() ARM: davinci: dm365: Fix McBSP dma_slave_map entry scsi: target: core: Do not overwrite CDB byte 1 of: unittest: fix memory leak in unittest_data_add MIPS: bmips: mark exception vectors as char arrays cifs: Fix cifsInodeInfo lock_sem deadlock when reconnect occurs dccp: do not leak jiffies on the wire net: fix sk_page_frag() recursion from memory reclaim net: hisilicon: Fix ping latency when deal with high throughput net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol() selftests: net: reuseport_dualstack: fix uninitalized parameter net: add READ_ONCE() annotation in __skb_wait_for_more_packets() net: dsa: fix switch tree list net: bcmgenet: reset 40nm EPHY on energy detect vxlan: check tun_info options_len properly net/mlx4_core: Dynamically set guaranteed amount of counters per VF inet: stop leaking jiffies on the wire Kbuild: make designated_init attribute fatal kbuild: use -fmacro-prefix-map to make __FILE__ a relative path kbuild: add -fcf-protection=none when using retpoline flags net/flow_dissector: switch to siphash dmaengine: qcom: bam_dma: Fix resource leak alarmtimer: Change remaining ENOTSUPP to EOPNOTSUPP Linux 4.9.200 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
99 lines
2.5 KiB
C
99 lines
2.5 KiB
C
/*
|
|
* Copyright (c) 2016 Qualcomm Atheros, Inc
|
|
*
|
|
* GPL v2
|
|
*
|
|
* Based on net/sched/sch_fq_codel.c
|
|
*/
|
|
#ifndef __NET_SCHED_FQ_H
|
|
#define __NET_SCHED_FQ_H
|
|
|
|
struct fq_tin;
|
|
|
|
/**
|
|
* struct fq_flow - per traffic flow queue
|
|
*
|
|
* @tin: owner of this flow. Used to manage collisions, i.e. when a packet
|
|
* hashes to an index which points to a flow that is already owned by a
|
|
* different tin the packet is destined to. In such case the implementer
|
|
* must provide a fallback flow
|
|
* @flowchain: can be linked to fq_tin's new_flows or old_flows. Used for DRR++
|
|
* (deficit round robin) based round robin queuing similar to the one
|
|
* found in net/sched/sch_fq_codel.c
|
|
* @backlogchain: can be linked to other fq_flow and fq. Used to keep track of
|
|
* fat flows and efficient head-dropping if packet limit is reached
|
|
* @queue: sk_buff queue to hold packets
|
|
* @backlog: number of bytes pending in the queue. The number of packets can be
|
|
* found in @queue.qlen
|
|
* @deficit: used for DRR++
|
|
*/
|
|
struct fq_flow {
|
|
struct fq_tin *tin;
|
|
struct list_head flowchain;
|
|
struct list_head backlogchain;
|
|
struct sk_buff_head queue;
|
|
u32 backlog;
|
|
int deficit;
|
|
};
|
|
|
|
/**
|
|
* struct fq_tin - a logical container of fq_flows
|
|
*
|
|
* Used to group fq_flows into a logical aggregate. DRR++ scheme is used to
|
|
* pull interleaved packets out of the associated flows.
|
|
*
|
|
* @new_flows: linked list of fq_flow
|
|
* @old_flows: linked list of fq_flow
|
|
*/
|
|
struct fq_tin {
|
|
struct list_head new_flows;
|
|
struct list_head old_flows;
|
|
u32 backlog_bytes;
|
|
u32 backlog_packets;
|
|
u32 overlimit;
|
|
u32 collisions;
|
|
u32 flows;
|
|
u32 tx_bytes;
|
|
u32 tx_packets;
|
|
};
|
|
|
|
/**
|
|
* struct fq - main container for fair queuing purposes
|
|
*
|
|
* @backlogs: linked to fq_flows. Used to maintain fat flows for efficient
|
|
* head-dropping when @backlog reaches @limit
|
|
* @limit: max number of packets that can be queued across all flows
|
|
* @backlog: number of packets queued across all flows
|
|
*/
|
|
struct fq {
|
|
struct fq_flow *flows;
|
|
struct list_head backlogs;
|
|
spinlock_t lock;
|
|
u32 flows_cnt;
|
|
siphash_key_t perturbation;
|
|
u32 limit;
|
|
u32 memory_limit;
|
|
u32 memory_usage;
|
|
u32 quantum;
|
|
u32 backlog;
|
|
u32 overlimit;
|
|
u32 overmemory;
|
|
u32 collisions;
|
|
};
|
|
|
|
typedef struct sk_buff *fq_tin_dequeue_t(struct fq *,
|
|
struct fq_tin *,
|
|
struct fq_flow *flow);
|
|
|
|
typedef void fq_skb_free_t(struct fq *,
|
|
struct fq_tin *,
|
|
struct fq_flow *,
|
|
struct sk_buff *);
|
|
|
|
typedef struct fq_flow *fq_flow_get_default_t(struct fq *,
|
|
struct fq_tin *,
|
|
int idx,
|
|
struct sk_buff *);
|
|
|
|
#endif
|