Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Nov 1999 14:21:25 +1000
From:      George Michaelson <ggm@dstc.edu.au>
To:        "Kees Verstoep" <versto@cs.vu.nl>
Cc:        freebsd-atm@FreeBSD.ORG
Subject:   Re: Bandwidth Capping fore ATM circuits? 
Message-ID:  <6046.942985285@dstc.edu.au>
In-Reply-To: Your message of "Wed, 17 Nov 1999 10:37:45 %2B0100." <9911171037.ZM24889@cs.vu.nl> 

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6046.942985285>