Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1532573
| From | Serge Semin <fancer.lancer@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 19/22] NTB PingPong: Alter driver to work with two-ports NTB API |
| Date | 2016-11-29 18:20 +0100 |
| Message-ID | <sIUev-2Xs-67@gated-at.bofh.it> (permalink) |
| References | <sIUet-2Xs-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
PingPong driver doesn't do much, but it uses Scratchpads, which can be
unsupported by most of IDT hardware. So I restricted the usage of the
driver with hardware, which supports Scratchpads up until the IDT driver
is ported to the NTB API. When it's done I'll alter the pingpong driver to
support message registers as well.
Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
---
drivers/ntb/test/ntb_pingpong.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/ntb/test/ntb_pingpong.c b/drivers/ntb/test/ntb_pingpong.c
index 4358611..90d3281 100644
--- a/drivers/ntb/test/ntb_pingpong.c
+++ b/drivers/ntb/test/ntb_pingpong.c
@@ -90,6 +90,9 @@ static unsigned long db_init = 0x7;
module_param(db_init, ulong, 0644);
MODULE_PARM_DESC(db_init, "Initial doorbell bits to ring on the peer");
+/* Only two-ports NTB devices are supported */
+#define PIDX 0
+
struct pp_ctx {
struct ntb_dev *ntb;
u64 db_bits;
@@ -135,7 +138,7 @@ static void pp_ping(unsigned long ctx)
"Ping bits %#llx read %#x write %#x\n",
db_bits, spad_rd, spad_wr);
- ntb_peer_spad_write(pp->ntb, 0, spad_wr);
+ ntb_peer_spad_write(pp->ntb, PIDX, 0, spad_wr);
ntb_peer_db_set(pp->ntb, db_bits);
ntb_db_clear_mask(pp->ntb, db_mask);
@@ -222,6 +225,12 @@ static int pp_probe(struct ntb_client *client,
}
}
+ if (ntb_spad_count(ntb) < 1) {
+ dev_dbg(&ntb->dev, "no enough scratchpads\n");
+ rc = -EINVAL;
+ goto err_pp;
+ }
+
if (ntb_spad_is_unsafe(ntb)) {
dev_dbg(&ntb->dev, "scratchpad is unsafe\n");
if (!unsafe) {
--
2.6.6
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/22] NTB: Alter kernel API to support multi-port devices Serge Semin <fancer.lancer@gmail.com> - 2016-11-29 18:20 +0100
[PATCH 01/22] NTB: Move link state API being first in sources Serge Semin <fancer.lancer@gmail.com> - 2016-11-29 18:20 +0100
[PATCH 16/22] NTB AMD: Alter MW interface to fit new NTB API Serge Semin <fancer.lancer@gmail.com> - 2016-11-29 18:20 +0100
[PATCH 22/22] NTB Transport: Alter driver to work with two-ports NTB API Serge Semin <fancer.lancer@gmail.com> - 2016-11-29 18:20 +0100
[PATCH 13/22] NTB Intel: Add T-Platforms copyrights to Intel NTB driver Serge Semin <fancer.lancer@gmail.com> - 2016-11-29 18:20 +0100
[PATCH 20/22] NTB Tool: Alter driver to work with two-ports NTB API Serge Semin <fancer.lancer@gmail.com> - 2016-11-29 18:20 +0100
[PATCH 19/22] NTB PingPong: Alter driver to work with two-ports NTB API Serge Semin <fancer.lancer@gmail.com> - 2016-11-29 18:20 +0100
[PATCH 03/22] NTB: Alter NTB API to support both inbound and outbound MW based interfaces Serge Semin <fancer.lancer@gmail.com> - 2016-11-29 18:20 +0100
[PATCH 06/22] NTB: Slightly alter link state NTB API Serge Semin <fancer.lancer@gmail.com> - 2016-11-29 18:30 +0100
[PATCH 18/22] NTB AMD: Add T-Platforms copyrights to AMD NTB driver Serge Semin <fancer.lancer@gmail.com> - 2016-11-29 18:30 +0100
[PATCH 08/22] NTB: Add T-Platforms copyrights to NTB API Serge Semin <fancer.lancer@gmail.com> - 2016-11-29 18:30 +0100
[PATCH 09/22] NTB Intel: Move link-related methods being first in the driver Serge Semin <fancer.lancer@gmail.com> - 2016-11-29 18:30 +0100
[PATCH 15/22] NTB AMD: Add port-related NTB API callback methods Serge Semin <fancer.lancer@gmail.com> - 2016-11-29 18:30 +0100
[PATCH 17/22] NTB AMD: Alter Scratchpads interface to fit new NTB API Serge Semin <fancer.lancer@gmail.com> - 2016-11-29 18:30 +0100
[PATCH 04/22] NTB: Add messaging NTB API Serge Semin <fancer.lancer@gmail.com> - 2016-11-29 18:30 +0100
[PATCH 05/22] NTB: Alter Scratchpads NTB API to support multi-ports interface Serge Semin <fancer.lancer@gmail.com> - 2016-11-29 18:30 +0100
[PATCH 10/22] NTB Intel: Add port-related NTB API callback methods Serge Semin <fancer.lancer@gmail.com> - 2016-11-29 18:30 +0100
RE: [PATCH 10/22] NTB Intel: Add port-related NTB API callback methods "Allen Hubbe" <Allen.Hubbe@dell.com> - 2016-12-08 00:00 +0100
[PATCH 12/22] NTB Intel: Alter Scratchpads interface to fit new NTB API Serge Semin <fancer.lancer@gmail.com> - 2016-11-29 18:30 +0100
[PATCH 11/22] NTB Intel: Alter MW interface to fit new NTB API Serge Semin <fancer.lancer@gmail.com> - 2016-11-29 18:30 +0100
[PATCH 14/22] NTB AMD: Move link-related methods being first in the driver Serge Semin <fancer.lancer@gmail.com> - 2016-11-29 18:30 +0100
[PATCH 07/22] NTB: Fix a few ntb.h issues Serge Semin <fancer.lancer@gmail.com> - 2016-11-29 18:30 +0100
csiph-web