ip_dummynet.c (257179) | ip_dummynet.c (266941) |
---|---|
1/*- 2 * Copyright (c) 1998-2002,2010 Luigi Rizzo, Universita` di Pisa 3 * Portions Copyright (c) 2000 Akamba Corp. 4 * All rights reserved 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1998-2002,2010 Luigi Rizzo, Universita` di Pisa 3 * Portions Copyright (c) 2000 Akamba Corp. 4 * All rights reserved 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/sys/netpfil/ipfw/ip_dummynet.c 257179 2013-10-26 18:18:50Z glebius $"); | 29__FBSDID("$FreeBSD: head/sys/netpfil/ipfw/ip_dummynet.c 266941 2014-06-01 07:28:24Z hiren $"); |
30 31/* 32 * Configuration and internal object management for dummynet. 33 */ 34 35#include "opt_inet6.h" 36 37#include <sys/param.h> --- 1028 unchanged lines hidden (view full) --- 1066 for (t = fs->lookup_step; t > 1; --t) 1067 weight = SCALE_MUL(weight, w0); 1068 fs->lookup_weight = (int)(weight); // scaled 1069 1070 /* Now doing stuff that was in kerneland */ 1071 fs->min_th = SCALE(fs->fs.min_th); 1072 fs->max_th = SCALE(fs->fs.max_th); 1073 | 30 31/* 32 * Configuration and internal object management for dummynet. 33 */ 34 35#include "opt_inet6.h" 36 37#include <sys/param.h> --- 1028 unchanged lines hidden (view full) --- 1066 for (t = fs->lookup_step; t > 1; --t) 1067 weight = SCALE_MUL(weight, w0); 1068 fs->lookup_weight = (int)(weight); // scaled 1069 1070 /* Now doing stuff that was in kerneland */ 1071 fs->min_th = SCALE(fs->fs.min_th); 1072 fs->max_th = SCALE(fs->fs.max_th); 1073 |
1074 fs->c_1 = fs->max_p / (fs->fs.max_th - fs->fs.min_th); | 1074 if (fs->fs.max_th == fs->fs.min_th) 1075 fs->c_1 = fs->max_p; 1076 else 1077 fs->c_1 = SCALE((int64_t)(fs->max_p)) / (fs->fs.max_th - fs->fs.min_th); |
1075 fs->c_2 = SCALE_MUL(fs->c_1, SCALE(fs->fs.min_th)); 1076 1077 if (fs->fs.flags & DN_IS_GENTLE_RED) { 1078 fs->c_3 = (SCALE(1) - fs->max_p) / fs->fs.max_th; 1079 fs->c_4 = SCALE(1) - 2 * fs->max_p; 1080 } 1081 1082 /* If the lookup table already exist, free and create it again. */ --- 1229 unchanged lines hidden --- | 1078 fs->c_2 = SCALE_MUL(fs->c_1, SCALE(fs->fs.min_th)); 1079 1080 if (fs->fs.flags & DN_IS_GENTLE_RED) { 1081 fs->c_3 = (SCALE(1) - fs->max_p) / fs->fs.max_th; 1082 fs->c_4 = SCALE(1) - 2 * fs->max_p; 1083 } 1084 1085 /* If the lookup table already exist, free and create it again. */ --- 1229 unchanged lines hidden --- |