~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/net/pie.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/net/pie.h (Architecture m68k) and /include/net/pie.h (Architecture ppc)


  1 /* SPDX-License-Identifier: GPL-2.0-only */         1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 #ifndef __NET_SCHED_PIE_H                           2 #ifndef __NET_SCHED_PIE_H
  3 #define __NET_SCHED_PIE_H                           3 #define __NET_SCHED_PIE_H
  4                                                     4 
  5 #include <linux/ktime.h>                            5 #include <linux/ktime.h>
  6 #include <linux/skbuff.h>                           6 #include <linux/skbuff.h>
  7 #include <linux/types.h>                            7 #include <linux/types.h>
  8 #include <net/inet_ecn.h>                           8 #include <net/inet_ecn.h>
  9 #include <net/pkt_sched.h>                          9 #include <net/pkt_sched.h>
 10                                                    10 
 11 #define MAX_PROB        (U64_MAX >> BITS_PER_B     11 #define MAX_PROB        (U64_MAX >> BITS_PER_BYTE)
 12 #define DTIME_INVALID   U64_MAX                    12 #define DTIME_INVALID   U64_MAX
 13 #define QUEUE_THRESHOLD 16384                      13 #define QUEUE_THRESHOLD 16384
 14 #define DQCOUNT_INVALID -1                         14 #define DQCOUNT_INVALID -1
 15 #define PIE_SCALE       8                          15 #define PIE_SCALE       8
 16                                                    16 
 17 /**                                                17 /**
 18  * struct pie_params - contains pie parameters     18  * struct pie_params - contains pie parameters
 19  * @target:             target delay in psched     19  * @target:             target delay in pschedtime
 20  * @tupdate:            interval at which drop     20  * @tupdate:            interval at which drop probability is calculated
 21  * @limit:              total number of packet     21  * @limit:              total number of packets that can be in the queue
 22  * @alpha:              parameter to control d     22  * @alpha:              parameter to control drop probability
 23  * @beta:               parameter to control d     23  * @beta:               parameter to control drop probability
 24  * @ecn:                is ECN marking of pack     24  * @ecn:                is ECN marking of packets enabled
 25  * @bytemode:           is drop probability sc     25  * @bytemode:           is drop probability scaled based on pkt size
 26  * @dq_rate_estimator:  is Little's law used f     26  * @dq_rate_estimator:  is Little's law used for qdelay calculation
 27  */                                                27  */
 28 struct pie_params {                                28 struct pie_params {
 29         psched_time_t target;                      29         psched_time_t target;
 30         u32 tupdate;                               30         u32 tupdate;
 31         u32 limit;                                 31         u32 limit;
 32         u32 alpha;                                 32         u32 alpha;
 33         u32 beta;                                  33         u32 beta;
 34         u8 ecn;                                    34         u8 ecn;
 35         u8 bytemode;                               35         u8 bytemode;
 36         u8 dq_rate_estimator;                      36         u8 dq_rate_estimator;
 37 };                                                 37 };
 38                                                    38 
 39 /**                                                39 /**
 40  * struct pie_vars - contains pie variables        40  * struct pie_vars - contains pie variables
 41  * @qdelay:             current queue delay        41  * @qdelay:             current queue delay
 42  * @qdelay_old:         queue delay in previou     42  * @qdelay_old:         queue delay in previous qdelay calculation
 43  * @burst_time:         burst time allowance       43  * @burst_time:         burst time allowance
 44  * @dq_tstamp:          timestamp at which dq      44  * @dq_tstamp:          timestamp at which dq rate was last calculated
 45  * @prob:               drop probability           45  * @prob:               drop probability
 46  * @accu_prob:          accumulated drop proba     46  * @accu_prob:          accumulated drop probability
 47  * @dq_count:           number of bytes dequeu     47  * @dq_count:           number of bytes dequeued in a measurement cycle
 48  * @avg_dq_rate:        calculated average dq      48  * @avg_dq_rate:        calculated average dq rate
 49  * @backlog_old:        queue backlog during p     49  * @backlog_old:        queue backlog during previous qdelay calculation
 50  */                                                50  */
 51 struct pie_vars {                                  51 struct pie_vars {
 52         psched_time_t qdelay;                      52         psched_time_t qdelay;
 53         psched_time_t qdelay_old;                  53         psched_time_t qdelay_old;
 54         psched_time_t burst_time;                  54         psched_time_t burst_time;
 55         psched_time_t dq_tstamp;                   55         psched_time_t dq_tstamp;
 56         u64 prob;                                  56         u64 prob;
 57         u64 accu_prob;                             57         u64 accu_prob;
 58         u64 dq_count;                              58         u64 dq_count;
 59         u32 avg_dq_rate;                           59         u32 avg_dq_rate;
 60         u32 backlog_old;                           60         u32 backlog_old;
 61 };                                                 61 };
 62                                                    62 
 63 /**                                                63 /**
 64  * struct pie_stats - contains pie stats           64  * struct pie_stats - contains pie stats
 65  * @packets_in: total number of packets enqueu     65  * @packets_in: total number of packets enqueued
 66  * @dropped:    packets dropped due to pie act     66  * @dropped:    packets dropped due to pie action
 67  * @overlimit:  packets dropped due to lack of     67  * @overlimit:  packets dropped due to lack of space in queue
 68  * @ecn_mark:   packets marked with ECN            68  * @ecn_mark:   packets marked with ECN
 69  * @maxq:       maximum queue size                 69  * @maxq:       maximum queue size
 70  */                                                70  */
 71 struct pie_stats {                                 71 struct pie_stats {
 72         u32 packets_in;                            72         u32 packets_in;
 73         u32 dropped;                               73         u32 dropped;
 74         u32 overlimit;                             74         u32 overlimit;
 75         u32 ecn_mark;                              75         u32 ecn_mark;
 76         u32 maxq;                                  76         u32 maxq;
 77 };                                                 77 };
 78                                                    78 
 79 /**                                                79 /**
 80  * struct pie_skb_cb - contains private skb va     80  * struct pie_skb_cb - contains private skb vars
 81  * @enqueue_time:       timestamp when the pac     81  * @enqueue_time:       timestamp when the packet is enqueued
 82  * @mem_usage:          size of the skb during     82  * @mem_usage:          size of the skb during enqueue
 83  */                                                83  */
 84 struct pie_skb_cb {                                84 struct pie_skb_cb {
 85         psched_time_t enqueue_time;                85         psched_time_t enqueue_time;
 86         u32 mem_usage;                             86         u32 mem_usage;
 87 };                                                 87 };
 88                                                    88 
 89 static inline void pie_params_init(struct pie_     89 static inline void pie_params_init(struct pie_params *params)
 90 {                                                  90 {
 91         params->target = PSCHED_NS2TICKS(15 *      91         params->target = PSCHED_NS2TICKS(15 * NSEC_PER_MSEC);   /* 15 ms */
 92         params->tupdate = usecs_to_jiffies(15      92         params->tupdate = usecs_to_jiffies(15 * USEC_PER_MSEC); /* 15 ms */
 93         params->limit = 1000;                      93         params->limit = 1000;
 94         params->alpha = 2;                         94         params->alpha = 2;
 95         params->beta = 20;                         95         params->beta = 20;
 96         params->ecn = false;                       96         params->ecn = false;
 97         params->bytemode = false;                  97         params->bytemode = false;
 98         params->dq_rate_estimator = false;         98         params->dq_rate_estimator = false;
 99 }                                                  99 }
100                                                   100 
101 static inline void pie_vars_init(struct pie_va    101 static inline void pie_vars_init(struct pie_vars *vars)
102 {                                                 102 {
103         vars->burst_time = PSCHED_NS2TICKS(150    103         vars->burst_time = PSCHED_NS2TICKS(150 * NSEC_PER_MSEC); /* 150 ms */
104         vars->dq_tstamp = DTIME_INVALID;          104         vars->dq_tstamp = DTIME_INVALID;
105         vars->accu_prob = 0;                      105         vars->accu_prob = 0;
106         vars->dq_count = DQCOUNT_INVALID;         106         vars->dq_count = DQCOUNT_INVALID;
107         vars->avg_dq_rate = 0;                    107         vars->avg_dq_rate = 0;
108 }                                                 108 }
109                                                   109 
110 static inline struct pie_skb_cb *get_pie_cb(co    110 static inline struct pie_skb_cb *get_pie_cb(const struct sk_buff *skb)
111 {                                                 111 {
112         qdisc_cb_private_validate(skb, sizeof(    112         qdisc_cb_private_validate(skb, sizeof(struct pie_skb_cb));
113         return (struct pie_skb_cb *)qdisc_skb_    113         return (struct pie_skb_cb *)qdisc_skb_cb(skb)->data;
114 }                                                 114 }
115                                                   115 
116 static inline psched_time_t pie_get_enqueue_ti    116 static inline psched_time_t pie_get_enqueue_time(const struct sk_buff *skb)
117 {                                                 117 {
118         return get_pie_cb(skb)->enqueue_time;     118         return get_pie_cb(skb)->enqueue_time;
119 }                                                 119 }
120                                                   120 
121 static inline void pie_set_enqueue_time(struct    121 static inline void pie_set_enqueue_time(struct sk_buff *skb)
122 {                                                 122 {
123         get_pie_cb(skb)->enqueue_time = psched    123         get_pie_cb(skb)->enqueue_time = psched_get_time();
124 }                                                 124 }
125                                                   125 
126 bool pie_drop_early(struct Qdisc *sch, struct     126 bool pie_drop_early(struct Qdisc *sch, struct pie_params *params,
127                     struct pie_vars *vars, u32    127                     struct pie_vars *vars, u32 backlog, u32 packet_size);
128                                                   128 
129 void pie_process_dequeue(struct sk_buff *skb,     129 void pie_process_dequeue(struct sk_buff *skb, struct pie_params *params,
130                          struct pie_vars *vars    130                          struct pie_vars *vars, u32 backlog);
131                                                   131 
132 void pie_calculate_probability(struct pie_para    132 void pie_calculate_probability(struct pie_params *params, struct pie_vars *vars,
133                                u32 backlog);      133                                u32 backlog);
134                                                   134 
135 #endif                                            135 #endif
136                                                   136 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php