Lines Matching defs:mark
82 struct ip_vs_wrr_mark *mark;
85 * Allocate the mark variable for WRR scheduling
87 mark = kmalloc(sizeof(struct ip_vs_wrr_mark), GFP_ATOMIC);
88 if (mark == NULL) {
92 mark->cl = &svc->destinations;
93 mark->cw = 0;
94 mark->mw = ip_vs_wrr_max_weight(svc);
95 mark->di = ip_vs_wrr_gcd_weight(svc);
96 svc->sched_data = mark;
105 * Release the mark variable
115 struct ip_vs_wrr_mark *mark = svc->sched_data;
117 mark->cl = &svc->destinations;
118 mark->mw = ip_vs_wrr_max_weight(svc);
119 mark->di = ip_vs_wrr_gcd_weight(svc);
120 if (mark->cw > mark->mw)
121 mark->cw = 0;
133 struct ip_vs_wrr_mark *mark = svc->sched_data;
139 * This loop will always terminate, because mark->cw in (0, max_weight]
143 p = mark->cl;
145 if (mark->cl == &svc->destinations) {
148 if (mark->cl == mark->cl->next) {
156 mark->cl = svc->destinations.next;
157 mark->cw -= mark->di;
158 if (mark->cw <= 0) {
159 mark->cw = mark->mw;
163 if (mark->cw == 0) {
164 mark->cl = &svc->destinations;
172 mark->cl = mark->cl->next;
174 if (mark->cl != &svc->destinations) {
176 dest = list_entry(mark->cl, struct ip_vs_dest, n_list);
178 atomic_read(&dest->weight) >= mark->cw) {
184 if (mark->cl == p && mark->cw == mark->di) {