lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Fw: (no subject)


From: Simon Goldschmidt
Subject: Re: [lwip-users] Fw: (no subject)
Date: Mon, 31 Oct 2011 09:36:54 +0100

Where do you call transfer_txperf_data()? I don't see it being called anywhere. And I would have expected you call it both from the connected callback (to initially send as much data as the sndbuf holds) and from the sent callback (to send more data when the sndbuf allows it). Also, you might want to modify that function to be able to write smaller parts of the 1400-byte buffer: depending on how large your sndbuf is, this limitation can slow down transfer, too.

Simon


Anirudha Sarangi <address@hidden> wrote:

Hi Simon and Kieran,
As per your advice, I provided the lwipopts.h for both of my versions in my last email. My txperf application is copied below.
 
Could you have a look at the configuration for lwip140 and let me know if something is missing.
Also, please have a look at the application file. The same application is used for both lwip130 and lwip140.
I did not change anything in the lwip130 or lwip140.
 
regards
Anirudha
 
static struct tcp_pcb *connected_pcb = NULL;
#define SEND_BUFSIZE (1400)
static char send_buf[SEND_BUFSIZE];
static unsigned txperf_client_connected = 0;
int
transfer_txperf_data()
{
 int copy = 1;
 err_t err;
 struct tcp_pcb *tpcb = connected_pcb;
 if (!connected_pcb)
  return ERR_OK;
 while (tcp_sndbuf(tpcb) > SEND_BUFSIZE) {
  err = tcp_write(tpcb, send_buf, SEND_BUFSIZE, copy);
  if (err != ERR_OK) {
   xil_printf("txperf: Error on tcp_write: %d\r\n", err);
                        connected_pcb = NULL;
   return -1;
  }
  tcp_output(tpcb);
 }
 return 0;
}
static err_t
txperf_sent_callback(void *arg, struct tcp_pcb *tpcb, u16_t len)
{
 return ERR_OK;
}
static err_t
txperf_connected_callback(void *arg, struct tcp_pcb *tpcb, err_t err)
{
 xil_printf("txperf: Connected to iperf server\r\n");
        txperf_client_connected = 1;
 /* store state */
 connected_pcb = tpcb;
 /* set callback values & functions */
 tcp_arg(tpcb, NULL);
 tcp_sent(tpcb, txperf_sent_callback);
 /* initiate data transfer */
 return ERR_OK;
}
int
start_txperf_application()
{
 struct tcp_pcb *pcb;
 struct ip_addr ipaddr;
 err_t err;
 u16_t port;
 int i;
 /* create new TCP PCB structure */
 pcb = tcp_new();
 if (!pcb) {
  xil_printf("txperf: Error creating PCB. Out of Memory\r\n");
  return -1;
 }
 /* connect to iperf server */
#if 1
 IP4_ADDR(&ipaddr,  192, 168,   1, 100);  /* iperf server address */
#else
 IP4_ADDR(&ipaddr,  172, 16,    0, 100);  /* iperf server address */
#endif
 port = 5001;     /* iperf default port */
 err = tcp_connect(pcb, &ipaddr, port, txperf_connected_callback);
        txperf_client_connected = 0;
 if (err != ERR_OK) {
  xil_printf("txperf: tcp_connect returned error: %d\r\n", err);
  return err;
 }
 /* initialize data buffer being sent */
 for (i = 0; i < SEND_BUFSIZE; i++)
  send_buf[i] = (i % 10) + '0';
 return 0;
}
 

From: "address@hidden" <address@hidden>
To: Mailing list for lwIP users <address@hidden>
Sent: Friday, 30 September 2011 12:37 AM
Subject: Re: [lwip-users] Fw: (no subject)

FreeRTOS Info wrote:
> Could you please provide details of what you changed.
Good idea, could you please provide your lwipopts.h for both versions?
Maybe we can see anything from that. I'd like to measure performance on
my hardware using these 2 versions + configs.

Also, which API are you using? Sockets, netconn or raw API?

Simon

>
>
> Regards,
> Richard.
>
> + http://www.FreeRTOS.org
> Designed for Microcontrollers.
> More than 7000 downloads per month.
>
>
>
>
> On 29/09/2011 07:29, Anirudha Sarangi wrote:
>> Hi Kieran,
>> I was playing with some of the new parameters that are added in lwip140.
>> I got good improvement in numbers.
>> The numbers improved from around 66 MB to 82 MB.
>>
>> With the same hardware and same application files (compiler options are
>> also same), lwip130 gives me a number of 92-93 MB for txperf and lwip140
>> gives me a number of 82 MB. There is still a difference of 10 MB.
>>
>> I want to send you the pcap files for both. Old as well as new lwip. But
>> not sure how. The pcap files are quite large.
>>
>> Is there anyway I could send them to you? Alternate mail id or something?
>>
>> regards
>> Anirudha
>>
>> *From:* Kieran Mansley<address@hidden>
>> *To:* Mailing list for lwIP users<address@hidden>
>> *Sent:* Wednesday, 28 September 2011 5:04 PM
>> *Subject:* Re: [lwip-users] Fw: (no subject)
>>
>>
>> On 28 Sep 2011, at 12:15, Anirudha Sarangi wrote:
>>
>>> Hi Kieren,
>>> Do you mean capturing the packets in wireshark and sending you the log?
>> Exactly.  Please send the pcap file, not just the textual log.
>>
>> Kieran
>>
>> _______________________________________________
>> lwip-users mailing list
>> address@hidden<mailto:address@hidden>
>> https://lists.nongnu.org/mailman/listinfo/lwip-users
>>
>>
>>
>>
>> _______________________________________________
>> lwip-users mailing list
>> address@hidden
>> https://lists.nongnu.org/mailman/listinfo/lwip-users
> _______________________________________________
> lwip-users mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>


_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users


_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users

reply via email to

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