Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added full duplex capability #31

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

buttercutter
Copy link

@buttercutter buttercutter commented Oct 23, 2018

This patch helps to enable bi-directional PCIe communication at PCIe gen2 speed grade

Major change in this patch is the enabling of chnl_recv() scatter-gather list first in the case of loopback.

Some other changes include splitting TX and RX into two separate FSMs in two always blocks as you can see in chnl_tester.v

Also, I need to give credit to @marzoul for #18 which I have already included in this patch altogether.

TODO

  1. Improves loopback bandwidth measurement result with respect to simplex bandwidth result (still slower with an approximate factor of 2). There is a latency between the moment a data transaction is possible to when it's carried out, which leads to a very uneven data transport. This, in turn, yields suboptimal bandwidth performance for loopback setup.

  2. Refactors code which does not fit standard code styling and removes unnecessary dead code accordingly

Modified iteration stop limit
added "make unload" and "make load" because "make install" does not unload the old driver
CHNL_TX_DATA_REN signal is redefined for full duplex such that it does not depend directly on CHNL_TX signal
whenever chnl_send() or chnl_recv() threads encountered timeout situation for pop_circ_queue(), do not execute free_sg_buf() so that the threads are given more chances to survive since for a specific full-duplex condition (that is loopback), receiver might need to wait until transmitter had actually sent some data
CHNL_TX is modified such that it is asserted whenever CHNL_RX is first asserted. This modification ensures that https://github.com/promach/riffa/blob/master/fpga/riffa_hdl/interrupt.v#L57 (new TX transaction) triggers the interrupt signal for https://github.com/promach/riffa/blob/full_duplex/driver/linux/riffa_driver.c#L319 (subsequent linux driver preparatory actions on new TX transactions) at an earlier timestep, so that in the case loopback, FPGA Tx side (or equivalently PC chnl_recv() side) won't be late to receive the actual data from FPGA Rx side (or equivalently PC chnl_send() side).
Eliminated the need to process another chnl_recv() event which is EVENT_TXN_LEN before the actual data receive transaction
Current linux driver code modification could support full duplex transaction at defined PCIe speed specification

The key point of this commit modification is the use of wake_up() call to speed up the call of wait_event_interruptible_timeout() function
this is to avoid premature circular queue overflow issue for repetitive transactions of large data batch size (or length)
@buttercutter
Copy link
Author

buttercutter commented Oct 23, 2018

@marzoul I really appreciate if you could comment on methods for further bandwidth optimization of this patch.

fengguang pushed a commit to 0day-ci/linux that referenced this pull request Nov 27, 2018
This patch adds RIFFA PCIe linux driver for https://github.com/promach/riffa/tree/full_duplex/driver/linux

This staging driver is modified from this upstream driver at https://github.com/KastnerRG/riffa/tree/master/driver/linux

For further details, please refer to KastnerRG/riffa#31

Signed-off-by: Cheng Fei Phung <[email protected]>
fengguang pushed a commit to 0day-ci/linux that referenced this pull request Dec 4, 2018
This patch adds RIFFA PCIe linux driver for https://github.com/promach/riffa/tree/full_duplex/driver/linux

This staging driver is modified from this upstream driver at https://github.com/KastnerRG/riffa/tree/master/driver/linux

For further details, please refer to KastnerRG/riffa#31

Signed-off-by: Cheng Fei Phung <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant