Steven Stallion wrote:
On Mon, 21 Sep 2009 15:22:33 -0700, Vishal Ahuja <[email protected]> wrote:
Hi All,

             I am trying to figure out the receive buffer size for the
NIC
on my machine. It is an Intel PRO/1000 controller (Gb controller), and
the
driver is e1000g. Can someone please point me to the right documentation.


http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/grub/grub-0.97/netboot/via-rhine.c#31(shows
the RX_BUFFER_SIZE = 1536). I am not sure what the units are, and if
this is the right file to look at.

Your best bet is to look in the hardware specifications for the specific
chipset you have. RX buffer limits are typically imposed by the hardware
and vary from manufacturer to manufacturer. Looking in the driver source
will probably just frustrate you.


pardon my ignorance. since your card is e1000g, and u are asking for rx buffer, the relevant code may be here:

http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/io/e1000g/e1000g_rx.c#141

and looking into the e1000g_rx_setup() function there is something like:

   236   */
   237  rx_data->rbd_next <http://src.opensolaris.org/source/s?defs=rbd_next&project=/onnv> 
= rx_data->rbd_first <http://src.opensolaris.org/source/s?defs=rbd_first&project=/onnv>;
238 239 size <http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/io/e1000g/e1000g_rx.c#size> = Adapter->rx_desc_num <http://src.opensolaris.org/source/s?defs=rx_desc_num&project=/onnv> * *sizeof* (*struct* e1000_rx_desc <http://src.opensolaris.org/source/s?defs=e1000_rx_desc&project=/onnv>);
   240  E1000_WRITE_REG 
<http://src.opensolaris.org/source/s?defs=E1000_WRITE_REG&project=/onnv>(hw, E1000_RDLEN 
<http://src.opensolaris.org/source/s?defs=E1000_RDLEN&project=/onnv>(0), size 
<http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/io/e1000g/e1000g_rx.c#size>);
   241  size 
<http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/io/e1000g/e1000g_rx.c#size> 
= E1000_READ_REG <http://src.opensolaris.org/source/s?defs=E1000_READ_REG&project=/onnv>(hw, 
E1000_RDLEN 
<http://src.opensolaris.org/source/s?defs=E1000_RDLEN&project=/onnv>(0));=================================>why
 do you need this?
242 243 /* To get lower order bits */
   244  buf_low 
<http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/io/e1000g/e1000g_rx.c#buf_low>
 = (uint32_t 
<http://src.opensolaris.org/source/s?defs=uint32_t&project=/onnv>)rx_data->rbd_dma_addr 
<http://src.opensolaris.org/source/s?defs=rbd_dma_addr&project=/onnv>;
   245  /* To get the higher order bits */
   246  buf_high 
<http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/io/e1000g/e1000g_rx.c#buf_high> = 
(uint32_t <http://src.opensolaris.org/source/s?defs=uint32_t&project=/onnv>)(rx_data->rbd_dma_addr 
<http://src.opensolaris.org/source/s?defs=rbd_dma_addr&project=/onnv> >> 32);
247 248 E1000_WRITE_REG <http://src.opensolaris.org/source/s?defs=E1000_WRITE_REG&project=/onnv>(hw, E1000_RDBAH <http://src.opensolaris.org/source/s?defs=E1000_RDBAH&project=/onnv>(0), buf_high <http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/io/e1000g/e1000g_rx.c#buf_high>);
   249  E1000_WRITE_REG 
<http://src.opensolaris.org/source/s?defs=E1000_WRITE_REG&project=/onnv>(hw, E1000_RDBAL 
<http://src.opensolaris.org/source/s?defs=E1000_RDBAL&project=/onnv>(0), buf_low 
<http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/io/e1000g/e1000g_rx.c#buf_low>);
250

I am not sure why you need to read back the size after writing to it. Does this read actually force the write to flush out from the cache into the hardware?

Perhaps you will have a better insight than me on the possible buffer size after reading? (buf_low and buf_high?)

does it make any sense to you?

Thanks.
_______________________________________________
driver-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/driver-discuss

Reply via email to