From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, oss-drivers@netronome.com,
Jakub Kicinski <jakub.kicinski@netronome.com>
Subject: [PATCH net-next 09/15] nfp: add basic errors messages to target logic
Date: Tue, 28 Aug 2018 13:20:41 -0700 [thread overview]
Message-ID: <20180828202047.1305-10-jakub.kicinski@netronome.com> (raw)
In-Reply-To: <20180828202047.1305-1-jakub.kicinski@netronome.com>
Add error prints to CPP target encoding/decoding logic, otherwise
it's quite hard to pin point the reasons why read or write
operations fail.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Francois H. Theron <francois.theron@netronome.com>
---
.../net/ethernet/netronome/nfp/nfpcore/nfp_target.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_target.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_target.c
index 4ea1e585d945..f691c6587c76 100644
--- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_target.c
+++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_target.c
@@ -39,7 +39,11 @@
* Francois H. Theron <francois.theron@netronome.com>
*/
+#define pr_fmt(fmt) "NFP target: " fmt
+
#include <linux/bitops.h>
+#include <linux/kernel.h>
+#include <linux/printk.h>
#include "nfp_cpp.h"
@@ -733,8 +737,10 @@ int nfp_target_cpp(u32 cpp_island_id, u64 cpp_island_address,
u32 imb;
int err;
- if (target < 0 || target >= 16)
+ if (target < 0 || target >= 16) {
+ pr_err("Invalid CPP target: %d\n", target);
return -EINVAL;
+ }
if (island == 0) {
/* Already translated */
@@ -753,8 +759,10 @@ int nfp_target_cpp(u32 cpp_island_id, u64 cpp_island_address,
err = nfp_cppat_addr_encode(cpp_target_address, island, target,
((imb >> 13) & 7), ((imb >> 12) & 1),
((imb >> 6) & 0x3f), ((imb >> 0) & 0x3f));
- if (err)
+ if (err) {
+ pr_err("Can't encode CPP address: %d\n", err);
return err;
+ }
*cpp_target_id = NFP_CPP_ID(target,
NFP_CPP_ID_ACTION_of(cpp_island_id),
--
2.17.1
next prev parent reply other threads:[~2018-08-29 0:15 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-28 20:20 [PATCH net-next 00/15] nfp: add NFP5000 support Jakub Kicinski
2018-08-28 20:20 ` [PATCH net-next 01/15] nfp: encapsulate NSP command arguments into structs Jakub Kicinski
2018-08-28 20:20 ` [PATCH net-next 02/15] nfp: attempt FW load from flash Jakub Kicinski
2018-08-28 20:20 ` [PATCH net-next 03/15] nfp: interpret extended FW load result codes Jakub Kicinski
2018-08-28 20:20 ` [PATCH net-next 04/15] nfp: add support for indirect HWinfo lookup Jakub Kicinski
2018-08-28 20:20 ` [PATCH net-next 05/15] nfp: abm: look up MAC addresses via management FW Jakub Kicinski
2018-08-28 20:20 ` [PATCH net-next 06/15] nfp: add support for NFP5000 Jakub Kicinski
2018-08-28 20:20 ` [PATCH net-next 07/15] nfp: refactor the per-chip PCIe config Jakub Kicinski
2018-08-28 20:20 ` [PATCH net-next 08/15] nfp: save the MU locality field offset Jakub Kicinski
2018-08-28 20:20 ` Jakub Kicinski [this message]
2018-08-28 20:20 ` [PATCH net-next 10/15] nfp: add RTsym access helpers Jakub Kicinski
2018-08-28 20:20 ` [PATCH net-next 11/15] nfp: pass cpp_id to nfp_cpp_map_area() Jakub Kicinski
2018-08-28 20:20 ` [PATCH net-next 12/15] nfp: convert existing RTsym helpers to full target decoding Jakub Kicinski
2018-08-28 20:20 ` [PATCH net-next 13/15] nfp: convert all RTsym users to use new read/write helpers Jakub Kicinski
2018-08-28 20:20 ` [PATCH net-next 14/15] nfp: support access to absolute RTsyms Jakub Kicinski
2018-08-28 20:20 ` [PATCH net-next 15/15] nfp: make RTsym users handle absolute symbols correctly Jakub Kicinski
2018-08-29 0:01 ` [PATCH net-next 00/15] nfp: add NFP5000 support David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180828202047.1305-10-jakub.kicinski@netronome.com \
--to=jakub.kicinski@netronome.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@netronome.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).