On 8/26/2022 8:38 PM, Long Li wrote:...
-/* Default maximum number of SGEs in a RDMA send/recv */
-#define SMBDIRECT_MAX_SGE 16
+/* Maximum number of SGEs needed by smbdirect.c in a send work
request */
+#define SMBDIRECT_MAX_SEND_SGE 5
I see the following comment in fs/cifs/smb2pdu.h:
/*
* Maximum number of iovs we need for an open/create request.
* [0] : struct smb2_create_req
* [1] : path
* [2] : lease context
* [3] : durable context
* [4] : posix context
* [5] : time warp context
* [6] : query id context
* [7] : compound padding
*/
#define SMB2_CREATE_IOV_SIZE 8
Maybe using 8 is safer?
Thanks for taking a look!
SMB Direct re-frames the SMB3 request and the rq_iov's don't
always marshal the same way when they're transmitted over
RDMA. Sometimes they go in different packets, or get turned
into RDMA channel descriptors. So there isn't always a 1:1
mapping.
Also, I haven't perfectly convinced myself this comment is
correct. There is a good bit of optional context insertion,
and some buffer sharing, in SMB2_open_init(). And don't
forget SMB2_TRANSFORMs, compounds, and other SMB3 goop.
Either way, I don't think a "safer" number is a good idea.
It's just kicking the can down the road, and btw "8" still
won't fix the softiWARP compatibility issue. The best fix
may be to refactor smbdirect.c to build the requests more
compactly, so a crisp marshaling strategy can work, always.
I'm scraping some test gear together and I'll be taking a
deeper look next week. Maybe get some focused testing when
we're at the upcoming SDC IOLab.
Tom.