sch_gred.c (69ecdbac144147a80747914d9b6ea3472e2d93e7) | sch_gred.c (e87cc4728f0e2fb663e592a1141742b1d6c63256) |
---|---|
1/* 2 * net/sched/sch_gred.c Generic Random Early Detection queue. 3 * 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License 7 * as published by the Free Software Foundation; either version 8 * 2 of the License, or (at your option) any later version. --- 241 unchanged lines hidden (view full) --- 250 251 skb = qdisc_dequeue_head(sch); 252 253 if (skb) { 254 struct gred_sched_data *q; 255 u16 dp = tc_index_to_dp(skb); 256 257 if (dp >= t->DPs || (q = t->tab[dp]) == NULL) { | 1/* 2 * net/sched/sch_gred.c Generic Random Early Detection queue. 3 * 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License 7 * as published by the Free Software Foundation; either version 8 * 2 of the License, or (at your option) any later version. --- 241 unchanged lines hidden (view full) --- 250 251 skb = qdisc_dequeue_head(sch); 252 253 if (skb) { 254 struct gred_sched_data *q; 255 u16 dp = tc_index_to_dp(skb); 256 257 if (dp >= t->DPs || (q = t->tab[dp]) == NULL) { |
258 if (net_ratelimit()) 259 pr_warning("GRED: Unable to relocate VQ 0x%x " 260 "after dequeue, screwing up " 261 "backlog.\n", tc_index_to_dp(skb)); | 258 net_warn_ratelimited("GRED: Unable to relocate VQ 0x%x after dequeue, screwing up backlog\n", 259 tc_index_to_dp(skb)); |
262 } else { 263 q->backlog -= qdisc_pkt_len(skb); 264 265 if (!q->backlog && !gred_wred_mode(t)) 266 red_start_of_idle_period(&q->vars); 267 } 268 269 return skb; --- 12 unchanged lines hidden (view full) --- 282 283 skb = qdisc_dequeue_tail(sch); 284 if (skb) { 285 unsigned int len = qdisc_pkt_len(skb); 286 struct gred_sched_data *q; 287 u16 dp = tc_index_to_dp(skb); 288 289 if (dp >= t->DPs || (q = t->tab[dp]) == NULL) { | 260 } else { 261 q->backlog -= qdisc_pkt_len(skb); 262 263 if (!q->backlog && !gred_wred_mode(t)) 264 red_start_of_idle_period(&q->vars); 265 } 266 267 return skb; --- 12 unchanged lines hidden (view full) --- 280 281 skb = qdisc_dequeue_tail(sch); 282 if (skb) { 283 unsigned int len = qdisc_pkt_len(skb); 284 struct gred_sched_data *q; 285 u16 dp = tc_index_to_dp(skb); 286 287 if (dp >= t->DPs || (q = t->tab[dp]) == NULL) { |
290 if (net_ratelimit()) 291 pr_warning("GRED: Unable to relocate VQ 0x%x " 292 "while dropping, screwing up " 293 "backlog.\n", tc_index_to_dp(skb)); | 288 net_warn_ratelimited("GRED: Unable to relocate VQ 0x%x while dropping, screwing up backlog\n", 289 tc_index_to_dp(skb)); |
294 } else { 295 q->backlog -= len; 296 q->stats.other++; 297 298 if (!q->backlog && !gred_wred_mode(t)) 299 red_start_of_idle_period(&q->vars); 300 } 301 --- 214 unchanged lines hidden (view full) --- 516 .def_DP = table->def, 517 .grio = gred_rio_mode(table), 518 .flags = table->red_flags, 519 }; 520 521 opts = nla_nest_start(skb, TCA_OPTIONS); 522 if (opts == NULL) 523 goto nla_put_failure; | 290 } else { 291 q->backlog -= len; 292 q->stats.other++; 293 294 if (!q->backlog && !gred_wred_mode(t)) 295 red_start_of_idle_period(&q->vars); 296 } 297 --- 214 unchanged lines hidden (view full) --- 512 .def_DP = table->def, 513 .grio = gred_rio_mode(table), 514 .flags = table->red_flags, 515 }; 516 517 opts = nla_nest_start(skb, TCA_OPTIONS); 518 if (opts == NULL) 519 goto nla_put_failure; |
524 NLA_PUT(skb, TCA_GRED_DPS, sizeof(sopt), &sopt); | 520 if (nla_put(skb, TCA_GRED_DPS, sizeof(sopt), &sopt)) 521 goto nla_put_failure; |
525 526 for (i = 0; i < MAX_DPs; i++) { 527 struct gred_sched_data *q = table->tab[i]; 528 529 max_p[i] = q ? q->parms.max_P : 0; 530 } | 522 523 for (i = 0; i < MAX_DPs; i++) { 524 struct gred_sched_data *q = table->tab[i]; 525 526 max_p[i] = q ? q->parms.max_P : 0; 527 } |
531 NLA_PUT(skb, TCA_GRED_MAX_P, sizeof(max_p), max_p); | 528 if (nla_put(skb, TCA_GRED_MAX_P, sizeof(max_p), max_p)) 529 goto nla_put_failure; |
532 533 parms = nla_nest_start(skb, TCA_GRED_PARMS); 534 if (parms == NULL) 535 goto nla_put_failure; 536 537 for (i = 0; i < MAX_DPs; i++) { 538 struct gred_sched_data *q = table->tab[i]; 539 struct tc_gred_qopt opt; --- 87 unchanged lines hidden --- | 530 531 parms = nla_nest_start(skb, TCA_GRED_PARMS); 532 if (parms == NULL) 533 goto nla_put_failure; 534 535 for (i = 0; i < MAX_DPs; i++) { 536 struct gred_sched_data *q = table->tab[i]; 537 struct tc_gred_qopt opt; --- 87 unchanged lines hidden --- |