[Click] ToDevice stats problem

Eddie Kohler kohler at CS.UCLA.EDU
Mon Feb 28 01:20:19 EST 2005


Hey Nikitas,

The _pulls and _npackets counters are measuring what they're supposed to.  We 
could argue about whether _npackets should mean "number of packets successfully 
sent" or "number of packets that we TRIED to send", as it does now.  But _pulls 
is measuring something useful.  You can figure out how many packets were 
successfully sent as _npackets - _rejected.

Eddie


Nikitas Liogkas wrote:
> It seems to me that some of the ToDevice stats are wrong! Specifically 
> _npackets now holds the number of packets pulled from the upstream 
> queue, and _pulls is incremented _before_ pull() is called, so it is 
> incremented even on an unsuccessful pull!
> 
> Here is a patch that makes more sense to me: _npackets now holds the 
> number of sent packets, and _pulls the number of pulled packets. Given 
> that _rejected holds the number of rejected packets, it is now true that 
> _pulls = _npackets + _rejected.
> 
> nikitas
> 
> 
> ------------------------------------------------------------------------
> 
> --- todevice-ori.cc	2005-02-27 18:01:57.000000000 -0800
> +++ todevice.cc	2005-02-27 18:30:54.000000000 -0800
> @@ -215,13 +215,12 @@
>  	uint64_t before_pull_cycles = click_get_cycles();
>  #endif
>  
> -	_pulls++;
> -
>  	Packet *p = input(0).pull();
>  	if (!p)
>  	    break;
>  
> -	_npackets++;
> +	_pulls++;
> +	
>  #if CLICK_DEVICE_THESIS_STATS && !CLICK_DEVICE_STATS
>  	_pull_cycles += click_get_cycles() - before_pull_cycles - CLICK_CYCLE_COMPENSATION;
>  #endif
> @@ -239,6 +238,8 @@
>  	sent++;
>      }
>  
> +    _npackets += sent;
> +    
>  #if HAVE_LINUX_POLLING
>      if (is_polling && sent > 0)
>  	_dev->tx_eob(_dev);
> @@ -376,7 +377,7 @@
>  	String(td->_busy_returns) + " device busy returns\n" +
>  	String(td->_npackets) + " packets sent\n" +
>  	String(td->_runs) + " calls to run_task()\n" +
> -	String(td->_pulls) + " pulls\n" +
> +	String(td->_pulls) + " packets pulled\n" +
>  #if CLICK_DEVICE_STATS
>  	String(td->_pull_cycles) + " cycles pull\n" +
>  	String(td->_time_clean) + " cycles clean\n" +
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click


More information about the click mailing list