Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - How to check if Ethernet drive uses DMA transactions or not?: (13 Items)
   
How to check if Ethernet drive uses DMA transactions or not?  
Hi,

I am using 6.3.2 and my Ethernet controller is a 10/100 Mbit Fast Ethernet. I don't know much about Ethernet/Networking 
stack in QNX expect using few basic commands like io-net, ifconfig, dhcp.client, etc.

I noticed that whenever I transfer data to/from my system (Vortex SoC 800 MHz) the CPU usage goes up to 100% and I get 
terrible speeds (as compared to running the system over Linux). I suspect that my QNX Ethernet driver might not be using
 the full DMA capabilities. How can I check that? I used nicinfo utility but did not see any DMA related information in 
the output.

Thanks.
Re: How to check if Ethernet drive uses DMA transactions or not?  
What network driver are you using?


On 10-04-28 1:33 PM, "Kushal Koolwal" <community-noreply@qnx.com> wrote:

> Hi,
> 
> I am using 6.3.2 and my Ethernet controller is a 10/100 Mbit Fast Ethernet. I
> don't know much about Ethernet/Networking stack in QNX expect using few basic
> commands like io-net, ifconfig, dhcp.client, etc.
> 
> I noticed that whenever I transfer data to/from my system (Vortex SoC 800 MHz)
> the CPU usage goes up to 100% and I get terrible speeds (as compared to
> running the system over Linux). I suspect that my QNX Ethernet driver might
> not be using the full DMA capabilities. How can I check that? I used nicinfo
> utility but did not see any DMA related information in the output.
> 
> Thanks.
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post53046
> 

-- 
Hugh Brown                      (613) 591-0931 ext. 2209 (voice)
QNX Software Systems Ltd.        (613) 591-3579           (fax)
175 Terence Matthews Cres.       email:  hsbrown@qnx.com
Kanata, Ontario, Canada.
K2M 1W8
 

Re: How to check if Ethernet drive uses DMA transactions or not?  
> What network driver are you using?
devn-vortex.so

As mentioned before I don't think this driver is a part of standard QNX release. Our vendor supplied this driver to us.

RE: How to check if Ethernet drive uses DMA transactions or not?  
Are you sharing interrupts?

--
aboyd
Re: RE: How to check if Ethernet drive uses DMA transactions or not?  
> Are you sharing interrupts?
I don't think so. Attached is the output of pci -v and the sloginfo output after downloading a 280MB files from local 
intranet over web browser:

# sloginfo

DMP vortex-R6040 Ethernet Controller

  Physical Node ID ........................... 000060 000001
  Current Physical Node ID ................... 000060 000001
  Current Operation Rate ..................... 100.00 Mb/s
  Active Interface Type ...................... MII
    Active PHY address ....................... 0
  Maximum Transmittable data Unit ............ 1514
  Maximum Receivable data Unit ............... 1514
  Hardware Interrupt ......................... 0x7
  I/O Aperture ............................... 0xd600 - 0xd6ff
  Memory Aperture ............................ 0xfebfe400 - 0xfebfe4ff
  Promiscuous Mode ........................... Off
  Multicast Support .......................... Enabled

  Packets Transmitted OK ..................... 68650
  Bytes Transmitted OK ....................... 3723307
  Memory Allocation Failures on Transmit ..... 0

  Packets Received OK ........................ 193129
  Bytes Received OK .......................... 289797339
  Memory Allocation Failures on Receive ...... 0

  Single Collisions on Transmit .............. 0
  Deferred Transmits ......................... 0
  Late Collision on Transmit errors .......... 0
  Transmits aborted (excessive collisions) ... 0
  Transmit Underruns ......................... 0
  No Carrier on Transmit ..................... 0
  Receive Alignment errors ................... 0
  Received packets with CRC errors ........... 0
  Packets Dropped on receive ................. 0
  Oversized Packets received ................. 0
  Short packets .............................. 0
  Frames with Dribble Bits ................... 0



Attachment: Text pci.txt 5.81 KB
Re: How to check if Ethernet drive uses DMA transactions or not?  
We didn't write this driver, so you will have to speak to whoever wrote it.


On 10-04-28 2:02 PM, "Kushal Koolwal" <community-noreply@qnx.com> wrote:

>> Are you sharing interrupts?
> I don't think so. Attached is the output of pci -v and the sloginfo output
> after downloading a 280MB files from local intranet over web browser:
> 
> # sloginfo
> 
> DMP vortex-R6040 Ethernet Controller
> 
>   Physical Node ID ........................... 000060 000001
>   Current Physical Node ID ................... 000060 000001
>   Current Operation Rate ..................... 100.00 Mb/s
>   Active Interface Type ...................... MII
>     Active PHY address ....................... 0
>   Maximum Transmittable data Unit ............ 1514
>   Maximum Receivable data Unit ............... 1514
>   Hardware Interrupt ......................... 0x7
>   I/O Aperture ............................... 0xd600 - 0xd6ff
>   Memory Aperture ............................ 0xfebfe400 - 0xfebfe4ff
>   Promiscuous Mode ........................... Off
>   Multicast Support .......................... Enabled
> 
>   Packets Transmitted OK ..................... 68650
>   Bytes Transmitted OK ....................... 3723307
>   Memory Allocation Failures on Transmit ..... 0
> 
>   Packets Received OK ........................ 193129
>   Bytes Received OK .......................... 289797339
>   Memory Allocation Failures on Receive ...... 0
> 
>   Single Collisions on Transmit .............. 0
>   Deferred Transmits ......................... 0
>   Late Collision on Transmit errors .......... 0
>   Transmits aborted (excessive collisions) ... 0
>   Transmit Underruns ......................... 0
>   No Carrier on Transmit ..................... 0
>   Receive Alignment errors ................... 0
>   Received packets with CRC errors ........... 0
>   Packets Dropped on receive ................. 0
>   Oversized Packets received ................. 0
>   Short packets .............................. 0
>   Frames with Dribble Bits ................... 0
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post53053

-- 
Hugh Brown                      (613) 591-0931 ext. 2209 (voice)
QNX Software Systems Ltd.        (613) 591-3579           (fax)
175 Terence Matthews Cres.       email:  hsbrown@qnx.com
Kanata, Ontario, Canada.
K2M 1W8
 

Re: How to check if Ethernet drive uses DMA transactions or not?  
> We didn't write this driver, so you will have to speak to whoever wrote it.
I understand that. I might try to do that.

However, I would appreciate if somebody can answer my original question - Is there any way to check (besides checking 
CPU usage) in QNX if the ethernet driver is DMA or not?

Thanks for all your help.

Re: How to check if Ethernet drive uses DMA transactions or not?  
If it is a PCI device it should be using bus mastering (PCI DMA), but I
cannot tell definitely without looking at the driver source, so that is why
you will have to speak to the developer.


On 10-04-28 2:15 PM, "Kushal Koolwal" <community-noreply@qnx.com> wrote:

>> We didn't write this driver, so you will have to speak to whoever wrote it.
> I understand that. I might try to do that.
> 
> However, I would appreciate if somebody can answer my original question - Is
> there any way to check (besides checking CPU usage) in QNX if the ethernet
> driver is DMA or not?
> 
> Thanks for all your help.
> 
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post53058
> 

-- 
Hugh Brown                      (613) 591-0931 ext. 2209 (voice)
QNX Software Systems Ltd.        (613) 591-3579           (fax)
175 Terence Matthews Cres.       email:  hsbrown@qnx.com
Kanata, Ontario, Canada.
K2M 1W8
 

Re: How to check if Ethernet drive uses DMA transactions or not?  
> I cannot tell definitely without looking at the driver source

We do have the source code for the driver.

This may be a crude method to find but anyways -  Is there a generic function/API that I should search within the source
 code files to find out if DMA bus mastering is used or not? I am guessing that any device driver that uses DMA might be
 using a particular API provided by QNX infrastructure to make use of DMA.
Re: How to check if Ethernet drive uses DMA transactions or not?  
Well you can look at the transmit or receive code and see whether the driver
is using descriptors for rx and tx. If there is a loop reading and/or
writing to the chip buffer, then it is not using DMA.


On 10-04-28 2:41 PM, "Kushal Koolwal" <community-noreply@qnx.com> wrote:

>> I cannot tell definitely without looking at the driver source
> 
> We do have the source code for the driver.
> 
> This may be a crude method to find but anyways -  Is there a generic
> function/API that I should search within the source code files to find out if
> DMA bus mastering is used or not? I am guessing that any device driver that
> uses DMA might be using a particular API provided by QNX infrastructure to
> make use of DMA.
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post53072
> 

-- 
Hugh Brown                      (613) 591-0931 ext. 2209 (voice)
QNX Software Systems Ltd.        (613) 591-3579           (fax)
175 Terence Matthews Cres.       email:  hsbrown@qnx.com
Kanata, Ontario, Canada.
K2M 1W8
 

Re: How to check if Ethernet drive uses DMA transactions or not?  
> Well you can look at the transmit or receive code and see whether the driver
> is using descriptors for rx and tx. If there is a loop reading and/or
> writing to the chip buffer, then it is not using DMA.

I think the driver is not using DMA because in the receive.c file in function vortex_receive I see a loop like:
for(i = 0; i < vortex->num_rx_descriptors; i++) 
{ 
.....
.....
}

Thanks Hugh for all your help! Much appreciated.
Re: How to check if Ethernet drive uses DMA transactions or not?  
No, that looks as though it is using descriptors, so it should be using DMA.


On 10-04-28 3:18 PM, "Kushal Koolwal" <community-noreply@qnx.com> wrote:

>> Well you can look at the transmit or receive code and see whether the driver
>> is using descriptors for rx and tx. If there is a loop reading and/or
>> writing to the chip buffer, then it is not using DMA.
> 
> I think the driver is not using DMA because in the receive.c file in function
> vortex_receive I see a loop like:
> for(i = 0; i < vortex->num_rx_descriptors; i++)
> { 
> .....
> .....
> }
> 
> Thanks Hugh for all your help! Much appreciated.
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post53085
> 

-- 
Hugh Brown                      (613) 591-0931 ext. 2209 (voice)
QNX Software Systems Ltd.        (613) 591-3579           (fax)
175 Terence Matthews Cres.       email:  hsbrown@qnx.com
Kanata, Ontario, Canada.
K2M 1W8
 

Re: How to check if Ethernet drive uses DMA transactions or not?  
> No, that looks as though it is using descriptors, so it should be using DMA.
Hmm...May be I misread/misunderstood your post. I thought having a loop with descriptors in the code means it is not 
using DMA.

Sorry for the confusion. I really wish I could post the source code but I am not sure about the licensing terms as there
 is no license file with the code.