kemenaran / iwidarwin

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

no header packet in rx? #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
jalavoui:
>the rx does receive packets with and without headers (fragments?). i'm
shure >about this

I dont meet this problem. 
I seem that it is not fragments. 
it is the reason that 2200/2945 is hardware fragmentation.

would you print the log?

Original issue reported on code.google.com by kazuh...@gmail.com on 16 Feb 2007 at 5:13

GoogleCodeExporter commented 9 years ago
jalavoui:
the problem is caused by following ?

skb's data length is 0 initialy in linux.
but  mbuf's length is not 0 in our code.because rxb->skb's size is defined as 
3000 in
allocatePacket.

mbuf must be  set correctly packet size  in previous reason.
so i reverse this routine. 

-       //skb_reserve(rxb->skb, offsetof(struct ipw_rx_packet, u.frame.data));
+       skb_reserve(rxb->skb, offsetof(struct ipw_rx_packet, u.frame.data));
        //mbuf_setlen(rxb->skb, offsetof(struct ipw_rx_packet, u.frame.data));
        /* Set the size of the skb to the size of the frame */
-       //skb_put(rxb->skb, le16_to_cpu(pkt->u.frame.length));
+       skb_put(rxb->skb, le16_to_cpu(pkt->u.frame.length));

-       // fix me: dont data length of single mbuf, should be the whole packet s
ize
-       //           mbuf_setlen -> mbuf_pkthdr_setlen ?
-       //           but if so, may change skb->m_len in other mbuf with the sam
e chain. 
-       //           this is np.
-       // now editing kazu
-       if( mbuf_flags(rxb->skb) & MBUF_PKTHDR)
-                       mbuf_pkthdr_setlen(rxb->skb,
-                               mbuf_pkthdr_len(rxb->skb) - mbuf_len(rxb->skb) 
+  
le16_to_cpu(pkt->u.frame.length));
-       
-       mbuf_setdata(rxb->skb, 
-                             (UInt8*)mbuf_data(rxb->skb) + offsetof(struct ipw_
rx_packet, u.frame.data),
-                         le16_to_cpu(pkt->u.frame.length));
-                         
-       //mbuf_setlen(rxb->skb, le16_to_cpu(pkt->u.frame.length));

Original comment by kazuh...@gmail.com on 16 Feb 2007 at 7:19

GoogleCodeExporter commented 9 years ago
if you think we should use mbuf_setdata and mbuf_setlen instead of skb_reserve 
and skb_put that's fine with 
me.

maybe both ways are wrong :)

i think skb_reserve and skb_put code is more stable. i test it and get stable 
speeds when downloading

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

GoogleCodeExporter commented 9 years ago
when using the ifnet_input, the pkt_header is required to have some data in it:

mbuf_pkthdr_setrcvif(m, ifp);
                mbuf_pkthdr_setheader(m, mbuf_data(m));
                MDATA_ETHER_END(m);
                ifnet_input(ifp, m, NULL)

this is not the same as setting the header size

if we use ifnet_input to improve speed how this should be fixed?

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

GoogleCodeExporter commented 9 years ago
if use ifnet_input directly,  performance is not to improve.
because setting mbuf_pkthdr's routine is not heavy.

performance may improve in following code. 
( i cannot test this  because currently i cannot connet to AP) 

rx low performance is caused by iligal size of mbuf.
rs's mbuf always is 3000 in corrently code.
and inputPacket copy 300 byte per calling.(real's size is supposed  90 byte)

also i worry another problem.
when allocatePacket(3000),all data is sequence ?

    // inialize data size and packet size in mbuf 
    mbuf_setlen(rxb->skb,0);

    if( mbuf_flags(rxb->skb) & MBUF_PKTHDR)
        mbuf_pkthdr_setlen(rxb->skb,0);

    /* Advance skb->data to the start of the actual payload */
    skb_reserve(rxb->skb, offsetof(struct ipw_rx_packet, u.frame.data));
    //mbuf_setlen(rxb->skb, offsetof(struct ipw_rx_packet, u.frame.data));
    /* Set the size of the skb to the size of the frame */
    skb_put(rxb->skb, le16_to_cpu(pkt->u.frame.length));

    mbuf_setlen(rxb->skb,le16_to_cpu(pkt->u.frame.length));
    if( mbuf_flags(rxb->skb) & MBUF_PKTHDR)
        mbuf_pkthdr_setlen(rxb->skb,le16_to_cpu(pkt->u.frame.length)); 

Original comment by kazuh...@gmail.com on 17 Feb 2007 at 3:34

GoogleCodeExporter commented 9 years ago
I added IWI_ERR when input packet dont has mbuf's packet header.
(on rev170)
if this error is displayed ,  we should print information with this.

Original comment by kazuh...@gmail.com on 21 Feb 2007 at 9:39

GoogleCodeExporter commented 9 years ago
changed Priority  to low.

Original comment by kazuh...@gmail.com on 21 Feb 2007 at 10:21

GoogleCodeExporter commented 9 years ago
we should change IWI_ERR to not show when using no debug messages. do you agree?

Original comment by jalav...@gmail.com on 21 Feb 2007 at 4:43

GoogleCodeExporter commented 9 years ago
I think that error message  should be displayed always.

Original comment by kazuh...@gmail.com on 21 Feb 2007 at 6:01

GoogleCodeExporter commented 9 years ago

Original comment by jalav...@gmail.com on 9 Mar 2007 at 10:32