17 Feb, 2017
4 commits
-
On Skylake hardware, the link_poll isn't clearing the pending interrupt
bit. Adding a new function for SKX that handles clearing of status bit the
right way.Signed-off-by: Dave Jiang
Fixes: 783dfa6c ("ntb: Adding Skylake Xeon NTB support")
Signed-off-by: Jon Mason -
Fix typo causing ntb_transport_create_queue to select the first
queue every time, instead of using the next free queue.Signed-off-by: Thomas VanSelus
Signed-off-by: Aaron Sierra
Acked-by: Allen Hubbe
Fixes: fce8a7bb5 ("PCI-Express Non-Transparent Bridge Support")
Signed-off-by: Jon Mason -
In the normal I/O execution path, ntb_perf is missing a call to
dmaengine_unmap_put() after submission. That causes us to leak
unmap objects.Signed-off-by: Dave Jiang
Fixes: 8a7b6a77 ("ntb: ntb perf tool")
Signed-off-by: Jon Mason -
The call to debugfs_remove_recursive(qp->debugfs_dir) of the sub-level
directory must not be later than
debugfs_remove_recursive(nt_debugfs_dir) of the top-level directory.
Otherwise, the sub-level directory will not exist, and it would be
invalid (panic) to attempt to remove it. This removes the top-level
directory last, after sub-level directories have been cleaned up.Signed-off-by: Allen Hubbe
Fixes: e26a5843f ("NTB: Split ntb_hw_intel and ntb_transport drivers")
Signed-off-by: Jon Mason
24 Dec, 2016
7 commits
-
The results were previously ignored, anyway.
Signed-off-by: Steve Wahl
Fixes: e26a5843f7f5014ae4460030ca4de029a3ac35d3
Acked-by: Allen Hubbe
Signed-off-by: Jon Mason -
'request_irq()' and 'free_irq()' should have the same 'dev_id'.
Signed-off-by: Christophe JAILLET
Acked-by: Dave Jiang
Signed-off-by: Jon Mason -
The offsets for the SZ registers are wrong. Updated.
Signed-off-by: Dave Jiang
Reported-by: Sandeep Mann
Tested-by: Zachary Ross
Signed-off-by: Jon Mason -
When the underlying NTB H/W driver advertises more memory windows
than the number of scratchpads available to setup MW's, it is likely
that we may end up filling the remaining memory windows with garbage.
So to avoid that, lets limit the memory windows that transport driver
can setup based on the available scratchpads.Signed-off-by: Shyam Sundar S K
Acked-by: Allen Hubbe
Signed-off-by: Jon Mason -
Due to incorrect limit and translation register values, NTB link was
going down when the memory window was setup. Made appropriate changes
as per spec.Fix limit register values for BAR1, which was overlapping
with the BAR23 address.Signed-off-by: Shyam Sundar S K
Acked-by: Allen Hubbe
Signed-off-by: Jon Mason -
AMD NTB support hotplug under B2B mode. NTB will trigger link
up/down interrupt event when doing plug add/remove, this patch
implements the two interrupt event to support B2B hotplug function.Signed-off-by: Xiangliang Yu
Signed-off-by: Shyam Sundar S K
Acked-by: Allen Hubbe
Signed-off-by: Jon Mason -
The Skylake Xeon NTB hardware has made some changes to the register name,
offset, and the way doorbells work. Adding driver support for the new
hardware.Signed-off-by: Dave Jiang
Acked-by: Allen Hubbe
Signed-off-by: Jon Mason
14 Nov, 2016
6 commits
-
This is a static checker warning, not something I'm desperately
concerned about. But snprintf() returns the number of bytes that
would have been copied if there were space. We really care about the
number of bytes that actually were copied so we should use scnprintf()
instead.It probably won't overrun, and in that case we may as well just use
sprintf() but these sorts of things make static checkers and code
reviewers happier.Signed-off-by: Dan Carpenter
Acked-by: Dave Jiang
Signed-off-by: Jon Mason -
The peer_addr member of intel_ntb_dev is not set, therefore when
acquiring ntb_peer_db and ntb_peer_spad we only get the offset rather
than the actual physical address. Adding fix to correct that.Signed-off-by: Dave Jiang
Acked-by: Allen Hubbe
Signed-off-by: Jon Mason -
schedule_timeout_* takes a timeout in jiffies but the code currently is
passing in a constant which makes this timeout HZ dependent, so pass it
through msecs_to_jiffies() to fix this up.Signed-off-by: Nicholas Mc Guire
Acked-by: Dave Jiang
Signed-off-by: Jon Mason -
schedule_timeout_* takes a timeout in jiffies but the code currently is
passing in a constant which makes this timeout HZ dependent, so pass it
through msecs_to_jiffies() to fix this up.Signed-off-by: Nicholas Mc Guire
Signed-off-by: Jon Mason -
Fix typo in module parameter descriptions.
Signed-off-by: Wei Yongjun
Acked-by: Allen Hubbe
Signed-off-by: Jon Mason -
Fix 'db_init' parameter description.
Signed-off-by: Wei Yongjun
Acked-by: Allen Hubbe
Signed-off-by: Jon Mason
08 Aug, 2016
2 commits
-
Adding support on the rx DMA path to allow recovery of errors when
DMA responds with error status and abort all the subsequent ops.Signed-off-by: Dave Jiang
Acked-by: Allen Hubbe
Cc: Jon Mason
Cc: linux-ntb@googlegroups.com
Signed-off-by: Vinod Koul -
Adding support on the tx DMA path to allow recovery of errors when
DMA responds with error status and abort all the subsequent ops.Signed-off-by: Dave Jiang
Acked-by: Allen Hubbe
Cc: Jon Mason
Cc: linux-ntb@googlegroups.com
Signed-off-by: Vinod Koul
05 Aug, 2016
16 commits
-
Clean up duplicated expression by replacing it with the equivalent local
variable pdev.Signed-off-by: Allen Hubbe
Acked-by: Dave Jiang
Signed-off-by: Jon Mason -
It will be useful to know the hardware configured BAR size to diagnose
issues with NTB memory windows.Signed-off-by: Allen Hubbe
Acked-by: Dave Jiang
Signed-off-by: Jon Mason -
When the link goes down, the link_is_up flag did not return to
false. This could have caused some subtle corner case bugs
when the link goes up and down quickly.Once that was fixed, there was found to be a race if the link was
brought down then immediately up. The link_cleanup work would
occasionally be scheduled after the next link up event. This would
cancel the link_work that was supposed to occur and leave ntb_perf
in an unusable state.To fix this we get rid of the link_cleanup work and put the actions
directly in the link_down event.Signed-off-by: Logan Gunthorpe
Acked-by: Dave Jiang
Signed-off-by: Jon Mason -
This commit adds a debugfs 'count' file to ntb_pingpong. This is so
testing with ntb_pingpong can be automated beyond just checking the
logs for pong messages.The count file returns a number which increments every pong. The
counter can be cleared by writing a zero.Signed-off-by: Logan Gunthorpe
Acked-by: Allen Hubbe
Signed-off-by: Jon Mason -
In order to more successfully script with ntb_tool it's useful to
have a link file to check the link status so that the script
doesn't use the other files until the link is up.This commit adds a 'link' file to the debugfs directory which reads
boolean (Y or N) depending on the link status. Writing to the file
change the link state using ntb_link_enable or ntb_link_disable.A 'link_event' file is also provided so an application can block until
the link changes to the desired state. If the user writes a 1, it will
block until the link is up. If the user writes a 0, it will block until
the link is down.Signed-off-by: Logan Gunthorpe
Acked-by: Allen Hubbe
Signed-off-by: Jon Mason -
In order to make the interface closer to the raw NTB API, this commit
changes memory windows so they are not initialized on link up.
Instead, the 'peer_trans*' debugfs files are introduced. When read,
they return information provided by ntb_mw_get_range. When written,
they create a buffer and initialize the memory window. The
value written is taken as the requested size of the buffer (which
is then rounded for alignment). Writing a value of zero frees the buffer
and tears down the memory window translation. The 'peer_mw*' file is
only created once the memory window translation is setup by the user.Additionally, it was noticed that the read and write functions for the
'peer_mw*' files should have checked for a NULL pointer.Signed-off-by: Logan Gunthorpe
Acked-by: Allen Hubbe
Signed-off-by: Jon Mason -
Instead of returning immediately with an error when the link is
down, wait for the link to come up (or the user sends a SIGINT).This is to make scripting ntb_perf easier.
Signed-off-by: Logan Gunthorpe
Acked-by: Dave Jiang
Signed-off-by: Jon Mason -
Instead of having to watch logs, allow the results to be retrieved
by reading back the run file. This file will return "running" when
the test is running and nothing if no tests have been run yet.
It returns 1 line per thread, and will display an error message if the
corresponding thread returns an error.With the above change, the pr_info calls that returned the results are
then changed to pr_debug calls.Signed-off-by: Logan Gunthorpe
Acked-by: Dave Jiang
Signed-off-by: Jon Mason -
This commit accomplishes a few things:
1) Properly prevent multiple sets of threads from running at once using
a mutex. Lots of race issues existed with the thread_cleanup.2) The mutex allows us to ensure that threads are finished before
tearing down the device or module.3) Don't use kthread_stop when the threads can exit by themselves, as
this is counter-indicated by the kthread_create documentation. Threads
now wait for kthread_stop to occur.4) Writing to the run file now blocks until the threads are complete.
The test can then be safely interrupted by a SIGINT.Also, while I was at it:
5) debugfs_run_write shouldn't return 0 in the early check cases as this
could cause debugfs_run_write to loop undesirably.Signed-off-by: Logan Gunthorpe
Acked-by: Dave Jiang
Signed-off-by: Jon Mason -
When debugging performance problems, if some issue causes the ntb
hardware to be significantly slower than expected, ntb_perf will
hang requiring a reboot because it only schedules once every 4GB.Instead, schedule based on jiffies so it will not hang the CPU if
the transfer is slow.Signed-off-by: Logan Gunthorpe
Acked-by: Dave Jiang
Signed-off-by: Jon Mason -
I'm working on hardware that currently has a limited number of
scratchpad registers and ntb_ndev fails with no clue as to why. I
feel it is better to fail early and provide a reasonable error message
then to fail later on.The same is done to ntb_perf, but it doesn't currently require enough
spads to actually fail. I've also removed the unused SPAD_MSG and
SPAD_ACK enums so that MAX_SPAD accurately reflects the number of
spads used.Signed-off-by: Logan Gunthorpe
Acked-by: Dave Jiang
Signed-off-by: Jon Mason -
We allocate some memory window buffers when the link comes up, then we
provide debugfs files to read/write each side of the link.This is useful for debugging the mapping when writing new drivers.
Signed-off-by: Logan Gunthorpe
Acked-by: Allen Hubbe
Signed-off-by: Jon Mason -
On my system, dma_alloc_coherent won't produce memory anywhere
near the size of the BAR. So I needed a way to limit this.It's pretty much copied straight from ntb_transport.
Signed-off-by: Logan Gunthorpe
Acked-by: Dave Jiang
Signed-off-by: Jon Mason -
Currently we only allocate a fixed default number of descriptors for the tx
and rx side. We should dynamically resize it to the number of descriptors
resides in the transport rings. We should know the number of transmit
descriptors at initializaiton. We will allocate the default number of
descriptors for receive side and allocate additional ones when we know the
actual max entries for receive.Signed-off-by: Dave Jiang
Acked-by: Allen Hubbe
Signed-off-by: Jon Mason -
On hardware with 32 scratchpad registers the spad field in ntb tool
could chop off the end. The maximum buffer size is increased from
256 to 15 times the number or scratchpads.Signed-off-by: Logan Gunthorpe
Acked-by: Allen Hubbe
Signed-off-by: Jon Mason -
If you tried to write two spads in one line, as per the example:
root@peer# echo '0 0x01010101 1 0x7f7f7f7f' > $DBG_DIR/peer_spad
then the CPU would freeze in an infinite loop.
This wasn't immediately obvious but 'pos' was not incrementing the
buffer, so after reading the second pair of values, 'pos' would once
again be 3 and it would re-read the second pair of values ad infinitum.Signed-off-by: Logan Gunthorpe
Acked-by: Allen Hubbe
Signed-off-by: Jon Mason
26 Mar, 2016
1 commit
-
Kernel zero day testing warned about address space confusion. A virtual
iomem address was used where a physical address is expected. The
offending functions implement an optional part of the api, so they are
removed. They can be added later, after testing.Fixes: a1b3695820aa490e58915d720a1438069813008b
Signed-off-by: Allen Hubbe
Acked-by: Xiangliang Yu
Signed-off-by: Jon Mason
22 Mar, 2016
2 commits
-
The clean up routine when we failed to allocate kthread is not cleaning
up all the threads, only the same one over and over again.Reported-by: Dan Carpenter
Signed-off-by: Dave Jiang
Acked-by: Allen Hubbe
Signed-off-by: Jon Mason -
kthread_create_no_node() returns error pointers, never NULL. Fix check so
it handles error correctly.Reported-by: Dan Carpenter
Signed-off-by: Dave Jiang
Signed-off-by: Jon Mason
18 Mar, 2016
2 commits
-
kmalloc can fail and we should check for NULL before using the pointer
returned by kmalloc.Signed-off-by: Sudip Mukherjee
Acked-by: Dave Jiang
Signed-off-by: Jon Mason -
The perf tool is missing the setup of translation window. Adding call to
setup the translation window for backed memory.Signed-off-by: John Kading
Signed-off-by: Dave Jiang
Signed-off-by: Jon Mason