netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srujana Challa <schalla@marvell.com>
To: <herbert@gondor.apana.org.au>, <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-crypto@vger.kernel.org>,
	<kuba@kernel.org>, <sgoutham@marvell.com>, <gakula@marvell.com>,
	<sbhatta@marvell.com>, <schandran@marvell.com>,
	<pathreya@marvell.com>, Srujana Challa <schalla@marvell.com>
Subject: [PATCH v5,net-next,01/13] octeontx2-pf: move lmt flush to include/linux/soc
Date: Mon, 12 Oct 2020 13:09:19 +0530	[thread overview]
Message-ID: <20201012073931.28766-2-schalla@marvell.com> (raw)
In-Reply-To: <20201012073931.28766-1-schalla@marvell.com>

On OcteonTX2 platform CPT instruction enqueue and NIX
packet send are only possible via LMTST operations which
uses LDEOR instruction. This patch moves lmt flush
function from OcteonTX2 nic driver to include/linux/soc
since it will be used by OcteonTX2 CPT and NIC driver for
LMTST.

Change-Id: I148c654bc0196826fd2664986d204f08c632f793
Signed-off-by: Srujana Challa <schalla@marvell.com>
---
 MAINTAINERS                                   |  2 ++
 .../marvell/octeontx2/nic/otx2_common.h       | 13 +--------
 include/linux/soc/marvell/octeontx2/asm.h     | 29 +++++++++++++++++++
 3 files changed, 32 insertions(+), 12 deletions(-)
 create mode 100644 include/linux/soc/marvell/octeontx2/asm.h

diff --git a/MAINTAINERS b/MAINTAINERS
index c80f87d7258c..ee903a39e2e9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10441,6 +10441,7 @@ M:	Srujana Challa <schalla@marvell.com>
 L:	linux-crypto@vger.kernel.org
 S:	Maintained
 F:	drivers/crypto/marvell/
+F:	include/linux/soc/marvell/octeontx2/
 
 MARVELL GIGABIT ETHERNET DRIVERS (skge/sky2)
 M:	Mirko Lindner <mlindner@marvell.com>
@@ -10513,6 +10514,7 @@ M:	hariprasad <hkelam@marvell.com>
 L:	netdev@vger.kernel.org
 S:	Supported
 F:	drivers/net/ethernet/marvell/octeontx2/nic/
+F:	include/linux/soc/marvell/octeontx2/
 
 MARVELL OCTEONTX2 RVU ADMIN FUNCTION DRIVER
 M:	Sunil Goutham <sgoutham@marvell.com>
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
index d6253f2a414d..2e8288445dcb 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
@@ -16,6 +16,7 @@
 #include <linux/net_tstamp.h>
 #include <linux/ptp_clock_kernel.h>
 #include <linux/timecounter.h>
+#include <linux/soc/marvell/octeontx2/asm.h>
 
 #include <mbox.h>
 #include "otx2_reg.h"
@@ -421,21 +422,9 @@ static inline u64 otx2_atomic64_add(u64 incr, u64 *ptr)
 	return result;
 }
 
-static inline u64 otx2_lmt_flush(uint64_t addr)
-{
-	u64 result = 0;
-
-	__asm__ volatile(".cpu  generic+lse\n"
-			 "ldeor xzr,%x[rf],[%[rs]]"
-			 : [rf]"=r"(result)
-			 : [rs]"r"(addr));
-	return result;
-}
-
 #else
 #define otx2_write128(lo, hi, addr)
 #define otx2_atomic64_add(incr, ptr)		({ *ptr += incr; })
-#define otx2_lmt_flush(addr)			({ 0; })
 #endif
 
 /* Alloc pointer from pool/aura */
diff --git a/include/linux/soc/marvell/octeontx2/asm.h b/include/linux/soc/marvell/octeontx2/asm.h
new file mode 100644
index 000000000000..ae2279fe830a
--- /dev/null
+++ b/include/linux/soc/marvell/octeontx2/asm.h
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: GPL-2.0-only
+ * Copyright (C) 2020 Marvell.
+ */
+
+#ifndef __SOC_OTX2_ASM_H
+#define __SOC_OTX2_ASM_H
+
+#if defined(CONFIG_ARM64)
+/*
+ * otx2_lmt_flush is used for LMT store operation.
+ * On octeontx2 platform CPT instruction enqueue and
+ * NIX packet send are only possible via LMTST
+ * operations and it uses LDEOR instruction targeting
+ * the coprocessor address.
+ */
+#define otx2_lmt_flush(ioaddr)                          \
+({                                                      \
+	u64 result = 0;                                 \
+	__asm__ volatile(".cpu  generic+lse\n"          \
+			 "ldeor xzr, %x[rf], [%[rs]]"   \
+			 : [rf]"=r" (result)            \
+			 : [rs]"r" (ioaddr));           \
+	(result);                                       \
+})
+#else
+#define otx2_lmt_flush(ioaddr)          ({ 0; })
+#endif
+
+#endif /* __SOC_OTX2_ASM_H */
-- 
2.28.0


  reply	other threads:[~2020-10-12  7:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-12  7:39 [PATCH v5,net-next,00/13] Add Support for Marvell OcteonTX2 Cryptographic Srujana Challa
2020-10-12  7:39 ` Srujana Challa [this message]
2020-10-12  7:39 ` [PATCH v5,net-next,02/13] octeontx2-af: add mailbox interface for CPT Srujana Challa
2020-10-12  7:39 ` [PATCH v5,net-next,03/13] octeontx2-af: add debugfs entries for CPT block Srujana Challa
2020-10-12  7:39 ` [PATCH v5,net-next,04/13] drivers: crypto: add Marvell OcteonTX2 CPT PF driver Srujana Challa
2020-10-12  7:39 ` [PATCH v5,net-next,05/13] crypto: octeontx2: add mailbox communication with AF Srujana Challa
2020-10-12  7:39 ` [PATCH v5,net-next,06/13] crypto: octeontx2: enable SR-IOV and mailbox communication with VF Srujana Challa
2020-10-12  7:39 ` [PATCH v5,net-next,07/13] crypto: octeontx2: load microcode and create engine groups Srujana Challa
2020-10-12  7:39 ` [PATCH v5,net-next,08/13] crypto: octeontx2: add LF framework Srujana Challa
2020-10-12  7:39 ` [PATCH v5,net-next,09/13] crypto: octeontx2: add support to get engine capabilities Srujana Challa
2020-10-12  7:39 ` [PATCH v5,net-next,10/13] crypto: octeontx2: add mailbox for inline-IPsec RX LF cfg Srujana Challa
2020-10-12  7:39 ` [PATCH v5,net-next,11/13] crypto: octeontx2: add virtual function driver support Srujana Challa
2020-10-12  7:39 ` [PATCH v5,net-next,12/13] crypto: octeontx2: add support to process the crypto request Srujana Challa
2020-10-12  7:39 ` [PATCH v5,net-next,13/13] crypto: octeontx2: register with linux crypto framework Srujana Challa
2020-10-12  8:00 ` [PATCH v5,net-next,00/13] Add Support for Marvell OcteonTX2 Cryptographic Srujana Challa

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=20201012073931.28766-2-schalla@marvell.com \
    --to=schalla@marvell.com \
    --cc=davem@davemloft.net \
    --cc=gakula@marvell.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=kuba@kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pathreya@marvell.com \
    --cc=sbhatta@marvell.com \
    --cc=schandran@marvell.com \
    --cc=sgoutham@marvell.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).