Hi folks, I have been looking at moving to using the socket callbacks. The reason I want to use socket callbacks is that I want to add support for multi-connect and then RDMA. Since the in-kernel RDMA support is naturally callback based, and I wanted to avoid the proliferation of extra threads, I started looking at converting to using socket callbacks. Attached is a patch that is only a start towards doing this. It uses two of the socket callbacks, the sk_data_ready and sk_state_change callbacks. It uses the existing cifsiod_wq work_queue to process most of what is handled in the cifs_demultiplex_thread today. However, I have had to re-write some stuff because I cannot sleep on a work queue, so code that does sleeps today had to be rewritten so that I can queue scheduled work rather than sleep. The main function that handles a connection is cifs_read_worker_main. It is a state machine that steps through reading the PDU header off the connection, reads the SMB header, etc. However, it must keep its state in the TCP_Server_Info struct because it must leave off if the socket is empty. On a positive note, I think that I can preserve all the send side stuff as it is. This work is far from complete and I expect to get to the point of testing the changes during the week. Anyway, feedback is welcome. -- Regards, Richard Sharpe (何以解憂?唯有杜康。--曹操)
Attachment:
cifs-callbacks.patch
Description: Binary data