01 Jun, 2020
1 commit
-
Use pr_fmt to standardize all logging for fs/cifs.
Some logging output had no CIFS: specific prefix.
Now all output has one of three prefixes:
o CIFS:
o CIFS: VFS:
o Root-CIFS:Miscellanea:
o Convert printks to pr_
o Neaten macro definitions
o Remove embedded CIFS: prefixes from formats
o Convert "illegal" to "invalid"
o Coalesce formats
o Add missing '\n' format terminations
o Consolidate multiple cifs_dbg continuations into single calls
o More consistent use of upper case first word output logging
o Multiline statement argument alignment and wrappingSigned-off-by: Joe Perches
Signed-off-by: Steve French
08 Apr, 2020
5 commits
-
Immediate packets should only be sent to peer when there are new
receive credits made available. New credits show up on freeing
receive buffer, not on receiving data.Fix this by avoid unnenecessary work schedules.
Signed-off-by: Long Li
Signed-off-by: Steve French -
When processing errors from ib_post_send(), the transport state needs to be
rolled back to the condition before the error.Refactor the old code to make it easy to roll back on IB errors, and fix this.
Signed-off-by: Long Li
Signed-off-by: Steve French -
…k on failure before sending
Recevie credits should be updated before sending the packet, not
before a work is scheduled. Also, the value needs roll back if
something fails and cannot send.Signed-off-by: Long Li <longli@microsoft.com>
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Steve French <stfrench@microsoft.com> -
Sometimes the remote peer may return more send credits than the send queue
depth. If all the send credits are used to post senasd, we may overflow the
send queue.Fix this by checking the send queue size before posting a send.
Signed-off-by: Long Li
Signed-off-by: Steve French -
As an optimization, SMBD tries to track two types of packets: packets with
payload and without payload. There is no obvious benefit or performance gain
to separately track two types of packets.Just treat them as pending packets and merge the tracking code.
Signed-off-by: Long Li
Signed-off-by: Steve French
30 Mar, 2020
2 commits
-
When a RDMA packet is received and server is extending send credits, we should
check and unblock senders immediately in IRQ context. Doing it in a worker
queue causes unnecessary delay and doesn't save much CPU on the receive path.Signed-off-by: Long Li
Signed-off-by: Steve French -
The packet size needs to take account of SMB2 header size and possible
encryption header size. This is only done when signing is used and it is for
RDMA send/receive, not read/write.Also remove the dead SMBD code in smb2_negotiate_r(w)size.
Signed-off-by: Long Li
Signed-off-by: Steve French
25 Nov, 2019
4 commits
-
It's not necessary to queue invalidated memory registration to work queue, as
all we need to do is to unmap the SG and make it usable again. This can save
CPU cycles in normal data paths as memory registration errors are rare and
normally only happens during reconnection.Signed-off-by: Long Li
Cc: stable@vger.kernel.org
Signed-off-by: Steve French -
The transport should return this error so the upper layer will reconnect.
Signed-off-by: Long Li
Cc: stable@vger.kernel.org
Signed-off-by: Steve French -
Log these activities to help production support.
Signed-off-by: Long Li
Cc: stable@vger.kernel.org
Signed-off-by: Steve French -
While it's not friendly to fail user processes that issue more iovs
than we support, at least we should return the correct error code so the
user process gets a chance to retry with smaller number of iovs.Signed-off-by: Long Li
Cc: stable@vger.kernel.org
Signed-off-by: Steve French
05 Aug, 2019
1 commit
-
Send and Receive completion is handled on a single CPU selected at
the time each Completion Queue is allocated. Typically this is when
an initiator instantiates an RDMA transport, or when a target
accepts an RDMA connection.Some ULPs cannot open a connection per CPU to spread completion
workload across available CPUs and MSI vectors. For such ULPs,
provide an API that allows the RDMA core to select a completion
vector based on the device's complement of available comp_vecs.ULPs that invoke ib_alloc_cq() with only comp_vector 0 are converted
to use the new API so that their completion workloads interfere less
with each other.Suggested-by: Håkon Bugge
Signed-off-by: Chuck Lever
Reviewed-by: Leon Romanovsky
Cc:
Cc:
Link: https://lore.kernel.org/r/20190729171923.13428.52555.stgit@manet.1015granger.net
Signed-off-by: Doug Ledford
31 May, 2019
1 commit
-
Based on 3 normalized pattern(s):
this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version this program is distributed in the
hope that it will be useful but without any warranty without even
the implied warranty of merchantability or fitness for a particular
purpose see the gnu general public license for more detailsthis program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version [author] [kishon] [vijay] [abraham]
[i] [kishon]@[ti] [com] this program is distributed in the hope that
it will be useful but without any warranty without even the implied
warranty of merchantability or fitness for a particular purpose see
the gnu general public license for more detailsthis program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version [author] [graeme] [gregory]
[gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i]
[kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema]
[hk] [hemahk]@[ti] [com] this program is distributed in the hope
that it will be useful but without any warranty without even the
implied warranty of merchantability or fitness for a particular
purpose see the gnu general public license for more detailsextracted by the scancode license scanner the SPDX license identifier
GPL-2.0-or-later
has been chosen to replace the boilerplate/reference in 1105 file(s).
Signed-off-by: Thomas Gleixner
Reviewed-by: Allison Randal
Reviewed-by: Richard Fontana
Reviewed-by: Kate Stewart
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.de
Signed-off-by: Greg Kroah-Hartman
15 May, 2019
1 commit
-
When sending data, use the DMA_TO_DEVICE to map buffers. Also log the number
of requests in a compounding request from upper layer.Signed-off-by: Long Li
Signed-off-by: Steve French
Acked-by: Pavel Shilovsky
Acked-by: Ronnie Sahlberg
08 May, 2019
5 commits
-
To support compounding, __smb_send_rqst() now sends an array of requests to
the transport layer.
Change smbd_send() to take an array of requests, and send them in as few
packets as possible.Signed-off-by: Long Li
Signed-off-by: Steve French
CC: Stable -
Failure to send a packet doesn't mean it's a permanent failure, it can't be
returned to user process. This I/O should be retried or failed based on
server packet response and transport health. This logic is handled by the
upper layer.Give this decision to upper layer.
Signed-off-by: Long Li
Signed-off-by: Steve French -
When packets are waiting for outbound I/O and interrupted, return the
proper error code to user process.Signed-off-by: Long Li
Signed-off-by: Steve French -
Now upper layer is handling the transport shutdown and reconnect, remove
the code that handling transport shutdown on RDMA disconnect.Signed-off-by: Long Li
Signed-off-by: Steve French -
On transport recoonect, upper layer CIFS code destroys the current
transport and then recoonect. This code path is not used by SMBD, in that
SMBD destroys its transport on RDMA disconnect notification independent of
CIFS upper layer behavior.This approach adds some costs to SMBD layer to handle transport shutdown
and restart, and to deal with several racing conditions on reconnecting
transport.Re-work this code path by introducing a new smbd_destroy. This function is
called form upper layer to ask SMBD to destroy the transport. SMBD will no
longer need to destroy the transport by itself while worrying about data
transfer is in progress. The upper layer guarantees the transport is
locked.change log:
v2: fix build errors when CONFIG_CIFS_SMB_DIRECT is not configuredSigned-off-by: Long Li
Signed-off-by: Steve French
05 Mar, 2019
1 commit
-
a trivial patch that replaces all use of snprintf with scnprintf.
scnprintf() is generally seen as a safer function to use than
snprintf for many use cases.In our case, there is no actual difference between the two since we never
look at the return value. Thus we did not have any of the bugs that
scnprintf protects against and the patch does nothing.However, for people reading our code it will be a receipt that we
have done our due dilligence and checked our code for this type of bugs.See the presentation "Making C Less Dangerous In The Linux Kernel"
at this years LCASigned-off-by: Ronnie Sahlberg
Signed-off-by: Steve French
12 Dec, 2018
1 commit
-
Make all the required change to start use the ib_device_ops structure.
Signed-off-by: Kamal Heib
Signed-off-by: Jason Gunthorpe
02 Nov, 2018
1 commit
-
Pull AFS updates from Al Viro:
"AFS series, with some iov_iter bits included"* 'work.afs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (26 commits)
missing bits of "iov_iter: Separate type from direction and use accessor functions"
afs: Probe multiple fileservers simultaneously
afs: Fix callback handling
afs: Eliminate the address pointer from the address list cursor
afs: Allow dumping of server cursor on operation failure
afs: Implement YFS support in the fs client
afs: Expand data structure fields to support YFS
afs: Get the target vnode in afs_rmdir() and get a callback on it
afs: Calc callback expiry in op reply delivery
afs: Fix FS.FetchStatus delivery from updating wrong vnode
afs: Implement the YFS cache manager service
afs: Remove callback details from afs_callback_break struct
afs: Commit the status on a new file/dir/symlink
afs: Increase to 64-bit volume ID and 96-bit vnode ID for YFS
afs: Don't invoke the server to read data beyond EOF
afs: Add a couple of tracepoints to log I/O errors
afs: Handle EIO from delivery function
afs: Fix TTL on VL server and address lists
afs: Implement VL server rotation
afs: Improve FS server rotation error handling
...
24 Oct, 2018
2 commits
-
It is not necessary to deregister a memory registration after it has been
successfully invalidated.Signed-off-by: Long Li
Signed-off-by: Steve French -
Use accessor functions to access an iterator's type and direction. This
allows for the possibility of using some other method of determining the
type of iterator than if-chains with bitwise-AND conditions.Signed-off-by: David Howells
17 Aug, 2018
1 commit
-
Resolve merge conflicts from the -rc cycle against the rdma.git tree:
Conflicts:
drivers/infiniband/core/uverbs_cmd.c
- New ifs added to ib_uverbs_ex_create_flow in -rc and for-next
- Merge removal of file->ucontext in for-next with new code in -rc
drivers/infiniband/core/uverbs_main.c
- for-next removed code from ib_uverbs_write() that was modified
in for-rcSigned-off-by: Jason Gunthorpe
25 Jul, 2018
1 commit
-
Instead of declaring and passing a dummy 'bad_wr' pointer, pass NULL
as third argument to ib_post_(send|recv|srq_recv)().Signed-off-by: Bart Van Assche
Signed-off-by: Jason Gunthorpe
06 Jul, 2018
1 commit
-
SMB1 mounting broke in commit 35e2cc1ba755
("cifs: Use correct packet length in SMB2_TRANSFORM header")
Fix it and also rename smb2_rqst_len to smb_rqst_len
to make it less unobvious that the function is also called from
CIFS/SMB1Good job by Paulo reviewing and cleaning up Ronnie's original patch.
Signed-off-by: Ronnie Sahlberg
Reviewed-by: Paulo Alcantara
Signed-off-by: Steve French
19 Jun, 2018
1 commit
-
This patch replaces the ib_device_attr.max_sge with max_send_sge and
max_recv_sge. It allows ulps to take advantage of devices that have very
different send and recv sge depths. For example cxgb4 has a max_recv_sge
of 4, yet a max_send_sge of 16. Splitting out these attributes allows
much more efficient use of the SQ for cxgb4 with ulps that use the RDMA_RW
API. Consider a large RDMA WRITE that has 16 scattergather entries.
With max_sge of 4, the ulp would send 4 WRITE WRs, but with max_sge of
16, it can be done with 1 WRITE WR.Acked-by: Sagi Grimberg
Acked-by: Christoph Hellwig
Acked-by: Selvin Xavier
Acked-by: Shiraz Saleem
Acked-by: Dennis Dalessandro
Signed-off-by: Steve Wise
Signed-off-by: Jason Gunthorpe
16 Jun, 2018
1 commit
-
In smb3_init_transform_rq(), 'orig_len' was only counting the request
length, but forgot to count any data pages in the request.Writing or creating files with the 'seal' mount option was broken.
In addition, do some code refactoring by exporting smb2_rqst_len() to
calculate the appropriate packet size and avoid duplicating the same
calculation all over the code.The start of the io vector is either the rfc1002 length (4 bytes) or a
SMB2 header which is always > 4. Use this fact to check and skip the
rfc1002 length if requested.Signed-off-by: Paulo Alcantara
Reviewed-by: Aurelien Aptel
Signed-off-by: Steve French
06 Jun, 2018
3 commits
-
Change code to pass the correct page offset during memory registration for
RDMA read/write.Signed-off-by: Long Li
Signed-off-by: Steve French -
RDMA recv function needs to place data to the correct place starting at
page offset.Signed-off-by: Long Li
Signed-off-by: Steve French -
The RDMA send function needs to look at offset in the request pages, and
send data starting from there.Signed-off-by: Long Li
Signed-off-by: Steve French
26 Apr, 2018
1 commit
-
It's not necessary to allocate another iov when going through the buffers
in smbd_send() through RDMA send.Remove it to reduce stack size.
Thanks to Matt for spotting a printk typo in the earlier version of this.
CC: Matt Redfearn
Signed-off-by: Long Li
Acked-by: Ronnie Sahlberg
Cc: stable@vger.kernel.org
Signed-off-by: Steve French
21 Apr, 2018
1 commit
-
When sending through SMB Direct, also dump the packet in SMB send path.
Also fixed a typo in debug message.
Signed-off-by: Long Li
Cc: stable@vger.kernel.org
Signed-off-by: Steve French
Reviewed-by: Ronnie Sahlberg
19 Apr, 2018
1 commit
-
When sending the last iov that breaks into smaller buffers to fit the
transfer size, it's necessary to check if this is the last iov.If this is the latest iov, stop and proceed to send pages.
Signed-off-by: Long Li
Cc: stable@vger.kernel.org
Signed-off-by: Steve French
Reviewed-by: Ronnie Sahlberg
02 Apr, 2018
3 commits
-
On RDMA errors, transport should disconnect the RDMA CM connection. This
will notify the upper layer, and it will attempt transport reconnect.Signed-off-by: Long Li
Signed-off-by: Steve French
Reviewed-by: Ronnie Sahlberg
CC: Stable -
During transport reconnect, other processes may have registered memory
and blocked on transport. This creates a deadlock situation because the
transport resources can't be freed, and reconnect is blocked.Fix this by returning to upper layer on timeout. Before returning,
transport status is set to reconnecting so other processes will release
memory registration resources.Upper layer will retry the reconnect. This is not in fast I/O path so
setting the timeout to 5 seconds.Signed-off-by: Long Li
Signed-off-by: Steve French
Reviewed-by: Ronnie Sahlberg
CC: Stable -
Trivial fix to spelling mistake in log_rdma_send and log_rdma_mr
message text.Signed-off-by: Colin Ian King
Signed-off-by: Steve French
Reviewed-by: Aurelien Aptel
07 Feb, 2018
1 commit
-
Although at least one of these was an overly strict sparse warning
in the new smbdirect code, it is cleaner to fix - so no warnings.Signed-off-by: Steve French
Reviewed-by: Ronnie Sahlberg