2 Replies Latest reply on Apr 24, 2013 5:20 PM by robert.ghilduta

    Applying back pressure

    robert.ghilduta

      Hello,

         

        I have a system where a user mode application sends data through a driver to the FX3, which then sends data to an FPGA via the GPIF2 bus. The FPGA can buffer data but it consumes exactly 100MB/s. The FPGA is capable of pulling data out of the FX3 when it needs it, however I'm uncertain how/when I should send data to the FX3.

         

        In case the driver sends too much data, the FPGA buffers will get filled up, then so will the FX3's buffers. What happens at that point if the driver attempts to send any more BULK OUTs? Is there anything that can be done to make BULK OUTs not be transmitted if there is no room left in the FX3's buffers?

        • 1. Re: Applying back pressure
          rama.sai.krishna.vakkantula

          Hi,

             

           

             

          If FX3 endpoint buffers are completely filled with data and then if host sends some more data, endpoint responds with a NAK. Host retries the OUT transaction with the same data. This data will be accepted by endpoint whenever the data in endpoint buffer is read by the GPIF II.

             

          This NAKing process continues forever unless the host application or device driver cancel the transfer by timeout.

             

           

             

          Thanks,

             

          Sai Krishna.

          • 2. Re: Applying back pressure
            robert.ghilduta

             This is not the behavior I'm seeing. It appears almost as if there is no back pressure from the device except for it becoming non-responsive. If the FX3 has 50 buffers, and I try to send enough OUT URBs to fill up 70 buffers the first 50 buffers are sent 8 at a time and are ACKed immediately. After the FX3 buffers are filled Linux stops calling my write callback handler (meaning it might not be receiving any ACK or NAK from the device) even after the FX3 buffers are being consumed by the GPIF interface.

               

            Shouldn't Linux be notified by the FX3 when the FX3 goes from haveing 50 out of 50 buffers full to only 49 out of 50 being full?

               

            If this process isn't automatic how do I enable it on the FX3?