kemenaran / iwidarwin

Automatically exported from code.google.com/p/iwidarwin
4 stars 4 forks source link

rx perfomance is lowwer. #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

jalavoui: 
> rx speed - using inputPackey from the controller helps speed. the mtu is
important
to make cache?

Original issue reported on code.google.com by kazuh...@gmail.com on 11 Feb 2007 at 10:15

GoogleCodeExporter commented 9 years ago

Original comment by kazuh...@gmail.com on 12 Feb 2007 at 12:13

GoogleCodeExporter commented 9 years ago
i tested the inputPacket() and get the driver to work with full rx speed. it 
crashes a few seconds after. the 
problem of using this function is that it doesn't release the memory. if you 
open "Activity Monitor" you'll see that 
the memory keeps groing.

i've got a new source code that is stable. i'll upload it to branches

i found that the debug messages crash the driver. so i change it too

do you think we should abandon the IOLogm command?

Original comment by jalav...@gmail.com on 13 Feb 2007 at 5:12

GoogleCodeExporter commented 9 years ago
the inputPacket() is a io80211controller function. i notice that it fails 
freeing the memory and the driver crashes 
after doing some downloads. i'll check this better

Original comment by jalav...@gmail.com on 13 Feb 2007 at 5:25

GoogleCodeExporter commented 9 years ago
sorry, which kind of class is no-freeing method? ( io80211controller or
IONetworkInterface ?).

and plz stop update braches tree.....
trunk is unstable tree. 

plz understand common rules in world....

if I must merge always new your feature  to trunk by hand, i dont have my 
hacking.
if you dont stop to update braches(dont merget the codes to trunk), 
  i will remove my written code from iwi2200 and will close this project web.

plz understand theses...

Original comment by kazuh...@gmail.com on 13 Feb 2007 at 8:48

GoogleCodeExporter commented 9 years ago
> i notice that it fails freeing the memory and the driver crashes after doing 
some
downloads.

memory leak happens in rx,really?

driver cannot know when mbuf should is freed. (with inputPacket).
because driver cannot know if treating of packet finish or not.

and i seem that memory allocation in rx is only rxq.

Original comment by kazuh...@gmail.com on 13 Feb 2007 at 9:41

GoogleCodeExporter commented 9 years ago
when we finish this new features we'll be working in trunk version only.

i'm also tired of watching 2 versions and wich to delete the trash from 
branches.

at this time i'm unable to commit with svn (because of https). do you know why?

i'd like to do the 169.254.xxx update in trunk, but if i can't commit...

Original comment by jalav...@gmail.com on 13 Feb 2007 at 10:31

GoogleCodeExporter commented 9 years ago
when  you can, please remove old vesions from tags - we don't need them

Original comment by jalav...@gmail.com on 13 Feb 2007 at 10:34

GoogleCodeExporter commented 9 years ago
> i'm also tired of watching 2 versions and wich to delete the trash from 
branches.
> at this time i'm unable to commit with svn (because of https). do you know 
why?

what do u use tool on tools. it is svn command in terminal?

you go to working repository( trunk/iwi2200 ) in terminal.
and type "svn update && svn status"
if you dont display "C iwi2200.cpp", plz type "svn commit -m " changelog 
message"

plz paste theses log. 

Original comment by kazuh...@gmail.com on 13 Feb 2007 at 11:08

GoogleCodeExporter commented 9 years ago
about rx speed
> rx speed - using inputPackey from the controller helps speed. the mtu is
>important to make cache?

i read this codes.

void darwin_iwi2200::inputPacket( mbuf_t m )
{
        UInt32 l=mbuf_pkthdr_len(m);

        if (countb+l>1500)// = mtu = IPW_RX_BUF_SIZE/2
        {
                countb=l;
                fNetif->flushInputQueue();
        }
        else
        countb=countb+l;

        super::inputPacket(m);
}

uuhm . i think that this is not good way.

i think that flushInputQueue() should be called 
  when the last of ipw_rx and called ipw_handle_data_packet.

i want to begin to changing it. 
jalavoui, do you have problem?

Original comment by kazuh...@gmail.com on 14 Feb 2007 at 7:31

GoogleCodeExporter commented 9 years ago
that's ok. we should try until find the best solution.

i searched some code:

if (mbuf_pkthdr_header(skb)==NULL) 
{
        // don't know how to receive skb        
}
else    
    ifnet_input(fifnet,skb,NULL);

this is a low level function, but could be a good solution.
the problem is that i've no way to resolve the case when there's no 
mbuf_pkthdr_header in skb

you should check the bsd file if_iwi.c - maybe we can use something from it

Original comment by jalav...@gmail.com on 14 Feb 2007 at 9:40

GoogleCodeExporter commented 9 years ago
jalavoui, mbuf_pkthdr_header always is not NULL in rx.

Original comment by kazuh...@gmail.com on 14 Feb 2007 at 11:05

GoogleCodeExporter commented 9 years ago
> when we finish this new features we'll be working in trunk version only. 

will? you should commit new features ,now. 

Original comment by kazuh...@gmail.com on 14 Feb 2007 at 11:27

GoogleCodeExporter commented 9 years ago
jalavoui.
about setCapacity.

you set MTU size(1500?)  to argmument in your code.
setCapacity is not size of MTU.

> from apple doccuments.
> setCapacity()
>Changes the number of packets that the queue can hold before it begins to drop
excess packets.

Original comment by kazuh...@gmail.com on 15 Feb 2007 at 7:57

GoogleCodeExporter commented 9 years ago
that's and old test i've done.

now i'm only working with the iwi2200. i'll delete the iwi2200-07 if you agree

Original comment by jalav...@gmail.com on 16 Feb 2007 at 9:27

GoogleCodeExporter commented 9 years ago
> the ipw_handle_data_pkt meed to be fix.
> i try several changes and get speed inprovements but it always crash 
> after a while.

why mbuf_setlen is called?
the problem of my older code  is no-set correctly mbuf_len .

i seem that always mbuf_len = 0 .
plz add the code after setting mbuf_pkthdr_setlen.

IWI_DEBUG("dump rx packet size mbuf_len = %d,mbuf_pkthdr_len %d , rx frame size 
%d.
mbuf_next is %s\n",mbuf_len(rxb->skb),mbuf_pkthdr_len(rxb->skb),
mbuf_next(rxb->skb) ? "exist"  : "nothing");

if mbuf_len != mbuf_pkthdr_len  and "mbuf_next is exist",
mbuf_setlen(le16_to_cpu(pkt->u.frame.length)) is required.

Original comment by kazuh...@gmail.com on 17 Feb 2007 at 11:49

GoogleCodeExporter commented 9 years ago
kazu this is fixed in svn.

you now can get full speed

the problem is that it crashes after a while

might be ipw_rx()?

i tryed to disable some of ipw_rx() features and it only makes the crash 
happens earlier

after this is fixed we can try to reenable the rest of the code to see if it 
works

Original comment by jalav...@gmail.com on 17 Feb 2007 at 11:59

GoogleCodeExporter commented 9 years ago
#15 is about current trunk.
plz add #15's routine for checking and test it.
because association dont work in my environment, yet.

IWI_DEBUG("dump rx packet size mbuf_len = %d," 
          "mbuf_pkthdr_len %d , rx frame size %d. "
          " mbuf_next is %s\n", mbuf_len(rxb->skb), 
                               mbuf_pkthdr_len(rxb->skb),
                               le16_to_cpu(pkt->u.frame.length),
                   mbuf_next(rxb->skb) ? "exist"  : "nothing");

Original comment by kazuh...@gmail.com on 18 Feb 2007 at 12:31

GoogleCodeExporter commented 9 years ago
you can commit it to svn too

if it crashes we fix it later

:)

Original comment by jalav...@gmail.com on 18 Feb 2007 at 1:02

GoogleCodeExporter commented 9 years ago
ok.
i added it.

Original comment by kazuh...@gmail.com on 18 Feb 2007 at 1:18

GoogleCodeExporter commented 9 years ago
i'm using this script to test rx speed

change it to use a fast server from your choise.

i get full speed download but

if i boot with -s and call the script it works - but i if set DEBUG_NORMAL i 
can't associate! why? cahanging 
IOLog to printf shows the debug in init() p_disable... with IOLog this fails to 
show

i find out that it ocasional crashes giving a invalid frame point 0x2010 or 
0x210. after boot the driver does 
the download but it crash when doing several downloads

i've added a if to ipw_rx(). do you think we should filter the rx packets 
(kismac)? looks like the rx gets strange 
packets - this could be the cause of the crash. 

Original comment by jalav...@gmail.com on 18 Feb 2007 at 5:02

Attachments:

GoogleCodeExporter commented 9 years ago
> if i boot with -s and call the script it works - 
> but i if set DEBUG_NORMAL i can't associate! why? cahanging

your card cannot associate  in IWI_DEBUG_NORMAL and single user mode?
the probem dont happen in normal mode?

> i find out that it ocasional crashes giving a invalid frame point 0x2010 or 
0x210. 
> after boot the driver download but it crash when doing several downloads

uhhm. connection is stalled( this is not crash) in my environment when i try to
download bigfile.

i seem that the problem is "#define IPW_RX_BUF_SIZE (3000)". plz change "#define
IPW_RX_BUF_SIZE (2024)"  and re-try it?

mbuf's cluster is allocated as 4048 when  allocatePacket(3000). ( mbuf_len and
mbuf_pkthdr_len = 3000).
so this problem may be caused by the reason.

Original comment by kazuh...@gmail.com on 18 Feb 2007 at 5:31

GoogleCodeExporter commented 9 years ago
>your card cannot associate  in IWI_DEBUG_NORMAL and single user mode?
thast's correct. it keeps scanning and don't associate

>the probem dont happen in normal mode?
in normal mode it's ok

>uhhm. connection is stalled( this is not crash) in my environment when i try to
>download bigfile.
i notice that i get 0 speed (this is not a crash) sometimes but after a while 
it starts downloading again

i see the crash only once in -s mode. but in normal mode it crash often and 
i've no way to find where the 
crash ocurs - kernel panic

>i seem that the problem is "#define IPW_RX_BUF_SIZE (3000)". plz change 
"#define
>IPW_RX_BUF_SIZE (2024)"  and re-try it?
commit it to svn. i'll test it later

if you're shure post a build version in forum to other to test

Original comment by jalav...@gmail.com on 18 Feb 2007 at 6:09

GoogleCodeExporter commented 9 years ago
i've tested IPW_RX_BUF_SIZE (2024)

it could help but the driver still crashes

Original comment by jalav...@gmail.com on 19 Feb 2007 at 3:42

GoogleCodeExporter commented 9 years ago
try this in ipw_rx():

//IWI_LOG("t: %04x f:%04x\n",mbuf_type(rxb->skb),mbuf_flags(rxb->skb)); this 
fails if boot with -s why?

        if (mbuf_type(rxb->skb)!=1 || mbuf_flags(rxb->skb)!=3)
        {
            rxb->skb=NULL;
            break;
        }
        //pci_dma_sync_single_for_cpu(priv->pci_dev, 
rxb>dma_addr,IPW_RX_BUF_SIZE,PCI_DMA_FROMDEVICE);

Original comment by jalav...@gmail.com on 19 Feb 2007 at 4:27

GoogleCodeExporter commented 9 years ago
sorry, what is crash ? 

kernel panic happen? 

when is it,strictly?
plz write all methods after command prompt( situation of readonly mounted).

kernel pannic dont occur in my environment.
but window system dont work  in the problem of ps2 driver. 

> if set DEBUG_NORMAL i can't associate! why? 
this is test in current trunk ? ( plz read r164's log and diff .)

plz create new issues about crashing.( crashing your environment)
I want to talk only about peformance in this issue.

Original comment by kazuh...@gmail.com on 19 Feb 2007 at 11:47

GoogleCodeExporter commented 9 years ago
jalavoui,
this is big question.

do you get the same performace as linux driver  without stalling packet?

current trunk in ping speed is faster than linux driver.
although iwi2200 is stalled in size like a 560kb(this is strictly) so 
I cannot take a benchmark .

Original comment by kazuh...@gmail.com on 20 Feb 2007 at 8:38

GoogleCodeExporter commented 9 years ago
crash = kernel panic

i can't test in linux cause i changed linux version.

i think rx is correct for now. i'm checking tx - i think that's the reaqson of 
crash. do you agree?

Original comment by jalav...@gmail.com on 20 Feb 2007 at 7:46

GoogleCodeExporter commented 9 years ago
fixed in r185.

Original comment by kazuh...@gmail.com on 22 Feb 2007 at 6:57