lwip-users
[Top][All Lists]
Advanced

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

RE: [lwip-users] A speed question


From: Matthew Yingling
Subject: RE: [lwip-users] A speed question
Date: Tue, 12 Sep 2006 16:27:36 -0400

Hi Ed,
 
I have a Microblaze running with interrupts and processing both TCP and UDP.  I built it using EDK 7.1, but the process should be the same for both versions of the EDK.  The hardware doesn't care if you want TCP or UDP, that's just setting LWIP callbacks and the appropriate software platform settings in the EDK tool.  The hardware does need to be setup with interrupts, and with a Microblaze you will need an opb_timer and opb_intc to take care of the ethernet interrupt and LWIP timing.  The EDK will choose the correct ethernet driver (polling, interrupt, or even DMA, I think) if your interrupts are connected.  You will then need to initialize the interrupt controller to handle the ethernet interrupts:
 
XEmacIf_Config *xemacif_ptr = &XEmacIf_ConfigTable[0];
 
/* Stop the interrupt controller */
XIntc_mMasterDisable(XPAR_OPB_INTC_0_BASEADDR);
 
  /* Enable MicroBlaze interrupts */  //done in main_main()
  microblaze_enable_interrupts();
/* Register the Ethernet interrupt handler in the vector table This is a driver function*/
XIntc_RegisterHandler(XPAR_OPB_INTC_0_BASEADDR,XPAR_OPB_INTC_0_MY_OPB_ETHERNET_IP2INTC_IRPT_INTR,
   (XInterruptHandler)XEmac_IntrHandlerFifo,xemacif_ptr->instance_ptr);
 
   /*Register Timer Interrupt handler This is your function for what to do when the timer fires.*/
   XIntc_RegisterHandler(XPAR_OPB_INTC_0_BASEADDR,XPAR_OPB_INTC_0_OPB_TIMER_1_INTERRU
      (XInterruptHandler)mytimer_int_handler,(void*)XPAR_OPB_TIMER_1_BASEADDR);
 
   /* Start the interrupt controller */
   XIntc_mMasterEnable(XPAR_OPB_INTC_0_BASEADDR);
 
   /* Enable timer and Ethernet interrupt requests in the interrupt controller */
   XIntc_mEnableIntr(XPAR_OPB_INTC_0_BASEADDR,
      XPAR_OPB_TIMER_1_INTERRUPT_MASK | XPAR_MY_OPB_ETHERNET_IP2INTC_IRPT_MASK);
 

   /* reset the timers, and clear interrupts */
   XTmrCtr_mSetControlStatusReg(XPAR_OPB_TIMER_1_BASEADDR, 0,
      XTC_CSR_INT_OCCURED_MASK | XTC_CSR_LOAD_MASK );
 
   /* start the timers */
   XTmrCtr_mSetControlStatusReg(XPAR_OPB_TIMER_1_BASEADDR, 0,
      XTC_CSR_ENABLE_TMR_MASK | XTC_CSR_ENABLE_INT_MASK |
      XTC_CSR_AUTO_RELOAD_MASK | XTC_CSR_DOWN_COUNT_MASK);
 
   /*-------------------------------
    * Enable microblaze interrupts
    *-------------------------------*/
   microblaze_enable_interrupts();
 
Most of that code came from an interrupt demo by Xilinx, though I don't remember which one.  I modified it a bit for Ethernet MAC support.
 
Now, when data is received via ethernet, the xemacif_input(default_netif); should automatically get called via the interrupt driver.  So long as your LWIP tcp_recv() and udp_recv()callback functions are defined, your code should receive the packets.  Before you set up the interrupts you will need to set your Timer to fire at an appropriate interval.  XTmrCtr_mSetLoadReg() is one function you can use.
 
If you haven't created and tested a polling based system, you may want to get that up and running with LWIP.  It's simpler to set up and get running (hw and sw), and the migration to interrupt based systems will have a known working code and hw base to build on.  I think there are a number of Microblaze and LWIP polling based hardware systems available for inspection.
 
Matthew Yingling
 
-----Original Message-----
From: address@hidden [mailto:address@hiddenOn Behalf Of Pisano, Edward A
Sent: Tuesday, September 12, 2006 3:08 PM
To: Mailing list for lwIP users
Subject: RE: [lwip-users] A speed question

Regarding the implementation of lwIP RAW_API on MicroBlaze @ 100MHz built with EDK 8.2i, is it set up for polling or is it interrupt driven?  Is it employing TCP, UDP or both?

 

Could someone provide a sample of the initialization and configuration for lwIP RAW_API, particularly for the Interrupt driven case?  Is there a special case for RAW_API where the application code must provide for the connection of the emac interrupts to the FIFO Interrupt Handlers in software?

 

I’ve set up a simple MicroBlaze application in EDK 8.2i using interrupts following the XiLinx examples provided (which I believe are for polling mode).  The symptom is that incoming packets to my SP305 Dev. Board are not being passed to the rcv_pkt_buf in the emac driver.  Hence, higher level software functions never sees the arriving packets.  In SOCKETS_API mode, these transactions work fine.

 

Regards,

Ed

a.k.a. - Paisan

[paisan ( pi-zän' ) 1. A countryman; a compatriot. 2. Slang A friend; a pal.]

SAN office:  858-655-4541

CV office:  541-715-4078

cell:    858-354-2744


From: address@hidden [mailto:address@hidden On Behalf Of Sathya Thammanur
Sent: Wednesday, August 30, 2006 12:24 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] A speed question

 

Iperf is an open source tool that can be used to measure the performances.

http://dast.nlanr.net/Projects/Iperf/

Regarding performances, the 8.2i release of EDK from Xilinx has improved performances with RAW API. The throughput seen were in the ranges of 50-60Mbps for MicroBlaze running @100Mhz with regular 10/100 ethernet core without dma.

Sathya

On 8/30/06, Pisano, Edward A <address@hidden> wrote:

Hi,
How are you measuring your data rate?

I'm building an application targeting a Virtex 2 using lwIP and running
on a MicroBlaze at about 150MHz.  I'd like to know what types of
non-invasive tools you are using to monitor and measure your apps speed.

Regards,
Ed

-----Original Message-----
From: lwip-users-bounces+edward.pisano=address@hidden
[mailto: address@hidden] On Behalf Of
Hampus Thorell
Sent: Wednesday, August 30, 2006 1:00 AM
To: Mailing list for lwIP users
Subject: [lwip-users] A speed question

Hey!

I have built an application on a Xilinx Virtex 2 Pro FPGA running on 200

Mhz using lwIP with TCP and the raw API. The maximum throughput I get is

somewhere round 7 Mbit/s. Has anyone else built an application under
similar circumstances and gotten better throughput than that?

Best regards,
Hampus



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


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

 


reply via email to

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