From owner-freebsd-atm Thu Nov 18 20:21:42 1999 Delivered-To: freebsd-atm@freebsd.org Received: from piglet.dstc.edu.au (piglet.dstc.edu.au [130.102.176.1]) by hub.freebsd.org (Postfix) with ESMTP id 66213154D4 for ; Thu, 18 Nov 1999 20:21:35 -0800 (PST) (envelope-from ggm@dstc.edu.au) Received: from dstc.edu.au (asuncion.dstc.edu.au [130.102.176.155]) by piglet.dstc.edu.au (8.9.3/8.9.3) with ESMTP id OAA21448; Fri, 19 Nov 1999 14:21:26 +1000 (EST) To: "Kees Verstoep" Cc: freebsd-atm@FreeBSD.ORG Subject: Re: Bandwidth Capping fore ATM circuits? In-reply-to: Your message of "Wed, 17 Nov 1999 10:37:45 +0100." <9911171037.ZM24889@cs.vu.nl> Date: Fri, 19 Nov 1999 14:21:25 +1000 Message-ID: <6046.942985285@dstc.edu.au> From: George Michaelson Sender: owner-freebsd-atm@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org This is what I think you said :-) /sys/dev/hfa/fore_output.c: /* * don't do this... */ #ifdef GGM xdp->xd_rate = FORE_DEF_RATE; #else /* * given target max_pcr of 74460 I have to work out * the rate, where rate is the fusion of data and idle as 16-bit fields * joined in a 32. * * Linux does this: * *fore200e_rate_ctrl(struct atm_qos* qos, struct tpd_rate* rate) *{ * if (qos->txtp.max_pcr < ATM_OC3_PCR) { * * compute the data cells to idle cells ratio from the PCR * rate->data_cells = * qos->txtp.max_pcr * FORE200E_MAX_BACK2BACK_CELLS / * ATM_OC3_PCR; * rate->idle_cells = FORE200E_MAX_BACK2BACK_CELLS - * rate->data_cells; * } * else { * disable rate control * rate->data_cells = rate->idle_cells = 0; * } *} * * typedef struct tpd_rate * { * BITFIELD2( * u32 idle_cells : 16, number of idle cells to insert * u32 data_cells : 16 number of data cells to transmit * ) * } tpd_rate_t; * * values found for the #defines from Linux are: * * #define FORE200E_MAX_BACK2BACK_CELLS 255 * * and from atm_h for FreeBSD I get: * * #define ATM_PCR_OC3C 353207 Peak Cell Rate for OC3c * * so I used BC to calculate the date_cells and idle_cells values * as (74460*255/353207)=53 and (255-53)=202 respectively. * on a PC, this becomes a u_long value of 3473610 */ xdp->xd_rate = 3473610; #endif -- George Michaelson | DSTC Pty Ltd Email: ggm@dstc.edu.au | University of Qld 4072 Phone: +61 7 3365 4310 | Australia Fax: +61 7 3365 4311 | http://www.dstc.edu.au To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-atm" in the body of the message