lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: [lwip-users] tcp_sndbuf always returns 0


From: WU Rui-Qing
Subject: Re: Re: [lwip-users] tcp_sndbuf always returns 0
Date: Mon, 20 Jul 2009 16:52:21 +0800

  Thank you very much . 
  This problem has been solved. It results from two bugs.
  First is in tcp_write(pcb, hs->file, len, 0); the data to be send was not 
copyed into TCP buffer,and then tcp_write returned ,the block in FIFO is 
rewrited.
  The second is from static err_t low_level_output(struct netif *netif, struct 
pbuf *p) for CS8900A network controller.
In the routine, 

err_t low_level_output(struct netif *netif, struct pbuf *p)
{

  u16_t  *ptr=NULL;
  struct pbuf *q; 
  ......

 for(q = p; q != NULL; q = q->next) {
    /* Send the data from the pbuf to the interface, one pbuf at a
       time. The size of the data in each pbuf is kept in the ->len
       variable. */
        ptr = (u16_t *)q->payload;
    for(i = 0; i < q->len; i =i+2)
    {      
          CS8900A_RTDATA0=*ptr++;
    }
  } 
  
  ...... 
  
  }
  
  In our platform ,the CS8900A works in 16 bits I/O mode. When the data length 
in pbuf is odd, a redundant byte is writen out. It results in a TCP checksum 
error. 

        
 

>On Fri, 2009-07-17 at 21:06 +0800, WU Rui-Qing wrote:
>>   In packet capture from wireshark ,the checksum shows Good
>> checksum :False  Bad checksum :False . Is this relative to  the
>> [validation disabled] configuration ? 
>
>Probably.  It shows up as bad in Wireshark when I look at it.
>
>>   I am sure that the block memory in FIFO is locked and not changed when it 
>> is read. 
>
>What happens to it when you move on to the next block though - this is
>the point at which you see the problem.
>
>>   when I implement the server using the socket , the server can run long 
>> time .Why is this?
>
>Because the socket API correctly sets the TCP_WRITE_FLAG_COPY flag for
>you when tcp_write() is called.
>
>Kieran
>
>
>
>_______________________________________________
>lwip-users mailing list
>address@hidden
>http://lists.nongnu.org/mailman/listinfo/lwip-users
 
 
WU Rui-Qing
address@hidden
2009-07-20








reply via email to

[Prev in Thread] Current Thread [Next in Thread]