mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	net_sched/hfsc: fix curve activation in hfsc_change_class()
If real-time or fair-share curves are enabled in hfsc_change_class() class isn't inserted into rb-trees yet. Thus init_ed() and init_vf() must be called in place of update_ed() and update_vf(). Remove isn't required because for now curves cannot be disabled. Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
		
							parent
							
								
									c8e1812960
								
							
						
					
					
						commit
						21f4d5cc25
					
				
					 1 changed files with 19 additions and 4 deletions
				
			
		| 
						 | 
					@ -958,6 +958,8 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (cl != NULL) {
 | 
						if (cl != NULL) {
 | 
				
			||||||
 | 
							int old_flags;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (parentid) {
 | 
							if (parentid) {
 | 
				
			||||||
			if (cl->cl_parent &&
 | 
								if (cl->cl_parent &&
 | 
				
			||||||
			    cl->cl_parent->cl_common.classid != parentid)
 | 
								    cl->cl_parent->cl_common.classid != parentid)
 | 
				
			||||||
| 
						 | 
					@ -978,6 +980,8 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		sch_tree_lock(sch);
 | 
							sch_tree_lock(sch);
 | 
				
			||||||
 | 
							old_flags = cl->cl_flags;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (rsc != NULL)
 | 
							if (rsc != NULL)
 | 
				
			||||||
			hfsc_change_rsc(cl, rsc, cur_time);
 | 
								hfsc_change_rsc(cl, rsc, cur_time);
 | 
				
			||||||
		if (fsc != NULL)
 | 
							if (fsc != NULL)
 | 
				
			||||||
| 
						 | 
					@ -986,10 +990,21 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
 | 
				
			||||||
			hfsc_change_usc(cl, usc, cur_time);
 | 
								hfsc_change_usc(cl, usc, cur_time);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (cl->qdisc->q.qlen != 0) {
 | 
							if (cl->qdisc->q.qlen != 0) {
 | 
				
			||||||
			if (cl->cl_flags & HFSC_RSC)
 | 
								int len = qdisc_peek_len(cl->qdisc);
 | 
				
			||||||
				update_ed(cl, qdisc_peek_len(cl->qdisc));
 | 
					
 | 
				
			||||||
			if (cl->cl_flags & HFSC_FSC)
 | 
								if (cl->cl_flags & HFSC_RSC) {
 | 
				
			||||||
				update_vf(cl, 0, cur_time);
 | 
									if (old_flags & HFSC_RSC)
 | 
				
			||||||
 | 
										update_ed(cl, len);
 | 
				
			||||||
 | 
									else
 | 
				
			||||||
 | 
										init_ed(cl, len);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								if (cl->cl_flags & HFSC_FSC) {
 | 
				
			||||||
 | 
									if (old_flags & HFSC_FSC)
 | 
				
			||||||
 | 
										update_vf(cl, 0, cur_time);
 | 
				
			||||||
 | 
									else
 | 
				
			||||||
 | 
										init_vf(cl, len);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		sch_tree_unlock(sch);
 | 
							sch_tree_unlock(sch);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue