netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, oss-drivers@netronome.com,
	alexei.starovoitov@gmail.com,
	Jakub Kicinski <jakub.kicinski@netronome.com>,
	Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Subject: [PATCH net-next 03/13] nfp: parse the mailbox cmsg TLV
Date: Wed,  5 Jun 2019 14:11:33 -0700	[thread overview]
Message-ID: <20190605211143.29689-4-jakub.kicinski@netronome.com> (raw)
In-Reply-To: <20190605211143.29689-1-jakub.kicinski@netronome.com>

Parse the mailbox TLV.  When control message queue is not available
we can fall back to passing the control messages via the vNIC
mailbox.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
---
 drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c | 4 ++++
 drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h | 8 ++++++++
 2 files changed, 12 insertions(+)

diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c b/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c
index 6d5213b5bcb0..6c207c5e9265 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c
@@ -99,6 +99,10 @@ int nfp_net_tlv_caps_parse(struct device *dev, u8 __iomem *ctrl_mem,
 
 			caps->repr_cap = readl(data);
 			break;
+		case NFP_NET_CFG_TLV_TYPE_MBOX_CMSG_TYPES:
+			if (length >= 4)
+				caps->mbox_cmsg_types = readl(data);
+			break;
 		default:
 			if (!FIELD_GET(NFP_NET_CFG_TLV_HEADER_REQUIRED, hdr))
 				break;
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h b/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h
index 25919e338071..05a5c82ac8f6 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h
@@ -466,6 +466,11 @@
  * %NFP_NET_CFG_TLV_TYPE_REPR_CAP:
  * Single word, equivalent of %NFP_NET_CFG_CAP for representors, features which
  * can be used on representors.
+ *
+ * %NFP_NET_CFG_TLV_TYPE_MBOX_CMSG_TYPES:
+ * Variable, bitmap of control message types supported by the mailbox handler.
+ * Bit 0 corresponds to message type 0, bit 1 to 1, etc.  Control messages are
+ * encapsulated into simple TLVs, with an end TLV and written to the Mailbox.
  */
 #define NFP_NET_CFG_TLV_TYPE_UNKNOWN		0
 #define NFP_NET_CFG_TLV_TYPE_RESERVED		1
@@ -475,6 +480,7 @@
 #define NFP_NET_CFG_TLV_TYPE_EXPERIMENTAL0	5
 #define NFP_NET_CFG_TLV_TYPE_EXPERIMENTAL1	6
 #define NFP_NET_CFG_TLV_TYPE_REPR_CAP		7
+#define NFP_NET_CFG_TLV_TYPE_MBOX_CMSG_TYPES	10
 
 struct device;
 
@@ -484,12 +490,14 @@ struct device;
  * @mbox_off:		vNIC mailbox area offset
  * @mbox_len:		vNIC mailbox area length
  * @repr_cap:		capabilities for representors
+ * @mbox_cmsg_types:	cmsgs which can be passed through the mailbox
  */
 struct nfp_net_tlv_caps {
 	u32 me_freq_mhz;
 	unsigned int mbox_off;
 	unsigned int mbox_len;
 	u32 repr_cap;
+	u32 mbox_cmsg_types;
 };
 
 int nfp_net_tlv_caps_parse(struct device *dev, u8 __iomem *ctrl_mem,
-- 
2.21.0


  parent reply	other threads:[~2019-06-05 21:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-05 21:11 [PATCH net-next 00/13] nfp: tls: add basic TX offload Jakub Kicinski
2019-06-05 21:11 ` [PATCH net-next 01/13] nfp: count all failed TX attempts as errors Jakub Kicinski
2019-06-05 21:11 ` [PATCH net-next 02/13] nfp: make bar_lock a semaphore Jakub Kicinski
2019-06-05 21:11 ` Jakub Kicinski [this message]
2019-06-05 21:11 ` [PATCH net-next 04/13] nfp: add support for sending control messages via mailbox Jakub Kicinski
2019-06-05 21:11 ` [PATCH net-next 05/13] nfp: parse crypto opcode TLV Jakub Kicinski
2019-06-05 21:11 ` [PATCH net-next 06/13] nfp: add tls init code Jakub Kicinski
2019-06-05 21:11 ` [PATCH net-next 07/13] nfp: prepare for more TX metadata prepend Jakub Kicinski
2019-06-05 21:11 ` [PATCH net-next 08/13] net/tls: split the TLS_DRIVER_STATE_SIZE and bump TX to 16 bytes Jakub Kicinski
2019-06-05 21:11 ` [PATCH net-next 09/13] net/tls: simplify driver context retrieval Jakub Kicinski
2019-06-05 21:11 ` [PATCH net-next 10/13] net/tls: export TLS per skb encryption Jakub Kicinski
2019-06-05 21:11 ` [PATCH net-next 11/13] nfp: tls: add datapath support for TLS TX Jakub Kicinski
2019-06-05 21:11 ` [PATCH net-next 12/13] nfp: tls: add/delete TLS TX connections Jakub Kicinski
2019-06-05 21:11 ` [PATCH net-next 13/13] nfp: tls: add basic statistics Jakub Kicinski
2019-06-06 21:13 ` [PATCH net-next 00/13] nfp: tls: add basic TX offload 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=20190605211143.29689-4-jakub.kicinski@netronome.com \
    --to=jakub.kicinski@netronome.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dirk.vandermerwe@netronome.com \
    --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).