sch_multiq.c (14f0290ba44de6ed435fea24bba26e7868421c66) | sch_multiq.c (cc7ec456f82da7f89a5b376e613b3ac4311b3e9a) |
---|---|
1/* 2 * Copyright (c) 2008, Intel Corporation. 3 * 4 * This program is free software; you can redistribute it and/or modify it 5 * under the terms and conditions of the GNU General Public License, 6 * version 2, as published by the Free Software Foundation. 7 * 8 * This program is distributed in the hope it will be useful, but WITHOUT --- 142 unchanged lines hidden (view full) --- 151 152static unsigned int multiq_drop(struct Qdisc *sch) 153{ 154 struct multiq_sched_data *q = qdisc_priv(sch); 155 int band; 156 unsigned int len; 157 struct Qdisc *qdisc; 158 | 1/* 2 * Copyright (c) 2008, Intel Corporation. 3 * 4 * This program is free software; you can redistribute it and/or modify it 5 * under the terms and conditions of the GNU General Public License, 6 * version 2, as published by the Free Software Foundation. 7 * 8 * This program is distributed in the hope it will be useful, but WITHOUT --- 142 unchanged lines hidden (view full) --- 151 152static unsigned int multiq_drop(struct Qdisc *sch) 153{ 154 struct multiq_sched_data *q = qdisc_priv(sch); 155 int band; 156 unsigned int len; 157 struct Qdisc *qdisc; 158 |
159 for (band = q->bands-1; band >= 0; band--) { | 159 for (band = q->bands - 1; band >= 0; band--) { |
160 qdisc = q->queues[band]; 161 if (qdisc->ops->drop) { 162 len = qdisc->ops->drop(qdisc); 163 if (len != 0) { 164 sch->q.qlen--; 165 return len; 166 } 167 } --- 92 unchanged lines hidden (view full) --- 260 q->max_bands = qdisc_dev(sch)->num_tx_queues; 261 262 q->queues = kcalloc(q->max_bands, sizeof(struct Qdisc *), GFP_KERNEL); 263 if (!q->queues) 264 return -ENOBUFS; 265 for (i = 0; i < q->max_bands; i++) 266 q->queues[i] = &noop_qdisc; 267 | 160 qdisc = q->queues[band]; 161 if (qdisc->ops->drop) { 162 len = qdisc->ops->drop(qdisc); 163 if (len != 0) { 164 sch->q.qlen--; 165 return len; 166 } 167 } --- 92 unchanged lines hidden (view full) --- 260 q->max_bands = qdisc_dev(sch)->num_tx_queues; 261 262 q->queues = kcalloc(q->max_bands, sizeof(struct Qdisc *), GFP_KERNEL); 263 if (!q->queues) 264 return -ENOBUFS; 265 for (i = 0; i < q->max_bands; i++) 266 q->queues[i] = &noop_qdisc; 267 |
268 err = multiq_tune(sch,opt); | 268 err = multiq_tune(sch, opt); |
269 270 if (err) 271 kfree(q->queues); 272 273 return err; 274} 275 276static int multiq_dump(struct Qdisc *sch, struct sk_buff *skb) --- 64 unchanged lines hidden (view full) --- 341} 342 343static int multiq_dump_class(struct Qdisc *sch, unsigned long cl, 344 struct sk_buff *skb, struct tcmsg *tcm) 345{ 346 struct multiq_sched_data *q = qdisc_priv(sch); 347 348 tcm->tcm_handle |= TC_H_MIN(cl); | 269 270 if (err) 271 kfree(q->queues); 272 273 return err; 274} 275 276static int multiq_dump(struct Qdisc *sch, struct sk_buff *skb) --- 64 unchanged lines hidden (view full) --- 341} 342 343static int multiq_dump_class(struct Qdisc *sch, unsigned long cl, 344 struct sk_buff *skb, struct tcmsg *tcm) 345{ 346 struct multiq_sched_data *q = qdisc_priv(sch); 347 348 tcm->tcm_handle |= TC_H_MIN(cl); |
349 tcm->tcm_info = q->queues[cl-1]->handle; | 349 tcm->tcm_info = q->queues[cl - 1]->handle; |
350 return 0; 351} 352 353static int multiq_dump_class_stats(struct Qdisc *sch, unsigned long cl, 354 struct gnet_dump *d) 355{ 356 struct multiq_sched_data *q = qdisc_priv(sch); 357 struct Qdisc *cl_q; --- 15 unchanged lines hidden (view full) --- 373 if (arg->stop) 374 return; 375 376 for (band = 0; band < q->bands; band++) { 377 if (arg->count < arg->skip) { 378 arg->count++; 379 continue; 380 } | 350 return 0; 351} 352 353static int multiq_dump_class_stats(struct Qdisc *sch, unsigned long cl, 354 struct gnet_dump *d) 355{ 356 struct multiq_sched_data *q = qdisc_priv(sch); 357 struct Qdisc *cl_q; --- 15 unchanged lines hidden (view full) --- 373 if (arg->stop) 374 return; 375 376 for (band = 0; band < q->bands; band++) { 377 if (arg->count < arg->skip) { 378 arg->count++; 379 continue; 380 } |
381 if (arg->fn(sch, band+1, arg) < 0) { | 381 if (arg->fn(sch, band + 1, arg) < 0) { |
382 arg->stop = 1; 383 break; 384 } 385 arg->count++; 386 } 387} 388 389static struct tcf_proto **multiq_find_tcf(struct Qdisc *sch, unsigned long cl) --- 52 unchanged lines hidden --- | 382 arg->stop = 1; 383 break; 384 } 385 arg->count++; 386 } 387} 388 389static struct tcf_proto **multiq_find_tcf(struct Qdisc *sch, unsigned long cl) --- 52 unchanged lines hidden --- |